From tjarvi at qbang.org Mon Feb 6 00:00:16 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue Mar 14 23:22:07 2006 Subject: [Rxtx] wiki delay until tomorrow night. In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: On Sun, 5 Feb 2006, Trent Jarvi wrote: > On Sun, 5 Feb 2006, Kim Lux wrote: > >> usb ? Tell me more... I need that too. > > usb is a very proper design. Thats all it is. > Maybe rxtx could help usb. But it would start with helping bring back the community that was already there. It's not something I'd love to do but maybe its the right thing to do. It would probably take 2 years to do right. But maybe thats better than what we have now. I honestly don't know what IBM is doing which could just run over everything. Just some thoughts after some fine german wine. -- Trent Jarvi tjarvi@qbang.org From gadelavega at yahoo.com.ar Mon Feb 6 02:17:05 2006 From: gadelavega at yahoo.com.ar (Gonzalo A. de la Vega) Date: Tue Mar 14 23:22:07 2006 Subject: [Rxtx] Serial port ownership question In-Reply-To: References: <20060205113618.30274.qmail@web53501.mail.yahoo.com> <1139157422.4553.9.camel@zd7280> <1139158698.4936.9.camel@zd7280> Message-ID: <43E71411.4050402@yahoo.com.ar> On my Fedora Core 4: ls -l /dev/ttyS* crw-rw---- 1 root uucp 4, 64 Feb 6 2006 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Feb 6 2006 /dev/ttyS1 ... and: grep "ttyUSB" /etc/udev/rules.d/50-udev.rules KERNEL=="ttyUSB*", GROUP="uucp", MODE="0660" So anyone in the "uucp" group can use serial ports. On Gentoo the group is "tty". Trent Jarvi escribi?: > > > On Sun, 5 Feb 2006, Dr. Douglas Lyon wrote: > >> I can confirm that this is the case (only root ownership of >> serial ports, under fedora 4). >> Wow, what were they thinking?! >> - DL >> >>> I've found that the newer kernels have the serial ports owned by root. >>> For example, >>> >>> $ls -al /dev/tty* >>> crw-rw-rw- 1 root root 5, 0 Feb 5 02:06 /dev/tty >>> crw-rw---- 1 root root 4, 0 Feb 5 02:06 /dev/tty0 >>> crw------- 1 root root 4, 1 Feb 5 09:07 /dev/tty1 >>> crw-rw---- 1 root tty 4, 10 Feb 5 02:06 /dev/tty10 >>> crw-rw---- 1 root tty 4, 11 Feb 5 02:06 /dev/tty11 >>> ... > > > This is just not a problem jcp or such are going to solve. Its a > platform spitwad fight. But do look at pam. In fact thats what Sun > is doing too. Maybe Linux followed their lead.. I'm not a pam guy. > I've spent 16 hours trying to understand it but your users wont :) > > Solution? I have no clue. Its two tangent mentalities from my > perspective. > > -- > Trent Jarvi > tjarvi@qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx@qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mtnvega at yahoo.com.br Mon Feb 6 05:35:43 2006 From: mtnvega at yahoo.com.br (Luiz Jr) Date: Tue Mar 14 23:22:07 2006 Subject: [Rxtx] Documentation Wiki In-Reply-To: <1139157422.4553.9.camel@zd7280> Message-ID: <20060206123543.57256.qmail@web53515.mail.yahoo.com> Hello, Thank you for you answer, but so the usage of the API is pretty much like the Java Communications Api? If yes, what version of the Java Comm Api? Thank you, Luiz A. Brandao Jr Kim Lux escreveu: On Sun, 2006-02-05 at 08:36 -0300, Luiz Jr wrote: > Hello, > > I want to start using the RXTX libraries, but I would to know how, > since I can not access the documentation wiki page I just started using them yesterday. Below is how I installed the libraries, if that helps. I used snippets of code from the SimpleWrite application here to get me going. http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html Instead of "import javax.comm.*;", use "import gnu.io.*;" which is gotten from RXTXcomm.jar, which you will need to include in your project references. I am working in Eclipse. BTW: there is no way to open a port without going through the port list and finding it. Maybe sometime in the future someone (me ?) will write a method called openSerialPort that allows the user to give a port identifier, such as "/dev/tty1" and return a port ready to use. It wouldn't take much to write that and it would save users a lot of code. Hope this helps. ======================================================================= 1) Figure out which java you are running, incase there is more than one installed. $ java -version java version "1.5.0_05" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_05-b05) Java HotSpot(TM) Client VM (build 1.5.0_05-b05, mixed mode, sharing) 2) Find all the jre directories and the one from which you are currently running. kfind (jre) 3) cd to that directory plus /lib/i386 cd /usr/java/jre1.5.0_05/lib/i386 4) Copy the library files (*.so) to that directory. cp /home/krlux/Desktop/'Java Controls'/rxtx-linux/bin/* . 5) Check that the copy was successful ls librxtx* librxtxI2C.so librxtxRaw.so librxtxSerial.so librxtxParallel.so librxtxRS485.so 6) cd to the /lib/ext directory for your java. cd /usr/java/jre1.5.0_05/lib/ext 7) Copy the Jar files there cp /home/krlux/Desktop/'Java Controls'/rxtx-linux/lib/ext/* . 8) Check that it was successful ls RXTX* RXTXcomm.jar Rxtx is now installed on your machine ready to use. =================================================================== -- Kim Lux, Diesel Research Inc. _______________________________________________ Rxtx mailing list Rxtx@qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx --------------------------------- Yahoo! Acesso Gr?tis - Internet r?pida e gr?tis. Instale o discador agora! -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/544aa403/attachment.html From lyon at docjava.com Mon Feb 6 05:49:34 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue Mar 14 23:22:07 2006 Subject: [Rxtx] wiki delay until tomorrow night. In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: Hi All, I have often thought about USB drivers being needed. For example, the ironman watch will not interface to a mac (windows only). It is USB. My dymo label writer has no Java driver (native only). Etc. Most cheap web cameras are USB (and Java drivers go through JAI, if it supports the camera at all). The JAI code shows how sun did the USB drivers. You have to be a member of the jai project to download the source code. https://jai.dev.java.net has the jai distro. And then you are not allowed to redistribute it. However, we can all learn from it (if so inclined). Basically: cvs -d :pserver:lyon@cvs.dev.java.net:/cvs login cvs -d :pserver:lyon@cvs.dev.java.net:/cvs checkout jai-core You will need to user your own uid and pw to get in. The ant build has over 100 warnings from sun deprecations of its own code. You might say that they were hoisted on their own Picard ;) One interesting thing is that they support several platforms: linux-amd64 64-bit Linux-AMD64 linux-i586 32-bit Linux-x86 solaris-amd64 64-bit Solaris-AMD64 solaris-i586 32-bit Solaris-x86 solaris-sparc 32-bit Solaris-SPARC solaris-sparcv9 64-bit Solaris-SPARC windows-i586 32-bit Windows-x86 Thus, ant is used to provide a multi-platform native method distro. Neat. How do they do it? check this out: And: The core download does not contain any C source code (it was all pre-built). Basically, they are just copying .so and .dll files into build directories. I would love to see the C code for this...but Sun does not post it on the https://jai.dev.java.net site. I don't know why...Perhaps I missed it. - Doug >On Sun, 5 Feb 2006, Trent Jarvi wrote: > >>On Sun, 5 Feb 2006, Kim Lux wrote: >> >>>usb ? Tell me more... I need that too. >> >>usb is a very proper design. Thats all it is. >> > >Maybe rxtx could help usb. But it would start with helping bring >back the community that was already there. > >It's not something I'd love to do but maybe its the right thing to do. > >It would probably take 2 years to do right. But maybe thats better >than what we have now. > >I honestly don't know what IBM is doing which could just run over everything. > >Just some thoughts after some fine german wine. > >-- >Trent Jarvi >tjarvi@qbang.org > >_______________________________________________ >Rxtx mailing list >Rxtx@qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tdelenik at gmail.com Mon Feb 6 05:56:32 2006 From: tdelenik at gmail.com (Thanasis Delenikas) Date: Tue Mar 14 23:22:07 2006 Subject: Fwd: [Rxtx] Documentation Wiki In-Reply-To: <1139157422.4553.9.camel@zd7280> References: <20060205113618.30274.qmail@web53501.mail.yahoo.com> <1139157422.4553.9.camel@zd7280> Message-ID: <310a1a930602060456t129f1dc6p5f2b908f13ab5a0b@mail.gmail.com> Hello all, Kim, this is a snippet from the code I use. The closest to directly opening a specific port without enumeration. << ... portId = CommPortIdentifier.getPortIdentifier(getPort()); serialPort = (SerialPort) portId.open("jSMSEngine", 1971); ... >> where getPort() return the string identifier of the port, i.e. "/dev/ttyS0" or "COM1" or whatever. Thanasis. ---------- Forwarded message ---------- From: Kim Lux Date: Feb 5, 2006 6:37 PM Subject: Re: [Rxtx] Documentation Wiki To: RXTX Developers and Users BTW: there is no way to open a port without going through the port list and finding it. Maybe sometime in the future someone (me ?) will write a method called openSerialPort that allows the user to give a port identifier, such as "/dev/tty1" and return a port ready to use. It wouldn't take much to write that and it would save users a lot of code. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/182ab5b8/attachment.html From tjarvi at qbang.org Mon Feb 6 11:53:57 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue Mar 14 23:22:07 2006 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: On Mon, 6 Feb 2006, Dr. Douglas Lyon wrote: > Hi All, > I have often thought about USB drivers being needed. > For example, the ironman watch will not interface > to a mac (windows only). It is USB. > My dymo label writer has no Java driver (native only). > Etc. > Most cheap web cameras are USB (and Java drivers go > through JAI, if it supports the camera at all). > The JAI code shows how sun did the USB drivers. > You have to be a member of the jai project to download > the source code. > https://jai.dev.java.net has the jai distro. > And then you are not allowed to redistribute it. However, > we can all learn from it (if so inclined). Basically: > cvs -d :pserver:lyon@cvs.dev.java.net:/cvs login > cvs -d :pserver:lyon@cvs.dev.java.net:/cvs checkout jai-core > You will need to user your own uid and pw to get in. > The ant build has over 100 warnings from sun deprecations > of its own code. > > You might say that they were hoisted on their own Picard ;) > > One interesting thing is that they support several platforms: > linux-amd64 64-bit Linux-AMD64 > linux-i586 32-bit Linux-x86 > solaris-amd64 64-bit Solaris-AMD64 > solaris-i586 32-bit Solaris-x86 > solaris-sparc 32-bit Solaris-SPARC > solaris-sparcv9 64-bit Solaris-SPARC > windows-i586 32-bit Windows-x86 > Thus, ant is used to provide a multi-platform native method distro. > Neat. > How do they do it? > check this out: > > > > > > > > > > > > > And: > > > > > > > > > > The core download does not contain any C source code (it was all pre-built). > Basically, they are just copying .so and .dll files into build directories. > > I would love to see the C code for this...but Sun does not post it on the > https://jai.dev.java.net site. > > I don't know why...Perhaps I missed it. > > - Doug > > I've looked at moving rxtx to Ant builds. I think that would help IDEs a great deal. I requested a evalutation desk copy the O'Reilly Ant book for some j2ee material I was teaching. http://www.oreilly.com/catalog/anttdg/ It has a one sentence mention of JNI. So there was not luck there. I saw that there is another Ant book that does mention JNI more. I can't find it now. Ant must be able to support it with extensions. http://ant.apache.org/manual/OptionalTasks/javah.html What the auto(break :) tools do in the rxtx build is 4 things really. 1) gcc compile flags 2) ld compile flags 3) config.h 4) compile flags for customizing rxtx (lockfiles, ...) See 1 All of this information except 4 can be static once obtained. So I'm not attached to the auto tools. If I could find an example of Ant being used for JNI code, I'd be one of the first to start moving that direction. Maybe someone saw an example someplace. The other thing we have not completed discussing is the directory structure. There is interest in making rxtx more IDE friendly. I get more mail about that off the list than how to install rxtx. And I see we have Ken Thompson in da house :) He is our trusted CVS maintainer and the guy that purchased the rxtx.org domain. Old community. We will need Ken for changing the directory structure of source. I would like to open up discussion about both of these as it is more than time. The problem is I have little experience with Ant and even less with IDEs. It would be nice if we could work with Eclipse and NetBeans. http://www.netbeans.org/ (sun and some community) http://www.eclipes.org (ibm,rhat,... perhaps more community) http://maven.apache.org/what-is-maven.html (apache. It is community) borland should sortof be here too but I think thats covered in eclipse. >From what I understand so far, we should morph rxtx to support those three maybe trusting apaches lead with maven. But I use vi. I have little to no clues beyond what people have fed me. Can we agree that thats the right direction to go? -- Trent Jarvi tjarvi@qbang.org From brian at mbari.org Mon Feb 6 14:57:50 2006 From: brian at mbari.org (Brian Schlining) Date: Tue Mar 14 23:22:07 2006 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> > The other thing we have not completed discussing is the directory > structure. There is interest in making rxtx more IDE friendly. I > get more mail about that off the list than how to install rxtx. > > And I see we have Ken Thompson in da house :) He is our trusted > CVS maintainer and the guy that purchased the rxtx.org domain. Old > community. We will need Ken for changing the directory structure of > source. > > I would like to open up discussion about both of these as it is > more than time. The problem is I have little experience with Ant > and even less with IDEs. It would be nice if we could work with > Eclipse and NetBeans. > > http://www.netbeans.org/ (sun and some community) > http://www.eclipes.org (ibm,rhat,... perhaps more community) > http://maven.apache.org/what-is-maven.html (apache. It is community) > borland should sortof be here too but I think thats covered in > eclipse. > >> From what I understand so far, we should morph rxtx to support >> those three > maybe trusting apaches lead with maven. But I use vi. I have > little to no clues beyond what people have fed me. > Maven likes the directory structure below for Java code. (From http:// maven.apache.org/guides/getting-started/index.html) This structure works fine with ant, netbeans, and eclipse. rxtx_root_directory `-- src |-- main | `-- java | `-- gnu | `-- io `-- test `-- java `-- gnu `-- io Brian Schlining Software Engineer http://www.mbari.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/d9451eba/attachment.html From tjarvi at qbang.org Mon Feb 6 15:11:45 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue Mar 14 23:22:07 2006 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: > rxtx_root_directory > `-- src > |-- main > | `-- java > | `-- gnu > | `-- io > `-- test > `-- java > `-- gnu > `-- io > >From what I understand this will just be good. For me it makes no difference. So lets do the rxtx thing. Let if fester for two weeks and if nobody objects, we will do it. I'm not doing this because I care. I'm doing this to eliminate much of my inbox. But test... man is rxtx lacking there in the community aspect. It is covered but not right. _maybe_ I can change that this year. -- Trent Jarvi tjarvi@qbang.org (cat hurding since 1997) From lux at diesel-research.com Mon Feb 6 21:38:49 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue Mar 14 23:22:07 2006 Subject: [Rxtx] How can I use Lock Files with rxtx (in FC4) ? Message-ID: <1139287129.17031.3.camel@zd7280> I am now running an rxtx application on FC4. I am getting: ========================================================= check_group_uucp(): error testing lock file creation Error details: Permission denied check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL ========================================================= $ ls -al /var/lock total 32 drwxrwxr-x 4 root lock 4096 Feb 6 16:04 . drwxr-xr-x 24 root root 4096 Nov 14 01:19 .. drwx------ 2 root root 4096 Apr 27 2005 lvm drwxr-xr-x 2 root root 4096 Feb 6 16:04 subsys How do I fix this for regulator users ? -- Kim Lux, Diesel Research Inc. From dmarkman at mac.com Mon Feb 6 22:24:44 2006 From: dmarkman at mac.com (Dmitry Markman) Date: Tue Mar 14 23:22:07 2006 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: if I understands the issue right in order to be able to use ant for c/c++ compilation you have to install ant's cc task http://ant-contrib.sourceforge.net/cc.html it looks like it should work on mac os x (authors claim, that it's platform independent) but I never tested so all you have to do it's providing right command line for the gcc compiler On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: >> rxtx_root_directory >> `-- src >> |-- main >> | `-- java >> | `-- gnu >> | `-- io >> `-- test >> `-- java >> `-- gnu >> `-- io >> > > >> From what I understand this will just be good. > > For me it makes no difference. So lets do the rxtx thing. Let if > fester for two weeks and if nobody objects, we will do it. > > I'm not doing this because I care. I'm doing this to eliminate > much of my inbox. > > But test... man is rxtx lacking there in the community aspect. It > is covered but not right. _maybe_ I can change that this year. > > -- > Trent Jarvi > tjarvi@qbang.org > (cat hurding since 1997) > _______________________________________________ > Rxtx mailing list > Rxtx@qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx Dmitry Markman From lux at diesel-research.com Mon Feb 6 23:20:15 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue Mar 14 23:22:07 2006 Subject: [Rxtx] portlist.hasMoreElements is false ? Message-ID: <1139293215.3689.4.camel@zd7280> I'm running the code below. portlist.hasMoreElements() is false. /dev has ports in it as listed below. What am I doing wrong ? ========================================================== // Step through the list of ports until we find one that matches // the one we are looking for. portList = CommPortIdentifier.getPortIdentifiers(); while(portList.hasMoreElements()) { portID = (CommPortIdentifier) portList.nextElement(); // if (portID.getName().equals("/dev/ttyUSB0")) { myTA.append("Serial port ttyUSB0 has been found\n"); break; }// if portID equals... }// End of while... ========================================================== ls -al /dev/tty* crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 ... crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 -- Kim Lux, Diesel Research Inc. From david.garnier at trusted-logic.com Tue Feb 7 00:46:30 2006 From: david.garnier at trusted-logic.com (David Garnier) Date: Tue Mar 14 23:22:07 2006 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: <43E85056.2090608@trusted-logic.com> Hello, I think that the make-based build process is fine as it is, apart from the location of the Java source files. It is true that putting the Java source in a directory structure that map 1-to-1 to the Java package structure is the norm and should make it easier for everyone to modify the Java source, with or without an IDE. Ant is a good tool, but in the RXTX case I fail to see the advantage of using it compared to the current make-based process. As Trent said, they are more pressing issues, like testing. Regards, David Dmitry Markman wrote: > if I understands the issue right > in order to be able to use ant for c/c++ compilation > you have to install ant's cc task > http://ant-contrib.sourceforge.net/cc.html > > it looks like it should work on mac os x > (authors claim, that it's platform independent) > but I never tested > > so all you have to do it's providing right command line > for the gcc compiler > > > > > On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: > >>> rxtx_root_directory >>> `-- src >>> |-- main >>> | `-- java >>> | `-- gnu >>> | `-- io >>> `-- test >>> `-- java >>> `-- gnu >>> `-- io >>> >> >> >>> From what I understand this will just be good. >> >> For me it makes no difference. So lets do the rxtx thing. Let if >> fester for two weeks and if nobody objects, we will do it. >> >> I'm not doing this because I care. I'm doing this to eliminate much >> of my inbox. >> >> But test... man is rxtx lacking there in the community aspect. It is >> covered but not right. _maybe_ I can change that this year. >> >> -- >> Trent Jarvi >> tjarvi@qbang.org >> (cat hurding since 1997) From tjarvi at qbang.org Tue Feb 7 01:11:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue Mar 14 23:22:07 2006 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <43E85056.2090608@trusted-logic.com> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: On Tue, 7 Feb 2006, David Garnier wrote: > Hello, > > I think that the make-based build process is fine as it is, apart from the location of the Java > source files. It is true that putting the Java source in a directory structure that map 1-to-1 to > the Java package structure is the norm and should make it easier for everyone to modify the Java > source, with or without an IDE. > > Ant is a good tool, but in the RXTX case I fail to see the advantage of using it compared to the > current make-based process. As Trent said, they are more pressing issues, like testing. > Hi David I have more experience with testing rxtx than I can talk about. But let it be known, rxtx has gone trough 100's of hours of testing. We are hobby folks interested in toys but there is more. rxtx has had some of the best guidance in the industry there. This is not an easy thing. I may be able to come back in a month from the other side of the corperate fence and help. I suspect the tests could just be made public but they are in a very unusual environment that just wont work in a wider sense. This is something I'll be trying to change. At one point it was agreed we could just make the results public so this isnt just noise.. There is interest and I think its safe to mention that much. The big problem with testing in the past is most of it is done with a loopback connection. So we *still* have major questions regarding things like flow control. rxtx talks to itself over a loopback and it works. regardless of right or wrong. This requires more thought to be done right. -- Trent Jarvi tjarvi@qbang.org From tjarvi at qbang.org Tue Feb 7 02:46:34 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue Mar 14 23:22:07 2006 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: > The big problem with testing in the past is most of it is done with a > loopback connection. So we *still* have major questions regarding things > like flow control. rxtx talks to itself over a loopback and it works. > regardless of right or wrong. With serial communication there are gold standards. ckermit is probably a definitive 'standard.' Maybe its possible to do ping/pong tests with ckermit? Is it scriptable? There are known issues in rxtx. Probably the worst is some threading issues regarding some JREs with multiple JNI threads setting java variables. Man did I get schooled there. Just switch the c functions to returning variables and things go away. Sometimes they work fine, sometimes they blow up. Without understanding everything, somehow rhat got it right and debian (and especially gentoo) grabbed kernel patches causing all sort of harm. Its not hard to fix once you understand whats going on but nearly impossible to track with a debugger. So I have a good idea what 2.1-8 will have outside of the IDE modifications. rxtx 2.1-7 is a release for everyone to sync with. Its not even as stable as -pre17 as far as I know - I ran no test suites. I'll be chasing it too. We just had so many contributions that it was time. It seriously broke internal scheduals but thats a great thing :) The other thing I want to do in 2.1-8 is automagic baud rates. It turns out lots of shops are doing really funky baud rates for things like automobile test equipment. It is possible but it requires a fair amount of change in the native code. Is anyone looking at this? -- Trent Jarvi tjarvi@qbang.org From lyon at docjava.com Tue Feb 7 02:57:21 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue Mar 14 23:22:07 2006 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <43E85056.2090608@trusted-logic.com> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: Hi All, I agree, testing is very important. The problem I have been trying to address is related to cross-platform testing and the robust nature of the installs. Typically, I visit 3 platforms to deploy my product, windows, linux and mac. A build is performed on each platform. The idea that you can build for many platforms from one copy the source code seems attractive. This should enable synchronized deployments of identical code. The question of how to achieve this goal remains open. As Trent mentioned, this is hard. Perhaps Ant will help here (but perhaps not). Ant does seem to help with running unit tests. However, it does not help with multi-platform tests. For that you need many machines and different operating environments. Toward that end, I have created a multi-platform test that can be run from web start, located at: http://show.docjava.com:8086/book/cgij/code/jnlp/serialPort.PortTest.jnlp This is interesting because many people in the community can run the test and we can improve the test, as time permits. No, it is not a perfect solution, however, the idea does help with multi-platform tests using many machines and different operating environments. If the group has a good test for a general serial port set-ups, i would be happy to deploy it, for general evaluation using web start. And as for ANT, it is just an idea. Not all my ideas are good ones! - Doug >Hello, > >I think that the make-based build process is fine as it is, apart >from the location of the Java >source files. It is true that putting the Java source in a directory >structure that map 1-to-1 to >the Java package structure is the norm and should make it easier for >everyone to modify the Java >source, with or without an IDE. > >Ant is a good tool, but in the RXTX case I fail to see the advantage >of using it compared to the >current make-based process. As Trent said, they are more pressing >issues, like testing. > >Regards, >David > >Dmitry Markman wrote: >> if I understands the issue right >> in order to be able to use ant for c/c++ compilation >> you have to install ant's cc task >> http://ant-contrib.sourceforge.net/cc.html >> >> it looks like it should work on mac os x >> (authors claim, that it's platform independent) >> but I never tested >> >> so all you have to do it's providing right command line >> for the gcc compiler >> >> >> >> >> On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: >> >>>> rxtx_root_directory >>>> `-- src >>>> |-- main >>>> | `-- java >>>> | `-- gnu >>>> | `-- io >>>> `-- test >>>> `-- java >>>> `-- gnu >>>> `-- io >>>> >>> >>> >>>> From what I understand this will just be good. >>> >>> For me it makes no difference. So lets do the rxtx thing. Let if >>> fester for two weeks and if nobody objects, we will do it. >>> >>> I'm not doing this because I care. I'm doing this to eliminate much >>> of my inbox. >>> >>> But test... man is rxtx lacking there in the community aspect. It is >>> covered but not right. _maybe_ I can change that this year. >>> >>> -- >>> Trent Jarvi >>> tjarvi@qbang.org >>> (cat hurding since 1997) > >_______________________________________________ >Rxtx mailing list >Rxtx@qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From matt.higgins at gmail.com Tue Feb 7 08:28:34 2006 From: matt.higgins at gmail.com (Matt Higgins) Date: Tue Mar 14 23:22:07 2006 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final Message-ID: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? import java.io.*; import java.util.*; import gnu.io.*; public class MySimpleRead implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; public static void main(String[] args) { boolean portFound = false; String defaultPort = "COM1"; if (args.length > 0) { defaultPort = args[0]; } portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; MySimpleRead reader = new MySimpleRead(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } } public MySimpleRead() { try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) { e.printStackTrace(); } try { inputStream = serialPort.getInputStream(); } catch (IOException e) { e.printStackTrace(); } try { serialPort.addEventListener(this); } catch (TooManyListenersException e) { e.printStackTrace(); } try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { e.printStackTrace(); } System.out.println("Baud is " + serialPort.getBaudRate()); System.out.println("Bits is " + serialPort.getDataBits()); System.out.println("Stop is " + serialPort.getStopBits()); System.out.println("Par is " + serialPort.getParity()); serialPort.notifyOnDataAvailable(true); readThread = new Thread(this); readThread.start(); } public void run() { // Thread.sleep(20000); //} catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { System.out.println("An event occurred " + event.getEventType()); switch (event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: byte[] readBuffer = new byte[20]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } System.out.print(new String(readBuffer)); } catch (IOException e) {} break; } } } --------------- Result on windows ------------------------------ Stable Library ============================================================== Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port:: COM1 Baud is 9600 Bits is 8 Stop is 1 Par is 0 ----------------- End Results ----------------------------------------- ------------------ Result on Linux ----------------------------------- Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 Found port: /dev/ttyS0 Baud is 9600 Bits is 8 Stop is 1 Par is 0 An event occurred 1 043100066224 ------------------ End Results --------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/a1431630/attachment.html From brian at mbari.org Tue Feb 7 09:48:37 2006 From: brian at mbari.org (Brian Schlining) Date: Tue Mar 14 23:22:08 2006 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> Message-ID: <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> Hi Matt > The following code works fine on Linux but I never see any data > when run on Windows. This is a cut and paste from the SimpleRead > example. > I am attempting to read data from a bar code scanner. I can fire > up HyperTermianl on windows and see that the device is working > properly as I see the barcodes are scanned and echoed back to the > terminal. However when I run the app I don't see any data. It is > however associating with the com port as the informational bits > print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. Cheers Brian Schlining Software Engineer http://www.mbari.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/16d07f37/attachment.html From lux at diesel-research.com Tue Feb 7 11:59:58 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue Mar 14 23:22:08 2006 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139293215.3689.4.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> Message-ID: <1139338798.8145.4.camel@zd7280> Any ideas on this ? Any reason why portList.hasMoreElements() should be false even though there are devices in /dev ? On Mon, 2006-02-06 at 23:20 -0700, Kim Lux wrote: > I'm running the code below. > > portlist.hasMoreElements() is false. > > /dev has ports in it as listed below. > > What am I doing wrong ? > > > ========================================================== > // Step through the list of ports until we find one that matches > // the one we are looking for. > > portList = CommPortIdentifier.getPortIdentifiers(); > > while(portList.hasMoreElements()) > { > portID = (CommPortIdentifier) portList.nextElement(); // > if (portID.getName().equals("/dev/ttyUSB0")) > { > myTA.append("Serial port ttyUSB0 has been found\n"); > break; > }// if portID equals... > }// End of while... > ========================================================== > > ls -al /dev/tty* > crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty > crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 > crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 > crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 > crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 > ... > crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 > crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 > crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 > > > -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 12:20:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue Mar 14 23:22:08 2006 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139338798.8145.4.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> Message-ID: On Tue, 7 Feb 2006, Kim Lux wrote: > > Any ideas on this ? Any reason why portList.hasMoreElements() should be > false even though there are devices in /dev ? > > > On Mon, 2006-02-06 at 23:20 -0700, Kim Lux wrote: >> I'm running the code below. >> >> portlist.hasMoreElements() is false. >> >> /dev has ports in it as listed below. >> >> What am I doing wrong ? >> >> >> ========================================================== >> // Step through the list of ports until we find one that matches >> // the one we are looking for. >> >> portList = CommPortIdentifier.getPortIdentifiers(); >> >> while(portList.hasMoreElements()) >> { >> portID = (CommPortIdentifier) portList.nextElement(); // >> if (portID.getName().equals("/dev/ttyUSB0")) >> { >> myTA.append("Serial port ttyUSB0 has been found\n"); >> break; >> }// if portID equals... >> }// End of while... >> ========================================================== >> >> ls -al /dev/tty* >> crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty >> crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 >> crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 >> crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 >> crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 >> ... >> crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 >> crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 >> crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 >> >> >> > Hi Kim What rxtx does is try to open the port and do a timed out read. If the kernel/... do not complain it's enumarted. I suspect you could do a crude test by doing something like cat /dev/ttyS0 > /dev/null If that barfs then rxtx wont enumerate the port. hmm looking at your question again, I suspect it's a lockfile problem. This is documented in INSTALL with the source. Its easy enough to test this too.. touch /var/lock/testingrxtxlockfiles && rm -f /var/lock/testingrxtxlockfiles If you are not in the right group it will bail. Root will work regardless. -- Trent Jarvi tjarvi@qbang.org From lux at diesel-research.com Tue Feb 7 12:37:56 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue Mar 14 23:22:08 2006 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> Message-ID: <1139341076.8145.11.camel@zd7280> Exactly which ports does rxtx attempt to put into the list ? /dev/* or /dev/tty* or /dev/tty[0-9[0-9] ? or /dev/ttyS* ? For the record, only /dev/ttyUSB0 is a valid port on the machine I am presently on. Will this be a problem ? On Tue, 2006-02-07 at 12:20 -0700, Trent Jarvi wrote: > This is documented in INSTALL with the source. > I was wondering where that file was. I will download source and dig it up. Thanks. -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 12:51:09 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue Mar 14 23:22:08 2006 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139341076.8145.11.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: On Tue, 7 Feb 2006, Kim Lux wrote: > > Exactly which ports does rxtx attempt to put into the list ? /dev/* > or /dev/tty* or /dev/tty[0-9[0-9] ? or /dev/ttyS* ? > > For the record, only /dev/ttyUSB0 is a valid port on the machine I am > presently on. Will this be a problem ? > > > On Tue, 2006-02-07 at 12:20 -0700, Trent Jarvi wrote: >> This is documented in INSTALL with the source. >> > I was wondering where that file was. I will download source and dig it > up. > > Thanks. > Hmm I'm looking at pre17 so this may have changed. (its just what I have on this machine) if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA" // for the IPAQs }; CandidatePortPrefixes=Temp; } So you may need to add "ttyUSB" to that list. RXTX used to enumerate _everything_ see if(osName.equals("Linux-all-ports") But it became less than practical. This is all in RXTXCommDriver.java hmm I just did a cvs update. if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have to get your fingers into the code. We aim for sane defaults. -- Trent Jarvi tjarvi@qbang.org From lux at diesel-research.com Tue Feb 7 13:06:45 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue Mar 14 23:22:08 2006 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139342805.8145.22.camel@zd7280> On Tue, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > Hmm I'm looking at pre17 so this may have changed. (its just what I have > on this machine) > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA" // for the IPAQs > }; > CandidatePortPrefixes=Temp; > } > > > So you may need to add "ttyUSB" to that list. RXTX used to enumerate > _everything_ see if(osName.equals("Linux-all-ports") But it became less > than practical. > > This is all in RXTXCommDriver.java > > hmm I just did a cvs update. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have > to get your fingers into the code. We aim for sane defaults. Excellent. Thanks for taking the time. -- Kim Lux, Diesel Research Inc. From ideiglenes1 at freemail.hu Tue Feb 7 13:53:39 2006 From: ideiglenes1 at freemail.hu (--) Date: Tue Mar 14 23:22:08 2006 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139345619.22534.2.camel@localhost> Hi! I use this code to get all the extra Linux devices. :) if ("Linux".equals(System.getProperty("os.name"))) { System.setProperty("os.name","Linux-all-ports"); } driver = new RXTXCommDriver(); On k, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > On Tue, 7 Feb 2006, Kim Lux wrote: > > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have > to get your fingers into the code. We aim for sane defaults. > > -- > Trent Jarvi > tjarvi@qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx@qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From matt.higgins at gmail.com Tue Feb 7 13:45:54 2006 From: matt.higgins at gmail.com (Matt Higgins) Date: Tue Mar 14 23:22:08 2006 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> Message-ID: <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> Sweet this is exactly what I needed. I was searching the archives through marc.theamisgroup they only have archives back to 1/3/05. Should have hit the mailman archive! Thanks a lot! On 2/7/06, Brian Schlining wrote: > > Hi Matt > > The following code works fine on Linux but I never see any data when run > on Windows. This is a cut and paste from the SimpleRead example. > I am attempting to read data from a bar code scanner. I can fire up > HyperTermianl on windows and see that the device is working properly as I > see the barcodes are scanned and echoed back to the terminal. However when I > run the app I don't see any data. It is however associating with the com > port as the informational bits print fine? > > > You're not the only one whose had this problem, I don't know if Trent has > addressed this is the latest release of RXTX but there is a workaround. > Here's the recent thread from the RXTX mailing list regarding this issues: > > Thanasis Delenikas tdelenik at gmail.com > Wed Jan 18 13:56:23 MST 2006 > > * Previous message: [Rxtx] Re: More close() performance fixes > * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] > > Hi all. > (I've subscribed again from my other email account). > > Trent, > > You are right. Linux *always* works, no matter what flow control you set. > Windows *works only* with hardware flow control (I haven't tested what > happens with software XON/XOFF flow control). > > I assume (but I am not certain) that even with no flow control at all, all > platforms should work. Without flow control, you have the risk of bumping > into overflow or framing errors, but that's your (the end programmer, I > mean) problem. > > >From my side, I shouldn't be working without flow control. That was a bug > too... It was some code forgotten from the old times, when I used to work > with phone emulation drivers which didn't support flow control. The > correct > way is to have some flow control enabled and that's why I suppose this is > a > low-severity bug for RxTx. > > I have no idea which platform shows the correct behaviour, since > my knowledge about Linux and the inner workings of these low-level i/o > operations is limited. > > Regards, > Thanasis Delenikas. > > > > > Message: 2 > > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > > From: Trent Jarvi > > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > > To: RXTX Developers and Users > > Message-ID: > > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > > > Hi all, > > > > > > Trent, I have found something. > > > I read your comment about flow control, so I experimented a bit. > > > > > > If you remember, in my sample program I've used no flow control at all > ( > > i.e. > > > Java constant FLOWCONTROL_NONE). > > > > > > Now, during testing, I've switch to hardware inbound flow control (i.e > . > > Java > > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > > beautifully! > > > > > > I think I will switch to H/W flow control and test things for a while, > > but > > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > > > > > Hi Thanasis, > > > > I'm fairly sure you have identified a bug. I would not worry too much > > about what Sun CommAPI w32 defaults are. I think they did more or less > > whatever the port opened with. Just a guess. Linux tries to stomp on > > ports so they are all the same. > > > > So this started out with Linux worked, Windows XP/.. did not as I > recall. > > Something is wrong in rxtx. Do I understand this right? > > > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > > > Perhaps there is something Wayne or I did not understand when we wrote > > that code. I wasnt programming back in the BBS days so modems are not > my > > thing. I have a few questions. > > > > Is the above matrix confirmed by observation? > > Linux just always worked? > > Which one _should_ work? I'm guessing modems work with hardware flow > > control. I'll have to dig around. > > > > The windows flow control changes a couple things with hardware flow > > control. Following the w32 API documentation is confusing sometimes. > > But it looks like Linux could have a bug too. > > Cheers > > Brian Schlining > Software Engineer > http://www.mbari.org > > > > _______________________________________________ > Rxtx mailing list > Rxtx@qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/9c989144/attachment.html From tjarvi at qbang.org Tue Feb 7 14:06:14 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue Mar 14 23:22:08 2006 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> Message-ID: >> >> You're not the only one whose had this problem, I don't know if Trent has >> addressed this is the latest release of RXTX but there is a workaround. >> Here's the recent thread from the RXTX mailing list regarding this issues: >> I have not. I expect to have access to some test equipment next month and I'll go through all of this. I really don't know whats going on and I need a gold standard. I thought maybe linux was autodetecting the flow control. Your observations would certainly be welcome. I need to talk to Russell King and see what he is doing. Until then I'd just be toying around over a loopback as usual. This is very high on the list though. -- Trent Jarvi tjarvi@qbang.org From lux at diesel-research.com Tue Feb 7 17:25:05 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue Mar 14 23:22:08 2006 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139358305.17994.2.camel@zd7280> My application now works. I installed the libraries and jar from 2.1-7 (Final). portlist.hasMoreElements is no longer false. The application finds the port for /dev/ttyUSB0. Thanks for your help, Trent (et al) Sorry I bothered you with this. Next time I will look in the source first. I didn't think it was an rxtx issue, I thought it was a Linux setup issue . On Tue, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > Hmm I'm looking at pre17 so this may have changed. (its just what I > have > on this machine) > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux > Serial Ports > "ttySA" // for the > IPAQs > }; > > CandidatePortPrefixes=Temp; > } > > > So you may need to add "ttyUSB" to that list. RXTX used to enumerate > _everything_ see if(osName.equals("Linux-all-ports") But it became > less > than practical. > > This is all in RXTXCommDriver.java > > hmm I just did a cvs update. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux > Serial Ports > "ttySA", // for the > IPAQs > "ttyUSB" // for USB > frobs > }; > > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you > have > to get your fingers into the code. We aim for sane defaults. -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 19:21:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue Mar 14 23:22:08 2006 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139358305.17994.2.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> <1139358305.17994.2.camel@zd7280> Message-ID: >Sorry I bothered you with this. Next time I will look in the source >first. I didn't think it was an rxtx issue, I thought it was a Linux >setup issue . Why would you be sorry? I would have done the same. I'm glad it's working :) -- Trent Jarvi tjarvi@qbang.org From tma at mail.island.net Wed Feb 8 13:39:35 2006 From: tma at mail.island.net (Tom Alldread) Date: Tue Mar 14 23:22:08 2006 Subject: [Rxtx] Win32/Linux Serial Port Data Dropouts In-Reply-To: <200602060702.k167255O007882@www.qbang.org> References: <200602060702.k167255O007882@www.qbang.org> Message-ID: <43EA5707.4020200@mail.island.net> Greetings Folks at RXTX: During the last couple of months I have been alternately testing with javax.comm 2 and RXTX 2.1 under Windows XP and CommApi 3 and RXTX 2.1 under Suse 10.0 Linux. In the process I have learned a little about java multi-threading under NetBeans 5 with Profiler. My java (jdk 1.5_06) application is used for data acquisition and provides a graphical display of A-D conversion data received from a 56KBaud serial port. The actual data throughput is about 10KBaud thus it is well below the speed of the port. I use hardware RTS/CTS flow control which can stall the data acquisition sample rate if necessary. This ensures the display computer has the ability to slow the data acquisition rate should it become too busy to accept the regular data flow. Both the serial port buffer and the java read buffer are set at 16KB. Usually the data transfers into the java read buffer are less than 100 bytes unless the data acquisition is recovering from a stall. The data flow normally hesitates after each 5 KB block as a continue command is needed from the display computer to start the drawing of a new graphics display line. Separate threads have been provided for the serial port event monitoring and data processing. The serial port event thread has been given the maximum priority and data processing thread the minimum priority provided by java. Thread yield statements have been placed within all data processing while/for loops as an effort to ensure quick access to CPU cycles for the serial port event thread. I have found that short data transmissions are essentially error free but occasional dropouts occur with continuous data flow especially under Windows XP. ....................................................................................................................................................................................... Linux results: I am happy to report that RXTX 2.1 appears to work very well under Linux although I did notice some errors when the screen savers were running with my dual monitors. I believe this is a local problem associated with my dual graphics which needs further attention. The recent CommApi 3 Linux release from Sun did not work at all with my program. It seemed to send commands out OK but did not receive any data. Although the serial port event triggered the ISR, the input stream appeared filled with nulls and thus did not contain any data. As my understanding is that CommApi 3 was tested with a Red Hat distribution of Linux I wonder if this problem is distro dependent? Although somewhat off topic here I wonder if anyone reading this has had similar experience? .................................................................................................................................................................................. Windows XP results: There are problems with occasional data dropouts which become more frequent as the sampling rate is increased or if the computer becomes busy with other duties. The dropouts typically consist of a half dozen byte block of lost data. It appears the lost bytes never get added to the java input stream. There has not been any indication of garbled data, overruns or framing errors which suggests the UART communications remains solid. Using javax.comm 2 I found that the setting of SerialPort 'enableReceiveThreshold' to 40 and 'enableReceiveTimeout' of 100mS reduced the dropouts error rate significantly. I found that I could not get RXTX 2.1 to function with the aforementioned threshold and timeout settings. The javax.comm 2 interface is consequently performing better for me under Windows than RXTX 2.1. I wonder if anyone here has any suggestions as to what I might try to improve RXTX 2.1? Although my settings are the same as under Suse 10.0, RXTX 2.1 performs much better for me under Linux than any of the alternatives that I have tried under Windows XP . ............................................................................................................................................................................... I would like to establish, based on the experience of others, if I have reached the normally expected performance limit of java serial port communications? Should I expect to achieve virtually error free serial port data input from a continuous stream under Windows XP java software? I am considering changing my protocol to packets with error checking if necessary but would like to know if the dropout problems I am experiencing are typical or not before I take this rather work intensive plunge. Many thanks in advance for any help! Best Regards, Tom Alldread -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.375 / Virus Database: 267.15.2/253 - Release Date: 2006-02-07 From jlaxson at mac.com Wed Feb 8 23:56:48 2006 From: jlaxson at mac.com (John Laxson) Date: Tue Mar 14 23:22:08 2006 Subject: [Rxtx] PortInUseException: Unknown Application on OSX Message-ID: Hi, I've been trying to get RXTX 2.1.7 going on Mac OS X for a while here, and am running up into a wall here. I've tried with pre- compiled and the source version and get the same problem, a gnu.io.PortInUseException: Unknown Application. I have run the fixperms script included with the source distribution, and id shows me as a member of the uucp group, and permissions on /var/spool/uucp are 775 root:uucp. Running a test program (included at the bottom for clarity) lets me enumerate all the serial ports correctly, but trying to open any of them gives the PortInUseException. If it helps, when I try to open a port that's set to make an outgoing bluetooth connection, there is no delay and no connection attempt at all. Thanks, John Laxson PS: The documentation wiki on qbang.org shows 404, and has for a few days now. My test code: public static void main(String[] args) { SerialPort serialPort; try { Enumeration e = CommPortIdentifier.getPortIdentifiers(); CommPortIdentifier ident; while (e.hasMoreElements()) { ident = (CommPortIdentifier)e.nextElement(); System.out.println(ident.getName()); } ident = CommPortIdentifier.getPortIdentifier("/dev/cu.modem"); serialPort = (SerialPort) ident.open("Me", 5000); } catch (Exception e) { e.printStackTrace(); } } From rajesh.invincible at gmail.com Thu Feb 9 03:39:38 2006 From: rajesh.invincible at gmail.com (Rajesh N) Date: Tue Mar 14 23:22:08 2006 Subject: [Rxtx] Re: Move .java Files in gnu.io filesystem hierarchy - Maven (2) In-Reply-To: <43DF21D2.7090200@ngi.it> References: <43DF21D2.7090200@ngi.it> Message-ID: <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Can anybody tell me how to overcome these EXCEPTIONS I AM WORKING ON SERIAL COMMN IN JAVA ON LINUX. 1. " NOT ALL PARAMETERS SUPPORTED BY THE KERNEL" This i came across the following statement inmy prog. SerialP is A SerialPort object SerialP.setSerialPortParams(9600(BAUDRATE),DATABITS_8,STOPBITS_1,PARITY_NONE) 2. NullPointer Exception at Event Dispatch Now i have checked all my object references for a null reference but i found none i have put up my entire code in try catch blocks but still I AM UNABLE TO CATCH THIS EXCEPTION AND HENCE MY APPLICATION CLOSES HOW DOES THESE GO? PLEASE HELP ME IT IS URGENTTTTTTTTTTTTTTTT yours sincerely RAJESH On 1/31/06, Fabio Frumento wrote: > Hi Xavier, > > I don't know maven at all but the directory hierarchy listed buy Trent > is fine for me... > > I'll take a look to maven, it seems an interesting project > > Regards > > Fabio Frumento > > Trent Jarvi wrote: > > On Tue, 31 Jan 2006, Xavier Frisaye wrote: > > > >> Hi all, > >> > >> If you are going to rearrange the src folder, i will propose to use > >> maven 2 and follow its directory structure > >> > (http://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html). > >> > >> Maven 2 simplify java project and give a standard way to make projects > >> (http://maven.apache.org/). > >> We are using it for internal projects and we are very satisfied. > >> > >> Is anybody interested? > >> > >> I'm not an expert in maven 2 (yet) but i'm agree to help using it if > >> you choose to make so. > >> > > > > so this would be: > > > > rxtx-devel/src/main/java/gnu.io > > rxtx-devel/src/test/java/ManIwish.java > > > > I don't use IDEs very much so I'll let others comment. But I don't see > > a problem with that. > > > > -- > > Trent Jarvi > > tjarvi@qbang.org > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx@qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx@qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Thu Feb 9 09:50:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue Mar 14 23:22:08 2006 Subject: [Rxtx] Re: Move .java Files in gnu.io filesystem hierarchy - Maven (2) In-Reply-To: <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Message-ID: On Thu, 9 Feb 2006, Rajesh N wrote: > Can anybody tell me how to overcome these EXCEPTIONS > I AM WORKING ON SERIAL COMMN IN JAVA ON LINUX. > > 1. " NOT ALL PARAMETERS SUPPORTED BY THE KERNEL" > > This i came across the following statement inmy prog. > SerialP is A SerialPort object > SerialP.setSerialPortParams(9600(BAUDRATE),DATABITS_8,STOPBITS_1,PARITY_NONE) > Strange. The parameters you use are the same the port should open with by default. Could you paste the actual exception you are getting? I don't see that in the rxtx source. Also it would help to know the rxtx version. -- Trent Jarvi tjarvi@qbang.org From lux at diesel-research.com Fri Feb 10 15:29:05 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue Mar 14 23:22:08 2006 Subject: [Rxtx] One serial port object for both sending and receiving ? Message-ID: <1139610545.18177.4.camel@zd7280> Is it OK to use one SerialPort ojbect (ex Serial Port serialPort;) and use it for both sending and receiving ? For example: ======================================================================== static SerialPort serialPort = null; static OutputStream serialOut = null; static InputStream serialIn = null; // assign it to an outputStream for use try{ serialOut = serialPort.getOutputStream(); System.out.println("Serial output stream has been assigned."); }//try catch(IOException e) { System.out.println("Error: Couldn't assign output stream to serial port."); }//catch //assign it to an inputStream for use try{ serialIn = serialPort.getInputStream(); System.out.println("Serial input stream has been assigned."); }//try catch(IOException e) { System.out.println("Error: Couldn't assign input stream to serial port."); }//catch ======================================================================== -- Kim Lux, Diesel Research Inc. From lux at diesel-research.com Fri Feb 10 21:23:00 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue Mar 14 23:22:08 2006 Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Message-ID: <1139631780.23882.10.camel@zd7280> I've got a problem receiving chars with my version of serialRead, written in an SWT GUI. I had a Java pro have a good look at my code and he can't see anything wrong with it. I can send chars fine. When I receive a char the cpu usage for the app goes to 100% and the code in the serial event handler doesn't get executed. The instructions on the Java Comm Serial API How-To for Linux page state that I must install javacomm. Is that true ? Everything builds without it and I can send chars on rxtx just fine, but I can't receive them. Could this be the problem ? I downloaded and installed javacomm. I was not able to add "Driver=gnuio.RXTXCommDriver to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 installed in /usr/java/jre1.5.0_05. I added comm.jar to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext to the library paths. Is this OK ? Does it matter that I am receiving on /dev/ttyUSB0 ? Thanks. -- Kim Lux, Diesel Research Inc. From lunareclipse03 at web.de Sat Feb 11 09:44:46 2006 From: lunareclipse03 at web.de (lunareclipse03@web.de) Date: Tue Mar 14 23:22:08 2006 Subject: [Rxtx] Question about Serial I/O under Win32 Message-ID: <662084330@web.de> Hello everybody, I have a strange problem with a piece of code I made for myself. No, this is not really concerning rxtx, but nevertheless I post this to the list, hoping that some of you can help me. I've written two libraries, one for linux and one for win32. The linux port works quite well, I can send / receive faxes and / or replay voice messages over the telephone line using a voice modem. But the win32 port of the library causes some trouble. If, for example, I send out a fax with a certain modem under linux, it works well. The fax is complete when it comes out of the fax machine. If I then use the same modem to send out a fax under win32, the fax coming out of the fax machine gets "stuck" halfways, but the sending modem thinks that transmission was ok and drops the connection. The answering fax machine then gives me "error while receiving." The "upper layer" java code MUST be right, because if I do the same thing under linux (using the linux library), everything is alright. Now I have to ask: Can somebody please help me out with this??!? Could it be the case that some kind of flow control or COMMTIMEOUTS setting causes this behaviour? I set flow control to RTS/CTS before sending out a fax. How can I DISABLE flow control? Or what do you think? Can something else cause this problems? Thank you all for your time and PLEASE write back soon. Regards, --Sven Ahlemann Am Waldrand 31 45721 Haltern am See Germany ______________________________________________________________ Verschicken Sie romantische, coole und witzige Bilder per SMS! Jetzt bei WEB.DE FreeMail: http://f.web.de/?mc=021193 From lux at diesel-research.com Sat Feb 11 10:06:52 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue Mar 14 23:22:08 2006 Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: <1139631780.23882.10.camel@zd7280> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> <1139631780.23882.10.camel@zd7280> Message-ID: <1139677612.3431.5.camel@zd7280> More on this problem. I copied and pasted simpleRead into a console based Eclipse project and I've got the same result, except that cpu usage doesn't go to 100%. I'm beginning to think there is an issue in rxtx. My imports for simpleRead are: ============================ import gnu.io.*; import java.util.*; //import javax.comm.*; import java.io.*; =========================== Any ideas ? I am trying to read from /dev/ttyUSB0 using a serial to USB adapter which has worked well with minicom and gtkterm. Thanks. On Fri, 2006-02-10 at 21:23 -0700, Kim Lux wrote: > I've got a problem receiving chars with my version of serialRead, > written in an SWT GUI. > > I had a Java pro have a good look at my code and he can't see anything > wrong with it. > > I can send chars fine. When I receive a char the cpu usage for the app > goes to 100% and the code in the serial event handler doesn't get > executed. > > The instructions on the Java Comm Serial API How-To for Linux page state > that I must install javacomm. Is that true ? Everything builds without > it and I can send chars on rxtx just fine, but I can't receive them. > Could this be the problem ? > > I downloaded and installed javacomm. I was not able to add > "Driver=gnuio.RXTXCommDriver > to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not > have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 > installed in /usr/java/jre1.5.0_05. I added comm.jar > to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext > to the library paths. Is this OK ? > > Does it matter that I am receiving on /dev/ttyUSB0 ? > > Thanks. > -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Sun Feb 12 21:01:33 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue Mar 14 23:22:08 2006 Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: <1139677612.3431.5.camel@zd7280> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> <1139631780.23882.10.camel@zd7280> <1139677612.3431.5.camel@zd7280> Message-ID: I suspect what is happening is the select() is breaking out in the native code but the driver does not have support for notifying there are X bytes available. On some traditional Unix based systems, the only way you know data is available is the fd status changes and do an FIORDCHK ioctl. Or perhaps the only thing you can know is the fd status changed. It would take reading through the kernel driver code to know for sure. So on USB, depending upon the driver, the same may need to be done or the driver improved a bit if possible to support. Polling reads will also work but don't use the event driven model of CommAPI which isnt acceptable in the long run. The 100% cpu usage can then be explained because select no longer blocks until the data is read; the eventLoop spins loose. You can put a well placed sleep but rxtx only expects those are needed when it knows data is available. This may not be a super simple thing to understand and fix. I do have ideas to get you started. I'm going to be short on time the next couple weeks. I expect to put some good time in and answer some other questions I saw around the 25th. For now, I'd look at the following and go from there with the hints I've given. JNIEXPORT jint JNICALL RXTXPort(nativeavailable)( JNIEnv *env, jobject jobj ) { int fd = get_java_var( env, jobj,"fd","I" ); int result; /* char message[80]; ENTER( "RXTXPort:nativeavailable" ); On SCO OpenServer FIONREAD always fails for serial devices, so try ioctl FIORDCHK instead; will only tell us whether bytes are available, not how many, but better than nothing. This turns out to be true on Solaris also. taj. */ #ifdef FIORDCHK /* __unixware__ __sun__ probably others */ result = ioctl(fd, FIORDCHK, 0); #else if( ioctl( fd, FIONREAD, &result ) < 0 ) { goto fail; } #endif /* FIORDCHK */ On Sat, 11 Feb 2006, Kim Lux wrote: > > More on this problem. I copied and pasted simpleRead into a console > based Eclipse project and I've got the same result, except that cpu > usage doesn't go to 100%. I'm beginning to think there is an issue in > rxtx. > > My imports for simpleRead are: > > ============================ > import gnu.io.*; > import java.util.*; > //import javax.comm.*; > import java.io.*; > =========================== > > Any ideas ? I am trying to read from /dev/ttyUSB0 using a serial to > USB adapter which has worked well with minicom and gtkterm. > > Thanks. > > > > On Fri, 2006-02-10 at 21:23 -0700, Kim Lux wrote: >> I've got a problem receiving chars with my version of serialRead, >> written in an SWT GUI. >> >> I had a Java pro have a good look at my code and he can't see anything >> wrong with it. >> >> I can send chars fine. When I receive a char the cpu usage for the app >> goes to 100% and the code in the serial event handler doesn't get >> executed. >> >> The instructions on the Java Comm Serial API How-To for Linux page state >> that I must install javacomm. Is that true ? Everything builds without >> it and I can send chars on rxtx just fine, but I can't receive them. >> Could this be the problem ? >> >> I downloaded and installed javacomm. I was not able to add >> "Driver=gnuio.RXTXCommDriver >> to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not >> have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 >> installed in /usr/java/jre1.5.0_05. I added comm.jar >> to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext >> to the library paths. Is this OK ? >> >> Does it matter that I am receiving on /dev/ttyUSB0 ? >> >> Thanks. >> > From tjarvi at qbang.org Sun Feb 12 21:03:30 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue Mar 14 23:22:08 2006 Subject: [Rxtx] One serial port object for both sending and receiving ? In-Reply-To: <1139610545.18177.4.camel@zd7280> References: <1139610545.18177.4.camel@zd7280> Message-ID: On Fri, 10 Feb 2006, Kim Lux wrote: > > Is it OK to use one SerialPort ojbect (ex Serial Port serialPort;) and > use it for both sending and receiving ? > > For example: > > ======================================================================== > static SerialPort serialPort = null; > static OutputStream serialOut = null; > static InputStream serialIn = null; > > > > > // assign it to an outputStream for use > try{ > serialOut = serialPort.getOutputStream(); > System.out.println("Serial output stream has been assigned."); > }//try > catch(IOException e) > { > System.out.println("Error: Couldn't assign output stream to serial > port."); > }//catch > > > //assign it to an inputStream for use > try{ > serialIn = serialPort.getInputStream(); > System.out.println("Serial input stream has been assigned."); > }//try > catch(IOException e) > { > System.out.println("Error: Couldn't assign input stream to serial > port."); > }//catch This should be fine. In fact trying to do it another way will probably not work as you will run into lockfile issues. -- Trent Jarvi tjarvi@qbang.org From tjarvi at qbang.org Sun Feb 12 21:13:13 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue Mar 14 23:22:08 2006 Subject: [Rxtx] Question about Serial I/O under Win32 In-Reply-To: <662084330@web.de> References: <662084330@web.de> Message-ID: On Sat, 11 Feb 2006 lunareclipse03@web.de wrote: > Hello everybody, > > I have a strange problem with a piece of code I made for myself. No, > this is not really concerning rxtx, but nevertheless I post this to the > list, hoping that some of you can help me. I've written two libraries, > one for linux and one for win32. The linux port works quite well, I can > send / receive faxes and / or replay voice messages over the telephone > line using a voice modem. But the win32 port of the library causes some > trouble. If, for example, I send out a fax with a certain modem under > linux, it works well. The fax is complete when it comes out of the fax > machine. If I then use the same modem to send out a fax under win32, the > fax coming out of the fax machine gets "stuck" halfways, but the sending > modem thinks that transmission was ok and drops the connection. The > answering fax machine then gives me "error while receiving." The "upper > layer" java code MUST be right, because if I do the same thing under > linux (using the linux library), everything is alright. Now I have to > ask: Can somebody please help me out with this??!? Could it be the case > that some kind of flow control or COMMTIMEOUTS setting causes this > behaviour? I set flow control to RTS/CTS before sending out a fax. How > can I DISABLE flow control? Or what do you think? Can something else > cause this problems? Thank you all for your time and PLEASE write back > soon. > Hi Sven I'm not too willing to talk about flow control at the low level until I confirm some things with test equipment later. It is not clear if you are using rxtx or writing your own native code. So I'm not sure how to answer much of this :) If you are wondering how to change the flow control using rxtx from java, The BlackBox example from Sun flips this back and forth. SerialPort.java in rxtx 2.1 uses the following: SerialPort.java: public static final int FLOWCONTROL_NONE =0; SerialPort.java: public static final int FLOWCONTROL_RTSCTS_IN =1; SerialPort.java: public static final int FLOWCONTROL_RTSCTS_OUT =2; SerialPort.java: public static final int FLOWCONTROL_XONXOFF_IN =4; SerialPort.java: public static final int FLOWCONTROL_XONXOFF_OUT=8; So if you set flowcontrol to RTSCTS, you can set it to NONE to turn it off. If you are looking for how to do it in native code, the rxtx Source is SerialImp.c (unix/linux/mac os x/w32) and termios.c (w32 only with SerialImp.c) You can track the code: SerialImp.c:JNIEXPORT void JNICALL RXTXPort(setflowcontrol)( JNIEnv *env, jobject jobj, jint flowmode ) termios.c:int tcgetattr( int fd, struct termios *s_termios ) termios.c:int tcsetattr( int fd, int when, struct termios *s_termios ) There may be a problem in the rxtx flow control code though. Rather than guess, I want to test this with a gold standard. -- Trent Jarvi tjarvi@qbang.org From tjarvi at qbang.org Mon Feb 6 00:00:16 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue Mar 28 18:25:33 2006 Subject: [Rxtx] wiki delay until tomorrow night. In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: On Sun, 5 Feb 2006, Trent Jarvi wrote: > On Sun, 5 Feb 2006, Kim Lux wrote: > >> usb ? Tell me more... I need that too. > > usb is a very proper design. Thats all it is. > Maybe rxtx could help usb. But it would start with helping bring back the community that was already there. It's not something I'd love to do but maybe its the right thing to do. It would probably take 2 years to do right. But maybe thats better than what we have now. I honestly don't know what IBM is doing which could just run over everything. Just some thoughts after some fine german wine. -- Trent Jarvi tjarvi@qbang.org From gadelavega at yahoo.com.ar Mon Feb 6 02:17:05 2006 From: gadelavega at yahoo.com.ar (Gonzalo A. de la Vega) Date: Tue Mar 28 18:25:33 2006 Subject: [Rxtx] Serial port ownership question In-Reply-To: References: <20060205113618.30274.qmail@web53501.mail.yahoo.com> <1139157422.4553.9.camel@zd7280> <1139158698.4936.9.camel@zd7280> Message-ID: <43E71411.4050402@yahoo.com.ar> On my Fedora Core 4: ls -l /dev/ttyS* crw-rw---- 1 root uucp 4, 64 Feb 6 2006 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Feb 6 2006 /dev/ttyS1 ... and: grep "ttyUSB" /etc/udev/rules.d/50-udev.rules KERNEL=="ttyUSB*", GROUP="uucp", MODE="0660" So anyone in the "uucp" group can use serial ports. On Gentoo the group is "tty". Trent Jarvi escribi?: > > > On Sun, 5 Feb 2006, Dr. Douglas Lyon wrote: > >> I can confirm that this is the case (only root ownership of >> serial ports, under fedora 4). >> Wow, what were they thinking?! >> - DL >> >>> I've found that the newer kernels have the serial ports owned by root. >>> For example, >>> >>> $ls -al /dev/tty* >>> crw-rw-rw- 1 root root 5, 0 Feb 5 02:06 /dev/tty >>> crw-rw---- 1 root root 4, 0 Feb 5 02:06 /dev/tty0 >>> crw------- 1 root root 4, 1 Feb 5 09:07 /dev/tty1 >>> crw-rw---- 1 root tty 4, 10 Feb 5 02:06 /dev/tty10 >>> crw-rw---- 1 root tty 4, 11 Feb 5 02:06 /dev/tty11 >>> ... > > > This is just not a problem jcp or such are going to solve. Its a > platform spitwad fight. But do look at pam. In fact thats what Sun > is doing too. Maybe Linux followed their lead.. I'm not a pam guy. > I've spent 16 hours trying to understand it but your users wont :) > > Solution? I have no clue. Its two tangent mentalities from my > perspective. > > -- > Trent Jarvi > tjarvi@qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx@qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mtnvega at yahoo.com.br Mon Feb 6 05:35:43 2006 From: mtnvega at yahoo.com.br (Luiz Jr) Date: Tue Mar 28 18:25:33 2006 Subject: [Rxtx] Documentation Wiki In-Reply-To: <1139157422.4553.9.camel@zd7280> Message-ID: <20060206123543.57256.qmail@web53515.mail.yahoo.com> Hello, Thank you for you answer, but so the usage of the API is pretty much like the Java Communications Api? If yes, what version of the Java Comm Api? Thank you, Luiz A. Brandao Jr Kim Lux escreveu: On Sun, 2006-02-05 at 08:36 -0300, Luiz Jr wrote: > Hello, > > I want to start using the RXTX libraries, but I would to know how, > since I can not access the documentation wiki page I just started using them yesterday. Below is how I installed the libraries, if that helps. I used snippets of code from the SimpleWrite application here to get me going. http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html Instead of "import javax.comm.*;", use "import gnu.io.*;" which is gotten from RXTXcomm.jar, which you will need to include in your project references. I am working in Eclipse. BTW: there is no way to open a port without going through the port list and finding it. Maybe sometime in the future someone (me ?) will write a method called openSerialPort that allows the user to give a port identifier, such as "/dev/tty1" and return a port ready to use. It wouldn't take much to write that and it would save users a lot of code. Hope this helps. ======================================================================= 1) Figure out which java you are running, incase there is more than one installed. $ java -version java version "1.5.0_05" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_05-b05) Java HotSpot(TM) Client VM (build 1.5.0_05-b05, mixed mode, sharing) 2) Find all the jre directories and the one from which you are currently running. kfind (jre) 3) cd to that directory plus /lib/i386 cd /usr/java/jre1.5.0_05/lib/i386 4) Copy the library files (*.so) to that directory. cp /home/krlux/Desktop/'Java Controls'/rxtx-linux/bin/* . 5) Check that the copy was successful ls librxtx* librxtxI2C.so librxtxRaw.so librxtxSerial.so librxtxParallel.so librxtxRS485.so 6) cd to the /lib/ext directory for your java. cd /usr/java/jre1.5.0_05/lib/ext 7) Copy the Jar files there cp /home/krlux/Desktop/'Java Controls'/rxtx-linux/lib/ext/* . 8) Check that it was successful ls RXTX* RXTXcomm.jar Rxtx is now installed on your machine ready to use. =================================================================== -- Kim Lux, Diesel Research Inc. _______________________________________________ Rxtx mailing list Rxtx@qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx --------------------------------- Yahoo! Acesso Gr?tis - Internet r?pida e gr?tis. Instale o discador agora! -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/544aa403/attachment-0001.html From lyon at docjava.com Mon Feb 6 05:49:34 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue Mar 28 18:25:33 2006 Subject: [Rxtx] wiki delay until tomorrow night. In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: Hi All, I have often thought about USB drivers being needed. For example, the ironman watch will not interface to a mac (windows only). It is USB. My dymo label writer has no Java driver (native only). Etc. Most cheap web cameras are USB (and Java drivers go through JAI, if it supports the camera at all). The JAI code shows how sun did the USB drivers. You have to be a member of the jai project to download the source code. https://jai.dev.java.net has the jai distro. And then you are not allowed to redistribute it. However, we can all learn from it (if so inclined). Basically: cvs -d :pserver:lyon@cvs.dev.java.net:/cvs login cvs -d :pserver:lyon@cvs.dev.java.net:/cvs checkout jai-core You will need to user your own uid and pw to get in. The ant build has over 100 warnings from sun deprecations of its own code. You might say that they were hoisted on their own Picard ;) One interesting thing is that they support several platforms: linux-amd64 64-bit Linux-AMD64 linux-i586 32-bit Linux-x86 solaris-amd64 64-bit Solaris-AMD64 solaris-i586 32-bit Solaris-x86 solaris-sparc 32-bit Solaris-SPARC solaris-sparcv9 64-bit Solaris-SPARC windows-i586 32-bit Windows-x86 Thus, ant is used to provide a multi-platform native method distro. Neat. How do they do it? check this out: And: The core download does not contain any C source code (it was all pre-built). Basically, they are just copying .so and .dll files into build directories. I would love to see the C code for this...but Sun does not post it on the https://jai.dev.java.net site. I don't know why...Perhaps I missed it. - Doug >On Sun, 5 Feb 2006, Trent Jarvi wrote: > >>On Sun, 5 Feb 2006, Kim Lux wrote: >> >>>usb ? Tell me more... I need that too. >> >>usb is a very proper design. Thats all it is. >> > >Maybe rxtx could help usb. But it would start with helping bring >back the community that was already there. > >It's not something I'd love to do but maybe its the right thing to do. > >It would probably take 2 years to do right. But maybe thats better >than what we have now. > >I honestly don't know what IBM is doing which could just run over everything. > >Just some thoughts after some fine german wine. > >-- >Trent Jarvi >tjarvi@qbang.org > >_______________________________________________ >Rxtx mailing list >Rxtx@qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tdelenik at gmail.com Mon Feb 6 05:56:32 2006 From: tdelenik at gmail.com (Thanasis Delenikas) Date: Tue Mar 28 18:25:33 2006 Subject: Fwd: [Rxtx] Documentation Wiki In-Reply-To: <1139157422.4553.9.camel@zd7280> References: <20060205113618.30274.qmail@web53501.mail.yahoo.com> <1139157422.4553.9.camel@zd7280> Message-ID: <310a1a930602060456t129f1dc6p5f2b908f13ab5a0b@mail.gmail.com> Hello all, Kim, this is a snippet from the code I use. The closest to directly opening a specific port without enumeration. << ... portId = CommPortIdentifier.getPortIdentifier(getPort()); serialPort = (SerialPort) portId.open("jSMSEngine", 1971); ... >> where getPort() return the string identifier of the port, i.e. "/dev/ttyS0" or "COM1" or whatever. Thanasis. ---------- Forwarded message ---------- From: Kim Lux Date: Feb 5, 2006 6:37 PM Subject: Re: [Rxtx] Documentation Wiki To: RXTX Developers and Users BTW: there is no way to open a port without going through the port list and finding it. Maybe sometime in the future someone (me ?) will write a method called openSerialPort that allows the user to give a port identifier, such as "/dev/tty1" and return a port ready to use. It wouldn't take much to write that and it would save users a lot of code. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/182ab5b8/attachment-0001.html From tjarvi at qbang.org Mon Feb 6 11:53:57 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue Mar 28 18:25:33 2006 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: On Mon, 6 Feb 2006, Dr. Douglas Lyon wrote: > Hi All, > I have often thought about USB drivers being needed. > For example, the ironman watch will not interface > to a mac (windows only). It is USB. > My dymo label writer has no Java driver (native only). > Etc. > Most cheap web cameras are USB (and Java drivers go > through JAI, if it supports the camera at all). > The JAI code shows how sun did the USB drivers. > You have to be a member of the jai project to download > the source code. > https://jai.dev.java.net has the jai distro. > And then you are not allowed to redistribute it. However, > we can all learn from it (if so inclined). Basically: > cvs -d :pserver:lyon@cvs.dev.java.net:/cvs login > cvs -d :pserver:lyon@cvs.dev.java.net:/cvs checkout jai-core > You will need to user your own uid and pw to get in. > The ant build has over 100 warnings from sun deprecations > of its own code. > > You might say that they were hoisted on their own Picard ;) > > One interesting thing is that they support several platforms: > linux-amd64 64-bit Linux-AMD64 > linux-i586 32-bit Linux-x86 > solaris-amd64 64-bit Solaris-AMD64 > solaris-i586 32-bit Solaris-x86 > solaris-sparc 32-bit Solaris-SPARC > solaris-sparcv9 64-bit Solaris-SPARC > windows-i586 32-bit Windows-x86 > Thus, ant is used to provide a multi-platform native method distro. > Neat. > How do they do it? > check this out: > > > > > > > > > > > > > And: > > > > > > > > > > The core download does not contain any C source code (it was all pre-built). > Basically, they are just copying .so and .dll files into build directories. > > I would love to see the C code for this...but Sun does not post it on the > https://jai.dev.java.net site. > > I don't know why...Perhaps I missed it. > > - Doug > > I've looked at moving rxtx to Ant builds. I think that would help IDEs a great deal. I requested a evalutation desk copy the O'Reilly Ant book for some j2ee material I was teaching. http://www.oreilly.com/catalog/anttdg/ It has a one sentence mention of JNI. So there was not luck there. I saw that there is another Ant book that does mention JNI more. I can't find it now. Ant must be able to support it with extensions. http://ant.apache.org/manual/OptionalTasks/javah.html What the auto(break :) tools do in the rxtx build is 4 things really. 1) gcc compile flags 2) ld compile flags 3) config.h 4) compile flags for customizing rxtx (lockfiles, ...) See 1 All of this information except 4 can be static once obtained. So I'm not attached to the auto tools. If I could find an example of Ant being used for JNI code, I'd be one of the first to start moving that direction. Maybe someone saw an example someplace. The other thing we have not completed discussing is the directory structure. There is interest in making rxtx more IDE friendly. I get more mail about that off the list than how to install rxtx. And I see we have Ken Thompson in da house :) He is our trusted CVS maintainer and the guy that purchased the rxtx.org domain. Old community. We will need Ken for changing the directory structure of source. I would like to open up discussion about both of these as it is more than time. The problem is I have little experience with Ant and even less with IDEs. It would be nice if we could work with Eclipse and NetBeans. http://www.netbeans.org/ (sun and some community) http://www.eclipes.org (ibm,rhat,... perhaps more community) http://maven.apache.org/what-is-maven.html (apache. It is community) borland should sortof be here too but I think thats covered in eclipse. >From what I understand so far, we should morph rxtx to support those three maybe trusting apaches lead with maven. But I use vi. I have little to no clues beyond what people have fed me. Can we agree that thats the right direction to go? -- Trent Jarvi tjarvi@qbang.org From brian at mbari.org Mon Feb 6 14:57:50 2006 From: brian at mbari.org (Brian Schlining) Date: Tue Mar 28 18:25:33 2006 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> > The other thing we have not completed discussing is the directory > structure. There is interest in making rxtx more IDE friendly. I > get more mail about that off the list than how to install rxtx. > > And I see we have Ken Thompson in da house :) He is our trusted > CVS maintainer and the guy that purchased the rxtx.org domain. Old > community. We will need Ken for changing the directory structure of > source. > > I would like to open up discussion about both of these as it is > more than time. The problem is I have little experience with Ant > and even less with IDEs. It would be nice if we could work with > Eclipse and NetBeans. > > http://www.netbeans.org/ (sun and some community) > http://www.eclipes.org (ibm,rhat,... perhaps more community) > http://maven.apache.org/what-is-maven.html (apache. It is community) > borland should sortof be here too but I think thats covered in > eclipse. > >> From what I understand so far, we should morph rxtx to support >> those three > maybe trusting apaches lead with maven. But I use vi. I have > little to no clues beyond what people have fed me. > Maven likes the directory structure below for Java code. (From http:// maven.apache.org/guides/getting-started/index.html) This structure works fine with ant, netbeans, and eclipse. rxtx_root_directory `-- src |-- main | `-- java | `-- gnu | `-- io `-- test `-- java `-- gnu `-- io Brian Schlining Software Engineer http://www.mbari.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/d9451eba/attachment-0001.html From tjarvi at qbang.org Mon Feb 6 15:11:45 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue Mar 28 18:25:33 2006 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: > rxtx_root_directory > `-- src > |-- main > | `-- java > | `-- gnu > | `-- io > `-- test > `-- java > `-- gnu > `-- io > >From what I understand this will just be good. For me it makes no difference. So lets do the rxtx thing. Let if fester for two weeks and if nobody objects, we will do it. I'm not doing this because I care. I'm doing this to eliminate much of my inbox. But test... man is rxtx lacking there in the community aspect. It is covered but not right. _maybe_ I can change that this year. -- Trent Jarvi tjarvi@qbang.org (cat hurding since 1997) From lux at diesel-research.com Mon Feb 6 21:38:49 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue Mar 28 18:25:33 2006 Subject: [Rxtx] How can I use Lock Files with rxtx (in FC4) ? Message-ID: <1139287129.17031.3.camel@zd7280> I am now running an rxtx application on FC4. I am getting: ========================================================= check_group_uucp(): error testing lock file creation Error details: Permission denied check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL ========================================================= $ ls -al /var/lock total 32 drwxrwxr-x 4 root lock 4096 Feb 6 16:04 . drwxr-xr-x 24 root root 4096 Nov 14 01:19 .. drwx------ 2 root root 4096 Apr 27 2005 lvm drwxr-xr-x 2 root root 4096 Feb 6 16:04 subsys How do I fix this for regulator users ? -- Kim Lux, Diesel Research Inc. From dmarkman at mac.com Mon Feb 6 22:24:44 2006 From: dmarkman at mac.com (Dmitry Markman) Date: Tue Mar 28 18:25:33 2006 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: if I understands the issue right in order to be able to use ant for c/c++ compilation you have to install ant's cc task http://ant-contrib.sourceforge.net/cc.html it looks like it should work on mac os x (authors claim, that it's platform independent) but I never tested so all you have to do it's providing right command line for the gcc compiler On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: >> rxtx_root_directory >> `-- src >> |-- main >> | `-- java >> | `-- gnu >> | `-- io >> `-- test >> `-- java >> `-- gnu >> `-- io >> > > >> From what I understand this will just be good. > > For me it makes no difference. So lets do the rxtx thing. Let if > fester for two weeks and if nobody objects, we will do it. > > I'm not doing this because I care. I'm doing this to eliminate > much of my inbox. > > But test... man is rxtx lacking there in the community aspect. It > is covered but not right. _maybe_ I can change that this year. > > -- > Trent Jarvi > tjarvi@qbang.org > (cat hurding since 1997) > _______________________________________________ > Rxtx mailing list > Rxtx@qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx Dmitry Markman From lux at diesel-research.com Mon Feb 6 23:20:15 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue Mar 28 18:25:33 2006 Subject: [Rxtx] portlist.hasMoreElements is false ? Message-ID: <1139293215.3689.4.camel@zd7280> I'm running the code below. portlist.hasMoreElements() is false. /dev has ports in it as listed below. What am I doing wrong ? ========================================================== // Step through the list of ports until we find one that matches // the one we are looking for. portList = CommPortIdentifier.getPortIdentifiers(); while(portList.hasMoreElements()) { portID = (CommPortIdentifier) portList.nextElement(); // if (portID.getName().equals("/dev/ttyUSB0")) { myTA.append("Serial port ttyUSB0 has been found\n"); break; }// if portID equals... }// End of while... ========================================================== ls -al /dev/tty* crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 ... crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 -- Kim Lux, Diesel Research Inc. From david.garnier at trusted-logic.com Tue Feb 7 00:46:30 2006 From: david.garnier at trusted-logic.com (David Garnier) Date: Tue Mar 28 18:25:33 2006 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: <43E85056.2090608@trusted-logic.com> Hello, I think that the make-based build process is fine as it is, apart from the location of the Java source files. It is true that putting the Java source in a directory structure that map 1-to-1 to the Java package structure is the norm and should make it easier for everyone to modify the Java source, with or without an IDE. Ant is a good tool, but in the RXTX case I fail to see the advantage of using it compared to the current make-based process. As Trent said, they are more pressing issues, like testing. Regards, David Dmitry Markman wrote: > if I understands the issue right > in order to be able to use ant for c/c++ compilation > you have to install ant's cc task > http://ant-contrib.sourceforge.net/cc.html > > it looks like it should work on mac os x > (authors claim, that it's platform independent) > but I never tested > > so all you have to do it's providing right command line > for the gcc compiler > > > > > On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: > >>> rxtx_root_directory >>> `-- src >>> |-- main >>> | `-- java >>> | `-- gnu >>> | `-- io >>> `-- test >>> `-- java >>> `-- gnu >>> `-- io >>> >> >> >>> From what I understand this will just be good. >> >> For me it makes no difference. So lets do the rxtx thing. Let if >> fester for two weeks and if nobody objects, we will do it. >> >> I'm not doing this because I care. I'm doing this to eliminate much >> of my inbox. >> >> But test... man is rxtx lacking there in the community aspect. It is >> covered but not right. _maybe_ I can change that this year. >> >> -- >> Trent Jarvi >> tjarvi@qbang.org >> (cat hurding since 1997) From tjarvi at qbang.org Tue Feb 7 01:11:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue Mar 28 18:25:33 2006 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <43E85056.2090608@trusted-logic.com> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: On Tue, 7 Feb 2006, David Garnier wrote: > Hello, > > I think that the make-based build process is fine as it is, apart from the location of the Java > source files. It is true that putting the Java source in a directory structure that map 1-to-1 to > the Java package structure is the norm and should make it easier for everyone to modify the Java > source, with or without an IDE. > > Ant is a good tool, but in the RXTX case I fail to see the advantage of using it compared to the > current make-based process. As Trent said, they are more pressing issues, like testing. > Hi David I have more experience with testing rxtx than I can talk about. But let it be known, rxtx has gone trough 100's of hours of testing. We are hobby folks interested in toys but there is more. rxtx has had some of the best guidance in the industry there. This is not an easy thing. I may be able to come back in a month from the other side of the corperate fence and help. I suspect the tests could just be made public but they are in a very unusual environment that just wont work in a wider sense. This is something I'll be trying to change. At one point it was agreed we could just make the results public so this isnt just noise.. There is interest and I think its safe to mention that much. The big problem with testing in the past is most of it is done with a loopback connection. So we *still* have major questions regarding things like flow control. rxtx talks to itself over a loopback and it works. regardless of right or wrong. This requires more thought to be done right. -- Trent Jarvi tjarvi@qbang.org From tjarvi at qbang.org Tue Feb 7 02:46:34 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue Mar 28 18:25:33 2006 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: > The big problem with testing in the past is most of it is done with a > loopback connection. So we *still* have major questions regarding things > like flow control. rxtx talks to itself over a loopback and it works. > regardless of right or wrong. With serial communication there are gold standards. ckermit is probably a definitive 'standard.' Maybe its possible to do ping/pong tests with ckermit? Is it scriptable? There are known issues in rxtx. Probably the worst is some threading issues regarding some JREs with multiple JNI threads setting java variables. Man did I get schooled there. Just switch the c functions to returning variables and things go away. Sometimes they work fine, sometimes they blow up. Without understanding everything, somehow rhat got it right and debian (and especially gentoo) grabbed kernel patches causing all sort of harm. Its not hard to fix once you understand whats going on but nearly impossible to track with a debugger. So I have a good idea what 2.1-8 will have outside of the IDE modifications. rxtx 2.1-7 is a release for everyone to sync with. Its not even as stable as -pre17 as far as I know - I ran no test suites. I'll be chasing it too. We just had so many contributions that it was time. It seriously broke internal scheduals but thats a great thing :) The other thing I want to do in 2.1-8 is automagic baud rates. It turns out lots of shops are doing really funky baud rates for things like automobile test equipment. It is possible but it requires a fair amount of change in the native code. Is anyone looking at this? -- Trent Jarvi tjarvi@qbang.org From lyon at docjava.com Tue Feb 7 02:57:21 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue Mar 28 18:25:33 2006 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <43E85056.2090608@trusted-logic.com> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: Hi All, I agree, testing is very important. The problem I have been trying to address is related to cross-platform testing and the robust nature of the installs. Typically, I visit 3 platforms to deploy my product, windows, linux and mac. A build is performed on each platform. The idea that you can build for many platforms from one copy the source code seems attractive. This should enable synchronized deployments of identical code. The question of how to achieve this goal remains open. As Trent mentioned, this is hard. Perhaps Ant will help here (but perhaps not). Ant does seem to help with running unit tests. However, it does not help with multi-platform tests. For that you need many machines and different operating environments. Toward that end, I have created a multi-platform test that can be run from web start, located at: http://show.docjava.com:8086/book/cgij/code/jnlp/serialPort.PortTest.jnlp This is interesting because many people in the community can run the test and we can improve the test, as time permits. No, it is not a perfect solution, however, the idea does help with multi-platform tests using many machines and different operating environments. If the group has a good test for a general serial port set-ups, i would be happy to deploy it, for general evaluation using web start. And as for ANT, it is just an idea. Not all my ideas are good ones! - Doug >Hello, > >I think that the make-based build process is fine as it is, apart >from the location of the Java >source files. It is true that putting the Java source in a directory >structure that map 1-to-1 to >the Java package structure is the norm and should make it easier for >everyone to modify the Java >source, with or without an IDE. > >Ant is a good tool, but in the RXTX case I fail to see the advantage >of using it compared to the >current make-based process. As Trent said, they are more pressing >issues, like testing. > >Regards, >David > >Dmitry Markman wrote: >> if I understands the issue right >> in order to be able to use ant for c/c++ compilation >> you have to install ant's cc task >> http://ant-contrib.sourceforge.net/cc.html >> >> it looks like it should work on mac os x >> (authors claim, that it's platform independent) >> but I never tested >> >> so all you have to do it's providing right command line >> for the gcc compiler >> >> >> >> >> On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: >> >>>> rxtx_root_directory >>>> `-- src >>>> |-- main >>>> | `-- java >>>> | `-- gnu >>>> | `-- io >>>> `-- test >>>> `-- java >>>> `-- gnu >>>> `-- io >>>> >>> >>> >>>> From what I understand this will just be good. >>> >>> For me it makes no difference. So lets do the rxtx thing. Let if >>> fester for two weeks and if nobody objects, we will do it. >>> >>> I'm not doing this because I care. I'm doing this to eliminate much >>> of my inbox. >>> >>> But test... man is rxtx lacking there in the community aspect. It is >>> covered but not right. _maybe_ I can change that this year. >>> >>> -- >>> Trent Jarvi >>> tjarvi@qbang.org >>> (cat hurding since 1997) > >_______________________________________________ >Rxtx mailing list >Rxtx@qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From matt.higgins at gmail.com Tue Feb 7 08:28:34 2006 From: matt.higgins at gmail.com (Matt Higgins) Date: Tue Mar 28 18:25:33 2006 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final Message-ID: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? import java.io.*; import java.util.*; import gnu.io.*; public class MySimpleRead implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; public static void main(String[] args) { boolean portFound = false; String defaultPort = "COM1"; if (args.length > 0) { defaultPort = args[0]; } portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; MySimpleRead reader = new MySimpleRead(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } } public MySimpleRead() { try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) { e.printStackTrace(); } try { inputStream = serialPort.getInputStream(); } catch (IOException e) { e.printStackTrace(); } try { serialPort.addEventListener(this); } catch (TooManyListenersException e) { e.printStackTrace(); } try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { e.printStackTrace(); } System.out.println("Baud is " + serialPort.getBaudRate()); System.out.println("Bits is " + serialPort.getDataBits()); System.out.println("Stop is " + serialPort.getStopBits()); System.out.println("Par is " + serialPort.getParity()); serialPort.notifyOnDataAvailable(true); readThread = new Thread(this); readThread.start(); } public void run() { // Thread.sleep(20000); //} catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { System.out.println("An event occurred " + event.getEventType()); switch (event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: byte[] readBuffer = new byte[20]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } System.out.print(new String(readBuffer)); } catch (IOException e) {} break; } } } --------------- Result on windows ------------------------------ Stable Library ============================================================== Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port:: COM1 Baud is 9600 Bits is 8 Stop is 1 Par is 0 ----------------- End Results ----------------------------------------- ------------------ Result on Linux ----------------------------------- Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 Found port: /dev/ttyS0 Baud is 9600 Bits is 8 Stop is 1 Par is 0 An event occurred 1 043100066224 ------------------ End Results --------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/a1431630/attachment-0001.html From brian at mbari.org Tue Feb 7 09:48:37 2006 From: brian at mbari.org (Brian Schlining) Date: Tue Mar 28 18:25:33 2006 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> Message-ID: <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> Hi Matt > The following code works fine on Linux but I never see any data > when run on Windows. This is a cut and paste from the SimpleRead > example. > I am attempting to read data from a bar code scanner. I can fire > up HyperTermianl on windows and see that the device is working > properly as I see the barcodes are scanned and echoed back to the > terminal. However when I run the app I don't see any data. It is > however associating with the com port as the informational bits > print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. Cheers Brian Schlining Software Engineer http://www.mbari.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/16d07f37/attachment-0001.html From lux at diesel-research.com Tue Feb 7 11:59:58 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue Mar 28 18:25:33 2006 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139293215.3689.4.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> Message-ID: <1139338798.8145.4.camel@zd7280> Any ideas on this ? Any reason why portList.hasMoreElements() should be false even though there are devices in /dev ? On Mon, 2006-02-06 at 23:20 -0700, Kim Lux wrote: > I'm running the code below. > > portlist.hasMoreElements() is false. > > /dev has ports in it as listed below. > > What am I doing wrong ? > > > ========================================================== > // Step through the list of ports until we find one that matches > // the one we are looking for. > > portList = CommPortIdentifier.getPortIdentifiers(); > > while(portList.hasMoreElements()) > { > portID = (CommPortIdentifier) portList.nextElement(); // > if (portID.getName().equals("/dev/ttyUSB0")) > { > myTA.append("Serial port ttyUSB0 has been found\n"); > break; > }// if portID equals... > }// End of while... > ========================================================== > > ls -al /dev/tty* > crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty > crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 > crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 > crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 > crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 > ... > crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 > crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 > crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 > > > -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 12:20:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue Mar 28 18:25:33 2006 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139338798.8145.4.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> Message-ID: On Tue, 7 Feb 2006, Kim Lux wrote: > > Any ideas on this ? Any reason why portList.hasMoreElements() should be > false even though there are devices in /dev ? > > > On Mon, 2006-02-06 at 23:20 -0700, Kim Lux wrote: >> I'm running the code below. >> >> portlist.hasMoreElements() is false. >> >> /dev has ports in it as listed below. >> >> What am I doing wrong ? >> >> >> ========================================================== >> // Step through the list of ports until we find one that matches >> // the one we are looking for. >> >> portList = CommPortIdentifier.getPortIdentifiers(); >> >> while(portList.hasMoreElements()) >> { >> portID = (CommPortIdentifier) portList.nextElement(); // >> if (portID.getName().equals("/dev/ttyUSB0")) >> { >> myTA.append("Serial port ttyUSB0 has been found\n"); >> break; >> }// if portID equals... >> }// End of while... >> ========================================================== >> >> ls -al /dev/tty* >> crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty >> crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 >> crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 >> crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 >> crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 >> ... >> crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 >> crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 >> crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 >> >> >> > Hi Kim What rxtx does is try to open the port and do a timed out read. If the kernel/... do not complain it's enumarted. I suspect you could do a crude test by doing something like cat /dev/ttyS0 > /dev/null If that barfs then rxtx wont enumerate the port. hmm looking at your question again, I suspect it's a lockfile problem. This is documented in INSTALL with the source. Its easy enough to test this too.. touch /var/lock/testingrxtxlockfiles && rm -f /var/lock/testingrxtxlockfiles If you are not in the right group it will bail. Root will work regardless. -- Trent Jarvi tjarvi@qbang.org From lux at diesel-research.com Tue Feb 7 12:37:56 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue Mar 28 18:25:33 2006 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> Message-ID: <1139341076.8145.11.camel@zd7280> Exactly which ports does rxtx attempt to put into the list ? /dev/* or /dev/tty* or /dev/tty[0-9[0-9] ? or /dev/ttyS* ? For the record, only /dev/ttyUSB0 is a valid port on the machine I am presently on. Will this be a problem ? On Tue, 2006-02-07 at 12:20 -0700, Trent Jarvi wrote: > This is documented in INSTALL with the source. > I was wondering where that file was. I will download source and dig it up. Thanks. -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 12:51:09 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue Mar 28 18:25:33 2006 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139341076.8145.11.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: On Tue, 7 Feb 2006, Kim Lux wrote: > > Exactly which ports does rxtx attempt to put into the list ? /dev/* > or /dev/tty* or /dev/tty[0-9[0-9] ? or /dev/ttyS* ? > > For the record, only /dev/ttyUSB0 is a valid port on the machine I am > presently on. Will this be a problem ? > > > On Tue, 2006-02-07 at 12:20 -0700, Trent Jarvi wrote: >> This is documented in INSTALL with the source. >> > I was wondering where that file was. I will download source and dig it > up. > > Thanks. > Hmm I'm looking at pre17 so this may have changed. (its just what I have on this machine) if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA" // for the IPAQs }; CandidatePortPrefixes=Temp; } So you may need to add "ttyUSB" to that list. RXTX used to enumerate _everything_ see if(osName.equals("Linux-all-ports") But it became less than practical. This is all in RXTXCommDriver.java hmm I just did a cvs update. if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have to get your fingers into the code. We aim for sane defaults. -- Trent Jarvi tjarvi@qbang.org From lux at diesel-research.com Tue Feb 7 13:06:45 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue Mar 28 18:25:33 2006 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139342805.8145.22.camel@zd7280> On Tue, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > Hmm I'm looking at pre17 so this may have changed. (its just what I have > on this machine) > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA" // for the IPAQs > }; > CandidatePortPrefixes=Temp; > } > > > So you may need to add "ttyUSB" to that list. RXTX used to enumerate > _everything_ see if(osName.equals("Linux-all-ports") But it became less > than practical. > > This is all in RXTXCommDriver.java > > hmm I just did a cvs update. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have > to get your fingers into the code. We aim for sane defaults. Excellent. Thanks for taking the time. -- Kim Lux, Diesel Research Inc. From ideiglenes1 at freemail.hu Tue Feb 7 13:53:39 2006 From: ideiglenes1 at freemail.hu (--) Date: Tue Mar 28 18:25:33 2006 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139345619.22534.2.camel@localhost> Hi! I use this code to get all the extra Linux devices. :) if ("Linux".equals(System.getProperty("os.name"))) { System.setProperty("os.name","Linux-all-ports"); } driver = new RXTXCommDriver(); On k, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > On Tue, 7 Feb 2006, Kim Lux wrote: > > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have > to get your fingers into the code. We aim for sane defaults. > > -- > Trent Jarvi > tjarvi@qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx@qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From matt.higgins at gmail.com Tue Feb 7 13:45:54 2006 From: matt.higgins at gmail.com (Matt Higgins) Date: Tue Mar 28 18:25:33 2006 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> Message-ID: <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> Sweet this is exactly what I needed. I was searching the archives through marc.theamisgroup they only have archives back to 1/3/05. Should have hit the mailman archive! Thanks a lot! On 2/7/06, Brian Schlining wrote: > > Hi Matt > > The following code works fine on Linux but I never see any data when run > on Windows. This is a cut and paste from the SimpleRead example. > I am attempting to read data from a bar code scanner. I can fire up > HyperTermianl on windows and see that the device is working properly as I > see the barcodes are scanned and echoed back to the terminal. However when I > run the app I don't see any data. It is however associating with the com > port as the informational bits print fine? > > > You're not the only one whose had this problem, I don't know if Trent has > addressed this is the latest release of RXTX but there is a workaround. > Here's the recent thread from the RXTX mailing list regarding this issues: > > Thanasis Delenikas tdelenik at gmail.com > Wed Jan 18 13:56:23 MST 2006 > > * Previous message: [Rxtx] Re: More close() performance fixes > * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] > > Hi all. > (I've subscribed again from my other email account). > > Trent, > > You are right. Linux *always* works, no matter what flow control you set. > Windows *works only* with hardware flow control (I haven't tested what > happens with software XON/XOFF flow control). > > I assume (but I am not certain) that even with no flow control at all, all > platforms should work. Without flow control, you have the risk of bumping > into overflow or framing errors, but that's your (the end programmer, I > mean) problem. > > >From my side, I shouldn't be working without flow control. That was a bug > too... It was some code forgotten from the old times, when I used to work > with phone emulation drivers which didn't support flow control. The > correct > way is to have some flow control enabled and that's why I suppose this is > a > low-severity bug for RxTx. > > I have no idea which platform shows the correct behaviour, since > my knowledge about Linux and the inner workings of these low-level i/o > operations is limited. > > Regards, > Thanasis Delenikas. > > > > > Message: 2 > > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > > From: Trent Jarvi > > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > > To: RXTX Developers and Users > > Message-ID: > > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > > > Hi all, > > > > > > Trent, I have found something. > > > I read your comment about flow control, so I experimented a bit. > > > > > > If you remember, in my sample program I've used no flow control at all > ( > > i.e. > > > Java constant FLOWCONTROL_NONE). > > > > > > Now, during testing, I've switch to hardware inbound flow control (i.e > . > > Java > > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > > beautifully! > > > > > > I think I will switch to H/W flow control and test things for a while, > > but > > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > > > > > Hi Thanasis, > > > > I'm fairly sure you have identified a bug. I would not worry too much > > about what Sun CommAPI w32 defaults are. I think they did more or less > > whatever the port opened with. Just a guess. Linux tries to stomp on > > ports so they are all the same. > > > > So this started out with Linux worked, Windows XP/.. did not as I > recall. > > Something is wrong in rxtx. Do I understand this right? > > > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > > > Perhaps there is something Wayne or I did not understand when we wrote > > that code. I wasnt programming back in the BBS days so modems are not > my > > thing. I have a few questions. > > > > Is the above matrix confirmed by observation? > > Linux just always worked? > > Which one _should_ work? I'm guessing modems work with hardware flow > > control. I'll have to dig around. > > > > The windows flow control changes a couple things with hardware flow > > control. Following the w32 API documentation is confusing sometimes. > > But it looks like Linux could have a bug too. > > Cheers > > Brian Schlining > Software Engineer > http://www.mbari.org > > > > _______________________________________________ > Rxtx mailing list > Rxtx@qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/9c989144/attachment-0001.html From tjarvi at qbang.org Tue Feb 7 14:06:14 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue Mar 28 18:25:33 2006 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> Message-ID: >> >> You're not the only one whose had this problem, I don't know if Trent has >> addressed this is the latest release of RXTX but there is a workaround. >> Here's the recent thread from the RXTX mailing list regarding this issues: >> I have not. I expect to have access to some test equipment next month and I'll go through all of this. I really don't know whats going on and I need a gold standard. I thought maybe linux was autodetecting the flow control. Your observations would certainly be welcome. I need to talk to Russell King and see what he is doing. Until then I'd just be toying around over a loopback as usual. This is very high on the list though. -- Trent Jarvi tjarvi@qbang.org From lux at diesel-research.com Tue Feb 7 17:25:05 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue Mar 28 18:25:34 2006 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139358305.17994.2.camel@zd7280> My application now works. I installed the libraries and jar from 2.1-7 (Final). portlist.hasMoreElements is no longer false. The application finds the port for /dev/ttyUSB0. Thanks for your help, Trent (et al) Sorry I bothered you with this. Next time I will look in the source first. I didn't think it was an rxtx issue, I thought it was a Linux setup issue . On Tue, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > Hmm I'm looking at pre17 so this may have changed. (its just what I > have > on this machine) > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux > Serial Ports > "ttySA" // for the > IPAQs > }; > > CandidatePortPrefixes=Temp; > } > > > So you may need to add "ttyUSB" to that list. RXTX used to enumerate > _everything_ see if(osName.equals("Linux-all-ports") But it became > less > than practical. > > This is all in RXTXCommDriver.java > > hmm I just did a cvs update. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux > Serial Ports > "ttySA", // for the > IPAQs > "ttyUSB" // for USB > frobs > }; > > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you > have > to get your fingers into the code. We aim for sane defaults. -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 19:21:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue Mar 28 18:25:34 2006 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139358305.17994.2.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> <1139358305.17994.2.camel@zd7280> Message-ID: >Sorry I bothered you with this. Next time I will look in the source >first. I didn't think it was an rxtx issue, I thought it was a Linux >setup issue . Why would you be sorry? I would have done the same. I'm glad it's working :) -- Trent Jarvi tjarvi@qbang.org From tma at mail.island.net Wed Feb 8 13:39:35 2006 From: tma at mail.island.net (Tom Alldread) Date: Tue Mar 28 18:25:34 2006 Subject: [Rxtx] Win32/Linux Serial Port Data Dropouts In-Reply-To: <200602060702.k167255O007882@www.qbang.org> References: <200602060702.k167255O007882@www.qbang.org> Message-ID: <43EA5707.4020200@mail.island.net> Greetings Folks at RXTX: During the last couple of months I have been alternately testing with javax.comm 2 and RXTX 2.1 under Windows XP and CommApi 3 and RXTX 2.1 under Suse 10.0 Linux. In the process I have learned a little about java multi-threading under NetBeans 5 with Profiler. My java (jdk 1.5_06) application is used for data acquisition and provides a graphical display of A-D conversion data received from a 56KBaud serial port. The actual data throughput is about 10KBaud thus it is well below the speed of the port. I use hardware RTS/CTS flow control which can stall the data acquisition sample rate if necessary. This ensures the display computer has the ability to slow the data acquisition rate should it become too busy to accept the regular data flow. Both the serial port buffer and the java read buffer are set at 16KB. Usually the data transfers into the java read buffer are less than 100 bytes unless the data acquisition is recovering from a stall. The data flow normally hesitates after each 5 KB block as a continue command is needed from the display computer to start the drawing of a new graphics display line. Separate threads have been provided for the serial port event monitoring and data processing. The serial port event thread has been given the maximum priority and data processing thread the minimum priority provided by java. Thread yield statements have been placed within all data processing while/for loops as an effort to ensure quick access to CPU cycles for the serial port event thread. I have found that short data transmissions are essentially error free but occasional dropouts occur with continuous data flow especially under Windows XP. ....................................................................................................................................................................................... Linux results: I am happy to report that RXTX 2.1 appears to work very well under Linux although I did notice some errors when the screen savers were running with my dual monitors. I believe this is a local problem associated with my dual graphics which needs further attention. The recent CommApi 3 Linux release from Sun did not work at all with my program. It seemed to send commands out OK but did not receive any data. Although the serial port event triggered the ISR, the input stream appeared filled with nulls and thus did not contain any data. As my understanding is that CommApi 3 was tested with a Red Hat distribution of Linux I wonder if this problem is distro dependent? Although somewhat off topic here I wonder if anyone reading this has had similar experience? .................................................................................................................................................................................. Windows XP results: There are problems with occasional data dropouts which become more frequent as the sampling rate is increased or if the computer becomes busy with other duties. The dropouts typically consist of a half dozen byte block of lost data. It appears the lost bytes never get added to the java input stream. There has not been any indication of garbled data, overruns or framing errors which suggests the UART communications remains solid. Using javax.comm 2 I found that the setting of SerialPort 'enableReceiveThreshold' to 40 and 'enableReceiveTimeout' of 100mS reduced the dropouts error rate significantly. I found that I could not get RXTX 2.1 to function with the aforementioned threshold and timeout settings. The javax.comm 2 interface is consequently performing better for me under Windows than RXTX 2.1. I wonder if anyone here has any suggestions as to what I might try to improve RXTX 2.1? Although my settings are the same as under Suse 10.0, RXTX 2.1 performs much better for me under Linux than any of the alternatives that I have tried under Windows XP . ............................................................................................................................................................................... I would like to establish, based on the experience of others, if I have reached the normally expected performance limit of java serial port communications? Should I expect to achieve virtually error free serial port data input from a continuous stream under Windows XP java software? I am considering changing my protocol to packets with error checking if necessary but would like to know if the dropout problems I am experiencing are typical or not before I take this rather work intensive plunge. Many thanks in advance for any help! Best Regards, Tom Alldread -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.375 / Virus Database: 267.15.2/253 - Release Date: 2006-02-07 From jlaxson at mac.com Wed Feb 8 23:56:48 2006 From: jlaxson at mac.com (John Laxson) Date: Tue Mar 28 18:25:34 2006 Subject: [Rxtx] PortInUseException: Unknown Application on OSX Message-ID: Hi, I've been trying to get RXTX 2.1.7 going on Mac OS X for a while here, and am running up into a wall here. I've tried with pre- compiled and the source version and get the same problem, a gnu.io.PortInUseException: Unknown Application. I have run the fixperms script included with the source distribution, and id shows me as a member of the uucp group, and permissions on /var/spool/uucp are 775 root:uucp. Running a test program (included at the bottom for clarity) lets me enumerate all the serial ports correctly, but trying to open any of them gives the PortInUseException. If it helps, when I try to open a port that's set to make an outgoing bluetooth connection, there is no delay and no connection attempt at all. Thanks, John Laxson PS: The documentation wiki on qbang.org shows 404, and has for a few days now. My test code: public static void main(String[] args) { SerialPort serialPort; try { Enumeration e = CommPortIdentifier.getPortIdentifiers(); CommPortIdentifier ident; while (e.hasMoreElements()) { ident = (CommPortIdentifier)e.nextElement(); System.out.println(ident.getName()); } ident = CommPortIdentifier.getPortIdentifier("/dev/cu.modem"); serialPort = (SerialPort) ident.open("Me", 5000); } catch (Exception e) { e.printStackTrace(); } } From rajesh.invincible at gmail.com Thu Feb 9 03:39:38 2006 From: rajesh.invincible at gmail.com (Rajesh N) Date: Tue Mar 28 18:25:34 2006 Subject: [Rxtx] Re: Move .java Files in gnu.io filesystem hierarchy - Maven (2) In-Reply-To: <43DF21D2.7090200@ngi.it> References: <43DF21D2.7090200@ngi.it> Message-ID: <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Can anybody tell me how to overcome these EXCEPTIONS I AM WORKING ON SERIAL COMMN IN JAVA ON LINUX. 1. " NOT ALL PARAMETERS SUPPORTED BY THE KERNEL" This i came across the following statement inmy prog. SerialP is A SerialPort object SerialP.setSerialPortParams(9600(BAUDRATE),DATABITS_8,STOPBITS_1,PARITY_NONE) 2. NullPointer Exception at Event Dispatch Now i have checked all my object references for a null reference but i found none i have put up my entire code in try catch blocks but still I AM UNABLE TO CATCH THIS EXCEPTION AND HENCE MY APPLICATION CLOSES HOW DOES THESE GO? PLEASE HELP ME IT IS URGENTTTTTTTTTTTTTTTT yours sincerely RAJESH On 1/31/06, Fabio Frumento wrote: > Hi Xavier, > > I don't know maven at all but the directory hierarchy listed buy Trent > is fine for me... > > I'll take a look to maven, it seems an interesting project > > Regards > > Fabio Frumento > > Trent Jarvi wrote: > > On Tue, 31 Jan 2006, Xavier Frisaye wrote: > > > >> Hi all, > >> > >> If you are going to rearrange the src folder, i will propose to use > >> maven 2 and follow its directory structure > >> > (http://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html). > >> > >> Maven 2 simplify java project and give a standard way to make projects > >> (http://maven.apache.org/). > >> We are using it for internal projects and we are very satisfied. > >> > >> Is anybody interested? > >> > >> I'm not an expert in maven 2 (yet) but i'm agree to help using it if > >> you choose to make so. > >> > > > > so this would be: > > > > rxtx-devel/src/main/java/gnu.io > > rxtx-devel/src/test/java/ManIwish.java > > > > I don't use IDEs very much so I'll let others comment. But I don't see > > a problem with that. > > > > -- > > Trent Jarvi > > tjarvi@qbang.org > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx@qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx@qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Thu Feb 9 09:50:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue Mar 28 18:25:34 2006 Subject: [Rxtx] Re: Move .java Files in gnu.io filesystem hierarchy - Maven (2) In-Reply-To: <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Message-ID: On Thu, 9 Feb 2006, Rajesh N wrote: > Can anybody tell me how to overcome these EXCEPTIONS > I AM WORKING ON SERIAL COMMN IN JAVA ON LINUX. > > 1. " NOT ALL PARAMETERS SUPPORTED BY THE KERNEL" > > This i came across the following statement inmy prog. > SerialP is A SerialPort object > SerialP.setSerialPortParams(9600(BAUDRATE),DATABITS_8,STOPBITS_1,PARITY_NONE) > Strange. The parameters you use are the same the port should open with by default. Could you paste the actual exception you are getting? I don't see that in the rxtx source. Also it would help to know the rxtx version. -- Trent Jarvi tjarvi@qbang.org From lux at diesel-research.com Fri Feb 10 15:29:05 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue Mar 28 18:25:34 2006 Subject: [Rxtx] One serial port object for both sending and receiving ? Message-ID: <1139610545.18177.4.camel@zd7280> Is it OK to use one SerialPort ojbect (ex Serial Port serialPort;) and use it for both sending and receiving ? For example: ======================================================================== static SerialPort serialPort = null; static OutputStream serialOut = null; static InputStream serialIn = null; // assign it to an outputStream for use try{ serialOut = serialPort.getOutputStream(); System.out.println("Serial output stream has been assigned."); }//try catch(IOException e) { System.out.println("Error: Couldn't assign output stream to serial port."); }//catch //assign it to an inputStream for use try{ serialIn = serialPort.getInputStream(); System.out.println("Serial input stream has been assigned."); }//try catch(IOException e) { System.out.println("Error: Couldn't assign input stream to serial port."); }//catch ======================================================================== -- Kim Lux, Diesel Research Inc. From lux at diesel-research.com Fri Feb 10 21:23:00 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue Mar 28 18:25:34 2006 Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Message-ID: <1139631780.23882.10.camel@zd7280> I've got a problem receiving chars with my version of serialRead, written in an SWT GUI. I had a Java pro have a good look at my code and he can't see anything wrong with it. I can send chars fine. When I receive a char the cpu usage for the app goes to 100% and the code in the serial event handler doesn't get executed. The instructions on the Java Comm Serial API How-To for Linux page state that I must install javacomm. Is that true ? Everything builds without it and I can send chars on rxtx just fine, but I can't receive them. Could this be the problem ? I downloaded and installed javacomm. I was not able to add "Driver=gnuio.RXTXCommDriver to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 installed in /usr/java/jre1.5.0_05. I added comm.jar to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext to the library paths. Is this OK ? Does it matter that I am receiving on /dev/ttyUSB0 ? Thanks. -- Kim Lux, Diesel Research Inc. From lunareclipse03 at web.de Sat Feb 11 09:44:46 2006 From: lunareclipse03 at web.de (lunareclipse03@web.de) Date: Tue Mar 28 18:25:34 2006 Subject: [Rxtx] Question about Serial I/O under Win32 Message-ID: <662084330@web.de> Hello everybody, I have a strange problem with a piece of code I made for myself. No, this is not really concerning rxtx, but nevertheless I post this to the list, hoping that some of you can help me. I've written two libraries, one for linux and one for win32. The linux port works quite well, I can send / receive faxes and / or replay voice messages over the telephone line using a voice modem. But the win32 port of the library causes some trouble. If, for example, I send out a fax with a certain modem under linux, it works well. The fax is complete when it comes out of the fax machine. If I then use the same modem to send out a fax under win32, the fax coming out of the fax machine gets "stuck" halfways, but the sending modem thinks that transmission was ok and drops the connection. The answering fax machine then gives me "error while receiving." The "upper layer" java code MUST be right, because if I do the same thing under linux (using the linux library), everything is alright. Now I have to ask: Can somebody please help me out with this??!? Could it be the case that some kind of flow control or COMMTIMEOUTS setting causes this behaviour? I set flow control to RTS/CTS before sending out a fax. How can I DISABLE flow control? Or what do you think? Can something else cause this problems? Thank you all for your time and PLEASE write back soon. Regards, --Sven Ahlemann Am Waldrand 31 45721 Haltern am See Germany ______________________________________________________________ Verschicken Sie romantische, coole und witzige Bilder per SMS! Jetzt bei WEB.DE FreeMail: http://f.web.de/?mc=021193 From lux at diesel-research.com Sat Feb 11 10:06:52 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue Mar 28 18:25:34 2006 Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: <1139631780.23882.10.camel@zd7280> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> <1139631780.23882.10.camel@zd7280> Message-ID: <1139677612.3431.5.camel@zd7280> More on this problem. I copied and pasted simpleRead into a console based Eclipse project and I've got the same result, except that cpu usage doesn't go to 100%. I'm beginning to think there is an issue in rxtx. My imports for simpleRead are: ============================ import gnu.io.*; import java.util.*; //import javax.comm.*; import java.io.*; =========================== Any ideas ? I am trying to read from /dev/ttyUSB0 using a serial to USB adapter which has worked well with minicom and gtkterm. Thanks. On Fri, 2006-02-10 at 21:23 -0700, Kim Lux wrote: > I've got a problem receiving chars with my version of serialRead, > written in an SWT GUI. > > I had a Java pro have a good look at my code and he can't see anything > wrong with it. > > I can send chars fine. When I receive a char the cpu usage for the app > goes to 100% and the code in the serial event handler doesn't get > executed. > > The instructions on the Java Comm Serial API How-To for Linux page state > that I must install javacomm. Is that true ? Everything builds without > it and I can send chars on rxtx just fine, but I can't receive them. > Could this be the problem ? > > I downloaded and installed javacomm. I was not able to add > "Driver=gnuio.RXTXCommDriver > to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not > have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 > installed in /usr/java/jre1.5.0_05. I added comm.jar > to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext > to the library paths. Is this OK ? > > Does it matter that I am receiving on /dev/ttyUSB0 ? > > Thanks. > -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Sun Feb 12 21:01:33 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue Mar 28 18:25:34 2006 Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: <1139677612.3431.5.camel@zd7280> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> <1139631780.23882.10.camel@zd7280> <1139677612.3431.5.camel@zd7280> Message-ID: I suspect what is happening is the select() is breaking out in the native code but the driver does not have support for notifying there are X bytes available. On some traditional Unix based systems, the only way you know data is available is the fd status changes and do an FIORDCHK ioctl. Or perhaps the only thing you can know is the fd status changed. It would take reading through the kernel driver code to know for sure. So on USB, depending upon the driver, the same may need to be done or the driver improved a bit if possible to support. Polling reads will also work but don't use the event driven model of CommAPI which isnt acceptable in the long run. The 100% cpu usage can then be explained because select no longer blocks until the data is read; the eventLoop spins loose. You can put a well placed sleep but rxtx only expects those are needed when it knows data is available. This may not be a super simple thing to understand and fix. I do have ideas to get you started. I'm going to be short on time the next couple weeks. I expect to put some good time in and answer some other questions I saw around the 25th. For now, I'd look at the following and go from there with the hints I've given. JNIEXPORT jint JNICALL RXTXPort(nativeavailable)( JNIEnv *env, jobject jobj ) { int fd = get_java_var( env, jobj,"fd","I" ); int result; /* char message[80]; ENTER( "RXTXPort:nativeavailable" ); On SCO OpenServer FIONREAD always fails for serial devices, so try ioctl FIORDCHK instead; will only tell us whether bytes are available, not how many, but better than nothing. This turns out to be true on Solaris also. taj. */ #ifdef FIORDCHK /* __unixware__ __sun__ probably others */ result = ioctl(fd, FIORDCHK, 0); #else if( ioctl( fd, FIONREAD, &result ) < 0 ) { goto fail; } #endif /* FIORDCHK */ On Sat, 11 Feb 2006, Kim Lux wrote: > > More on this problem. I copied and pasted simpleRead into a console > based Eclipse project and I've got the same result, except that cpu > usage doesn't go to 100%. I'm beginning to think there is an issue in > rxtx. > > My imports for simpleRead are: > > ============================ > import gnu.io.*; > import java.util.*; > //import javax.comm.*; > import java.io.*; > =========================== > > Any ideas ? I am trying to read from /dev/ttyUSB0 using a serial to > USB adapter which has worked well with minicom and gtkterm. > > Thanks. > > > > On Fri, 2006-02-10 at 21:23 -0700, Kim Lux wrote: >> I've got a problem receiving chars with my version of serialRead, >> written in an SWT GUI. >> >> I had a Java pro have a good look at my code and he can't see anything >> wrong with it. >> >> I can send chars fine. When I receive a char the cpu usage for the app >> goes to 100% and the code in the serial event handler doesn't get >> executed. >> >> The instructions on the Java Comm Serial API How-To for Linux page state >> that I must install javacomm. Is that true ? Everything builds without >> it and I can send chars on rxtx just fine, but I can't receive them. >> Could this be the problem ? >> >> I downloaded and installed javacomm. I was not able to add >> "Driver=gnuio.RXTXCommDriver >> to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not >> have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 >> installed in /usr/java/jre1.5.0_05. I added comm.jar >> to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext >> to the library paths. Is this OK ? >> >> Does it matter that I am receiving on /dev/ttyUSB0 ? >> >> Thanks. >> > From tjarvi at qbang.org Sun Feb 12 21:03:30 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue Mar 28 18:25:34 2006 Subject: [Rxtx] One serial port object for both sending and receiving ? In-Reply-To: <1139610545.18177.4.camel@zd7280> References: <1139610545.18177.4.camel@zd7280> Message-ID: On Fri, 10 Feb 2006, Kim Lux wrote: > > Is it OK to use one SerialPort ojbect (ex Serial Port serialPort;) and > use it for both sending and receiving ? > > For example: > > ======================================================================== > static SerialPort serialPort = null; > static OutputStream serialOut = null; > static InputStream serialIn = null; > > > > > // assign it to an outputStream for use > try{ > serialOut = serialPort.getOutputStream(); > System.out.println("Serial output stream has been assigned."); > }//try > catch(IOException e) > { > System.out.println("Error: Couldn't assign output stream to serial > port."); > }//catch > > > //assign it to an inputStream for use > try{ > serialIn = serialPort.getInputStream(); > System.out.println("Serial input stream has been assigned."); > }//try > catch(IOException e) > { > System.out.println("Error: Couldn't assign input stream to serial > port."); > }//catch This should be fine. In fact trying to do it another way will probably not work as you will run into lockfile issues. -- Trent Jarvi tjarvi@qbang.org From tjarvi at qbang.org Sun Feb 12 21:13:13 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue Mar 28 18:25:34 2006 Subject: [Rxtx] Question about Serial I/O under Win32 In-Reply-To: <662084330@web.de> References: <662084330@web.de> Message-ID: On Sat, 11 Feb 2006 lunareclipse03@web.de wrote: > Hello everybody, > > I have a strange problem with a piece of code I made for myself. No, > this is not really concerning rxtx, but nevertheless I post this to the > list, hoping that some of you can help me. I've written two libraries, > one for linux and one for win32. The linux port works quite well, I can > send / receive faxes and / or replay voice messages over the telephone > line using a voice modem. But the win32 port of the library causes some > trouble. If, for example, I send out a fax with a certain modem under > linux, it works well. The fax is complete when it comes out of the fax > machine. If I then use the same modem to send out a fax under win32, the > fax coming out of the fax machine gets "stuck" halfways, but the sending > modem thinks that transmission was ok and drops the connection. The > answering fax machine then gives me "error while receiving." The "upper > layer" java code MUST be right, because if I do the same thing under > linux (using the linux library), everything is alright. Now I have to > ask: Can somebody please help me out with this??!? Could it be the case > that some kind of flow control or COMMTIMEOUTS setting causes this > behaviour? I set flow control to RTS/CTS before sending out a fax. How > can I DISABLE flow control? Or what do you think? Can something else > cause this problems? Thank you all for your time and PLEASE write back > soon. > Hi Sven I'm not too willing to talk about flow control at the low level until I confirm some things with test equipment later. It is not clear if you are using rxtx or writing your own native code. So I'm not sure how to answer much of this :) If you are wondering how to change the flow control using rxtx from java, The BlackBox example from Sun flips this back and forth. SerialPort.java in rxtx 2.1 uses the following: SerialPort.java: public static final int FLOWCONTROL_NONE =0; SerialPort.java: public static final int FLOWCONTROL_RTSCTS_IN =1; SerialPort.java: public static final int FLOWCONTROL_RTSCTS_OUT =2; SerialPort.java: public static final int FLOWCONTROL_XONXOFF_IN =4; SerialPort.java: public static final int FLOWCONTROL_XONXOFF_OUT=8; So if you set flowcontrol to RTSCTS, you can set it to NONE to turn it off. If you are looking for how to do it in native code, the rxtx Source is SerialImp.c (unix/linux/mac os x/w32) and termios.c (w32 only with SerialImp.c) You can track the code: SerialImp.c:JNIEXPORT void JNICALL RXTXPort(setflowcontrol)( JNIEnv *env, jobject jobj, jint flowmode ) termios.c:int tcgetattr( int fd, struct termios *s_termios ) termios.c:int tcsetattr( int fd, int when, struct termios *s_termios ) There may be a problem in the rxtx flow control code though. Rather than guess, I want to test this with a gold standard. -- Trent Jarvi tjarvi@qbang.org From tjarvi at qbang.org Mon Feb 6 00:00:16 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue Mar 28 20:17:27 2006 Subject: [Rxtx] wiki delay until tomorrow night. In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: On Sun, 5 Feb 2006, Trent Jarvi wrote: > On Sun, 5 Feb 2006, Kim Lux wrote: > >> usb ? Tell me more... I need that too. > > usb is a very proper design. Thats all it is. > Maybe rxtx could help usb. But it would start with helping bring back the community that was already there. It's not something I'd love to do but maybe its the right thing to do. It would probably take 2 years to do right. But maybe thats better than what we have now. I honestly don't know what IBM is doing which could just run over everything. Just some thoughts after some fine german wine. -- Trent Jarvi tjarvi@qbang.org From gadelavega at yahoo.com.ar Mon Feb 6 02:17:05 2006 From: gadelavega at yahoo.com.ar (Gonzalo A. de la Vega) Date: Tue Mar 28 20:17:27 2006 Subject: [Rxtx] Serial port ownership question In-Reply-To: References: <20060205113618.30274.qmail@web53501.mail.yahoo.com> <1139157422.4553.9.camel@zd7280> <1139158698.4936.9.camel@zd7280> Message-ID: <43E71411.4050402@yahoo.com.ar> On my Fedora Core 4: ls -l /dev/ttyS* crw-rw---- 1 root uucp 4, 64 Feb 6 2006 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Feb 6 2006 /dev/ttyS1 ... and: grep "ttyUSB" /etc/udev/rules.d/50-udev.rules KERNEL=="ttyUSB*", GROUP="uucp", MODE="0660" So anyone in the "uucp" group can use serial ports. On Gentoo the group is "tty". Trent Jarvi escribi?: > > > On Sun, 5 Feb 2006, Dr. Douglas Lyon wrote: > >> I can confirm that this is the case (only root ownership of >> serial ports, under fedora 4). >> Wow, what were they thinking?! >> - DL >> >>> I've found that the newer kernels have the serial ports owned by root. >>> For example, >>> >>> $ls -al /dev/tty* >>> crw-rw-rw- 1 root root 5, 0 Feb 5 02:06 /dev/tty >>> crw-rw---- 1 root root 4, 0 Feb 5 02:06 /dev/tty0 >>> crw------- 1 root root 4, 1 Feb 5 09:07 /dev/tty1 >>> crw-rw---- 1 root tty 4, 10 Feb 5 02:06 /dev/tty10 >>> crw-rw---- 1 root tty 4, 11 Feb 5 02:06 /dev/tty11 >>> ... > > > This is just not a problem jcp or such are going to solve. Its a > platform spitwad fight. But do look at pam. In fact thats what Sun > is doing too. Maybe Linux followed their lead.. I'm not a pam guy. > I've spent 16 hours trying to understand it but your users wont :) > > Solution? I have no clue. Its two tangent mentalities from my > perspective. > > -- > Trent Jarvi > tjarvi@qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx@qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mtnvega at yahoo.com.br Mon Feb 6 05:35:43 2006 From: mtnvega at yahoo.com.br (Luiz Jr) Date: Tue Mar 28 20:17:27 2006 Subject: [Rxtx] Documentation Wiki In-Reply-To: <1139157422.4553.9.camel@zd7280> Message-ID: <20060206123543.57256.qmail@web53515.mail.yahoo.com> Hello, Thank you for you answer, but so the usage of the API is pretty much like the Java Communications Api? If yes, what version of the Java Comm Api? Thank you, Luiz A. Brandao Jr Kim Lux escreveu: On Sun, 2006-02-05 at 08:36 -0300, Luiz Jr wrote: > Hello, > > I want to start using the RXTX libraries, but I would to know how, > since I can not access the documentation wiki page I just started using them yesterday. Below is how I installed the libraries, if that helps. I used snippets of code from the SimpleWrite application here to get me going. http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html Instead of "import javax.comm.*;", use "import gnu.io.*;" which is gotten from RXTXcomm.jar, which you will need to include in your project references. I am working in Eclipse. BTW: there is no way to open a port without going through the port list and finding it. Maybe sometime in the future someone (me ?) will write a method called openSerialPort that allows the user to give a port identifier, such as "/dev/tty1" and return a port ready to use. It wouldn't take much to write that and it would save users a lot of code. Hope this helps. ======================================================================= 1) Figure out which java you are running, incase there is more than one installed. $ java -version java version "1.5.0_05" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_05-b05) Java HotSpot(TM) Client VM (build 1.5.0_05-b05, mixed mode, sharing) 2) Find all the jre directories and the one from which you are currently running. kfind (jre) 3) cd to that directory plus /lib/i386 cd /usr/java/jre1.5.0_05/lib/i386 4) Copy the library files (*.so) to that directory. cp /home/krlux/Desktop/'Java Controls'/rxtx-linux/bin/* . 5) Check that the copy was successful ls librxtx* librxtxI2C.so librxtxRaw.so librxtxSerial.so librxtxParallel.so librxtxRS485.so 6) cd to the /lib/ext directory for your java. cd /usr/java/jre1.5.0_05/lib/ext 7) Copy the Jar files there cp /home/krlux/Desktop/'Java Controls'/rxtx-linux/lib/ext/* . 8) Check that it was successful ls RXTX* RXTXcomm.jar Rxtx is now installed on your machine ready to use. =================================================================== -- Kim Lux, Diesel Research Inc. _______________________________________________ Rxtx mailing list Rxtx@qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx --------------------------------- Yahoo! Acesso Gr?tis - Internet r?pida e gr?tis. Instale o discador agora! -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/544aa403/attachment-0002.html From lyon at docjava.com Mon Feb 6 05:49:34 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue Mar 28 20:17:27 2006 Subject: [Rxtx] wiki delay until tomorrow night. In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: Hi All, I have often thought about USB drivers being needed. For example, the ironman watch will not interface to a mac (windows only). It is USB. My dymo label writer has no Java driver (native only). Etc. Most cheap web cameras are USB (and Java drivers go through JAI, if it supports the camera at all). The JAI code shows how sun did the USB drivers. You have to be a member of the jai project to download the source code. https://jai.dev.java.net has the jai distro. And then you are not allowed to redistribute it. However, we can all learn from it (if so inclined). Basically: cvs -d :pserver:lyon@cvs.dev.java.net:/cvs login cvs -d :pserver:lyon@cvs.dev.java.net:/cvs checkout jai-core You will need to user your own uid and pw to get in. The ant build has over 100 warnings from sun deprecations of its own code. You might say that they were hoisted on their own Picard ;) One interesting thing is that they support several platforms: linux-amd64 64-bit Linux-AMD64 linux-i586 32-bit Linux-x86 solaris-amd64 64-bit Solaris-AMD64 solaris-i586 32-bit Solaris-x86 solaris-sparc 32-bit Solaris-SPARC solaris-sparcv9 64-bit Solaris-SPARC windows-i586 32-bit Windows-x86 Thus, ant is used to provide a multi-platform native method distro. Neat. How do they do it? check this out: And: The core download does not contain any C source code (it was all pre-built). Basically, they are just copying .so and .dll files into build directories. I would love to see the C code for this...but Sun does not post it on the https://jai.dev.java.net site. I don't know why...Perhaps I missed it. - Doug >On Sun, 5 Feb 2006, Trent Jarvi wrote: > >>On Sun, 5 Feb 2006, Kim Lux wrote: >> >>>usb ? Tell me more... I need that too. >> >>usb is a very proper design. Thats all it is. >> > >Maybe rxtx could help usb. But it would start with helping bring >back the community that was already there. > >It's not something I'd love to do but maybe its the right thing to do. > >It would probably take 2 years to do right. But maybe thats better >than what we have now. > >I honestly don't know what IBM is doing which could just run over everything. > >Just some thoughts after some fine german wine. > >-- >Trent Jarvi >tjarvi@qbang.org > >_______________________________________________ >Rxtx mailing list >Rxtx@qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tdelenik at gmail.com Mon Feb 6 05:56:32 2006 From: tdelenik at gmail.com (Thanasis Delenikas) Date: Tue Mar 28 20:17:27 2006 Subject: Fwd: [Rxtx] Documentation Wiki In-Reply-To: <1139157422.4553.9.camel@zd7280> References: <20060205113618.30274.qmail@web53501.mail.yahoo.com> <1139157422.4553.9.camel@zd7280> Message-ID: <310a1a930602060456t129f1dc6p5f2b908f13ab5a0b@mail.gmail.com> Hello all, Kim, this is a snippet from the code I use. The closest to directly opening a specific port without enumeration. << ... portId = CommPortIdentifier.getPortIdentifier(getPort()); serialPort = (SerialPort) portId.open("jSMSEngine", 1971); ... >> where getPort() return the string identifier of the port, i.e. "/dev/ttyS0" or "COM1" or whatever. Thanasis. ---------- Forwarded message ---------- From: Kim Lux Date: Feb 5, 2006 6:37 PM Subject: Re: [Rxtx] Documentation Wiki To: RXTX Developers and Users BTW: there is no way to open a port without going through the port list and finding it. Maybe sometime in the future someone (me ?) will write a method called openSerialPort that allows the user to give a port identifier, such as "/dev/tty1" and return a port ready to use. It wouldn't take much to write that and it would save users a lot of code. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/182ab5b8/attachment-0002.html From tjarvi at qbang.org Mon Feb 6 11:53:57 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue Mar 28 20:17:27 2006 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: On Mon, 6 Feb 2006, Dr. Douglas Lyon wrote: > Hi All, > I have often thought about USB drivers being needed. > For example, the ironman watch will not interface > to a mac (windows only). It is USB. > My dymo label writer has no Java driver (native only). > Etc. > Most cheap web cameras are USB (and Java drivers go > through JAI, if it supports the camera at all). > The JAI code shows how sun did the USB drivers. > You have to be a member of the jai project to download > the source code. > https://jai.dev.java.net has the jai distro. > And then you are not allowed to redistribute it. However, > we can all learn from it (if so inclined). Basically: > cvs -d :pserver:lyon@cvs.dev.java.net:/cvs login > cvs -d :pserver:lyon@cvs.dev.java.net:/cvs checkout jai-core > You will need to user your own uid and pw to get in. > The ant build has over 100 warnings from sun deprecations > of its own code. > > You might say that they were hoisted on their own Picard ;) > > One interesting thing is that they support several platforms: > linux-amd64 64-bit Linux-AMD64 > linux-i586 32-bit Linux-x86 > solaris-amd64 64-bit Solaris-AMD64 > solaris-i586 32-bit Solaris-x86 > solaris-sparc 32-bit Solaris-SPARC > solaris-sparcv9 64-bit Solaris-SPARC > windows-i586 32-bit Windows-x86 > Thus, ant is used to provide a multi-platform native method distro. > Neat. > How do they do it? > check this out: > > > > > > > > > > > > > And: > > > > > > > > > > The core download does not contain any C source code (it was all pre-built). > Basically, they are just copying .so and .dll files into build directories. > > I would love to see the C code for this...but Sun does not post it on the > https://jai.dev.java.net site. > > I don't know why...Perhaps I missed it. > > - Doug > > I've looked at moving rxtx to Ant builds. I think that would help IDEs a great deal. I requested a evalutation desk copy the O'Reilly Ant book for some j2ee material I was teaching. http://www.oreilly.com/catalog/anttdg/ It has a one sentence mention of JNI. So there was not luck there. I saw that there is another Ant book that does mention JNI more. I can't find it now. Ant must be able to support it with extensions. http://ant.apache.org/manual/OptionalTasks/javah.html What the auto(break :) tools do in the rxtx build is 4 things really. 1) gcc compile flags 2) ld compile flags 3) config.h 4) compile flags for customizing rxtx (lockfiles, ...) See 1 All of this information except 4 can be static once obtained. So I'm not attached to the auto tools. If I could find an example of Ant being used for JNI code, I'd be one of the first to start moving that direction. Maybe someone saw an example someplace. The other thing we have not completed discussing is the directory structure. There is interest in making rxtx more IDE friendly. I get more mail about that off the list than how to install rxtx. And I see we have Ken Thompson in da house :) He is our trusted CVS maintainer and the guy that purchased the rxtx.org domain. Old community. We will need Ken for changing the directory structure of source. I would like to open up discussion about both of these as it is more than time. The problem is I have little experience with Ant and even less with IDEs. It would be nice if we could work with Eclipse and NetBeans. http://www.netbeans.org/ (sun and some community) http://www.eclipes.org (ibm,rhat,... perhaps more community) http://maven.apache.org/what-is-maven.html (apache. It is community) borland should sortof be here too but I think thats covered in eclipse. >From what I understand so far, we should morph rxtx to support those three maybe trusting apaches lead with maven. But I use vi. I have little to no clues beyond what people have fed me. Can we agree that thats the right direction to go? -- Trent Jarvi tjarvi@qbang.org From brian at mbari.org Mon Feb 6 14:57:50 2006 From: brian at mbari.org (Brian Schlining) Date: Tue Mar 28 20:17:27 2006 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> > The other thing we have not completed discussing is the directory > structure. There is interest in making rxtx more IDE friendly. I > get more mail about that off the list than how to install rxtx. > > And I see we have Ken Thompson in da house :) He is our trusted > CVS maintainer and the guy that purchased the rxtx.org domain. Old > community. We will need Ken for changing the directory structure of > source. > > I would like to open up discussion about both of these as it is > more than time. The problem is I have little experience with Ant > and even less with IDEs. It would be nice if we could work with > Eclipse and NetBeans. > > http://www.netbeans.org/ (sun and some community) > http://www.eclipes.org (ibm,rhat,... perhaps more community) > http://maven.apache.org/what-is-maven.html (apache. It is community) > borland should sortof be here too but I think thats covered in > eclipse. > >> From what I understand so far, we should morph rxtx to support >> those three > maybe trusting apaches lead with maven. But I use vi. I have > little to no clues beyond what people have fed me. > Maven likes the directory structure below for Java code. (From http:// maven.apache.org/guides/getting-started/index.html) This structure works fine with ant, netbeans, and eclipse. rxtx_root_directory `-- src |-- main | `-- java | `-- gnu | `-- io `-- test `-- java `-- gnu `-- io Brian Schlining Software Engineer http://www.mbari.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/d9451eba/attachment-0002.html From tjarvi at qbang.org Mon Feb 6 15:11:45 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue Mar 28 20:17:27 2006 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: > rxtx_root_directory > `-- src > |-- main > | `-- java > | `-- gnu > | `-- io > `-- test > `-- java > `-- gnu > `-- io > >From what I understand this will just be good. For me it makes no difference. So lets do the rxtx thing. Let if fester for two weeks and if nobody objects, we will do it. I'm not doing this because I care. I'm doing this to eliminate much of my inbox. But test... man is rxtx lacking there in the community aspect. It is covered but not right. _maybe_ I can change that this year. -- Trent Jarvi tjarvi@qbang.org (cat hurding since 1997) From lux at diesel-research.com Mon Feb 6 21:38:49 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue Mar 28 20:17:27 2006 Subject: [Rxtx] How can I use Lock Files with rxtx (in FC4) ? Message-ID: <1139287129.17031.3.camel@zd7280> I am now running an rxtx application on FC4. I am getting: ========================================================= check_group_uucp(): error testing lock file creation Error details: Permission denied check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL ========================================================= $ ls -al /var/lock total 32 drwxrwxr-x 4 root lock 4096 Feb 6 16:04 . drwxr-xr-x 24 root root 4096 Nov 14 01:19 .. drwx------ 2 root root 4096 Apr 27 2005 lvm drwxr-xr-x 2 root root 4096 Feb 6 16:04 subsys How do I fix this for regulator users ? -- Kim Lux, Diesel Research Inc. From dmarkman at mac.com Mon Feb 6 22:24:44 2006 From: dmarkman at mac.com (Dmitry Markman) Date: Tue Mar 28 20:17:27 2006 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: if I understands the issue right in order to be able to use ant for c/c++ compilation you have to install ant's cc task http://ant-contrib.sourceforge.net/cc.html it looks like it should work on mac os x (authors claim, that it's platform independent) but I never tested so all you have to do it's providing right command line for the gcc compiler On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: >> rxtx_root_directory >> `-- src >> |-- main >> | `-- java >> | `-- gnu >> | `-- io >> `-- test >> `-- java >> `-- gnu >> `-- io >> > > >> From what I understand this will just be good. > > For me it makes no difference. So lets do the rxtx thing. Let if > fester for two weeks and if nobody objects, we will do it. > > I'm not doing this because I care. I'm doing this to eliminate > much of my inbox. > > But test... man is rxtx lacking there in the community aspect. It > is covered but not right. _maybe_ I can change that this year. > > -- > Trent Jarvi > tjarvi@qbang.org > (cat hurding since 1997) > _______________________________________________ > Rxtx mailing list > Rxtx@qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx Dmitry Markman From lux at diesel-research.com Mon Feb 6 23:20:15 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue Mar 28 20:17:27 2006 Subject: [Rxtx] portlist.hasMoreElements is false ? Message-ID: <1139293215.3689.4.camel@zd7280> I'm running the code below. portlist.hasMoreElements() is false. /dev has ports in it as listed below. What am I doing wrong ? ========================================================== // Step through the list of ports until we find one that matches // the one we are looking for. portList = CommPortIdentifier.getPortIdentifiers(); while(portList.hasMoreElements()) { portID = (CommPortIdentifier) portList.nextElement(); // if (portID.getName().equals("/dev/ttyUSB0")) { myTA.append("Serial port ttyUSB0 has been found\n"); break; }// if portID equals... }// End of while... ========================================================== ls -al /dev/tty* crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 ... crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 -- Kim Lux, Diesel Research Inc. From david.garnier at trusted-logic.com Tue Feb 7 00:46:30 2006 From: david.garnier at trusted-logic.com (David Garnier) Date: Tue Mar 28 20:17:27 2006 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: <43E85056.2090608@trusted-logic.com> Hello, I think that the make-based build process is fine as it is, apart from the location of the Java source files. It is true that putting the Java source in a directory structure that map 1-to-1 to the Java package structure is the norm and should make it easier for everyone to modify the Java source, with or without an IDE. Ant is a good tool, but in the RXTX case I fail to see the advantage of using it compared to the current make-based process. As Trent said, they are more pressing issues, like testing. Regards, David Dmitry Markman wrote: > if I understands the issue right > in order to be able to use ant for c/c++ compilation > you have to install ant's cc task > http://ant-contrib.sourceforge.net/cc.html > > it looks like it should work on mac os x > (authors claim, that it's platform independent) > but I never tested > > so all you have to do it's providing right command line > for the gcc compiler > > > > > On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: > >>> rxtx_root_directory >>> `-- src >>> |-- main >>> | `-- java >>> | `-- gnu >>> | `-- io >>> `-- test >>> `-- java >>> `-- gnu >>> `-- io >>> >> >> >>> From what I understand this will just be good. >> >> For me it makes no difference. So lets do the rxtx thing. Let if >> fester for two weeks and if nobody objects, we will do it. >> >> I'm not doing this because I care. I'm doing this to eliminate much >> of my inbox. >> >> But test... man is rxtx lacking there in the community aspect. It is >> covered but not right. _maybe_ I can change that this year. >> >> -- >> Trent Jarvi >> tjarvi@qbang.org >> (cat hurding since 1997) From tjarvi at qbang.org Tue Feb 7 01:11:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue Mar 28 20:17:27 2006 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <43E85056.2090608@trusted-logic.com> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: On Tue, 7 Feb 2006, David Garnier wrote: > Hello, > > I think that the make-based build process is fine as it is, apart from the location of the Java > source files. It is true that putting the Java source in a directory structure that map 1-to-1 to > the Java package structure is the norm and should make it easier for everyone to modify the Java > source, with or without an IDE. > > Ant is a good tool, but in the RXTX case I fail to see the advantage of using it compared to the > current make-based process. As Trent said, they are more pressing issues, like testing. > Hi David I have more experience with testing rxtx than I can talk about. But let it be known, rxtx has gone trough 100's of hours of testing. We are hobby folks interested in toys but there is more. rxtx has had some of the best guidance in the industry there. This is not an easy thing. I may be able to come back in a month from the other side of the corperate fence and help. I suspect the tests could just be made public but they are in a very unusual environment that just wont work in a wider sense. This is something I'll be trying to change. At one point it was agreed we could just make the results public so this isnt just noise.. There is interest and I think its safe to mention that much. The big problem with testing in the past is most of it is done with a loopback connection. So we *still* have major questions regarding things like flow control. rxtx talks to itself over a loopback and it works. regardless of right or wrong. This requires more thought to be done right. -- Trent Jarvi tjarvi@qbang.org From tjarvi at qbang.org Tue Feb 7 02:46:34 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue Mar 28 20:17:27 2006 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: > The big problem with testing in the past is most of it is done with a > loopback connection. So we *still* have major questions regarding things > like flow control. rxtx talks to itself over a loopback and it works. > regardless of right or wrong. With serial communication there are gold standards. ckermit is probably a definitive 'standard.' Maybe its possible to do ping/pong tests with ckermit? Is it scriptable? There are known issues in rxtx. Probably the worst is some threading issues regarding some JREs with multiple JNI threads setting java variables. Man did I get schooled there. Just switch the c functions to returning variables and things go away. Sometimes they work fine, sometimes they blow up. Without understanding everything, somehow rhat got it right and debian (and especially gentoo) grabbed kernel patches causing all sort of harm. Its not hard to fix once you understand whats going on but nearly impossible to track with a debugger. So I have a good idea what 2.1-8 will have outside of the IDE modifications. rxtx 2.1-7 is a release for everyone to sync with. Its not even as stable as -pre17 as far as I know - I ran no test suites. I'll be chasing it too. We just had so many contributions that it was time. It seriously broke internal scheduals but thats a great thing :) The other thing I want to do in 2.1-8 is automagic baud rates. It turns out lots of shops are doing really funky baud rates for things like automobile test equipment. It is possible but it requires a fair amount of change in the native code. Is anyone looking at this? -- Trent Jarvi tjarvi@qbang.org From lyon at docjava.com Tue Feb 7 02:57:21 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue Mar 28 20:17:27 2006 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <43E85056.2090608@trusted-logic.com> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: Hi All, I agree, testing is very important. The problem I have been trying to address is related to cross-platform testing and the robust nature of the installs. Typically, I visit 3 platforms to deploy my product, windows, linux and mac. A build is performed on each platform. The idea that you can build for many platforms from one copy the source code seems attractive. This should enable synchronized deployments of identical code. The question of how to achieve this goal remains open. As Trent mentioned, this is hard. Perhaps Ant will help here (but perhaps not). Ant does seem to help with running unit tests. However, it does not help with multi-platform tests. For that you need many machines and different operating environments. Toward that end, I have created a multi-platform test that can be run from web start, located at: http://show.docjava.com:8086/book/cgij/code/jnlp/serialPort.PortTest.jnlp This is interesting because many people in the community can run the test and we can improve the test, as time permits. No, it is not a perfect solution, however, the idea does help with multi-platform tests using many machines and different operating environments. If the group has a good test for a general serial port set-ups, i would be happy to deploy it, for general evaluation using web start. And as for ANT, it is just an idea. Not all my ideas are good ones! - Doug >Hello, > >I think that the make-based build process is fine as it is, apart >from the location of the Java >source files. It is true that putting the Java source in a directory >structure that map 1-to-1 to >the Java package structure is the norm and should make it easier for >everyone to modify the Java >source, with or without an IDE. > >Ant is a good tool, but in the RXTX case I fail to see the advantage >of using it compared to the >current make-based process. As Trent said, they are more pressing >issues, like testing. > >Regards, >David > >Dmitry Markman wrote: >> if I understands the issue right >> in order to be able to use ant for c/c++ compilation >> you have to install ant's cc task >> http://ant-contrib.sourceforge.net/cc.html >> >> it looks like it should work on mac os x >> (authors claim, that it's platform independent) >> but I never tested >> >> so all you have to do it's providing right command line >> for the gcc compiler >> >> >> >> >> On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: >> >>>> rxtx_root_directory >>>> `-- src >>>> |-- main >>>> | `-- java >>>> | `-- gnu >>>> | `-- io >>>> `-- test >>>> `-- java >>>> `-- gnu >>>> `-- io >>>> >>> >>> >>>> From what I understand this will just be good. >>> >>> For me it makes no difference. So lets do the rxtx thing. Let if >>> fester for two weeks and if nobody objects, we will do it. >>> >>> I'm not doing this because I care. I'm doing this to eliminate much >>> of my inbox. >>> >>> But test... man is rxtx lacking there in the community aspect. It is >>> covered but not right. _maybe_ I can change that this year. >>> >>> -- >>> Trent Jarvi >>> tjarvi@qbang.org >>> (cat hurding since 1997) > >_______________________________________________ >Rxtx mailing list >Rxtx@qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From matt.higgins at gmail.com Tue Feb 7 08:28:34 2006 From: matt.higgins at gmail.com (Matt Higgins) Date: Tue Mar 28 20:17:27 2006 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final Message-ID: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? import java.io.*; import java.util.*; import gnu.io.*; public class MySimpleRead implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; public static void main(String[] args) { boolean portFound = false; String defaultPort = "COM1"; if (args.length > 0) { defaultPort = args[0]; } portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; MySimpleRead reader = new MySimpleRead(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } } public MySimpleRead() { try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) { e.printStackTrace(); } try { inputStream = serialPort.getInputStream(); } catch (IOException e) { e.printStackTrace(); } try { serialPort.addEventListener(this); } catch (TooManyListenersException e) { e.printStackTrace(); } try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { e.printStackTrace(); } System.out.println("Baud is " + serialPort.getBaudRate()); System.out.println("Bits is " + serialPort.getDataBits()); System.out.println("Stop is " + serialPort.getStopBits()); System.out.println("Par is " + serialPort.getParity()); serialPort.notifyOnDataAvailable(true); readThread = new Thread(this); readThread.start(); } public void run() { // Thread.sleep(20000); //} catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { System.out.println("An event occurred " + event.getEventType()); switch (event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: byte[] readBuffer = new byte[20]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } System.out.print(new String(readBuffer)); } catch (IOException e) {} break; } } } --------------- Result on windows ------------------------------ Stable Library ============================================================== Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port:: COM1 Baud is 9600 Bits is 8 Stop is 1 Par is 0 ----------------- End Results ----------------------------------------- ------------------ Result on Linux ----------------------------------- Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 Found port: /dev/ttyS0 Baud is 9600 Bits is 8 Stop is 1 Par is 0 An event occurred 1 043100066224 ------------------ End Results --------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/a1431630/attachment-0002.html From brian at mbari.org Tue Feb 7 09:48:37 2006 From: brian at mbari.org (Brian Schlining) Date: Tue Mar 28 20:17:27 2006 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> Message-ID: <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> Hi Matt > The following code works fine on Linux but I never see any data > when run on Windows. This is a cut and paste from the SimpleRead > example. > I am attempting to read data from a bar code scanner. I can fire > up HyperTermianl on windows and see that the device is working > properly as I see the barcodes are scanned and echoed back to the > terminal. However when I run the app I don't see any data. It is > however associating with the com port as the informational bits > print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. Cheers Brian Schlining Software Engineer http://www.mbari.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/16d07f37/attachment-0002.html From lux at diesel-research.com Tue Feb 7 11:59:58 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue Mar 28 20:17:27 2006 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139293215.3689.4.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> Message-ID: <1139338798.8145.4.camel@zd7280> Any ideas on this ? Any reason why portList.hasMoreElements() should be false even though there are devices in /dev ? On Mon, 2006-02-06 at 23:20 -0700, Kim Lux wrote: > I'm running the code below. > > portlist.hasMoreElements() is false. > > /dev has ports in it as listed below. > > What am I doing wrong ? > > > ========================================================== > // Step through the list of ports until we find one that matches > // the one we are looking for. > > portList = CommPortIdentifier.getPortIdentifiers(); > > while(portList.hasMoreElements()) > { > portID = (CommPortIdentifier) portList.nextElement(); // > if (portID.getName().equals("/dev/ttyUSB0")) > { > myTA.append("Serial port ttyUSB0 has been found\n"); > break; > }// if portID equals... > }// End of while... > ========================================================== > > ls -al /dev/tty* > crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty > crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 > crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 > crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 > crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 > ... > crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 > crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 > crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 > > > -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 12:20:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue Mar 28 20:17:27 2006 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139338798.8145.4.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> Message-ID: On Tue, 7 Feb 2006, Kim Lux wrote: > > Any ideas on this ? Any reason why portList.hasMoreElements() should be > false even though there are devices in /dev ? > > > On Mon, 2006-02-06 at 23:20 -0700, Kim Lux wrote: >> I'm running the code below. >> >> portlist.hasMoreElements() is false. >> >> /dev has ports in it as listed below. >> >> What am I doing wrong ? >> >> >> ========================================================== >> // Step through the list of ports until we find one that matches >> // the one we are looking for. >> >> portList = CommPortIdentifier.getPortIdentifiers(); >> >> while(portList.hasMoreElements()) >> { >> portID = (CommPortIdentifier) portList.nextElement(); // >> if (portID.getName().equals("/dev/ttyUSB0")) >> { >> myTA.append("Serial port ttyUSB0 has been found\n"); >> break; >> }// if portID equals... >> }// End of while... >> ========================================================== >> >> ls -al /dev/tty* >> crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty >> crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 >> crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 >> crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 >> crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 >> ... >> crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 >> crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 >> crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 >> >> >> > Hi Kim What rxtx does is try to open the port and do a timed out read. If the kernel/... do not complain it's enumarted. I suspect you could do a crude test by doing something like cat /dev/ttyS0 > /dev/null If that barfs then rxtx wont enumerate the port. hmm looking at your question again, I suspect it's a lockfile problem. This is documented in INSTALL with the source. Its easy enough to test this too.. touch /var/lock/testingrxtxlockfiles && rm -f /var/lock/testingrxtxlockfiles If you are not in the right group it will bail. Root will work regardless. -- Trent Jarvi tjarvi@qbang.org From lux at diesel-research.com Tue Feb 7 12:37:56 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue Mar 28 20:17:27 2006 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> Message-ID: <1139341076.8145.11.camel@zd7280> Exactly which ports does rxtx attempt to put into the list ? /dev/* or /dev/tty* or /dev/tty[0-9[0-9] ? or /dev/ttyS* ? For the record, only /dev/ttyUSB0 is a valid port on the machine I am presently on. Will this be a problem ? On Tue, 2006-02-07 at 12:20 -0700, Trent Jarvi wrote: > This is documented in INSTALL with the source. > I was wondering where that file was. I will download source and dig it up. Thanks. -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 12:51:09 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue Mar 28 20:17:27 2006 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139341076.8145.11.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: On Tue, 7 Feb 2006, Kim Lux wrote: > > Exactly which ports does rxtx attempt to put into the list ? /dev/* > or /dev/tty* or /dev/tty[0-9[0-9] ? or /dev/ttyS* ? > > For the record, only /dev/ttyUSB0 is a valid port on the machine I am > presently on. Will this be a problem ? > > > On Tue, 2006-02-07 at 12:20 -0700, Trent Jarvi wrote: >> This is documented in INSTALL with the source. >> > I was wondering where that file was. I will download source and dig it > up. > > Thanks. > Hmm I'm looking at pre17 so this may have changed. (its just what I have on this machine) if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA" // for the IPAQs }; CandidatePortPrefixes=Temp; } So you may need to add "ttyUSB" to that list. RXTX used to enumerate _everything_ see if(osName.equals("Linux-all-ports") But it became less than practical. This is all in RXTXCommDriver.java hmm I just did a cvs update. if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have to get your fingers into the code. We aim for sane defaults. -- Trent Jarvi tjarvi@qbang.org From lux at diesel-research.com Tue Feb 7 13:06:45 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue Mar 28 20:17:27 2006 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139342805.8145.22.camel@zd7280> On Tue, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > Hmm I'm looking at pre17 so this may have changed. (its just what I have > on this machine) > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA" // for the IPAQs > }; > CandidatePortPrefixes=Temp; > } > > > So you may need to add "ttyUSB" to that list. RXTX used to enumerate > _everything_ see if(osName.equals("Linux-all-ports") But it became less > than practical. > > This is all in RXTXCommDriver.java > > hmm I just did a cvs update. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have > to get your fingers into the code. We aim for sane defaults. Excellent. Thanks for taking the time. -- Kim Lux, Diesel Research Inc. From ideiglenes1 at freemail.hu Tue Feb 7 13:53:39 2006 From: ideiglenes1 at freemail.hu (--) Date: Tue Mar 28 20:17:27 2006 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139345619.22534.2.camel@localhost> Hi! I use this code to get all the extra Linux devices. :) if ("Linux".equals(System.getProperty("os.name"))) { System.setProperty("os.name","Linux-all-ports"); } driver = new RXTXCommDriver(); On k, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > On Tue, 7 Feb 2006, Kim Lux wrote: > > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have > to get your fingers into the code. We aim for sane defaults. > > -- > Trent Jarvi > tjarvi@qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx@qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From matt.higgins at gmail.com Tue Feb 7 13:45:54 2006 From: matt.higgins at gmail.com (Matt Higgins) Date: Tue Mar 28 20:17:27 2006 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> Message-ID: <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> Sweet this is exactly what I needed. I was searching the archives through marc.theamisgroup they only have archives back to 1/3/05. Should have hit the mailman archive! Thanks a lot! On 2/7/06, Brian Schlining wrote: > > Hi Matt > > The following code works fine on Linux but I never see any data when run > on Windows. This is a cut and paste from the SimpleRead example. > I am attempting to read data from a bar code scanner. I can fire up > HyperTermianl on windows and see that the device is working properly as I > see the barcodes are scanned and echoed back to the terminal. However when I > run the app I don't see any data. It is however associating with the com > port as the informational bits print fine? > > > You're not the only one whose had this problem, I don't know if Trent has > addressed this is the latest release of RXTX but there is a workaround. > Here's the recent thread from the RXTX mailing list regarding this issues: > > Thanasis Delenikas tdelenik at gmail.com > Wed Jan 18 13:56:23 MST 2006 > > * Previous message: [Rxtx] Re: More close() performance fixes > * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] > > Hi all. > (I've subscribed again from my other email account). > > Trent, > > You are right. Linux *always* works, no matter what flow control you set. > Windows *works only* with hardware flow control (I haven't tested what > happens with software XON/XOFF flow control). > > I assume (but I am not certain) that even with no flow control at all, all > platforms should work. Without flow control, you have the risk of bumping > into overflow or framing errors, but that's your (the end programmer, I > mean) problem. > > >From my side, I shouldn't be working without flow control. That was a bug > too... It was some code forgotten from the old times, when I used to work > with phone emulation drivers which didn't support flow control. The > correct > way is to have some flow control enabled and that's why I suppose this is > a > low-severity bug for RxTx. > > I have no idea which platform shows the correct behaviour, since > my knowledge about Linux and the inner workings of these low-level i/o > operations is limited. > > Regards, > Thanasis Delenikas. > > > > > Message: 2 > > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > > From: Trent Jarvi > > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > > To: RXTX Developers and Users > > Message-ID: > > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > > > Hi all, > > > > > > Trent, I have found something. > > > I read your comment about flow control, so I experimented a bit. > > > > > > If you remember, in my sample program I've used no flow control at all > ( > > i.e. > > > Java constant FLOWCONTROL_NONE). > > > > > > Now, during testing, I've switch to hardware inbound flow control (i.e > . > > Java > > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > > beautifully! > > > > > > I think I will switch to H/W flow control and test things for a while, > > but > > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > > > > > Hi Thanasis, > > > > I'm fairly sure you have identified a bug. I would not worry too much > > about what Sun CommAPI w32 defaults are. I think they did more or less > > whatever the port opened with. Just a guess. Linux tries to stomp on > > ports so they are all the same. > > > > So this started out with Linux worked, Windows XP/.. did not as I > recall. > > Something is wrong in rxtx. Do I understand this right? > > > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > > > Perhaps there is something Wayne or I did not understand when we wrote > > that code. I wasnt programming back in the BBS days so modems are not > my > > thing. I have a few questions. > > > > Is the above matrix confirmed by observation? > > Linux just always worked? > > Which one _should_ work? I'm guessing modems work with hardware flow > > control. I'll have to dig around. > > > > The windows flow control changes a couple things with hardware flow > > control. Following the w32 API documentation is confusing sometimes. > > But it looks like Linux could have a bug too. > > Cheers > > Brian Schlining > Software Engineer > http://www.mbari.org > > > > _______________________________________________ > Rxtx mailing list > Rxtx@qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/9c989144/attachment-0002.html From tjarvi at qbang.org Tue Feb 7 14:06:14 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue Mar 28 20:17:27 2006 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> Message-ID: >> >> You're not the only one whose had this problem, I don't know if Trent has >> addressed this is the latest release of RXTX but there is a workaround. >> Here's the recent thread from the RXTX mailing list regarding this issues: >> I have not. I expect to have access to some test equipment next month and I'll go through all of this. I really don't know whats going on and I need a gold standard. I thought maybe linux was autodetecting the flow control. Your observations would certainly be welcome. I need to talk to Russell King and see what he is doing. Until then I'd just be toying around over a loopback as usual. This is very high on the list though. -- Trent Jarvi tjarvi@qbang.org From lux at diesel-research.com Tue Feb 7 17:25:05 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue Mar 28 20:17:27 2006 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139358305.17994.2.camel@zd7280> My application now works. I installed the libraries and jar from 2.1-7 (Final). portlist.hasMoreElements is no longer false. The application finds the port for /dev/ttyUSB0. Thanks for your help, Trent (et al) Sorry I bothered you with this. Next time I will look in the source first. I didn't think it was an rxtx issue, I thought it was a Linux setup issue . On Tue, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > Hmm I'm looking at pre17 so this may have changed. (its just what I > have > on this machine) > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux > Serial Ports > "ttySA" // for the > IPAQs > }; > > CandidatePortPrefixes=Temp; > } > > > So you may need to add "ttyUSB" to that list. RXTX used to enumerate > _everything_ see if(osName.equals("Linux-all-ports") But it became > less > than practical. > > This is all in RXTXCommDriver.java > > hmm I just did a cvs update. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux > Serial Ports > "ttySA", // for the > IPAQs > "ttyUSB" // for USB > frobs > }; > > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you > have > to get your fingers into the code. We aim for sane defaults. -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 19:21:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue Mar 28 20:17:27 2006 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139358305.17994.2.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> <1139358305.17994.2.camel@zd7280> Message-ID: >Sorry I bothered you with this. Next time I will look in the source >first. I didn't think it was an rxtx issue, I thought it was a Linux >setup issue . Why would you be sorry? I would have done the same. I'm glad it's working :) -- Trent Jarvi tjarvi@qbang.org From tma at mail.island.net Wed Feb 8 13:39:35 2006 From: tma at mail.island.net (Tom Alldread) Date: Tue Mar 28 20:17:27 2006 Subject: [Rxtx] Win32/Linux Serial Port Data Dropouts In-Reply-To: <200602060702.k167255O007882@www.qbang.org> References: <200602060702.k167255O007882@www.qbang.org> Message-ID: <43EA5707.4020200@mail.island.net> Greetings Folks at RXTX: During the last couple of months I have been alternately testing with javax.comm 2 and RXTX 2.1 under Windows XP and CommApi 3 and RXTX 2.1 under Suse 10.0 Linux. In the process I have learned a little about java multi-threading under NetBeans 5 with Profiler. My java (jdk 1.5_06) application is used for data acquisition and provides a graphical display of A-D conversion data received from a 56KBaud serial port. The actual data throughput is about 10KBaud thus it is well below the speed of the port. I use hardware RTS/CTS flow control which can stall the data acquisition sample rate if necessary. This ensures the display computer has the ability to slow the data acquisition rate should it become too busy to accept the regular data flow. Both the serial port buffer and the java read buffer are set at 16KB. Usually the data transfers into the java read buffer are less than 100 bytes unless the data acquisition is recovering from a stall. The data flow normally hesitates after each 5 KB block as a continue command is needed from the display computer to start the drawing of a new graphics display line. Separate threads have been provided for the serial port event monitoring and data processing. The serial port event thread has been given the maximum priority and data processing thread the minimum priority provided by java. Thread yield statements have been placed within all data processing while/for loops as an effort to ensure quick access to CPU cycles for the serial port event thread. I have found that short data transmissions are essentially error free but occasional dropouts occur with continuous data flow especially under Windows XP. ....................................................................................................................................................................................... Linux results: I am happy to report that RXTX 2.1 appears to work very well under Linux although I did notice some errors when the screen savers were running with my dual monitors. I believe this is a local problem associated with my dual graphics which needs further attention. The recent CommApi 3 Linux release from Sun did not work at all with my program. It seemed to send commands out OK but did not receive any data. Although the serial port event triggered the ISR, the input stream appeared filled with nulls and thus did not contain any data. As my understanding is that CommApi 3 was tested with a Red Hat distribution of Linux I wonder if this problem is distro dependent? Although somewhat off topic here I wonder if anyone reading this has had similar experience? .................................................................................................................................................................................. Windows XP results: There are problems with occasional data dropouts which become more frequent as the sampling rate is increased or if the computer becomes busy with other duties. The dropouts typically consist of a half dozen byte block of lost data. It appears the lost bytes never get added to the java input stream. There has not been any indication of garbled data, overruns or framing errors which suggests the UART communications remains solid. Using javax.comm 2 I found that the setting of SerialPort 'enableReceiveThreshold' to 40 and 'enableReceiveTimeout' of 100mS reduced the dropouts error rate significantly. I found that I could not get RXTX 2.1 to function with the aforementioned threshold and timeout settings. The javax.comm 2 interface is consequently performing better for me under Windows than RXTX 2.1. I wonder if anyone here has any suggestions as to what I might try to improve RXTX 2.1? Although my settings are the same as under Suse 10.0, RXTX 2.1 performs much better for me under Linux than any of the alternatives that I have tried under Windows XP . ............................................................................................................................................................................... I would like to establish, based on the experience of others, if I have reached the normally expected performance limit of java serial port communications? Should I expect to achieve virtually error free serial port data input from a continuous stream under Windows XP java software? I am considering changing my protocol to packets with error checking if necessary but would like to know if the dropout problems I am experiencing are typical or not before I take this rather work intensive plunge. Many thanks in advance for any help! Best Regards, Tom Alldread -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.375 / Virus Database: 267.15.2/253 - Release Date: 2006-02-07 From jlaxson at mac.com Wed Feb 8 23:56:48 2006 From: jlaxson at mac.com (John Laxson) Date: Tue Mar 28 20:17:27 2006 Subject: [Rxtx] PortInUseException: Unknown Application on OSX Message-ID: Hi, I've been trying to get RXTX 2.1.7 going on Mac OS X for a while here, and am running up into a wall here. I've tried with pre- compiled and the source version and get the same problem, a gnu.io.PortInUseException: Unknown Application. I have run the fixperms script included with the source distribution, and id shows me as a member of the uucp group, and permissions on /var/spool/uucp are 775 root:uucp. Running a test program (included at the bottom for clarity) lets me enumerate all the serial ports correctly, but trying to open any of them gives the PortInUseException. If it helps, when I try to open a port that's set to make an outgoing bluetooth connection, there is no delay and no connection attempt at all. Thanks, John Laxson PS: The documentation wiki on qbang.org shows 404, and has for a few days now. My test code: public static void main(String[] args) { SerialPort serialPort; try { Enumeration e = CommPortIdentifier.getPortIdentifiers(); CommPortIdentifier ident; while (e.hasMoreElements()) { ident = (CommPortIdentifier)e.nextElement(); System.out.println(ident.getName()); } ident = CommPortIdentifier.getPortIdentifier("/dev/cu.modem"); serialPort = (SerialPort) ident.open("Me", 5000); } catch (Exception e) { e.printStackTrace(); } } From rajesh.invincible at gmail.com Thu Feb 9 03:39:38 2006 From: rajesh.invincible at gmail.com (Rajesh N) Date: Tue Mar 28 20:17:27 2006 Subject: [Rxtx] Re: Move .java Files in gnu.io filesystem hierarchy - Maven (2) In-Reply-To: <43DF21D2.7090200@ngi.it> References: <43DF21D2.7090200@ngi.it> Message-ID: <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Can anybody tell me how to overcome these EXCEPTIONS I AM WORKING ON SERIAL COMMN IN JAVA ON LINUX. 1. " NOT ALL PARAMETERS SUPPORTED BY THE KERNEL" This i came across the following statement inmy prog. SerialP is A SerialPort object SerialP.setSerialPortParams(9600(BAUDRATE),DATABITS_8,STOPBITS_1,PARITY_NONE) 2. NullPointer Exception at Event Dispatch Now i have checked all my object references for a null reference but i found none i have put up my entire code in try catch blocks but still I AM UNABLE TO CATCH THIS EXCEPTION AND HENCE MY APPLICATION CLOSES HOW DOES THESE GO? PLEASE HELP ME IT IS URGENTTTTTTTTTTTTTTTT yours sincerely RAJESH On 1/31/06, Fabio Frumento wrote: > Hi Xavier, > > I don't know maven at all but the directory hierarchy listed buy Trent > is fine for me... > > I'll take a look to maven, it seems an interesting project > > Regards > > Fabio Frumento > > Trent Jarvi wrote: > > On Tue, 31 Jan 2006, Xavier Frisaye wrote: > > > >> Hi all, > >> > >> If you are going to rearrange the src folder, i will propose to use > >> maven 2 and follow its directory structure > >> > (http://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html). > >> > >> Maven 2 simplify java project and give a standard way to make projects > >> (http://maven.apache.org/). > >> We are using it for internal projects and we are very satisfied. > >> > >> Is anybody interested? > >> > >> I'm not an expert in maven 2 (yet) but i'm agree to help using it if > >> you choose to make so. > >> > > > > so this would be: > > > > rxtx-devel/src/main/java/gnu.io > > rxtx-devel/src/test/java/ManIwish.java > > > > I don't use IDEs very much so I'll let others comment. But I don't see > > a problem with that. > > > > -- > > Trent Jarvi > > tjarvi@qbang.org > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx@qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx@qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Thu Feb 9 09:50:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue Mar 28 20:17:27 2006 Subject: [Rxtx] Re: Move .java Files in gnu.io filesystem hierarchy - Maven (2) In-Reply-To: <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Message-ID: On Thu, 9 Feb 2006, Rajesh N wrote: > Can anybody tell me how to overcome these EXCEPTIONS > I AM WORKING ON SERIAL COMMN IN JAVA ON LINUX. > > 1. " NOT ALL PARAMETERS SUPPORTED BY THE KERNEL" > > This i came across the following statement inmy prog. > SerialP is A SerialPort object > SerialP.setSerialPortParams(9600(BAUDRATE),DATABITS_8,STOPBITS_1,PARITY_NONE) > Strange. The parameters you use are the same the port should open with by default. Could you paste the actual exception you are getting? I don't see that in the rxtx source. Also it would help to know the rxtx version. -- Trent Jarvi tjarvi@qbang.org From lux at diesel-research.com Fri Feb 10 15:29:05 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue Mar 28 20:17:27 2006 Subject: [Rxtx] One serial port object for both sending and receiving ? Message-ID: <1139610545.18177.4.camel@zd7280> Is it OK to use one SerialPort ojbect (ex Serial Port serialPort;) and use it for both sending and receiving ? For example: ======================================================================== static SerialPort serialPort = null; static OutputStream serialOut = null; static InputStream serialIn = null; // assign it to an outputStream for use try{ serialOut = serialPort.getOutputStream(); System.out.println("Serial output stream has been assigned."); }//try catch(IOException e) { System.out.println("Error: Couldn't assign output stream to serial port."); }//catch //assign it to an inputStream for use try{ serialIn = serialPort.getInputStream(); System.out.println("Serial input stream has been assigned."); }//try catch(IOException e) { System.out.println("Error: Couldn't assign input stream to serial port."); }//catch ======================================================================== -- Kim Lux, Diesel Research Inc. From lux at diesel-research.com Fri Feb 10 21:23:00 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue Mar 28 20:17:27 2006 Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Message-ID: <1139631780.23882.10.camel@zd7280> I've got a problem receiving chars with my version of serialRead, written in an SWT GUI. I had a Java pro have a good look at my code and he can't see anything wrong with it. I can send chars fine. When I receive a char the cpu usage for the app goes to 100% and the code in the serial event handler doesn't get executed. The instructions on the Java Comm Serial API How-To for Linux page state that I must install javacomm. Is that true ? Everything builds without it and I can send chars on rxtx just fine, but I can't receive them. Could this be the problem ? I downloaded and installed javacomm. I was not able to add "Driver=gnuio.RXTXCommDriver to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 installed in /usr/java/jre1.5.0_05. I added comm.jar to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext to the library paths. Is this OK ? Does it matter that I am receiving on /dev/ttyUSB0 ? Thanks. -- Kim Lux, Diesel Research Inc. From lunareclipse03 at web.de Sat Feb 11 09:44:46 2006 From: lunareclipse03 at web.de (lunareclipse03@web.de) Date: Tue Mar 28 20:17:27 2006 Subject: [Rxtx] Question about Serial I/O under Win32 Message-ID: <662084330@web.de> Hello everybody, I have a strange problem with a piece of code I made for myself. No, this is not really concerning rxtx, but nevertheless I post this to the list, hoping that some of you can help me. I've written two libraries, one for linux and one for win32. The linux port works quite well, I can send / receive faxes and / or replay voice messages over the telephone line using a voice modem. But the win32 port of the library causes some trouble. If, for example, I send out a fax with a certain modem under linux, it works well. The fax is complete when it comes out of the fax machine. If I then use the same modem to send out a fax under win32, the fax coming out of the fax machine gets "stuck" halfways, but the sending modem thinks that transmission was ok and drops the connection. The answering fax machine then gives me "error while receiving." The "upper layer" java code MUST be right, because if I do the same thing under linux (using the linux library), everything is alright. Now I have to ask: Can somebody please help me out with this??!? Could it be the case that some kind of flow control or COMMTIMEOUTS setting causes this behaviour? I set flow control to RTS/CTS before sending out a fax. How can I DISABLE flow control? Or what do you think? Can something else cause this problems? Thank you all for your time and PLEASE write back soon. Regards, --Sven Ahlemann Am Waldrand 31 45721 Haltern am See Germany ______________________________________________________________ Verschicken Sie romantische, coole und witzige Bilder per SMS! Jetzt bei WEB.DE FreeMail: http://f.web.de/?mc=021193 From lux at diesel-research.com Sat Feb 11 10:06:52 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue Mar 28 20:17:27 2006 Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: <1139631780.23882.10.camel@zd7280> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> <1139631780.23882.10.camel@zd7280> Message-ID: <1139677612.3431.5.camel@zd7280> More on this problem. I copied and pasted simpleRead into a console based Eclipse project and I've got the same result, except that cpu usage doesn't go to 100%. I'm beginning to think there is an issue in rxtx. My imports for simpleRead are: ============================ import gnu.io.*; import java.util.*; //import javax.comm.*; import java.io.*; =========================== Any ideas ? I am trying to read from /dev/ttyUSB0 using a serial to USB adapter which has worked well with minicom and gtkterm. Thanks. On Fri, 2006-02-10 at 21:23 -0700, Kim Lux wrote: > I've got a problem receiving chars with my version of serialRead, > written in an SWT GUI. > > I had a Java pro have a good look at my code and he can't see anything > wrong with it. > > I can send chars fine. When I receive a char the cpu usage for the app > goes to 100% and the code in the serial event handler doesn't get > executed. > > The instructions on the Java Comm Serial API How-To for Linux page state > that I must install javacomm. Is that true ? Everything builds without > it and I can send chars on rxtx just fine, but I can't receive them. > Could this be the problem ? > > I downloaded and installed javacomm. I was not able to add > "Driver=gnuio.RXTXCommDriver > to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not > have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 > installed in /usr/java/jre1.5.0_05. I added comm.jar > to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext > to the library paths. Is this OK ? > > Does it matter that I am receiving on /dev/ttyUSB0 ? > > Thanks. > -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Sun Feb 12 21:01:33 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue Mar 28 20:17:27 2006 Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: <1139677612.3431.5.camel@zd7280> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> <1139631780.23882.10.camel@zd7280> <1139677612.3431.5.camel@zd7280> Message-ID: I suspect what is happening is the select() is breaking out in the native code but the driver does not have support for notifying there are X bytes available. On some traditional Unix based systems, the only way you know data is available is the fd status changes and do an FIORDCHK ioctl. Or perhaps the only thing you can know is the fd status changed. It would take reading through the kernel driver code to know for sure. So on USB, depending upon the driver, the same may need to be done or the driver improved a bit if possible to support. Polling reads will also work but don't use the event driven model of CommAPI which isnt acceptable in the long run. The 100% cpu usage can then be explained because select no longer blocks until the data is read; the eventLoop spins loose. You can put a well placed sleep but rxtx only expects those are needed when it knows data is available. This may not be a super simple thing to understand and fix. I do have ideas to get you started. I'm going to be short on time the next couple weeks. I expect to put some good time in and answer some other questions I saw around the 25th. For now, I'd look at the following and go from there with the hints I've given. JNIEXPORT jint JNICALL RXTXPort(nativeavailable)( JNIEnv *env, jobject jobj ) { int fd = get_java_var( env, jobj,"fd","I" ); int result; /* char message[80]; ENTER( "RXTXPort:nativeavailable" ); On SCO OpenServer FIONREAD always fails for serial devices, so try ioctl FIORDCHK instead; will only tell us whether bytes are available, not how many, but better than nothing. This turns out to be true on Solaris also. taj. */ #ifdef FIORDCHK /* __unixware__ __sun__ probably others */ result = ioctl(fd, FIORDCHK, 0); #else if( ioctl( fd, FIONREAD, &result ) < 0 ) { goto fail; } #endif /* FIORDCHK */ On Sat, 11 Feb 2006, Kim Lux wrote: > > More on this problem. I copied and pasted simpleRead into a console > based Eclipse project and I've got the same result, except that cpu > usage doesn't go to 100%. I'm beginning to think there is an issue in > rxtx. > > My imports for simpleRead are: > > ============================ > import gnu.io.*; > import java.util.*; > //import javax.comm.*; > import java.io.*; > =========================== > > Any ideas ? I am trying to read from /dev/ttyUSB0 using a serial to > USB adapter which has worked well with minicom and gtkterm. > > Thanks. > > > > On Fri, 2006-02-10 at 21:23 -0700, Kim Lux wrote: >> I've got a problem receiving chars with my version of serialRead, >> written in an SWT GUI. >> >> I had a Java pro have a good look at my code and he can't see anything >> wrong with it. >> >> I can send chars fine. When I receive a char the cpu usage for the app >> goes to 100% and the code in the serial event handler doesn't get >> executed. >> >> The instructions on the Java Comm Serial API How-To for Linux page state >> that I must install javacomm. Is that true ? Everything builds without >> it and I can send chars on rxtx just fine, but I can't receive them. >> Could this be the problem ? >> >> I downloaded and installed javacomm. I was not able to add >> "Driver=gnuio.RXTXCommDriver >> to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not >> have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 >> installed in /usr/java/jre1.5.0_05. I added comm.jar >> to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext >> to the library paths. Is this OK ? >> >> Does it matter that I am receiving on /dev/ttyUSB0 ? >> >> Thanks. >> > From tjarvi at qbang.org Sun Feb 12 21:03:30 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue Mar 28 20:17:27 2006 Subject: [Rxtx] One serial port object for both sending and receiving ? In-Reply-To: <1139610545.18177.4.camel@zd7280> References: <1139610545.18177.4.camel@zd7280> Message-ID: On Fri, 10 Feb 2006, Kim Lux wrote: > > Is it OK to use one SerialPort ojbect (ex Serial Port serialPort;) and > use it for both sending and receiving ? > > For example: > > ======================================================================== > static SerialPort serialPort = null; > static OutputStream serialOut = null; > static InputStream serialIn = null; > > > > > // assign it to an outputStream for use > try{ > serialOut = serialPort.getOutputStream(); > System.out.println("Serial output stream has been assigned."); > }//try > catch(IOException e) > { > System.out.println("Error: Couldn't assign output stream to serial > port."); > }//catch > > > //assign it to an inputStream for use > try{ > serialIn = serialPort.getInputStream(); > System.out.println("Serial input stream has been assigned."); > }//try > catch(IOException e) > { > System.out.println("Error: Couldn't assign input stream to serial > port."); > }//catch This should be fine. In fact trying to do it another way will probably not work as you will run into lockfile issues. -- Trent Jarvi tjarvi@qbang.org From tjarvi at qbang.org Sun Feb 12 21:13:13 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue Mar 28 20:17:27 2006 Subject: [Rxtx] Question about Serial I/O under Win32 In-Reply-To: <662084330@web.de> References: <662084330@web.de> Message-ID: On Sat, 11 Feb 2006 lunareclipse03@web.de wrote: > Hello everybody, > > I have a strange problem with a piece of code I made for myself. No, > this is not really concerning rxtx, but nevertheless I post this to the > list, hoping that some of you can help me. I've written two libraries, > one for linux and one for win32. The linux port works quite well, I can > send / receive faxes and / or replay voice messages over the telephone > line using a voice modem. But the win32 port of the library causes some > trouble. If, for example, I send out a fax with a certain modem under > linux, it works well. The fax is complete when it comes out of the fax > machine. If I then use the same modem to send out a fax under win32, the > fax coming out of the fax machine gets "stuck" halfways, but the sending > modem thinks that transmission was ok and drops the connection. The > answering fax machine then gives me "error while receiving." The "upper > layer" java code MUST be right, because if I do the same thing under > linux (using the linux library), everything is alright. Now I have to > ask: Can somebody please help me out with this??!? Could it be the case > that some kind of flow control or COMMTIMEOUTS setting causes this > behaviour? I set flow control to RTS/CTS before sending out a fax. How > can I DISABLE flow control? Or what do you think? Can something else > cause this problems? Thank you all for your time and PLEASE write back > soon. > Hi Sven I'm not too willing to talk about flow control at the low level until I confirm some things with test equipment later. It is not clear if you are using rxtx or writing your own native code. So I'm not sure how to answer much of this :) If you are wondering how to change the flow control using rxtx from java, The BlackBox example from Sun flips this back and forth. SerialPort.java in rxtx 2.1 uses the following: SerialPort.java: public static final int FLOWCONTROL_NONE =0; SerialPort.java: public static final int FLOWCONTROL_RTSCTS_IN =1; SerialPort.java: public static final int FLOWCONTROL_RTSCTS_OUT =2; SerialPort.java: public static final int FLOWCONTROL_XONXOFF_IN =4; SerialPort.java: public static final int FLOWCONTROL_XONXOFF_OUT=8; So if you set flowcontrol to RTSCTS, you can set it to NONE to turn it off. If you are looking for how to do it in native code, the rxtx Source is SerialImp.c (unix/linux/mac os x/w32) and termios.c (w32 only with SerialImp.c) You can track the code: SerialImp.c:JNIEXPORT void JNICALL RXTXPort(setflowcontrol)( JNIEnv *env, jobject jobj, jint flowmode ) termios.c:int tcgetattr( int fd, struct termios *s_termios ) termios.c:int tcsetattr( int fd, int when, struct termios *s_termios ) There may be a problem in the rxtx flow control code though. Rather than guess, I want to test this with a gold standard. -- Trent Jarvi tjarvi@qbang.org From tjarvi at qbang.org Mon Feb 6 00:00:16 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 00:00:16 -0700 (MST) Subject: [Rxtx] wiki delay until tomorrow night. In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: On Sun, 5 Feb 2006, Trent Jarvi wrote: > On Sun, 5 Feb 2006, Kim Lux wrote: > >> usb ? Tell me more... I need that too. > > usb is a very proper design. Thats all it is. > Maybe rxtx could help usb. But it would start with helping bring back the community that was already there. It's not something I'd love to do but maybe its the right thing to do. It would probably take 2 years to do right. But maybe thats better than what we have now. I honestly don't know what IBM is doing which could just run over everything. Just some thoughts after some fine german wine. -- Trent Jarvi tjarvi at qbang.org From gadelavega at yahoo.com.ar Mon Feb 6 02:17:05 2006 From: gadelavega at yahoo.com.ar (Gonzalo A. de la Vega) Date: Mon, 06 Feb 2006 10:17:05 +0100 Subject: [Rxtx] Serial port ownership question In-Reply-To: References: <20060205113618.30274.qmail@web53501.mail.yahoo.com> <1139157422.4553.9.camel@zd7280> <1139158698.4936.9.camel@zd7280> Message-ID: <43E71411.4050402@yahoo.com.ar> On my Fedora Core 4: ls -l /dev/ttyS* crw-rw---- 1 root uucp 4, 64 Feb 6 2006 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Feb 6 2006 /dev/ttyS1 ... and: grep "ttyUSB" /etc/udev/rules.d/50-udev.rules KERNEL=="ttyUSB*", GROUP="uucp", MODE="0660" So anyone in the "uucp" group can use serial ports. On Gentoo the group is "tty". Trent Jarvi escribi?: > > > On Sun, 5 Feb 2006, Dr. Douglas Lyon wrote: > >> I can confirm that this is the case (only root ownership of >> serial ports, under fedora 4). >> Wow, what were they thinking?! >> - DL >> >>> I've found that the newer kernels have the serial ports owned by root. >>> For example, >>> >>> $ls -al /dev/tty* >>> crw-rw-rw- 1 root root 5, 0 Feb 5 02:06 /dev/tty >>> crw-rw---- 1 root root 4, 0 Feb 5 02:06 /dev/tty0 >>> crw------- 1 root root 4, 1 Feb 5 09:07 /dev/tty1 >>> crw-rw---- 1 root tty 4, 10 Feb 5 02:06 /dev/tty10 >>> crw-rw---- 1 root tty 4, 11 Feb 5 02:06 /dev/tty11 >>> ... > > > This is just not a problem jcp or such are going to solve. Its a > platform spitwad fight. But do look at pam. In fact thats what Sun > is doing too. Maybe Linux followed their lead.. I'm not a pam guy. > I've spent 16 hours trying to understand it but your users wont :) > > Solution? I have no clue. Its two tangent mentalities from my > perspective. > > -- > Trent Jarvi > tjarvi at qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mtnvega at yahoo.com.br Mon Feb 6 05:35:43 2006 From: mtnvega at yahoo.com.br (Luiz Jr) Date: Mon, 6 Feb 2006 12:35:43 +0000 (GMT) Subject: [Rxtx] Documentation Wiki In-Reply-To: <1139157422.4553.9.camel@zd7280> Message-ID: <20060206123543.57256.qmail@web53515.mail.yahoo.com> Hello, Thank you for you answer, but so the usage of the API is pretty much like the Java Communications Api? If yes, what version of the Java Comm Api? Thank you, Luiz A. Brandao Jr Kim Lux escreveu: On Sun, 2006-02-05 at 08:36 -0300, Luiz Jr wrote: > Hello, > > I want to start using the RXTX libraries, but I would to know how, > since I can not access the documentation wiki page I just started using them yesterday. Below is how I installed the libraries, if that helps. I used snippets of code from the SimpleWrite application here to get me going. http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html Instead of "import javax.comm.*;", use "import gnu.io.*;" which is gotten from RXTXcomm.jar, which you will need to include in your project references. I am working in Eclipse. BTW: there is no way to open a port without going through the port list and finding it. Maybe sometime in the future someone (me ?) will write a method called openSerialPort that allows the user to give a port identifier, such as "/dev/tty1" and return a port ready to use. It wouldn't take much to write that and it would save users a lot of code. Hope this helps. ======================================================================= 1) Figure out which java you are running, incase there is more than one installed. $ java -version java version "1.5.0_05" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_05-b05) Java HotSpot(TM) Client VM (build 1.5.0_05-b05, mixed mode, sharing) 2) Find all the jre directories and the one from which you are currently running. kfind (jre) 3) cd to that directory plus /lib/i386 cd /usr/java/jre1.5.0_05/lib/i386 4) Copy the library files (*.so) to that directory. cp /home/krlux/Desktop/'Java Controls'/rxtx-linux/bin/* . 5) Check that the copy was successful ls librxtx* librxtxI2C.so librxtxRaw.so librxtxSerial.so librxtxParallel.so librxtxRS485.so 6) cd to the /lib/ext directory for your java. cd /usr/java/jre1.5.0_05/lib/ext 7) Copy the Jar files there cp /home/krlux/Desktop/'Java Controls'/rxtx-linux/lib/ext/* . 8) Check that it was successful ls RXTX* RXTXcomm.jar Rxtx is now installed on your machine ready to use. =================================================================== -- Kim Lux, Diesel Research Inc. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx --------------------------------- Yahoo! Acesso Gr?tis - Internet r?pida e gr?tis. Instale o discador agora! -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/544aa403/attachment-0003.html From lyon at docjava.com Mon Feb 6 05:49:34 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 06 Feb 2006 07:49:34 -0500 Subject: [Rxtx] wiki delay until tomorrow night. In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: Hi All, I have often thought about USB drivers being needed. For example, the ironman watch will not interface to a mac (windows only). It is USB. My dymo label writer has no Java driver (native only). Etc. Most cheap web cameras are USB (and Java drivers go through JAI, if it supports the camera at all). The JAI code shows how sun did the USB drivers. You have to be a member of the jai project to download the source code. https://jai.dev.java.net has the jai distro. And then you are not allowed to redistribute it. However, we can all learn from it (if so inclined). Basically: cvs -d :pserver:lyon at cvs.dev.java.net:/cvs login cvs -d :pserver:lyon at cvs.dev.java.net:/cvs checkout jai-core You will need to user your own uid and pw to get in. The ant build has over 100 warnings from sun deprecations of its own code. You might say that they were hoisted on their own Picard ;) One interesting thing is that they support several platforms: linux-amd64 64-bit Linux-AMD64 linux-i586 32-bit Linux-x86 solaris-amd64 64-bit Solaris-AMD64 solaris-i586 32-bit Solaris-x86 solaris-sparc 32-bit Solaris-SPARC solaris-sparcv9 64-bit Solaris-SPARC windows-i586 32-bit Windows-x86 Thus, ant is used to provide a multi-platform native method distro. Neat. How do they do it? check this out: And: The core download does not contain any C source code (it was all pre-built). Basically, they are just copying .so and .dll files into build directories. I would love to see the C code for this...but Sun does not post it on the https://jai.dev.java.net site. I don't know why...Perhaps I missed it. - Doug >On Sun, 5 Feb 2006, Trent Jarvi wrote: > >>On Sun, 5 Feb 2006, Kim Lux wrote: >> >>>usb ? Tell me more... I need that too. >> >>usb is a very proper design. Thats all it is. >> > >Maybe rxtx could help usb. But it would start with helping bring >back the community that was already there. > >It's not something I'd love to do but maybe its the right thing to do. > >It would probably take 2 years to do right. But maybe thats better >than what we have now. > >I honestly don't know what IBM is doing which could just run over everything. > >Just some thoughts after some fine german wine. > >-- >Trent Jarvi >tjarvi at qbang.org > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tdelenik at gmail.com Mon Feb 6 05:56:32 2006 From: tdelenik at gmail.com (Thanasis Delenikas) Date: Mon, 6 Feb 2006 14:56:32 +0200 Subject: Fwd: [Rxtx] Documentation Wiki In-Reply-To: <1139157422.4553.9.camel@zd7280> References: <20060205113618.30274.qmail@web53501.mail.yahoo.com> <1139157422.4553.9.camel@zd7280> Message-ID: <310a1a930602060456t129f1dc6p5f2b908f13ab5a0b@mail.gmail.com> Hello all, Kim, this is a snippet from the code I use. The closest to directly opening a specific port without enumeration. << ... portId = CommPortIdentifier.getPortIdentifier(getPort()); serialPort = (SerialPort) portId.open("jSMSEngine", 1971); ... >> where getPort() return the string identifier of the port, i.e. "/dev/ttyS0" or "COM1" or whatever. Thanasis. ---------- Forwarded message ---------- From: Kim Lux Date: Feb 5, 2006 6:37 PM Subject: Re: [Rxtx] Documentation Wiki To: RXTX Developers and Users BTW: there is no way to open a port without going through the port list and finding it. Maybe sometime in the future someone (me ?) will write a method called openSerialPort that allows the user to give a port identifier, such as "/dev/tty1" and return a port ready to use. It wouldn't take much to write that and it would save users a lot of code. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/182ab5b8/attachment-0003.html From tjarvi at qbang.org Mon Feb 6 11:53:57 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 11:53:57 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: On Mon, 6 Feb 2006, Dr. Douglas Lyon wrote: > Hi All, > I have often thought about USB drivers being needed. > For example, the ironman watch will not interface > to a mac (windows only). It is USB. > My dymo label writer has no Java driver (native only). > Etc. > Most cheap web cameras are USB (and Java drivers go > through JAI, if it supports the camera at all). > The JAI code shows how sun did the USB drivers. > You have to be a member of the jai project to download > the source code. > https://jai.dev.java.net has the jai distro. > And then you are not allowed to redistribute it. However, > we can all learn from it (if so inclined). Basically: > cvs -d :pserver:lyon at cvs.dev.java.net:/cvs login > cvs -d :pserver:lyon at cvs.dev.java.net:/cvs checkout jai-core > You will need to user your own uid and pw to get in. > The ant build has over 100 warnings from sun deprecations > of its own code. > > You might say that they were hoisted on their own Picard ;) > > One interesting thing is that they support several platforms: > linux-amd64 64-bit Linux-AMD64 > linux-i586 32-bit Linux-x86 > solaris-amd64 64-bit Solaris-AMD64 > solaris-i586 32-bit Solaris-x86 > solaris-sparc 32-bit Solaris-SPARC > solaris-sparcv9 64-bit Solaris-SPARC > windows-i586 32-bit Windows-x86 > Thus, ant is used to provide a multi-platform native method distro. > Neat. > How do they do it? > check this out: > > > > > > > > > > > > > And: > > > > > > > > > > The core download does not contain any C source code (it was all pre-built). > Basically, they are just copying .so and .dll files into build directories. > > I would love to see the C code for this...but Sun does not post it on the > https://jai.dev.java.net site. > > I don't know why...Perhaps I missed it. > > - Doug > > I've looked at moving rxtx to Ant builds. I think that would help IDEs a great deal. I requested a evalutation desk copy the O'Reilly Ant book for some j2ee material I was teaching. http://www.oreilly.com/catalog/anttdg/ It has a one sentence mention of JNI. So there was not luck there. I saw that there is another Ant book that does mention JNI more. I can't find it now. Ant must be able to support it with extensions. http://ant.apache.org/manual/OptionalTasks/javah.html What the auto(break :) tools do in the rxtx build is 4 things really. 1) gcc compile flags 2) ld compile flags 3) config.h 4) compile flags for customizing rxtx (lockfiles, ...) See 1 All of this information except 4 can be static once obtained. So I'm not attached to the auto tools. If I could find an example of Ant being used for JNI code, I'd be one of the first to start moving that direction. Maybe someone saw an example someplace. The other thing we have not completed discussing is the directory structure. There is interest in making rxtx more IDE friendly. I get more mail about that off the list than how to install rxtx. And I see we have Ken Thompson in da house :) He is our trusted CVS maintainer and the guy that purchased the rxtx.org domain. Old community. We will need Ken for changing the directory structure of source. I would like to open up discussion about both of these as it is more than time. The problem is I have little experience with Ant and even less with IDEs. It would be nice if we could work with Eclipse and NetBeans. http://www.netbeans.org/ (sun and some community) http://www.eclipes.org (ibm,rhat,... perhaps more community) http://maven.apache.org/what-is-maven.html (apache. It is community) borland should sortof be here too but I think thats covered in eclipse. >From what I understand so far, we should morph rxtx to support those three maybe trusting apaches lead with maven. But I use vi. I have little to no clues beyond what people have fed me. Can we agree that thats the right direction to go? -- Trent Jarvi tjarvi at qbang.org From brian at mbari.org Mon Feb 6 14:57:50 2006 From: brian at mbari.org (Brian Schlining) Date: Mon, 6 Feb 2006 13:57:50 -0800 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> > The other thing we have not completed discussing is the directory > structure. There is interest in making rxtx more IDE friendly. I > get more mail about that off the list than how to install rxtx. > > And I see we have Ken Thompson in da house :) He is our trusted > CVS maintainer and the guy that purchased the rxtx.org domain. Old > community. We will need Ken for changing the directory structure of > source. > > I would like to open up discussion about both of these as it is > more than time. The problem is I have little experience with Ant > and even less with IDEs. It would be nice if we could work with > Eclipse and NetBeans. > > http://www.netbeans.org/ (sun and some community) > http://www.eclipes.org (ibm,rhat,... perhaps more community) > http://maven.apache.org/what-is-maven.html (apache. It is community) > borland should sortof be here too but I think thats covered in > eclipse. > >> From what I understand so far, we should morph rxtx to support >> those three > maybe trusting apaches lead with maven. But I use vi. I have > little to no clues beyond what people have fed me. > Maven likes the directory structure below for Java code. (From http:// maven.apache.org/guides/getting-started/index.html) This structure works fine with ant, netbeans, and eclipse. rxtx_root_directory `-- src |-- main | `-- java | `-- gnu | `-- io `-- test `-- java `-- gnu `-- io Brian Schlining Software Engineer http://www.mbari.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/d9451eba/attachment-0003.html From tjarvi at qbang.org Mon Feb 6 15:11:45 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 15:11:45 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: > rxtx_root_directory > `-- src > |-- main > | `-- java > | `-- gnu > | `-- io > `-- test > `-- java > `-- gnu > `-- io > >From what I understand this will just be good. For me it makes no difference. So lets do the rxtx thing. Let if fester for two weeks and if nobody objects, we will do it. I'm not doing this because I care. I'm doing this to eliminate much of my inbox. But test... man is rxtx lacking there in the community aspect. It is covered but not right. _maybe_ I can change that this year. -- Trent Jarvi tjarvi at qbang.org (cat hurding since 1997) From lux at diesel-research.com Mon Feb 6 21:38:49 2006 From: lux at diesel-research.com (Kim Lux) Date: Mon, 06 Feb 2006 21:38:49 -0700 Subject: [Rxtx] How can I use Lock Files with rxtx (in FC4) ? Message-ID: <1139287129.17031.3.camel@zd7280> I am now running an rxtx application on FC4. I am getting: ========================================================= check_group_uucp(): error testing lock file creation Error details: Permission denied check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL ========================================================= $ ls -al /var/lock total 32 drwxrwxr-x 4 root lock 4096 Feb 6 16:04 . drwxr-xr-x 24 root root 4096 Nov 14 01:19 .. drwx------ 2 root root 4096 Apr 27 2005 lvm drwxr-xr-x 2 root root 4096 Feb 6 16:04 subsys How do I fix this for regulator users ? -- Kim Lux, Diesel Research Inc. From dmarkman at mac.com Mon Feb 6 22:24:44 2006 From: dmarkman at mac.com (Dmitry Markman) Date: Tue, 7 Feb 2006 00:24:44 -0500 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: if I understands the issue right in order to be able to use ant for c/c++ compilation you have to install ant's cc task http://ant-contrib.sourceforge.net/cc.html it looks like it should work on mac os x (authors claim, that it's platform independent) but I never tested so all you have to do it's providing right command line for the gcc compiler On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: >> rxtx_root_directory >> `-- src >> |-- main >> | `-- java >> | `-- gnu >> | `-- io >> `-- test >> `-- java >> `-- gnu >> `-- io >> > > >> From what I understand this will just be good. > > For me it makes no difference. So lets do the rxtx thing. Let if > fester for two weeks and if nobody objects, we will do it. > > I'm not doing this because I care. I'm doing this to eliminate > much of my inbox. > > But test... man is rxtx lacking there in the community aspect. It > is covered but not right. _maybe_ I can change that this year. > > -- > Trent Jarvi > tjarvi at qbang.org > (cat hurding since 1997) > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx Dmitry Markman From lux at diesel-research.com Mon Feb 6 23:20:15 2006 From: lux at diesel-research.com (Kim Lux) Date: Mon, 06 Feb 2006 23:20:15 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? Message-ID: <1139293215.3689.4.camel@zd7280> I'm running the code below. portlist.hasMoreElements() is false. /dev has ports in it as listed below. What am I doing wrong ? ========================================================== // Step through the list of ports until we find one that matches // the one we are looking for. portList = CommPortIdentifier.getPortIdentifiers(); while(portList.hasMoreElements()) { portID = (CommPortIdentifier) portList.nextElement(); // if (portID.getName().equals("/dev/ttyUSB0")) { myTA.append("Serial port ttyUSB0 has been found\n"); break; }// if portID equals... }// End of while... ========================================================== ls -al /dev/tty* crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 ... crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 -- Kim Lux, Diesel Research Inc. From david.garnier at trusted-logic.com Tue Feb 7 00:46:30 2006 From: david.garnier at trusted-logic.com (David Garnier) Date: Tue, 07 Feb 2006 08:46:30 +0100 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: <43E85056.2090608@trusted-logic.com> Hello, I think that the make-based build process is fine as it is, apart from the location of the Java source files. It is true that putting the Java source in a directory structure that map 1-to-1 to the Java package structure is the norm and should make it easier for everyone to modify the Java source, with or without an IDE. Ant is a good tool, but in the RXTX case I fail to see the advantage of using it compared to the current make-based process. As Trent said, they are more pressing issues, like testing. Regards, David Dmitry Markman wrote: > if I understands the issue right > in order to be able to use ant for c/c++ compilation > you have to install ant's cc task > http://ant-contrib.sourceforge.net/cc.html > > it looks like it should work on mac os x > (authors claim, that it's platform independent) > but I never tested > > so all you have to do it's providing right command line > for the gcc compiler > > > > > On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: > >>> rxtx_root_directory >>> `-- src >>> |-- main >>> | `-- java >>> | `-- gnu >>> | `-- io >>> `-- test >>> `-- java >>> `-- gnu >>> `-- io >>> >> >> >>> From what I understand this will just be good. >> >> For me it makes no difference. So lets do the rxtx thing. Let if >> fester for two weeks and if nobody objects, we will do it. >> >> I'm not doing this because I care. I'm doing this to eliminate much >> of my inbox. >> >> But test... man is rxtx lacking there in the community aspect. It is >> covered but not right. _maybe_ I can change that this year. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> (cat hurding since 1997) From tjarvi at qbang.org Tue Feb 7 01:11:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 01:11:31 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <43E85056.2090608@trusted-logic.com> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: On Tue, 7 Feb 2006, David Garnier wrote: > Hello, > > I think that the make-based build process is fine as it is, apart from the location of the Java > source files. It is true that putting the Java source in a directory structure that map 1-to-1 to > the Java package structure is the norm and should make it easier for everyone to modify the Java > source, with or without an IDE. > > Ant is a good tool, but in the RXTX case I fail to see the advantage of using it compared to the > current make-based process. As Trent said, they are more pressing issues, like testing. > Hi David I have more experience with testing rxtx than I can talk about. But let it be known, rxtx has gone trough 100's of hours of testing. We are hobby folks interested in toys but there is more. rxtx has had some of the best guidance in the industry there. This is not an easy thing. I may be able to come back in a month from the other side of the corperate fence and help. I suspect the tests could just be made public but they are in a very unusual environment that just wont work in a wider sense. This is something I'll be trying to change. At one point it was agreed we could just make the results public so this isnt just noise.. There is interest and I think its safe to mention that much. The big problem with testing in the past is most of it is done with a loopback connection. So we *still* have major questions regarding things like flow control. rxtx talks to itself over a loopback and it works. regardless of right or wrong. This requires more thought to be done right. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Feb 7 02:46:34 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 02:46:34 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: > The big problem with testing in the past is most of it is done with a > loopback connection. So we *still* have major questions regarding things > like flow control. rxtx talks to itself over a loopback and it works. > regardless of right or wrong. With serial communication there are gold standards. ckermit is probably a definitive 'standard.' Maybe its possible to do ping/pong tests with ckermit? Is it scriptable? There are known issues in rxtx. Probably the worst is some threading issues regarding some JREs with multiple JNI threads setting java variables. Man did I get schooled there. Just switch the c functions to returning variables and things go away. Sometimes they work fine, sometimes they blow up. Without understanding everything, somehow rhat got it right and debian (and especially gentoo) grabbed kernel patches causing all sort of harm. Its not hard to fix once you understand whats going on but nearly impossible to track with a debugger. So I have a good idea what 2.1-8 will have outside of the IDE modifications. rxtx 2.1-7 is a release for everyone to sync with. Its not even as stable as -pre17 as far as I know - I ran no test suites. I'll be chasing it too. We just had so many contributions that it was time. It seriously broke internal scheduals but thats a great thing :) The other thing I want to do in 2.1-8 is automagic baud rates. It turns out lots of shops are doing really funky baud rates for things like automobile test equipment. It is possible but it requires a fair amount of change in the native code. Is anyone looking at this? -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Feb 7 02:57:21 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 07 Feb 2006 04:57:21 -0500 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <43E85056.2090608@trusted-logic.com> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: Hi All, I agree, testing is very important. The problem I have been trying to address is related to cross-platform testing and the robust nature of the installs. Typically, I visit 3 platforms to deploy my product, windows, linux and mac. A build is performed on each platform. The idea that you can build for many platforms from one copy the source code seems attractive. This should enable synchronized deployments of identical code. The question of how to achieve this goal remains open. As Trent mentioned, this is hard. Perhaps Ant will help here (but perhaps not). Ant does seem to help with running unit tests. However, it does not help with multi-platform tests. For that you need many machines and different operating environments. Toward that end, I have created a multi-platform test that can be run from web start, located at: http://show.docjava.com:8086/book/cgij/code/jnlp/serialPort.PortTest.jnlp This is interesting because many people in the community can run the test and we can improve the test, as time permits. No, it is not a perfect solution, however, the idea does help with multi-platform tests using many machines and different operating environments. If the group has a good test for a general serial port set-ups, i would be happy to deploy it, for general evaluation using web start. And as for ANT, it is just an idea. Not all my ideas are good ones! - Doug >Hello, > >I think that the make-based build process is fine as it is, apart >from the location of the Java >source files. It is true that putting the Java source in a directory >structure that map 1-to-1 to >the Java package structure is the norm and should make it easier for >everyone to modify the Java >source, with or without an IDE. > >Ant is a good tool, but in the RXTX case I fail to see the advantage >of using it compared to the >current make-based process. As Trent said, they are more pressing >issues, like testing. > >Regards, >David > >Dmitry Markman wrote: >> if I understands the issue right >> in order to be able to use ant for c/c++ compilation >> you have to install ant's cc task >> http://ant-contrib.sourceforge.net/cc.html >> >> it looks like it should work on mac os x >> (authors claim, that it's platform independent) >> but I never tested >> >> so all you have to do it's providing right command line >> for the gcc compiler >> >> >> >> >> On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: >> >>>> rxtx_root_directory >>>> `-- src >>>> |-- main >>>> | `-- java >>>> | `-- gnu >>>> | `-- io >>>> `-- test >>>> `-- java >>>> `-- gnu >>>> `-- io >>>> >>> >>> >>>> From what I understand this will just be good. >>> >>> For me it makes no difference. So lets do the rxtx thing. Let if >>> fester for two weeks and if nobody objects, we will do it. >>> >>> I'm not doing this because I care. I'm doing this to eliminate much >>> of my inbox. >>> >>> But test... man is rxtx lacking there in the community aspect. It is >>> covered but not right. _maybe_ I can change that this year. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> (cat hurding since 1997) > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From matt.higgins at gmail.com Tue Feb 7 08:28:34 2006 From: matt.higgins at gmail.com (Matt Higgins) Date: Tue, 7 Feb 2006 10:28:34 -0500 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final Message-ID: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? import java.io.*; import java.util.*; import gnu.io.*; public class MySimpleRead implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; public static void main(String[] args) { boolean portFound = false; String defaultPort = "COM1"; if (args.length > 0) { defaultPort = args[0]; } portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; MySimpleRead reader = new MySimpleRead(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } } public MySimpleRead() { try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) { e.printStackTrace(); } try { inputStream = serialPort.getInputStream(); } catch (IOException e) { e.printStackTrace(); } try { serialPort.addEventListener(this); } catch (TooManyListenersException e) { e.printStackTrace(); } try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { e.printStackTrace(); } System.out.println("Baud is " + serialPort.getBaudRate()); System.out.println("Bits is " + serialPort.getDataBits()); System.out.println("Stop is " + serialPort.getStopBits()); System.out.println("Par is " + serialPort.getParity()); serialPort.notifyOnDataAvailable(true); readThread = new Thread(this); readThread.start(); } public void run() { // Thread.sleep(20000); //} catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { System.out.println("An event occurred " + event.getEventType()); switch (event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: byte[] readBuffer = new byte[20]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } System.out.print(new String(readBuffer)); } catch (IOException e) {} break; } } } --------------- Result on windows ------------------------------ Stable Library ============================================================== Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port:: COM1 Baud is 9600 Bits is 8 Stop is 1 Par is 0 ----------------- End Results ----------------------------------------- ------------------ Result on Linux ----------------------------------- Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 Found port: /dev/ttyS0 Baud is 9600 Bits is 8 Stop is 1 Par is 0 An event occurred 1 043100066224 ------------------ End Results --------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/a1431630/attachment-0003.html From brian at mbari.org Tue Feb 7 09:48:37 2006 From: brian at mbari.org (Brian Schlining) Date: Tue, 7 Feb 2006 08:48:37 -0800 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> Message-ID: <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> Hi Matt > The following code works fine on Linux but I never see any data > when run on Windows. This is a cut and paste from the SimpleRead > example. > I am attempting to read data from a bar code scanner. I can fire > up HyperTermianl on windows and see that the device is working > properly as I see the barcodes are scanned and echoed back to the > terminal. However when I run the app I don't see any data. It is > however associating with the com port as the informational bits > print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. Cheers Brian Schlining Software Engineer http://www.mbari.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/16d07f37/attachment-0003.html From lux at diesel-research.com Tue Feb 7 11:59:58 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 11:59:58 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139293215.3689.4.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> Message-ID: <1139338798.8145.4.camel@zd7280> Any ideas on this ? Any reason why portList.hasMoreElements() should be false even though there are devices in /dev ? On Mon, 2006-02-06 at 23:20 -0700, Kim Lux wrote: > I'm running the code below. > > portlist.hasMoreElements() is false. > > /dev has ports in it as listed below. > > What am I doing wrong ? > > > ========================================================== > // Step through the list of ports until we find one that matches > // the one we are looking for. > > portList = CommPortIdentifier.getPortIdentifiers(); > > while(portList.hasMoreElements()) > { > portID = (CommPortIdentifier) portList.nextElement(); // > if (portID.getName().equals("/dev/ttyUSB0")) > { > myTA.append("Serial port ttyUSB0 has been found\n"); > break; > }// if portID equals... > }// End of while... > ========================================================== > > ls -al /dev/tty* > crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty > crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 > crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 > crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 > crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 > ... > crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 > crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 > crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 > > > -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 12:20:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 12:20:25 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139338798.8145.4.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> Message-ID: On Tue, 7 Feb 2006, Kim Lux wrote: > > Any ideas on this ? Any reason why portList.hasMoreElements() should be > false even though there are devices in /dev ? > > > On Mon, 2006-02-06 at 23:20 -0700, Kim Lux wrote: >> I'm running the code below. >> >> portlist.hasMoreElements() is false. >> >> /dev has ports in it as listed below. >> >> What am I doing wrong ? >> >> >> ========================================================== >> // Step through the list of ports until we find one that matches >> // the one we are looking for. >> >> portList = CommPortIdentifier.getPortIdentifiers(); >> >> while(portList.hasMoreElements()) >> { >> portID = (CommPortIdentifier) portList.nextElement(); // >> if (portID.getName().equals("/dev/ttyUSB0")) >> { >> myTA.append("Serial port ttyUSB0 has been found\n"); >> break; >> }// if portID equals... >> }// End of while... >> ========================================================== >> >> ls -al /dev/tty* >> crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty >> crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 >> crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 >> crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 >> crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 >> ... >> crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 >> crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 >> crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 >> >> >> > Hi Kim What rxtx does is try to open the port and do a timed out read. If the kernel/... do not complain it's enumarted. I suspect you could do a crude test by doing something like cat /dev/ttyS0 > /dev/null If that barfs then rxtx wont enumerate the port. hmm looking at your question again, I suspect it's a lockfile problem. This is documented in INSTALL with the source. Its easy enough to test this too.. touch /var/lock/testingrxtxlockfiles && rm -f /var/lock/testingrxtxlockfiles If you are not in the right group it will bail. Root will work regardless. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 12:37:56 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 12:37:56 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> Message-ID: <1139341076.8145.11.camel@zd7280> Exactly which ports does rxtx attempt to put into the list ? /dev/* or /dev/tty* or /dev/tty[0-9[0-9] ? or /dev/ttyS* ? For the record, only /dev/ttyUSB0 is a valid port on the machine I am presently on. Will this be a problem ? On Tue, 2006-02-07 at 12:20 -0700, Trent Jarvi wrote: > This is documented in INSTALL with the source. > I was wondering where that file was. I will download source and dig it up. Thanks. -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 12:51:09 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 12:51:09 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139341076.8145.11.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: On Tue, 7 Feb 2006, Kim Lux wrote: > > Exactly which ports does rxtx attempt to put into the list ? /dev/* > or /dev/tty* or /dev/tty[0-9[0-9] ? or /dev/ttyS* ? > > For the record, only /dev/ttyUSB0 is a valid port on the machine I am > presently on. Will this be a problem ? > > > On Tue, 2006-02-07 at 12:20 -0700, Trent Jarvi wrote: >> This is documented in INSTALL with the source. >> > I was wondering where that file was. I will download source and dig it > up. > > Thanks. > Hmm I'm looking at pre17 so this may have changed. (its just what I have on this machine) if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA" // for the IPAQs }; CandidatePortPrefixes=Temp; } So you may need to add "ttyUSB" to that list. RXTX used to enumerate _everything_ see if(osName.equals("Linux-all-ports") But it became less than practical. This is all in RXTXCommDriver.java hmm I just did a cvs update. if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have to get your fingers into the code. We aim for sane defaults. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 13:06:45 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 13:06:45 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139342805.8145.22.camel@zd7280> On Tue, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > Hmm I'm looking at pre17 so this may have changed. (its just what I have > on this machine) > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA" // for the IPAQs > }; > CandidatePortPrefixes=Temp; > } > > > So you may need to add "ttyUSB" to that list. RXTX used to enumerate > _everything_ see if(osName.equals("Linux-all-ports") But it became less > than practical. > > This is all in RXTXCommDriver.java > > hmm I just did a cvs update. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have > to get your fingers into the code. We aim for sane defaults. Excellent. Thanks for taking the time. -- Kim Lux, Diesel Research Inc. From ideiglenes1 at freemail.hu Tue Feb 7 13:53:39 2006 From: ideiglenes1 at freemail.hu (--) Date: Tue, 07 Feb 2006 21:53:39 +0100 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139345619.22534.2.camel@localhost> Hi! I use this code to get all the extra Linux devices. :) if ("Linux".equals(System.getProperty("os.name"))) { System.setProperty("os.name","Linux-all-ports"); } driver = new RXTXCommDriver(); On k, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > On Tue, 7 Feb 2006, Kim Lux wrote: > > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have > to get your fingers into the code. We aim for sane defaults. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From matt.higgins at gmail.com Tue Feb 7 13:45:54 2006 From: matt.higgins at gmail.com (Matt Higgins) Date: Tue, 7 Feb 2006 15:45:54 -0500 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> Message-ID: <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> Sweet this is exactly what I needed. I was searching the archives through marc.theamisgroup they only have archives back to 1/3/05. Should have hit the mailman archive! Thanks a lot! On 2/7/06, Brian Schlining wrote: > > Hi Matt > > The following code works fine on Linux but I never see any data when run > on Windows. This is a cut and paste from the SimpleRead example. > I am attempting to read data from a bar code scanner. I can fire up > HyperTermianl on windows and see that the device is working properly as I > see the barcodes are scanned and echoed back to the terminal. However when I > run the app I don't see any data. It is however associating with the com > port as the informational bits print fine? > > > You're not the only one whose had this problem, I don't know if Trent has > addressed this is the latest release of RXTX but there is a workaround. > Here's the recent thread from the RXTX mailing list regarding this issues: > > Thanasis Delenikas tdelenik at gmail.com > Wed Jan 18 13:56:23 MST 2006 > > * Previous message: [Rxtx] Re: More close() performance fixes > * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] > > Hi all. > (I've subscribed again from my other email account). > > Trent, > > You are right. Linux *always* works, no matter what flow control you set. > Windows *works only* with hardware flow control (I haven't tested what > happens with software XON/XOFF flow control). > > I assume (but I am not certain) that even with no flow control at all, all > platforms should work. Without flow control, you have the risk of bumping > into overflow or framing errors, but that's your (the end programmer, I > mean) problem. > > >From my side, I shouldn't be working without flow control. That was a bug > too... It was some code forgotten from the old times, when I used to work > with phone emulation drivers which didn't support flow control. The > correct > way is to have some flow control enabled and that's why I suppose this is > a > low-severity bug for RxTx. > > I have no idea which platform shows the correct behaviour, since > my knowledge about Linux and the inner workings of these low-level i/o > operations is limited. > > Regards, > Thanasis Delenikas. > > > > > Message: 2 > > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > > From: Trent Jarvi > > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > > To: RXTX Developers and Users > > Message-ID: > > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > > > Hi all, > > > > > > Trent, I have found something. > > > I read your comment about flow control, so I experimented a bit. > > > > > > If you remember, in my sample program I've used no flow control at all > ( > > i.e. > > > Java constant FLOWCONTROL_NONE). > > > > > > Now, during testing, I've switch to hardware inbound flow control (i.e > . > > Java > > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > > beautifully! > > > > > > I think I will switch to H/W flow control and test things for a while, > > but > > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > > > > > Hi Thanasis, > > > > I'm fairly sure you have identified a bug. I would not worry too much > > about what Sun CommAPI w32 defaults are. I think they did more or less > > whatever the port opened with. Just a guess. Linux tries to stomp on > > ports so they are all the same. > > > > So this started out with Linux worked, Windows XP/.. did not as I > recall. > > Something is wrong in rxtx. Do I understand this right? > > > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > > > Perhaps there is something Wayne or I did not understand when we wrote > > that code. I wasnt programming back in the BBS days so modems are not > my > > thing. I have a few questions. > > > > Is the above matrix confirmed by observation? > > Linux just always worked? > > Which one _should_ work? I'm guessing modems work with hardware flow > > control. I'll have to dig around. > > > > The windows flow control changes a couple things with hardware flow > > control. Following the w32 API documentation is confusing sometimes. > > But it looks like Linux could have a bug too. > > Cheers > > Brian Schlining > Software Engineer > http://www.mbari.org > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/9c989144/attachment-0003.html From tjarvi at qbang.org Tue Feb 7 14:06:14 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 14:06:14 -0700 (MST) Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> Message-ID: >> >> You're not the only one whose had this problem, I don't know if Trent has >> addressed this is the latest release of RXTX but there is a workaround. >> Here's the recent thread from the RXTX mailing list regarding this issues: >> I have not. I expect to have access to some test equipment next month and I'll go through all of this. I really don't know whats going on and I need a gold standard. I thought maybe linux was autodetecting the flow control. Your observations would certainly be welcome. I need to talk to Russell King and see what he is doing. Until then I'd just be toying around over a loopback as usual. This is very high on the list though. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 17:25:05 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 17:25:05 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139358305.17994.2.camel@zd7280> My application now works. I installed the libraries and jar from 2.1-7 (Final). portlist.hasMoreElements is no longer false. The application finds the port for /dev/ttyUSB0. Thanks for your help, Trent (et al) Sorry I bothered you with this. Next time I will look in the source first. I didn't think it was an rxtx issue, I thought it was a Linux setup issue . On Tue, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > Hmm I'm looking at pre17 so this may have changed. (its just what I > have > on this machine) > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux > Serial Ports > "ttySA" // for the > IPAQs > }; > > CandidatePortPrefixes=Temp; > } > > > So you may need to add "ttyUSB" to that list. RXTX used to enumerate > _everything_ see if(osName.equals("Linux-all-ports") But it became > less > than practical. > > This is all in RXTXCommDriver.java > > hmm I just did a cvs update. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux > Serial Ports > "ttySA", // for the > IPAQs > "ttyUSB" // for USB > frobs > }; > > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you > have > to get your fingers into the code. We aim for sane defaults. -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 19:21:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 19:21:54 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139358305.17994.2.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> <1139358305.17994.2.camel@zd7280> Message-ID: >Sorry I bothered you with this. Next time I will look in the source >first. I didn't think it was an rxtx issue, I thought it was a Linux >setup issue . Why would you be sorry? I would have done the same. I'm glad it's working :) -- Trent Jarvi tjarvi at qbang.org From tma at mail.island.net Wed Feb 8 13:39:35 2006 From: tma at mail.island.net (Tom Alldread) Date: Wed, 08 Feb 2006 12:39:35 -0800 Subject: [Rxtx] Win32/Linux Serial Port Data Dropouts In-Reply-To: <200602060702.k167255O007882@www.qbang.org> References: <200602060702.k167255O007882@www.qbang.org> Message-ID: <43EA5707.4020200@mail.island.net> Greetings Folks at RXTX: During the last couple of months I have been alternately testing with javax.comm 2 and RXTX 2.1 under Windows XP and CommApi 3 and RXTX 2.1 under Suse 10.0 Linux. In the process I have learned a little about java multi-threading under NetBeans 5 with Profiler. My java (jdk 1.5_06) application is used for data acquisition and provides a graphical display of A-D conversion data received from a 56KBaud serial port. The actual data throughput is about 10KBaud thus it is well below the speed of the port. I use hardware RTS/CTS flow control which can stall the data acquisition sample rate if necessary. This ensures the display computer has the ability to slow the data acquisition rate should it become too busy to accept the regular data flow. Both the serial port buffer and the java read buffer are set at 16KB. Usually the data transfers into the java read buffer are less than 100 bytes unless the data acquisition is recovering from a stall. The data flow normally hesitates after each 5 KB block as a continue command is needed from the display computer to start the drawing of a new graphics display line. Separate threads have been provided for the serial port event monitoring and data processing. The serial port event thread has been given the maximum priority and data processing thread the minimum priority provided by java. Thread yield statements have been placed within all data processing while/for loops as an effort to ensure quick access to CPU cycles for the serial port event thread. I have found that short data transmissions are essentially error free but occasional dropouts occur with continuous data flow especially under Windows XP. ....................................................................................................................................................................................... Linux results: I am happy to report that RXTX 2.1 appears to work very well under Linux although I did notice some errors when the screen savers were running with my dual monitors. I believe this is a local problem associated with my dual graphics which needs further attention. The recent CommApi 3 Linux release from Sun did not work at all with my program. It seemed to send commands out OK but did not receive any data. Although the serial port event triggered the ISR, the input stream appeared filled with nulls and thus did not contain any data. As my understanding is that CommApi 3 was tested with a Red Hat distribution of Linux I wonder if this problem is distro dependent? Although somewhat off topic here I wonder if anyone reading this has had similar experience? .................................................................................................................................................................................. Windows XP results: There are problems with occasional data dropouts which become more frequent as the sampling rate is increased or if the computer becomes busy with other duties. The dropouts typically consist of a half dozen byte block of lost data. It appears the lost bytes never get added to the java input stream. There has not been any indication of garbled data, overruns or framing errors which suggests the UART communications remains solid. Using javax.comm 2 I found that the setting of SerialPort 'enableReceiveThreshold' to 40 and 'enableReceiveTimeout' of 100mS reduced the dropouts error rate significantly. I found that I could not get RXTX 2.1 to function with the aforementioned threshold and timeout settings. The javax.comm 2 interface is consequently performing better for me under Windows than RXTX 2.1. I wonder if anyone here has any suggestions as to what I might try to improve RXTX 2.1? Although my settings are the same as under Suse 10.0, RXTX 2.1 performs much better for me under Linux than any of the alternatives that I have tried under Windows XP . ............................................................................................................................................................................... I would like to establish, based on the experience of others, if I have reached the normally expected performance limit of java serial port communications? Should I expect to achieve virtually error free serial port data input from a continuous stream under Windows XP java software? I am considering changing my protocol to packets with error checking if necessary but would like to know if the dropout problems I am experiencing are typical or not before I take this rather work intensive plunge. Many thanks in advance for any help! Best Regards, Tom Alldread -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.375 / Virus Database: 267.15.2/253 - Release Date: 2006-02-07 From jlaxson at mac.com Wed Feb 8 23:56:48 2006 From: jlaxson at mac.com (John Laxson) Date: Thu, 9 Feb 2006 00:56:48 -0600 Subject: [Rxtx] PortInUseException: Unknown Application on OSX Message-ID: Hi, I've been trying to get RXTX 2.1.7 going on Mac OS X for a while here, and am running up into a wall here. I've tried with pre- compiled and the source version and get the same problem, a gnu.io.PortInUseException: Unknown Application. I have run the fixperms script included with the source distribution, and id shows me as a member of the uucp group, and permissions on /var/spool/uucp are 775 root:uucp. Running a test program (included at the bottom for clarity) lets me enumerate all the serial ports correctly, but trying to open any of them gives the PortInUseException. If it helps, when I try to open a port that's set to make an outgoing bluetooth connection, there is no delay and no connection attempt at all. Thanks, John Laxson PS: The documentation wiki on qbang.org shows 404, and has for a few days now. My test code: public static void main(String[] args) { SerialPort serialPort; try { Enumeration e = CommPortIdentifier.getPortIdentifiers(); CommPortIdentifier ident; while (e.hasMoreElements()) { ident = (CommPortIdentifier)e.nextElement(); System.out.println(ident.getName()); } ident = CommPortIdentifier.getPortIdentifier("/dev/cu.modem"); serialPort = (SerialPort) ident.open("Me", 5000); } catch (Exception e) { e.printStackTrace(); } } From rajesh.invincible at gmail.com Thu Feb 9 03:39:38 2006 From: rajesh.invincible at gmail.com (Rajesh N) Date: Thu, 9 Feb 2006 16:09:38 +0530 Subject: [Rxtx] Re: Move .java Files in gnu.io filesystem hierarchy - Maven (2) In-Reply-To: <43DF21D2.7090200@ngi.it> References: <43DF21D2.7090200@ngi.it> Message-ID: <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Can anybody tell me how to overcome these EXCEPTIONS I AM WORKING ON SERIAL COMMN IN JAVA ON LINUX. 1. " NOT ALL PARAMETERS SUPPORTED BY THE KERNEL" This i came across the following statement inmy prog. SerialP is A SerialPort object SerialP.setSerialPortParams(9600(BAUDRATE),DATABITS_8,STOPBITS_1,PARITY_NONE) 2. NullPointer Exception at Event Dispatch Now i have checked all my object references for a null reference but i found none i have put up my entire code in try catch blocks but still I AM UNABLE TO CATCH THIS EXCEPTION AND HENCE MY APPLICATION CLOSES HOW DOES THESE GO? PLEASE HELP ME IT IS URGENTTTTTTTTTTTTTTTT yours sincerely RAJESH On 1/31/06, Fabio Frumento wrote: > Hi Xavier, > > I don't know maven at all but the directory hierarchy listed buy Trent > is fine for me... > > I'll take a look to maven, it seems an interesting project > > Regards > > Fabio Frumento > > Trent Jarvi wrote: > > On Tue, 31 Jan 2006, Xavier Frisaye wrote: > > > >> Hi all, > >> > >> If you are going to rearrange the src folder, i will propose to use > >> maven 2 and follow its directory structure > >> > (http://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html). > >> > >> Maven 2 simplify java project and give a standard way to make projects > >> (http://maven.apache.org/). > >> We are using it for internal projects and we are very satisfied. > >> > >> Is anybody interested? > >> > >> I'm not an expert in maven 2 (yet) but i'm agree to help using it if > >> you choose to make so. > >> > > > > so this would be: > > > > rxtx-devel/src/main/java/gnu.io > > rxtx-devel/src/test/java/ManIwish.java > > > > I don't use IDEs very much so I'll let others comment. But I don't see > > a problem with that. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Thu Feb 9 09:50:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 9 Feb 2006 09:50:31 -0700 (MST) Subject: [Rxtx] Re: Move .java Files in gnu.io filesystem hierarchy - Maven (2) In-Reply-To: <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Message-ID: On Thu, 9 Feb 2006, Rajesh N wrote: > Can anybody tell me how to overcome these EXCEPTIONS > I AM WORKING ON SERIAL COMMN IN JAVA ON LINUX. > > 1. " NOT ALL PARAMETERS SUPPORTED BY THE KERNEL" > > This i came across the following statement inmy prog. > SerialP is A SerialPort object > SerialP.setSerialPortParams(9600(BAUDRATE),DATABITS_8,STOPBITS_1,PARITY_NONE) > Strange. The parameters you use are the same the port should open with by default. Could you paste the actual exception you are getting? I don't see that in the rxtx source. Also it would help to know the rxtx version. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Fri Feb 10 15:29:05 2006 From: lux at diesel-research.com (Kim Lux) Date: Fri, 10 Feb 2006 15:29:05 -0700 Subject: [Rxtx] One serial port object for both sending and receiving ? Message-ID: <1139610545.18177.4.camel@zd7280> Is it OK to use one SerialPort ojbect (ex Serial Port serialPort;) and use it for both sending and receiving ? For example: ======================================================================== static SerialPort serialPort = null; static OutputStream serialOut = null; static InputStream serialIn = null; // assign it to an outputStream for use try{ serialOut = serialPort.getOutputStream(); System.out.println("Serial output stream has been assigned."); }//try catch(IOException e) { System.out.println("Error: Couldn't assign output stream to serial port."); }//catch //assign it to an inputStream for use try{ serialIn = serialPort.getInputStream(); System.out.println("Serial input stream has been assigned."); }//try catch(IOException e) { System.out.println("Error: Couldn't assign input stream to serial port."); }//catch ======================================================================== -- Kim Lux, Diesel Research Inc. From lux at diesel-research.com Fri Feb 10 21:23:00 2006 From: lux at diesel-research.com (Kim Lux) Date: Fri, 10 Feb 2006 21:23:00 -0700 Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Message-ID: <1139631780.23882.10.camel@zd7280> I've got a problem receiving chars with my version of serialRead, written in an SWT GUI. I had a Java pro have a good look at my code and he can't see anything wrong with it. I can send chars fine. When I receive a char the cpu usage for the app goes to 100% and the code in the serial event handler doesn't get executed. The instructions on the Java Comm Serial API How-To for Linux page state that I must install javacomm. Is that true ? Everything builds without it and I can send chars on rxtx just fine, but I can't receive them. Could this be the problem ? I downloaded and installed javacomm. I was not able to add "Driver=gnuio.RXTXCommDriver to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 installed in /usr/java/jre1.5.0_05. I added comm.jar to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext to the library paths. Is this OK ? Does it matter that I am receiving on /dev/ttyUSB0 ? Thanks. -- Kim Lux, Diesel Research Inc. From lunareclipse03 at web.de Sat Feb 11 09:44:46 2006 From: lunareclipse03 at web.de (lunareclipse03@web.de) Date: Sat, 11 Feb 2006 17:44:46 +0100 Subject: [Rxtx] Question about Serial I/O under Win32 Message-ID: <662084330@web.de> Hello everybody, I have a strange problem with a piece of code I made for myself. No, this is not really concerning rxtx, but nevertheless I post this to the list, hoping that some of you can help me. I've written two libraries, one for linux and one for win32. The linux port works quite well, I can send / receive faxes and / or replay voice messages over the telephone line using a voice modem. But the win32 port of the library causes some trouble. If, for example, I send out a fax with a certain modem under linux, it works well. The fax is complete when it comes out of the fax machine. If I then use the same modem to send out a fax under win32, the fax coming out of the fax machine gets "stuck" halfways, but the sending modem thinks that transmission was ok and drops the connection. The answering fax machine then gives me "error while receiving." The "upper layer" java code MUST be right, because if I do the same thing under linux (using the linux library), everything is alright. Now I have to ask: Can somebody please help me out with this??!? Could it be the case that some kind of flow control or COMMTIMEOUTS setting causes this behaviour? I set flow control to RTS/CTS before sending out a fax. How can I DISABLE flow control? Or what do you think? Can something else cause this problems? Thank you all for your time and PLEASE write back soon. Regards, --Sven Ahlemann Am Waldrand 31 45721 Haltern am See Germany ______________________________________________________________ Verschicken Sie romantische, coole und witzige Bilder per SMS! Jetzt bei WEB.DE FreeMail: http://f.web.de/?mc=021193 From lux at diesel-research.com Sat Feb 11 10:06:52 2006 From: lux at diesel-research.com (Kim Lux) Date: Sat, 11 Feb 2006 10:06:52 -0700 Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: <1139631780.23882.10.camel@zd7280> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> <1139631780.23882.10.camel@zd7280> Message-ID: <1139677612.3431.5.camel@zd7280> More on this problem. I copied and pasted simpleRead into a console based Eclipse project and I've got the same result, except that cpu usage doesn't go to 100%. I'm beginning to think there is an issue in rxtx. My imports for simpleRead are: ============================ import gnu.io.*; import java.util.*; //import javax.comm.*; import java.io.*; =========================== Any ideas ? I am trying to read from /dev/ttyUSB0 using a serial to USB adapter which has worked well with minicom and gtkterm. Thanks. On Fri, 2006-02-10 at 21:23 -0700, Kim Lux wrote: > I've got a problem receiving chars with my version of serialRead, > written in an SWT GUI. > > I had a Java pro have a good look at my code and he can't see anything > wrong with it. > > I can send chars fine. When I receive a char the cpu usage for the app > goes to 100% and the code in the serial event handler doesn't get > executed. > > The instructions on the Java Comm Serial API How-To for Linux page state > that I must install javacomm. Is that true ? Everything builds without > it and I can send chars on rxtx just fine, but I can't receive them. > Could this be the problem ? > > I downloaded and installed javacomm. I was not able to add > "Driver=gnuio.RXTXCommDriver > to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not > have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 > installed in /usr/java/jre1.5.0_05. I added comm.jar > to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext > to the library paths. Is this OK ? > > Does it matter that I am receiving on /dev/ttyUSB0 ? > > Thanks. > -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Sun Feb 12 21:01:33 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:01:33 -0700 (MST) Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: <1139677612.3431.5.camel@zd7280> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> <1139631780.23882.10.camel@zd7280> <1139677612.3431.5.camel@zd7280> Message-ID: I suspect what is happening is the select() is breaking out in the native code but the driver does not have support for notifying there are X bytes available. On some traditional Unix based systems, the only way you know data is available is the fd status changes and do an FIORDCHK ioctl. Or perhaps the only thing you can know is the fd status changed. It would take reading through the kernel driver code to know for sure. So on USB, depending upon the driver, the same may need to be done or the driver improved a bit if possible to support. Polling reads will also work but don't use the event driven model of CommAPI which isnt acceptable in the long run. The 100% cpu usage can then be explained because select no longer blocks until the data is read; the eventLoop spins loose. You can put a well placed sleep but rxtx only expects those are needed when it knows data is available. This may not be a super simple thing to understand and fix. I do have ideas to get you started. I'm going to be short on time the next couple weeks. I expect to put some good time in and answer some other questions I saw around the 25th. For now, I'd look at the following and go from there with the hints I've given. JNIEXPORT jint JNICALL RXTXPort(nativeavailable)( JNIEnv *env, jobject jobj ) { int fd = get_java_var( env, jobj,"fd","I" ); int result; /* char message[80]; ENTER( "RXTXPort:nativeavailable" ); On SCO OpenServer FIONREAD always fails for serial devices, so try ioctl FIORDCHK instead; will only tell us whether bytes are available, not how many, but better than nothing. This turns out to be true on Solaris also. taj. */ #ifdef FIORDCHK /* __unixware__ __sun__ probably others */ result = ioctl(fd, FIORDCHK, 0); #else if( ioctl( fd, FIONREAD, &result ) < 0 ) { goto fail; } #endif /* FIORDCHK */ On Sat, 11 Feb 2006, Kim Lux wrote: > > More on this problem. I copied and pasted simpleRead into a console > based Eclipse project and I've got the same result, except that cpu > usage doesn't go to 100%. I'm beginning to think there is an issue in > rxtx. > > My imports for simpleRead are: > > ============================ > import gnu.io.*; > import java.util.*; > //import javax.comm.*; > import java.io.*; > =========================== > > Any ideas ? I am trying to read from /dev/ttyUSB0 using a serial to > USB adapter which has worked well with minicom and gtkterm. > > Thanks. > > > > On Fri, 2006-02-10 at 21:23 -0700, Kim Lux wrote: >> I've got a problem receiving chars with my version of serialRead, >> written in an SWT GUI. >> >> I had a Java pro have a good look at my code and he can't see anything >> wrong with it. >> >> I can send chars fine. When I receive a char the cpu usage for the app >> goes to 100% and the code in the serial event handler doesn't get >> executed. >> >> The instructions on the Java Comm Serial API How-To for Linux page state >> that I must install javacomm. Is that true ? Everything builds without >> it and I can send chars on rxtx just fine, but I can't receive them. >> Could this be the problem ? >> >> I downloaded and installed javacomm. I was not able to add >> "Driver=gnuio.RXTXCommDriver >> to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not >> have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 >> installed in /usr/java/jre1.5.0_05. I added comm.jar >> to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext >> to the library paths. Is this OK ? >> >> Does it matter that I am receiving on /dev/ttyUSB0 ? >> >> Thanks. >> > From tjarvi at qbang.org Sun Feb 12 21:03:30 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:03:30 -0700 (MST) Subject: [Rxtx] One serial port object for both sending and receiving ? In-Reply-To: <1139610545.18177.4.camel@zd7280> References: <1139610545.18177.4.camel@zd7280> Message-ID: On Fri, 10 Feb 2006, Kim Lux wrote: > > Is it OK to use one SerialPort ojbect (ex Serial Port serialPort;) and > use it for both sending and receiving ? > > For example: > > ======================================================================== > static SerialPort serialPort = null; > static OutputStream serialOut = null; > static InputStream serialIn = null; > > > > > // assign it to an outputStream for use > try{ > serialOut = serialPort.getOutputStream(); > System.out.println("Serial output stream has been assigned."); > }//try > catch(IOException e) > { > System.out.println("Error: Couldn't assign output stream to serial > port."); > }//catch > > > //assign it to an inputStream for use > try{ > serialIn = serialPort.getInputStream(); > System.out.println("Serial input stream has been assigned."); > }//try > catch(IOException e) > { > System.out.println("Error: Couldn't assign input stream to serial > port."); > }//catch This should be fine. In fact trying to do it another way will probably not work as you will run into lockfile issues. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun Feb 12 21:13:13 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:13:13 -0700 (MST) Subject: [Rxtx] Question about Serial I/O under Win32 In-Reply-To: <662084330@web.de> References: <662084330@web.de> Message-ID: On Sat, 11 Feb 2006 lunareclipse03 at web.de wrote: > Hello everybody, > > I have a strange problem with a piece of code I made for myself. No, > this is not really concerning rxtx, but nevertheless I post this to the > list, hoping that some of you can help me. I've written two libraries, > one for linux and one for win32. The linux port works quite well, I can > send / receive faxes and / or replay voice messages over the telephone > line using a voice modem. But the win32 port of the library causes some > trouble. If, for example, I send out a fax with a certain modem under > linux, it works well. The fax is complete when it comes out of the fax > machine. If I then use the same modem to send out a fax under win32, the > fax coming out of the fax machine gets "stuck" halfways, but the sending > modem thinks that transmission was ok and drops the connection. The > answering fax machine then gives me "error while receiving." The "upper > layer" java code MUST be right, because if I do the same thing under > linux (using the linux library), everything is alright. Now I have to > ask: Can somebody please help me out with this??!? Could it be the case > that some kind of flow control or COMMTIMEOUTS setting causes this > behaviour? I set flow control to RTS/CTS before sending out a fax. How > can I DISABLE flow control? Or what do you think? Can something else > cause this problems? Thank you all for your time and PLEASE write back > soon. > Hi Sven I'm not too willing to talk about flow control at the low level until I confirm some things with test equipment later. It is not clear if you are using rxtx or writing your own native code. So I'm not sure how to answer much of this :) If you are wondering how to change the flow control using rxtx from java, The BlackBox example from Sun flips this back and forth. SerialPort.java in rxtx 2.1 uses the following: SerialPort.java: public static final int FLOWCONTROL_NONE =0; SerialPort.java: public static final int FLOWCONTROL_RTSCTS_IN =1; SerialPort.java: public static final int FLOWCONTROL_RTSCTS_OUT =2; SerialPort.java: public static final int FLOWCONTROL_XONXOFF_IN =4; SerialPort.java: public static final int FLOWCONTROL_XONXOFF_OUT=8; So if you set flowcontrol to RTSCTS, you can set it to NONE to turn it off. If you are looking for how to do it in native code, the rxtx Source is SerialImp.c (unix/linux/mac os x/w32) and termios.c (w32 only with SerialImp.c) You can track the code: SerialImp.c:JNIEXPORT void JNICALL RXTXPort(setflowcontrol)( JNIEnv *env, jobject jobj, jint flowmode ) termios.c:int tcgetattr( int fd, struct termios *s_termios ) termios.c:int tcsetattr( int fd, int when, struct termios *s_termios ) There may be a problem in the rxtx flow control code though. Rather than guess, I want to test this with a gold standard. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Feb 6 00:00:16 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 00:00:16 -0700 (MST) Subject: [Rxtx] wiki delay until tomorrow night. In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: On Sun, 5 Feb 2006, Trent Jarvi wrote: > On Sun, 5 Feb 2006, Kim Lux wrote: > >> usb ? Tell me more... I need that too. > > usb is a very proper design. Thats all it is. > Maybe rxtx could help usb. But it would start with helping bring back the community that was already there. It's not something I'd love to do but maybe its the right thing to do. It would probably take 2 years to do right. But maybe thats better than what we have now. I honestly don't know what IBM is doing which could just run over everything. Just some thoughts after some fine german wine. -- Trent Jarvi tjarvi at qbang.org From gadelavega at yahoo.com.ar Mon Feb 6 02:17:05 2006 From: gadelavega at yahoo.com.ar (Gonzalo A. de la Vega) Date: Mon, 06 Feb 2006 10:17:05 +0100 Subject: [Rxtx] Serial port ownership question In-Reply-To: References: <20060205113618.30274.qmail@web53501.mail.yahoo.com> <1139157422.4553.9.camel@zd7280> <1139158698.4936.9.camel@zd7280> Message-ID: <43E71411.4050402@yahoo.com.ar> On my Fedora Core 4: ls -l /dev/ttyS* crw-rw---- 1 root uucp 4, 64 Feb 6 2006 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Feb 6 2006 /dev/ttyS1 ... and: grep "ttyUSB" /etc/udev/rules.d/50-udev.rules KERNEL=="ttyUSB*", GROUP="uucp", MODE="0660" So anyone in the "uucp" group can use serial ports. On Gentoo the group is "tty". Trent Jarvi escribi?: > > > On Sun, 5 Feb 2006, Dr. Douglas Lyon wrote: > >> I can confirm that this is the case (only root ownership of >> serial ports, under fedora 4). >> Wow, what were they thinking?! >> - DL >> >>> I've found that the newer kernels have the serial ports owned by root. >>> For example, >>> >>> $ls -al /dev/tty* >>> crw-rw-rw- 1 root root 5, 0 Feb 5 02:06 /dev/tty >>> crw-rw---- 1 root root 4, 0 Feb 5 02:06 /dev/tty0 >>> crw------- 1 root root 4, 1 Feb 5 09:07 /dev/tty1 >>> crw-rw---- 1 root tty 4, 10 Feb 5 02:06 /dev/tty10 >>> crw-rw---- 1 root tty 4, 11 Feb 5 02:06 /dev/tty11 >>> ... > > > This is just not a problem jcp or such are going to solve. Its a > platform spitwad fight. But do look at pam. In fact thats what Sun > is doing too. Maybe Linux followed their lead.. I'm not a pam guy. > I've spent 16 hours trying to understand it but your users wont :) > > Solution? I have no clue. Its two tangent mentalities from my > perspective. > > -- > Trent Jarvi > tjarvi at qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mtnvega at yahoo.com.br Mon Feb 6 05:35:43 2006 From: mtnvega at yahoo.com.br (Luiz Jr) Date: Mon, 6 Feb 2006 12:35:43 +0000 (GMT) Subject: [Rxtx] Documentation Wiki In-Reply-To: <1139157422.4553.9.camel@zd7280> Message-ID: <20060206123543.57256.qmail@web53515.mail.yahoo.com> Hello, Thank you for you answer, but so the usage of the API is pretty much like the Java Communications Api? If yes, what version of the Java Comm Api? Thank you, Luiz A. Brandao Jr Kim Lux escreveu: On Sun, 2006-02-05 at 08:36 -0300, Luiz Jr wrote: > Hello, > > I want to start using the RXTX libraries, but I would to know how, > since I can not access the documentation wiki page I just started using them yesterday. Below is how I installed the libraries, if that helps. I used snippets of code from the SimpleWrite application here to get me going. http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html Instead of "import javax.comm.*;", use "import gnu.io.*;" which is gotten from RXTXcomm.jar, which you will need to include in your project references. I am working in Eclipse. BTW: there is no way to open a port without going through the port list and finding it. Maybe sometime in the future someone (me ?) will write a method called openSerialPort that allows the user to give a port identifier, such as "/dev/tty1" and return a port ready to use. It wouldn't take much to write that and it would save users a lot of code. Hope this helps. ======================================================================= 1) Figure out which java you are running, incase there is more than one installed. $ java -version java version "1.5.0_05" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_05-b05) Java HotSpot(TM) Client VM (build 1.5.0_05-b05, mixed mode, sharing) 2) Find all the jre directories and the one from which you are currently running. kfind (jre) 3) cd to that directory plus /lib/i386 cd /usr/java/jre1.5.0_05/lib/i386 4) Copy the library files (*.so) to that directory. cp /home/krlux/Desktop/'Java Controls'/rxtx-linux/bin/* . 5) Check that the copy was successful ls librxtx* librxtxI2C.so librxtxRaw.so librxtxSerial.so librxtxParallel.so librxtxRS485.so 6) cd to the /lib/ext directory for your java. cd /usr/java/jre1.5.0_05/lib/ext 7) Copy the Jar files there cp /home/krlux/Desktop/'Java Controls'/rxtx-linux/lib/ext/* . 8) Check that it was successful ls RXTX* RXTXcomm.jar Rxtx is now installed on your machine ready to use. =================================================================== -- Kim Lux, Diesel Research Inc. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx --------------------------------- Yahoo! Acesso Gr?tis - Internet r?pida e gr?tis. Instale o discador agora! -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/544aa403/attachment-0004.html From lyon at docjava.com Mon Feb 6 05:49:34 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 06 Feb 2006 07:49:34 -0500 Subject: [Rxtx] wiki delay until tomorrow night. In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: Hi All, I have often thought about USB drivers being needed. For example, the ironman watch will not interface to a mac (windows only). It is USB. My dymo label writer has no Java driver (native only). Etc. Most cheap web cameras are USB (and Java drivers go through JAI, if it supports the camera at all). The JAI code shows how sun did the USB drivers. You have to be a member of the jai project to download the source code. https://jai.dev.java.net has the jai distro. And then you are not allowed to redistribute it. However, we can all learn from it (if so inclined). Basically: cvs -d :pserver:lyon at cvs.dev.java.net:/cvs login cvs -d :pserver:lyon at cvs.dev.java.net:/cvs checkout jai-core You will need to user your own uid and pw to get in. The ant build has over 100 warnings from sun deprecations of its own code. You might say that they were hoisted on their own Picard ;) One interesting thing is that they support several platforms: linux-amd64 64-bit Linux-AMD64 linux-i586 32-bit Linux-x86 solaris-amd64 64-bit Solaris-AMD64 solaris-i586 32-bit Solaris-x86 solaris-sparc 32-bit Solaris-SPARC solaris-sparcv9 64-bit Solaris-SPARC windows-i586 32-bit Windows-x86 Thus, ant is used to provide a multi-platform native method distro. Neat. How do they do it? check this out: And: The core download does not contain any C source code (it was all pre-built). Basically, they are just copying .so and .dll files into build directories. I would love to see the C code for this...but Sun does not post it on the https://jai.dev.java.net site. I don't know why...Perhaps I missed it. - Doug >On Sun, 5 Feb 2006, Trent Jarvi wrote: > >>On Sun, 5 Feb 2006, Kim Lux wrote: >> >>>usb ? Tell me more... I need that too. >> >>usb is a very proper design. Thats all it is. >> > >Maybe rxtx could help usb. But it would start with helping bring >back the community that was already there. > >It's not something I'd love to do but maybe its the right thing to do. > >It would probably take 2 years to do right. But maybe thats better >than what we have now. > >I honestly don't know what IBM is doing which could just run over everything. > >Just some thoughts after some fine german wine. > >-- >Trent Jarvi >tjarvi at qbang.org > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tdelenik at gmail.com Mon Feb 6 05:56:32 2006 From: tdelenik at gmail.com (Thanasis Delenikas) Date: Mon, 6 Feb 2006 14:56:32 +0200 Subject: Fwd: [Rxtx] Documentation Wiki In-Reply-To: <1139157422.4553.9.camel@zd7280> References: <20060205113618.30274.qmail@web53501.mail.yahoo.com> <1139157422.4553.9.camel@zd7280> Message-ID: <310a1a930602060456t129f1dc6p5f2b908f13ab5a0b@mail.gmail.com> Hello all, Kim, this is a snippet from the code I use. The closest to directly opening a specific port without enumeration. << ... portId = CommPortIdentifier.getPortIdentifier(getPort()); serialPort = (SerialPort) portId.open("jSMSEngine", 1971); ... >> where getPort() return the string identifier of the port, i.e. "/dev/ttyS0" or "COM1" or whatever. Thanasis. ---------- Forwarded message ---------- From: Kim Lux Date: Feb 5, 2006 6:37 PM Subject: Re: [Rxtx] Documentation Wiki To: RXTX Developers and Users BTW: there is no way to open a port without going through the port list and finding it. Maybe sometime in the future someone (me ?) will write a method called openSerialPort that allows the user to give a port identifier, such as "/dev/tty1" and return a port ready to use. It wouldn't take much to write that and it would save users a lot of code. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/182ab5b8/attachment-0004.html From tjarvi at qbang.org Mon Feb 6 11:53:57 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 11:53:57 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: On Mon, 6 Feb 2006, Dr. Douglas Lyon wrote: > Hi All, > I have often thought about USB drivers being needed. > For example, the ironman watch will not interface > to a mac (windows only). It is USB. > My dymo label writer has no Java driver (native only). > Etc. > Most cheap web cameras are USB (and Java drivers go > through JAI, if it supports the camera at all). > The JAI code shows how sun did the USB drivers. > You have to be a member of the jai project to download > the source code. > https://jai.dev.java.net has the jai distro. > And then you are not allowed to redistribute it. However, > we can all learn from it (if so inclined). Basically: > cvs -d :pserver:lyon at cvs.dev.java.net:/cvs login > cvs -d :pserver:lyon at cvs.dev.java.net:/cvs checkout jai-core > You will need to user your own uid and pw to get in. > The ant build has over 100 warnings from sun deprecations > of its own code. > > You might say that they were hoisted on their own Picard ;) > > One interesting thing is that they support several platforms: > linux-amd64 64-bit Linux-AMD64 > linux-i586 32-bit Linux-x86 > solaris-amd64 64-bit Solaris-AMD64 > solaris-i586 32-bit Solaris-x86 > solaris-sparc 32-bit Solaris-SPARC > solaris-sparcv9 64-bit Solaris-SPARC > windows-i586 32-bit Windows-x86 > Thus, ant is used to provide a multi-platform native method distro. > Neat. > How do they do it? > check this out: > > > > > > > > > > > > > And: > > > > > > > > > > The core download does not contain any C source code (it was all pre-built). > Basically, they are just copying .so and .dll files into build directories. > > I would love to see the C code for this...but Sun does not post it on the > https://jai.dev.java.net site. > > I don't know why...Perhaps I missed it. > > - Doug > > I've looked at moving rxtx to Ant builds. I think that would help IDEs a great deal. I requested a evalutation desk copy the O'Reilly Ant book for some j2ee material I was teaching. http://www.oreilly.com/catalog/anttdg/ It has a one sentence mention of JNI. So there was not luck there. I saw that there is another Ant book that does mention JNI more. I can't find it now. Ant must be able to support it with extensions. http://ant.apache.org/manual/OptionalTasks/javah.html What the auto(break :) tools do in the rxtx build is 4 things really. 1) gcc compile flags 2) ld compile flags 3) config.h 4) compile flags for customizing rxtx (lockfiles, ...) See 1 All of this information except 4 can be static once obtained. So I'm not attached to the auto tools. If I could find an example of Ant being used for JNI code, I'd be one of the first to start moving that direction. Maybe someone saw an example someplace. The other thing we have not completed discussing is the directory structure. There is interest in making rxtx more IDE friendly. I get more mail about that off the list than how to install rxtx. And I see we have Ken Thompson in da house :) He is our trusted CVS maintainer and the guy that purchased the rxtx.org domain. Old community. We will need Ken for changing the directory structure of source. I would like to open up discussion about both of these as it is more than time. The problem is I have little experience with Ant and even less with IDEs. It would be nice if we could work with Eclipse and NetBeans. http://www.netbeans.org/ (sun and some community) http://www.eclipes.org (ibm,rhat,... perhaps more community) http://maven.apache.org/what-is-maven.html (apache. It is community) borland should sortof be here too but I think thats covered in eclipse. >From what I understand so far, we should morph rxtx to support those three maybe trusting apaches lead with maven. But I use vi. I have little to no clues beyond what people have fed me. Can we agree that thats the right direction to go? -- Trent Jarvi tjarvi at qbang.org From brian at mbari.org Mon Feb 6 14:57:50 2006 From: brian at mbari.org (Brian Schlining) Date: Mon, 6 Feb 2006 13:57:50 -0800 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> > The other thing we have not completed discussing is the directory > structure. There is interest in making rxtx more IDE friendly. I > get more mail about that off the list than how to install rxtx. > > And I see we have Ken Thompson in da house :) He is our trusted > CVS maintainer and the guy that purchased the rxtx.org domain. Old > community. We will need Ken for changing the directory structure of > source. > > I would like to open up discussion about both of these as it is > more than time. The problem is I have little experience with Ant > and even less with IDEs. It would be nice if we could work with > Eclipse and NetBeans. > > http://www.netbeans.org/ (sun and some community) > http://www.eclipes.org (ibm,rhat,... perhaps more community) > http://maven.apache.org/what-is-maven.html (apache. It is community) > borland should sortof be here too but I think thats covered in > eclipse. > >> From what I understand so far, we should morph rxtx to support >> those three > maybe trusting apaches lead with maven. But I use vi. I have > little to no clues beyond what people have fed me. > Maven likes the directory structure below for Java code. (From http:// maven.apache.org/guides/getting-started/index.html) This structure works fine with ant, netbeans, and eclipse. rxtx_root_directory `-- src |-- main | `-- java | `-- gnu | `-- io `-- test `-- java `-- gnu `-- io Brian Schlining Software Engineer http://www.mbari.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/d9451eba/attachment-0004.html From tjarvi at qbang.org Mon Feb 6 15:11:45 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 15:11:45 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: > rxtx_root_directory > `-- src > |-- main > | `-- java > | `-- gnu > | `-- io > `-- test > `-- java > `-- gnu > `-- io > >From what I understand this will just be good. For me it makes no difference. So lets do the rxtx thing. Let if fester for two weeks and if nobody objects, we will do it. I'm not doing this because I care. I'm doing this to eliminate much of my inbox. But test... man is rxtx lacking there in the community aspect. It is covered but not right. _maybe_ I can change that this year. -- Trent Jarvi tjarvi at qbang.org (cat hurding since 1997) From lux at diesel-research.com Mon Feb 6 21:38:49 2006 From: lux at diesel-research.com (Kim Lux) Date: Mon, 06 Feb 2006 21:38:49 -0700 Subject: [Rxtx] How can I use Lock Files with rxtx (in FC4) ? Message-ID: <1139287129.17031.3.camel@zd7280> I am now running an rxtx application on FC4. I am getting: ========================================================= check_group_uucp(): error testing lock file creation Error details: Permission denied check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL ========================================================= $ ls -al /var/lock total 32 drwxrwxr-x 4 root lock 4096 Feb 6 16:04 . drwxr-xr-x 24 root root 4096 Nov 14 01:19 .. drwx------ 2 root root 4096 Apr 27 2005 lvm drwxr-xr-x 2 root root 4096 Feb 6 16:04 subsys How do I fix this for regulator users ? -- Kim Lux, Diesel Research Inc. From dmarkman at mac.com Mon Feb 6 22:24:44 2006 From: dmarkman at mac.com (Dmitry Markman) Date: Tue, 7 Feb 2006 00:24:44 -0500 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: if I understands the issue right in order to be able to use ant for c/c++ compilation you have to install ant's cc task http://ant-contrib.sourceforge.net/cc.html it looks like it should work on mac os x (authors claim, that it's platform independent) but I never tested so all you have to do it's providing right command line for the gcc compiler On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: >> rxtx_root_directory >> `-- src >> |-- main >> | `-- java >> | `-- gnu >> | `-- io >> `-- test >> `-- java >> `-- gnu >> `-- io >> > > >> From what I understand this will just be good. > > For me it makes no difference. So lets do the rxtx thing. Let if > fester for two weeks and if nobody objects, we will do it. > > I'm not doing this because I care. I'm doing this to eliminate > much of my inbox. > > But test... man is rxtx lacking there in the community aspect. It > is covered but not right. _maybe_ I can change that this year. > > -- > Trent Jarvi > tjarvi at qbang.org > (cat hurding since 1997) > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx Dmitry Markman From lux at diesel-research.com Mon Feb 6 23:20:15 2006 From: lux at diesel-research.com (Kim Lux) Date: Mon, 06 Feb 2006 23:20:15 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? Message-ID: <1139293215.3689.4.camel@zd7280> I'm running the code below. portlist.hasMoreElements() is false. /dev has ports in it as listed below. What am I doing wrong ? ========================================================== // Step through the list of ports until we find one that matches // the one we are looking for. portList = CommPortIdentifier.getPortIdentifiers(); while(portList.hasMoreElements()) { portID = (CommPortIdentifier) portList.nextElement(); // if (portID.getName().equals("/dev/ttyUSB0")) { myTA.append("Serial port ttyUSB0 has been found\n"); break; }// if portID equals... }// End of while... ========================================================== ls -al /dev/tty* crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 ... crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 -- Kim Lux, Diesel Research Inc. From david.garnier at trusted-logic.com Tue Feb 7 00:46:30 2006 From: david.garnier at trusted-logic.com (David Garnier) Date: Tue, 07 Feb 2006 08:46:30 +0100 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: <43E85056.2090608@trusted-logic.com> Hello, I think that the make-based build process is fine as it is, apart from the location of the Java source files. It is true that putting the Java source in a directory structure that map 1-to-1 to the Java package structure is the norm and should make it easier for everyone to modify the Java source, with or without an IDE. Ant is a good tool, but in the RXTX case I fail to see the advantage of using it compared to the current make-based process. As Trent said, they are more pressing issues, like testing. Regards, David Dmitry Markman wrote: > if I understands the issue right > in order to be able to use ant for c/c++ compilation > you have to install ant's cc task > http://ant-contrib.sourceforge.net/cc.html > > it looks like it should work on mac os x > (authors claim, that it's platform independent) > but I never tested > > so all you have to do it's providing right command line > for the gcc compiler > > > > > On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: > >>> rxtx_root_directory >>> `-- src >>> |-- main >>> | `-- java >>> | `-- gnu >>> | `-- io >>> `-- test >>> `-- java >>> `-- gnu >>> `-- io >>> >> >> >>> From what I understand this will just be good. >> >> For me it makes no difference. So lets do the rxtx thing. Let if >> fester for two weeks and if nobody objects, we will do it. >> >> I'm not doing this because I care. I'm doing this to eliminate much >> of my inbox. >> >> But test... man is rxtx lacking there in the community aspect. It is >> covered but not right. _maybe_ I can change that this year. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> (cat hurding since 1997) From tjarvi at qbang.org Tue Feb 7 01:11:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 01:11:31 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <43E85056.2090608@trusted-logic.com> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: On Tue, 7 Feb 2006, David Garnier wrote: > Hello, > > I think that the make-based build process is fine as it is, apart from the location of the Java > source files. It is true that putting the Java source in a directory structure that map 1-to-1 to > the Java package structure is the norm and should make it easier for everyone to modify the Java > source, with or without an IDE. > > Ant is a good tool, but in the RXTX case I fail to see the advantage of using it compared to the > current make-based process. As Trent said, they are more pressing issues, like testing. > Hi David I have more experience with testing rxtx than I can talk about. But let it be known, rxtx has gone trough 100's of hours of testing. We are hobby folks interested in toys but there is more. rxtx has had some of the best guidance in the industry there. This is not an easy thing. I may be able to come back in a month from the other side of the corperate fence and help. I suspect the tests could just be made public but they are in a very unusual environment that just wont work in a wider sense. This is something I'll be trying to change. At one point it was agreed we could just make the results public so this isnt just noise.. There is interest and I think its safe to mention that much. The big problem with testing in the past is most of it is done with a loopback connection. So we *still* have major questions regarding things like flow control. rxtx talks to itself over a loopback and it works. regardless of right or wrong. This requires more thought to be done right. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Feb 7 02:46:34 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 02:46:34 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: > The big problem with testing in the past is most of it is done with a > loopback connection. So we *still* have major questions regarding things > like flow control. rxtx talks to itself over a loopback and it works. > regardless of right or wrong. With serial communication there are gold standards. ckermit is probably a definitive 'standard.' Maybe its possible to do ping/pong tests with ckermit? Is it scriptable? There are known issues in rxtx. Probably the worst is some threading issues regarding some JREs with multiple JNI threads setting java variables. Man did I get schooled there. Just switch the c functions to returning variables and things go away. Sometimes they work fine, sometimes they blow up. Without understanding everything, somehow rhat got it right and debian (and especially gentoo) grabbed kernel patches causing all sort of harm. Its not hard to fix once you understand whats going on but nearly impossible to track with a debugger. So I have a good idea what 2.1-8 will have outside of the IDE modifications. rxtx 2.1-7 is a release for everyone to sync with. Its not even as stable as -pre17 as far as I know - I ran no test suites. I'll be chasing it too. We just had so many contributions that it was time. It seriously broke internal scheduals but thats a great thing :) The other thing I want to do in 2.1-8 is automagic baud rates. It turns out lots of shops are doing really funky baud rates for things like automobile test equipment. It is possible but it requires a fair amount of change in the native code. Is anyone looking at this? -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Feb 7 02:57:21 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 07 Feb 2006 04:57:21 -0500 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <43E85056.2090608@trusted-logic.com> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: Hi All, I agree, testing is very important. The problem I have been trying to address is related to cross-platform testing and the robust nature of the installs. Typically, I visit 3 platforms to deploy my product, windows, linux and mac. A build is performed on each platform. The idea that you can build for many platforms from one copy the source code seems attractive. This should enable synchronized deployments of identical code. The question of how to achieve this goal remains open. As Trent mentioned, this is hard. Perhaps Ant will help here (but perhaps not). Ant does seem to help with running unit tests. However, it does not help with multi-platform tests. For that you need many machines and different operating environments. Toward that end, I have created a multi-platform test that can be run from web start, located at: http://show.docjava.com:8086/book/cgij/code/jnlp/serialPort.PortTest.jnlp This is interesting because many people in the community can run the test and we can improve the test, as time permits. No, it is not a perfect solution, however, the idea does help with multi-platform tests using many machines and different operating environments. If the group has a good test for a general serial port set-ups, i would be happy to deploy it, for general evaluation using web start. And as for ANT, it is just an idea. Not all my ideas are good ones! - Doug >Hello, > >I think that the make-based build process is fine as it is, apart >from the location of the Java >source files. It is true that putting the Java source in a directory >structure that map 1-to-1 to >the Java package structure is the norm and should make it easier for >everyone to modify the Java >source, with or without an IDE. > >Ant is a good tool, but in the RXTX case I fail to see the advantage >of using it compared to the >current make-based process. As Trent said, they are more pressing >issues, like testing. > >Regards, >David > >Dmitry Markman wrote: >> if I understands the issue right >> in order to be able to use ant for c/c++ compilation >> you have to install ant's cc task >> http://ant-contrib.sourceforge.net/cc.html >> >> it looks like it should work on mac os x >> (authors claim, that it's platform independent) >> but I never tested >> >> so all you have to do it's providing right command line >> for the gcc compiler >> >> >> >> >> On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: >> >>>> rxtx_root_directory >>>> `-- src >>>> |-- main >>>> | `-- java >>>> | `-- gnu >>>> | `-- io >>>> `-- test >>>> `-- java >>>> `-- gnu >>>> `-- io >>>> >>> >>> >>>> From what I understand this will just be good. >>> >>> For me it makes no difference. So lets do the rxtx thing. Let if >>> fester for two weeks and if nobody objects, we will do it. >>> >>> I'm not doing this because I care. I'm doing this to eliminate much >>> of my inbox. >>> >>> But test... man is rxtx lacking there in the community aspect. It is >>> covered but not right. _maybe_ I can change that this year. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> (cat hurding since 1997) > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From matt.higgins at gmail.com Tue Feb 7 08:28:34 2006 From: matt.higgins at gmail.com (Matt Higgins) Date: Tue, 7 Feb 2006 10:28:34 -0500 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final Message-ID: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? import java.io.*; import java.util.*; import gnu.io.*; public class MySimpleRead implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; public static void main(String[] args) { boolean portFound = false; String defaultPort = "COM1"; if (args.length > 0) { defaultPort = args[0]; } portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; MySimpleRead reader = new MySimpleRead(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } } public MySimpleRead() { try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) { e.printStackTrace(); } try { inputStream = serialPort.getInputStream(); } catch (IOException e) { e.printStackTrace(); } try { serialPort.addEventListener(this); } catch (TooManyListenersException e) { e.printStackTrace(); } try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { e.printStackTrace(); } System.out.println("Baud is " + serialPort.getBaudRate()); System.out.println("Bits is " + serialPort.getDataBits()); System.out.println("Stop is " + serialPort.getStopBits()); System.out.println("Par is " + serialPort.getParity()); serialPort.notifyOnDataAvailable(true); readThread = new Thread(this); readThread.start(); } public void run() { // Thread.sleep(20000); //} catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { System.out.println("An event occurred " + event.getEventType()); switch (event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: byte[] readBuffer = new byte[20]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } System.out.print(new String(readBuffer)); } catch (IOException e) {} break; } } } --------------- Result on windows ------------------------------ Stable Library ============================================================== Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port:: COM1 Baud is 9600 Bits is 8 Stop is 1 Par is 0 ----------------- End Results ----------------------------------------- ------------------ Result on Linux ----------------------------------- Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 Found port: /dev/ttyS0 Baud is 9600 Bits is 8 Stop is 1 Par is 0 An event occurred 1 043100066224 ------------------ End Results --------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/a1431630/attachment-0004.html From brian at mbari.org Tue Feb 7 09:48:37 2006 From: brian at mbari.org (Brian Schlining) Date: Tue, 7 Feb 2006 08:48:37 -0800 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> Message-ID: <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> Hi Matt > The following code works fine on Linux but I never see any data > when run on Windows. This is a cut and paste from the SimpleRead > example. > I am attempting to read data from a bar code scanner. I can fire > up HyperTermianl on windows and see that the device is working > properly as I see the barcodes are scanned and echoed back to the > terminal. However when I run the app I don't see any data. It is > however associating with the com port as the informational bits > print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. Cheers Brian Schlining Software Engineer http://www.mbari.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/16d07f37/attachment-0004.html From lux at diesel-research.com Tue Feb 7 11:59:58 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 11:59:58 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139293215.3689.4.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> Message-ID: <1139338798.8145.4.camel@zd7280> Any ideas on this ? Any reason why portList.hasMoreElements() should be false even though there are devices in /dev ? On Mon, 2006-02-06 at 23:20 -0700, Kim Lux wrote: > I'm running the code below. > > portlist.hasMoreElements() is false. > > /dev has ports in it as listed below. > > What am I doing wrong ? > > > ========================================================== > // Step through the list of ports until we find one that matches > // the one we are looking for. > > portList = CommPortIdentifier.getPortIdentifiers(); > > while(portList.hasMoreElements()) > { > portID = (CommPortIdentifier) portList.nextElement(); // > if (portID.getName().equals("/dev/ttyUSB0")) > { > myTA.append("Serial port ttyUSB0 has been found\n"); > break; > }// if portID equals... > }// End of while... > ========================================================== > > ls -al /dev/tty* > crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty > crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 > crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 > crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 > crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 > ... > crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 > crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 > crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 > > > -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 12:20:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 12:20:25 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139338798.8145.4.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> Message-ID: On Tue, 7 Feb 2006, Kim Lux wrote: > > Any ideas on this ? Any reason why portList.hasMoreElements() should be > false even though there are devices in /dev ? > > > On Mon, 2006-02-06 at 23:20 -0700, Kim Lux wrote: >> I'm running the code below. >> >> portlist.hasMoreElements() is false. >> >> /dev has ports in it as listed below. >> >> What am I doing wrong ? >> >> >> ========================================================== >> // Step through the list of ports until we find one that matches >> // the one we are looking for. >> >> portList = CommPortIdentifier.getPortIdentifiers(); >> >> while(portList.hasMoreElements()) >> { >> portID = (CommPortIdentifier) portList.nextElement(); // >> if (portID.getName().equals("/dev/ttyUSB0")) >> { >> myTA.append("Serial port ttyUSB0 has been found\n"); >> break; >> }// if portID equals... >> }// End of while... >> ========================================================== >> >> ls -al /dev/tty* >> crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty >> crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 >> crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 >> crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 >> crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 >> ... >> crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 >> crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 >> crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 >> >> >> > Hi Kim What rxtx does is try to open the port and do a timed out read. If the kernel/... do not complain it's enumarted. I suspect you could do a crude test by doing something like cat /dev/ttyS0 > /dev/null If that barfs then rxtx wont enumerate the port. hmm looking at your question again, I suspect it's a lockfile problem. This is documented in INSTALL with the source. Its easy enough to test this too.. touch /var/lock/testingrxtxlockfiles && rm -f /var/lock/testingrxtxlockfiles If you are not in the right group it will bail. Root will work regardless. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 12:37:56 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 12:37:56 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> Message-ID: <1139341076.8145.11.camel@zd7280> Exactly which ports does rxtx attempt to put into the list ? /dev/* or /dev/tty* or /dev/tty[0-9[0-9] ? or /dev/ttyS* ? For the record, only /dev/ttyUSB0 is a valid port on the machine I am presently on. Will this be a problem ? On Tue, 2006-02-07 at 12:20 -0700, Trent Jarvi wrote: > This is documented in INSTALL with the source. > I was wondering where that file was. I will download source and dig it up. Thanks. -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 12:51:09 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 12:51:09 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139341076.8145.11.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: On Tue, 7 Feb 2006, Kim Lux wrote: > > Exactly which ports does rxtx attempt to put into the list ? /dev/* > or /dev/tty* or /dev/tty[0-9[0-9] ? or /dev/ttyS* ? > > For the record, only /dev/ttyUSB0 is a valid port on the machine I am > presently on. Will this be a problem ? > > > On Tue, 2006-02-07 at 12:20 -0700, Trent Jarvi wrote: >> This is documented in INSTALL with the source. >> > I was wondering where that file was. I will download source and dig it > up. > > Thanks. > Hmm I'm looking at pre17 so this may have changed. (its just what I have on this machine) if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA" // for the IPAQs }; CandidatePortPrefixes=Temp; } So you may need to add "ttyUSB" to that list. RXTX used to enumerate _everything_ see if(osName.equals("Linux-all-ports") But it became less than practical. This is all in RXTXCommDriver.java hmm I just did a cvs update. if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have to get your fingers into the code. We aim for sane defaults. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 13:06:45 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 13:06:45 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139342805.8145.22.camel@zd7280> On Tue, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > Hmm I'm looking at pre17 so this may have changed. (its just what I have > on this machine) > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA" // for the IPAQs > }; > CandidatePortPrefixes=Temp; > } > > > So you may need to add "ttyUSB" to that list. RXTX used to enumerate > _everything_ see if(osName.equals("Linux-all-ports") But it became less > than practical. > > This is all in RXTXCommDriver.java > > hmm I just did a cvs update. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have > to get your fingers into the code. We aim for sane defaults. Excellent. Thanks for taking the time. -- Kim Lux, Diesel Research Inc. From ideiglenes1 at freemail.hu Tue Feb 7 13:53:39 2006 From: ideiglenes1 at freemail.hu (--) Date: Tue, 07 Feb 2006 21:53:39 +0100 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139345619.22534.2.camel@localhost> Hi! I use this code to get all the extra Linux devices. :) if ("Linux".equals(System.getProperty("os.name"))) { System.setProperty("os.name","Linux-all-ports"); } driver = new RXTXCommDriver(); On k, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > On Tue, 7 Feb 2006, Kim Lux wrote: > > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have > to get your fingers into the code. We aim for sane defaults. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From matt.higgins at gmail.com Tue Feb 7 13:45:54 2006 From: matt.higgins at gmail.com (Matt Higgins) Date: Tue, 7 Feb 2006 15:45:54 -0500 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> Message-ID: <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> Sweet this is exactly what I needed. I was searching the archives through marc.theamisgroup they only have archives back to 1/3/05. Should have hit the mailman archive! Thanks a lot! On 2/7/06, Brian Schlining wrote: > > Hi Matt > > The following code works fine on Linux but I never see any data when run > on Windows. This is a cut and paste from the SimpleRead example. > I am attempting to read data from a bar code scanner. I can fire up > HyperTermianl on windows and see that the device is working properly as I > see the barcodes are scanned and echoed back to the terminal. However when I > run the app I don't see any data. It is however associating with the com > port as the informational bits print fine? > > > You're not the only one whose had this problem, I don't know if Trent has > addressed this is the latest release of RXTX but there is a workaround. > Here's the recent thread from the RXTX mailing list regarding this issues: > > Thanasis Delenikas tdelenik at gmail.com > Wed Jan 18 13:56:23 MST 2006 > > * Previous message: [Rxtx] Re: More close() performance fixes > * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] > > Hi all. > (I've subscribed again from my other email account). > > Trent, > > You are right. Linux *always* works, no matter what flow control you set. > Windows *works only* with hardware flow control (I haven't tested what > happens with software XON/XOFF flow control). > > I assume (but I am not certain) that even with no flow control at all, all > platforms should work. Without flow control, you have the risk of bumping > into overflow or framing errors, but that's your (the end programmer, I > mean) problem. > > >From my side, I shouldn't be working without flow control. That was a bug > too... It was some code forgotten from the old times, when I used to work > with phone emulation drivers which didn't support flow control. The > correct > way is to have some flow control enabled and that's why I suppose this is > a > low-severity bug for RxTx. > > I have no idea which platform shows the correct behaviour, since > my knowledge about Linux and the inner workings of these low-level i/o > operations is limited. > > Regards, > Thanasis Delenikas. > > > > > Message: 2 > > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > > From: Trent Jarvi > > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > > To: RXTX Developers and Users > > Message-ID: > > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > > > Hi all, > > > > > > Trent, I have found something. > > > I read your comment about flow control, so I experimented a bit. > > > > > > If you remember, in my sample program I've used no flow control at all > ( > > i.e. > > > Java constant FLOWCONTROL_NONE). > > > > > > Now, during testing, I've switch to hardware inbound flow control (i.e > . > > Java > > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > > beautifully! > > > > > > I think I will switch to H/W flow control and test things for a while, > > but > > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > > > > > Hi Thanasis, > > > > I'm fairly sure you have identified a bug. I would not worry too much > > about what Sun CommAPI w32 defaults are. I think they did more or less > > whatever the port opened with. Just a guess. Linux tries to stomp on > > ports so they are all the same. > > > > So this started out with Linux worked, Windows XP/.. did not as I > recall. > > Something is wrong in rxtx. Do I understand this right? > > > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > > > Perhaps there is something Wayne or I did not understand when we wrote > > that code. I wasnt programming back in the BBS days so modems are not > my > > thing. I have a few questions. > > > > Is the above matrix confirmed by observation? > > Linux just always worked? > > Which one _should_ work? I'm guessing modems work with hardware flow > > control. I'll have to dig around. > > > > The windows flow control changes a couple things with hardware flow > > control. Following the w32 API documentation is confusing sometimes. > > But it looks like Linux could have a bug too. > > Cheers > > Brian Schlining > Software Engineer > http://www.mbari.org > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/9c989144/attachment-0004.html From tjarvi at qbang.org Tue Feb 7 14:06:14 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 14:06:14 -0700 (MST) Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> Message-ID: >> >> You're not the only one whose had this problem, I don't know if Trent has >> addressed this is the latest release of RXTX but there is a workaround. >> Here's the recent thread from the RXTX mailing list regarding this issues: >> I have not. I expect to have access to some test equipment next month and I'll go through all of this. I really don't know whats going on and I need a gold standard. I thought maybe linux was autodetecting the flow control. Your observations would certainly be welcome. I need to talk to Russell King and see what he is doing. Until then I'd just be toying around over a loopback as usual. This is very high on the list though. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 17:25:05 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 17:25:05 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139358305.17994.2.camel@zd7280> My application now works. I installed the libraries and jar from 2.1-7 (Final). portlist.hasMoreElements is no longer false. The application finds the port for /dev/ttyUSB0. Thanks for your help, Trent (et al) Sorry I bothered you with this. Next time I will look in the source first. I didn't think it was an rxtx issue, I thought it was a Linux setup issue . On Tue, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > Hmm I'm looking at pre17 so this may have changed. (its just what I > have > on this machine) > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux > Serial Ports > "ttySA" // for the > IPAQs > }; > > CandidatePortPrefixes=Temp; > } > > > So you may need to add "ttyUSB" to that list. RXTX used to enumerate > _everything_ see if(osName.equals("Linux-all-ports") But it became > less > than practical. > > This is all in RXTXCommDriver.java > > hmm I just did a cvs update. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux > Serial Ports > "ttySA", // for the > IPAQs > "ttyUSB" // for USB > frobs > }; > > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you > have > to get your fingers into the code. We aim for sane defaults. -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 19:21:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 19:21:54 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139358305.17994.2.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> <1139358305.17994.2.camel@zd7280> Message-ID: >Sorry I bothered you with this. Next time I will look in the source >first. I didn't think it was an rxtx issue, I thought it was a Linux >setup issue . Why would you be sorry? I would have done the same. I'm glad it's working :) -- Trent Jarvi tjarvi at qbang.org From tma at mail.island.net Wed Feb 8 13:39:35 2006 From: tma at mail.island.net (Tom Alldread) Date: Wed, 08 Feb 2006 12:39:35 -0800 Subject: [Rxtx] Win32/Linux Serial Port Data Dropouts In-Reply-To: <200602060702.k167255O007882@www.qbang.org> References: <200602060702.k167255O007882@www.qbang.org> Message-ID: <43EA5707.4020200@mail.island.net> Greetings Folks at RXTX: During the last couple of months I have been alternately testing with javax.comm 2 and RXTX 2.1 under Windows XP and CommApi 3 and RXTX 2.1 under Suse 10.0 Linux. In the process I have learned a little about java multi-threading under NetBeans 5 with Profiler. My java (jdk 1.5_06) application is used for data acquisition and provides a graphical display of A-D conversion data received from a 56KBaud serial port. The actual data throughput is about 10KBaud thus it is well below the speed of the port. I use hardware RTS/CTS flow control which can stall the data acquisition sample rate if necessary. This ensures the display computer has the ability to slow the data acquisition rate should it become too busy to accept the regular data flow. Both the serial port buffer and the java read buffer are set at 16KB. Usually the data transfers into the java read buffer are less than 100 bytes unless the data acquisition is recovering from a stall. The data flow normally hesitates after each 5 KB block as a continue command is needed from the display computer to start the drawing of a new graphics display line. Separate threads have been provided for the serial port event monitoring and data processing. The serial port event thread has been given the maximum priority and data processing thread the minimum priority provided by java. Thread yield statements have been placed within all data processing while/for loops as an effort to ensure quick access to CPU cycles for the serial port event thread. I have found that short data transmissions are essentially error free but occasional dropouts occur with continuous data flow especially under Windows XP. ....................................................................................................................................................................................... Linux results: I am happy to report that RXTX 2.1 appears to work very well under Linux although I did notice some errors when the screen savers were running with my dual monitors. I believe this is a local problem associated with my dual graphics which needs further attention. The recent CommApi 3 Linux release from Sun did not work at all with my program. It seemed to send commands out OK but did not receive any data. Although the serial port event triggered the ISR, the input stream appeared filled with nulls and thus did not contain any data. As my understanding is that CommApi 3 was tested with a Red Hat distribution of Linux I wonder if this problem is distro dependent? Although somewhat off topic here I wonder if anyone reading this has had similar experience? .................................................................................................................................................................................. Windows XP results: There are problems with occasional data dropouts which become more frequent as the sampling rate is increased or if the computer becomes busy with other duties. The dropouts typically consist of a half dozen byte block of lost data. It appears the lost bytes never get added to the java input stream. There has not been any indication of garbled data, overruns or framing errors which suggests the UART communications remains solid. Using javax.comm 2 I found that the setting of SerialPort 'enableReceiveThreshold' to 40 and 'enableReceiveTimeout' of 100mS reduced the dropouts error rate significantly. I found that I could not get RXTX 2.1 to function with the aforementioned threshold and timeout settings. The javax.comm 2 interface is consequently performing better for me under Windows than RXTX 2.1. I wonder if anyone here has any suggestions as to what I might try to improve RXTX 2.1? Although my settings are the same as under Suse 10.0, RXTX 2.1 performs much better for me under Linux than any of the alternatives that I have tried under Windows XP . ............................................................................................................................................................................... I would like to establish, based on the experience of others, if I have reached the normally expected performance limit of java serial port communications? Should I expect to achieve virtually error free serial port data input from a continuous stream under Windows XP java software? I am considering changing my protocol to packets with error checking if necessary but would like to know if the dropout problems I am experiencing are typical or not before I take this rather work intensive plunge. Many thanks in advance for any help! Best Regards, Tom Alldread -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.375 / Virus Database: 267.15.2/253 - Release Date: 2006-02-07 From jlaxson at mac.com Wed Feb 8 23:56:48 2006 From: jlaxson at mac.com (John Laxson) Date: Thu, 9 Feb 2006 00:56:48 -0600 Subject: [Rxtx] PortInUseException: Unknown Application on OSX Message-ID: Hi, I've been trying to get RXTX 2.1.7 going on Mac OS X for a while here, and am running up into a wall here. I've tried with pre- compiled and the source version and get the same problem, a gnu.io.PortInUseException: Unknown Application. I have run the fixperms script included with the source distribution, and id shows me as a member of the uucp group, and permissions on /var/spool/uucp are 775 root:uucp. Running a test program (included at the bottom for clarity) lets me enumerate all the serial ports correctly, but trying to open any of them gives the PortInUseException. If it helps, when I try to open a port that's set to make an outgoing bluetooth connection, there is no delay and no connection attempt at all. Thanks, John Laxson PS: The documentation wiki on qbang.org shows 404, and has for a few days now. My test code: public static void main(String[] args) { SerialPort serialPort; try { Enumeration e = CommPortIdentifier.getPortIdentifiers(); CommPortIdentifier ident; while (e.hasMoreElements()) { ident = (CommPortIdentifier)e.nextElement(); System.out.println(ident.getName()); } ident = CommPortIdentifier.getPortIdentifier("/dev/cu.modem"); serialPort = (SerialPort) ident.open("Me", 5000); } catch (Exception e) { e.printStackTrace(); } } From rajesh.invincible at gmail.com Thu Feb 9 03:39:38 2006 From: rajesh.invincible at gmail.com (Rajesh N) Date: Thu, 9 Feb 2006 16:09:38 +0530 Subject: [Rxtx] Re: Move .java Files in gnu.io filesystem hierarchy - Maven (2) In-Reply-To: <43DF21D2.7090200@ngi.it> References: <43DF21D2.7090200@ngi.it> Message-ID: <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Can anybody tell me how to overcome these EXCEPTIONS I AM WORKING ON SERIAL COMMN IN JAVA ON LINUX. 1. " NOT ALL PARAMETERS SUPPORTED BY THE KERNEL" This i came across the following statement inmy prog. SerialP is A SerialPort object SerialP.setSerialPortParams(9600(BAUDRATE),DATABITS_8,STOPBITS_1,PARITY_NONE) 2. NullPointer Exception at Event Dispatch Now i have checked all my object references for a null reference but i found none i have put up my entire code in try catch blocks but still I AM UNABLE TO CATCH THIS EXCEPTION AND HENCE MY APPLICATION CLOSES HOW DOES THESE GO? PLEASE HELP ME IT IS URGENTTTTTTTTTTTTTTTT yours sincerely RAJESH On 1/31/06, Fabio Frumento wrote: > Hi Xavier, > > I don't know maven at all but the directory hierarchy listed buy Trent > is fine for me... > > I'll take a look to maven, it seems an interesting project > > Regards > > Fabio Frumento > > Trent Jarvi wrote: > > On Tue, 31 Jan 2006, Xavier Frisaye wrote: > > > >> Hi all, > >> > >> If you are going to rearrange the src folder, i will propose to use > >> maven 2 and follow its directory structure > >> > (http://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html). > >> > >> Maven 2 simplify java project and give a standard way to make projects > >> (http://maven.apache.org/). > >> We are using it for internal projects and we are very satisfied. > >> > >> Is anybody interested? > >> > >> I'm not an expert in maven 2 (yet) but i'm agree to help using it if > >> you choose to make so. > >> > > > > so this would be: > > > > rxtx-devel/src/main/java/gnu.io > > rxtx-devel/src/test/java/ManIwish.java > > > > I don't use IDEs very much so I'll let others comment. But I don't see > > a problem with that. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Thu Feb 9 09:50:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 9 Feb 2006 09:50:31 -0700 (MST) Subject: [Rxtx] Re: Move .java Files in gnu.io filesystem hierarchy - Maven (2) In-Reply-To: <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Message-ID: On Thu, 9 Feb 2006, Rajesh N wrote: > Can anybody tell me how to overcome these EXCEPTIONS > I AM WORKING ON SERIAL COMMN IN JAVA ON LINUX. > > 1. " NOT ALL PARAMETERS SUPPORTED BY THE KERNEL" > > This i came across the following statement inmy prog. > SerialP is A SerialPort object > SerialP.setSerialPortParams(9600(BAUDRATE),DATABITS_8,STOPBITS_1,PARITY_NONE) > Strange. The parameters you use are the same the port should open with by default. Could you paste the actual exception you are getting? I don't see that in the rxtx source. Also it would help to know the rxtx version. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Fri Feb 10 15:29:05 2006 From: lux at diesel-research.com (Kim Lux) Date: Fri, 10 Feb 2006 15:29:05 -0700 Subject: [Rxtx] One serial port object for both sending and receiving ? Message-ID: <1139610545.18177.4.camel@zd7280> Is it OK to use one SerialPort ojbect (ex Serial Port serialPort;) and use it for both sending and receiving ? For example: ======================================================================== static SerialPort serialPort = null; static OutputStream serialOut = null; static InputStream serialIn = null; // assign it to an outputStream for use try{ serialOut = serialPort.getOutputStream(); System.out.println("Serial output stream has been assigned."); }//try catch(IOException e) { System.out.println("Error: Couldn't assign output stream to serial port."); }//catch //assign it to an inputStream for use try{ serialIn = serialPort.getInputStream(); System.out.println("Serial input stream has been assigned."); }//try catch(IOException e) { System.out.println("Error: Couldn't assign input stream to serial port."); }//catch ======================================================================== -- Kim Lux, Diesel Research Inc. From lux at diesel-research.com Fri Feb 10 21:23:00 2006 From: lux at diesel-research.com (Kim Lux) Date: Fri, 10 Feb 2006 21:23:00 -0700 Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Message-ID: <1139631780.23882.10.camel@zd7280> I've got a problem receiving chars with my version of serialRead, written in an SWT GUI. I had a Java pro have a good look at my code and he can't see anything wrong with it. I can send chars fine. When I receive a char the cpu usage for the app goes to 100% and the code in the serial event handler doesn't get executed. The instructions on the Java Comm Serial API How-To for Linux page state that I must install javacomm. Is that true ? Everything builds without it and I can send chars on rxtx just fine, but I can't receive them. Could this be the problem ? I downloaded and installed javacomm. I was not able to add "Driver=gnuio.RXTXCommDriver to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 installed in /usr/java/jre1.5.0_05. I added comm.jar to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext to the library paths. Is this OK ? Does it matter that I am receiving on /dev/ttyUSB0 ? Thanks. -- Kim Lux, Diesel Research Inc. From lunareclipse03 at web.de Sat Feb 11 09:44:46 2006 From: lunareclipse03 at web.de (lunareclipse03@web.de) Date: Sat, 11 Feb 2006 17:44:46 +0100 Subject: [Rxtx] Question about Serial I/O under Win32 Message-ID: <662084330@web.de> Hello everybody, I have a strange problem with a piece of code I made for myself. No, this is not really concerning rxtx, but nevertheless I post this to the list, hoping that some of you can help me. I've written two libraries, one for linux and one for win32. The linux port works quite well, I can send / receive faxes and / or replay voice messages over the telephone line using a voice modem. But the win32 port of the library causes some trouble. If, for example, I send out a fax with a certain modem under linux, it works well. The fax is complete when it comes out of the fax machine. If I then use the same modem to send out a fax under win32, the fax coming out of the fax machine gets "stuck" halfways, but the sending modem thinks that transmission was ok and drops the connection. The answering fax machine then gives me "error while receiving." The "upper layer" java code MUST be right, because if I do the same thing under linux (using the linux library), everything is alright. Now I have to ask: Can somebody please help me out with this??!? Could it be the case that some kind of flow control or COMMTIMEOUTS setting causes this behaviour? I set flow control to RTS/CTS before sending out a fax. How can I DISABLE flow control? Or what do you think? Can something else cause this problems? Thank you all for your time and PLEASE write back soon. Regards, --Sven Ahlemann Am Waldrand 31 45721 Haltern am See Germany ______________________________________________________________ Verschicken Sie romantische, coole und witzige Bilder per SMS! Jetzt bei WEB.DE FreeMail: http://f.web.de/?mc=021193 From lux at diesel-research.com Sat Feb 11 10:06:52 2006 From: lux at diesel-research.com (Kim Lux) Date: Sat, 11 Feb 2006 10:06:52 -0700 Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: <1139631780.23882.10.camel@zd7280> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> <1139631780.23882.10.camel@zd7280> Message-ID: <1139677612.3431.5.camel@zd7280> More on this problem. I copied and pasted simpleRead into a console based Eclipse project and I've got the same result, except that cpu usage doesn't go to 100%. I'm beginning to think there is an issue in rxtx. My imports for simpleRead are: ============================ import gnu.io.*; import java.util.*; //import javax.comm.*; import java.io.*; =========================== Any ideas ? I am trying to read from /dev/ttyUSB0 using a serial to USB adapter which has worked well with minicom and gtkterm. Thanks. On Fri, 2006-02-10 at 21:23 -0700, Kim Lux wrote: > I've got a problem receiving chars with my version of serialRead, > written in an SWT GUI. > > I had a Java pro have a good look at my code and he can't see anything > wrong with it. > > I can send chars fine. When I receive a char the cpu usage for the app > goes to 100% and the code in the serial event handler doesn't get > executed. > > The instructions on the Java Comm Serial API How-To for Linux page state > that I must install javacomm. Is that true ? Everything builds without > it and I can send chars on rxtx just fine, but I can't receive them. > Could this be the problem ? > > I downloaded and installed javacomm. I was not able to add > "Driver=gnuio.RXTXCommDriver > to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not > have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 > installed in /usr/java/jre1.5.0_05. I added comm.jar > to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext > to the library paths. Is this OK ? > > Does it matter that I am receiving on /dev/ttyUSB0 ? > > Thanks. > -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Sun Feb 12 21:01:33 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:01:33 -0700 (MST) Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: <1139677612.3431.5.camel@zd7280> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> <1139631780.23882.10.camel@zd7280> <1139677612.3431.5.camel@zd7280> Message-ID: I suspect what is happening is the select() is breaking out in the native code but the driver does not have support for notifying there are X bytes available. On some traditional Unix based systems, the only way you know data is available is the fd status changes and do an FIORDCHK ioctl. Or perhaps the only thing you can know is the fd status changed. It would take reading through the kernel driver code to know for sure. So on USB, depending upon the driver, the same may need to be done or the driver improved a bit if possible to support. Polling reads will also work but don't use the event driven model of CommAPI which isnt acceptable in the long run. The 100% cpu usage can then be explained because select no longer blocks until the data is read; the eventLoop spins loose. You can put a well placed sleep but rxtx only expects those are needed when it knows data is available. This may not be a super simple thing to understand and fix. I do have ideas to get you started. I'm going to be short on time the next couple weeks. I expect to put some good time in and answer some other questions I saw around the 25th. For now, I'd look at the following and go from there with the hints I've given. JNIEXPORT jint JNICALL RXTXPort(nativeavailable)( JNIEnv *env, jobject jobj ) { int fd = get_java_var( env, jobj,"fd","I" ); int result; /* char message[80]; ENTER( "RXTXPort:nativeavailable" ); On SCO OpenServer FIONREAD always fails for serial devices, so try ioctl FIORDCHK instead; will only tell us whether bytes are available, not how many, but better than nothing. This turns out to be true on Solaris also. taj. */ #ifdef FIORDCHK /* __unixware__ __sun__ probably others */ result = ioctl(fd, FIORDCHK, 0); #else if( ioctl( fd, FIONREAD, &result ) < 0 ) { goto fail; } #endif /* FIORDCHK */ On Sat, 11 Feb 2006, Kim Lux wrote: > > More on this problem. I copied and pasted simpleRead into a console > based Eclipse project and I've got the same result, except that cpu > usage doesn't go to 100%. I'm beginning to think there is an issue in > rxtx. > > My imports for simpleRead are: > > ============================ > import gnu.io.*; > import java.util.*; > //import javax.comm.*; > import java.io.*; > =========================== > > Any ideas ? I am trying to read from /dev/ttyUSB0 using a serial to > USB adapter which has worked well with minicom and gtkterm. > > Thanks. > > > > On Fri, 2006-02-10 at 21:23 -0700, Kim Lux wrote: >> I've got a problem receiving chars with my version of serialRead, >> written in an SWT GUI. >> >> I had a Java pro have a good look at my code and he can't see anything >> wrong with it. >> >> I can send chars fine. When I receive a char the cpu usage for the app >> goes to 100% and the code in the serial event handler doesn't get >> executed. >> >> The instructions on the Java Comm Serial API How-To for Linux page state >> that I must install javacomm. Is that true ? Everything builds without >> it and I can send chars on rxtx just fine, but I can't receive them. >> Could this be the problem ? >> >> I downloaded and installed javacomm. I was not able to add >> "Driver=gnuio.RXTXCommDriver >> to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not >> have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 >> installed in /usr/java/jre1.5.0_05. I added comm.jar >> to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext >> to the library paths. Is this OK ? >> >> Does it matter that I am receiving on /dev/ttyUSB0 ? >> >> Thanks. >> > From tjarvi at qbang.org Sun Feb 12 21:03:30 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:03:30 -0700 (MST) Subject: [Rxtx] One serial port object for both sending and receiving ? In-Reply-To: <1139610545.18177.4.camel@zd7280> References: <1139610545.18177.4.camel@zd7280> Message-ID: On Fri, 10 Feb 2006, Kim Lux wrote: > > Is it OK to use one SerialPort ojbect (ex Serial Port serialPort;) and > use it for both sending and receiving ? > > For example: > > ======================================================================== > static SerialPort serialPort = null; > static OutputStream serialOut = null; > static InputStream serialIn = null; > > > > > // assign it to an outputStream for use > try{ > serialOut = serialPort.getOutputStream(); > System.out.println("Serial output stream has been assigned."); > }//try > catch(IOException e) > { > System.out.println("Error: Couldn't assign output stream to serial > port."); > }//catch > > > //assign it to an inputStream for use > try{ > serialIn = serialPort.getInputStream(); > System.out.println("Serial input stream has been assigned."); > }//try > catch(IOException e) > { > System.out.println("Error: Couldn't assign input stream to serial > port."); > }//catch This should be fine. In fact trying to do it another way will probably not work as you will run into lockfile issues. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun Feb 12 21:13:13 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:13:13 -0700 (MST) Subject: [Rxtx] Question about Serial I/O under Win32 In-Reply-To: <662084330@web.de> References: <662084330@web.de> Message-ID: On Sat, 11 Feb 2006 lunareclipse03 at web.de wrote: > Hello everybody, > > I have a strange problem with a piece of code I made for myself. No, > this is not really concerning rxtx, but nevertheless I post this to the > list, hoping that some of you can help me. I've written two libraries, > one for linux and one for win32. The linux port works quite well, I can > send / receive faxes and / or replay voice messages over the telephone > line using a voice modem. But the win32 port of the library causes some > trouble. If, for example, I send out a fax with a certain modem under > linux, it works well. The fax is complete when it comes out of the fax > machine. If I then use the same modem to send out a fax under win32, the > fax coming out of the fax machine gets "stuck" halfways, but the sending > modem thinks that transmission was ok and drops the connection. The > answering fax machine then gives me "error while receiving." The "upper > layer" java code MUST be right, because if I do the same thing under > linux (using the linux library), everything is alright. Now I have to > ask: Can somebody please help me out with this??!? Could it be the case > that some kind of flow control or COMMTIMEOUTS setting causes this > behaviour? I set flow control to RTS/CTS before sending out a fax. How > can I DISABLE flow control? Or what do you think? Can something else > cause this problems? Thank you all for your time and PLEASE write back > soon. > Hi Sven I'm not too willing to talk about flow control at the low level until I confirm some things with test equipment later. It is not clear if you are using rxtx or writing your own native code. So I'm not sure how to answer much of this :) If you are wondering how to change the flow control using rxtx from java, The BlackBox example from Sun flips this back and forth. SerialPort.java in rxtx 2.1 uses the following: SerialPort.java: public static final int FLOWCONTROL_NONE =0; SerialPort.java: public static final int FLOWCONTROL_RTSCTS_IN =1; SerialPort.java: public static final int FLOWCONTROL_RTSCTS_OUT =2; SerialPort.java: public static final int FLOWCONTROL_XONXOFF_IN =4; SerialPort.java: public static final int FLOWCONTROL_XONXOFF_OUT=8; So if you set flowcontrol to RTSCTS, you can set it to NONE to turn it off. If you are looking for how to do it in native code, the rxtx Source is SerialImp.c (unix/linux/mac os x/w32) and termios.c (w32 only with SerialImp.c) You can track the code: SerialImp.c:JNIEXPORT void JNICALL RXTXPort(setflowcontrol)( JNIEnv *env, jobject jobj, jint flowmode ) termios.c:int tcgetattr( int fd, struct termios *s_termios ) termios.c:int tcsetattr( int fd, int when, struct termios *s_termios ) There may be a problem in the rxtx flow control code though. Rather than guess, I want to test this with a gold standard. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Feb 6 00:00:16 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 00:00:16 -0700 (MST) Subject: [Rxtx] wiki delay until tomorrow night. In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: On Sun, 5 Feb 2006, Trent Jarvi wrote: > On Sun, 5 Feb 2006, Kim Lux wrote: > >> usb ? Tell me more... I need that too. > > usb is a very proper design. Thats all it is. > Maybe rxtx could help usb. But it would start with helping bring back the community that was already there. It's not something I'd love to do but maybe its the right thing to do. It would probably take 2 years to do right. But maybe thats better than what we have now. I honestly don't know what IBM is doing which could just run over everything. Just some thoughts after some fine german wine. -- Trent Jarvi tjarvi at qbang.org From gadelavega at yahoo.com.ar Mon Feb 6 02:17:05 2006 From: gadelavega at yahoo.com.ar (Gonzalo A. de la Vega) Date: Mon, 06 Feb 2006 10:17:05 +0100 Subject: [Rxtx] Serial port ownership question In-Reply-To: References: <20060205113618.30274.qmail@web53501.mail.yahoo.com> <1139157422.4553.9.camel@zd7280> <1139158698.4936.9.camel@zd7280> Message-ID: <43E71411.4050402@yahoo.com.ar> On my Fedora Core 4: ls -l /dev/ttyS* crw-rw---- 1 root uucp 4, 64 Feb 6 2006 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Feb 6 2006 /dev/ttyS1 ... and: grep "ttyUSB" /etc/udev/rules.d/50-udev.rules KERNEL=="ttyUSB*", GROUP="uucp", MODE="0660" So anyone in the "uucp" group can use serial ports. On Gentoo the group is "tty". Trent Jarvi escribi?: > > > On Sun, 5 Feb 2006, Dr. Douglas Lyon wrote: > >> I can confirm that this is the case (only root ownership of >> serial ports, under fedora 4). >> Wow, what were they thinking?! >> - DL >> >>> I've found that the newer kernels have the serial ports owned by root. >>> For example, >>> >>> $ls -al /dev/tty* >>> crw-rw-rw- 1 root root 5, 0 Feb 5 02:06 /dev/tty >>> crw-rw---- 1 root root 4, 0 Feb 5 02:06 /dev/tty0 >>> crw------- 1 root root 4, 1 Feb 5 09:07 /dev/tty1 >>> crw-rw---- 1 root tty 4, 10 Feb 5 02:06 /dev/tty10 >>> crw-rw---- 1 root tty 4, 11 Feb 5 02:06 /dev/tty11 >>> ... > > > This is just not a problem jcp or such are going to solve. Its a > platform spitwad fight. But do look at pam. In fact thats what Sun > is doing too. Maybe Linux followed their lead.. I'm not a pam guy. > I've spent 16 hours trying to understand it but your users wont :) > > Solution? I have no clue. Its two tangent mentalities from my > perspective. > > -- > Trent Jarvi > tjarvi at qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mtnvega at yahoo.com.br Mon Feb 6 05:35:43 2006 From: mtnvega at yahoo.com.br (Luiz Jr) Date: Mon, 6 Feb 2006 12:35:43 +0000 (GMT) Subject: [Rxtx] Documentation Wiki In-Reply-To: <1139157422.4553.9.camel@zd7280> Message-ID: <20060206123543.57256.qmail@web53515.mail.yahoo.com> Hello, Thank you for you answer, but so the usage of the API is pretty much like the Java Communications Api? If yes, what version of the Java Comm Api? Thank you, Luiz A. Brandao Jr Kim Lux escreveu: On Sun, 2006-02-05 at 08:36 -0300, Luiz Jr wrote: > Hello, > > I want to start using the RXTX libraries, but I would to know how, > since I can not access the documentation wiki page I just started using them yesterday. Below is how I installed the libraries, if that helps. I used snippets of code from the SimpleWrite application here to get me going. http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html Instead of "import javax.comm.*;", use "import gnu.io.*;" which is gotten from RXTXcomm.jar, which you will need to include in your project references. I am working in Eclipse. BTW: there is no way to open a port without going through the port list and finding it. Maybe sometime in the future someone (me ?) will write a method called openSerialPort that allows the user to give a port identifier, such as "/dev/tty1" and return a port ready to use. It wouldn't take much to write that and it would save users a lot of code. Hope this helps. ======================================================================= 1) Figure out which java you are running, incase there is more than one installed. $ java -version java version "1.5.0_05" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_05-b05) Java HotSpot(TM) Client VM (build 1.5.0_05-b05, mixed mode, sharing) 2) Find all the jre directories and the one from which you are currently running. kfind (jre) 3) cd to that directory plus /lib/i386 cd /usr/java/jre1.5.0_05/lib/i386 4) Copy the library files (*.so) to that directory. cp /home/krlux/Desktop/'Java Controls'/rxtx-linux/bin/* . 5) Check that the copy was successful ls librxtx* librxtxI2C.so librxtxRaw.so librxtxSerial.so librxtxParallel.so librxtxRS485.so 6) cd to the /lib/ext directory for your java. cd /usr/java/jre1.5.0_05/lib/ext 7) Copy the Jar files there cp /home/krlux/Desktop/'Java Controls'/rxtx-linux/lib/ext/* . 8) Check that it was successful ls RXTX* RXTXcomm.jar Rxtx is now installed on your machine ready to use. =================================================================== -- Kim Lux, Diesel Research Inc. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx --------------------------------- Yahoo! Acesso Gr?tis - Internet r?pida e gr?tis. Instale o discador agora! -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/544aa403/attachment-0005.html From lyon at docjava.com Mon Feb 6 05:49:34 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 06 Feb 2006 07:49:34 -0500 Subject: [Rxtx] wiki delay until tomorrow night. In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: Hi All, I have often thought about USB drivers being needed. For example, the ironman watch will not interface to a mac (windows only). It is USB. My dymo label writer has no Java driver (native only). Etc. Most cheap web cameras are USB (and Java drivers go through JAI, if it supports the camera at all). The JAI code shows how sun did the USB drivers. You have to be a member of the jai project to download the source code. https://jai.dev.java.net has the jai distro. And then you are not allowed to redistribute it. However, we can all learn from it (if so inclined). Basically: cvs -d :pserver:lyon at cvs.dev.java.net:/cvs login cvs -d :pserver:lyon at cvs.dev.java.net:/cvs checkout jai-core You will need to user your own uid and pw to get in. The ant build has over 100 warnings from sun deprecations of its own code. You might say that they were hoisted on their own Picard ;) One interesting thing is that they support several platforms: linux-amd64 64-bit Linux-AMD64 linux-i586 32-bit Linux-x86 solaris-amd64 64-bit Solaris-AMD64 solaris-i586 32-bit Solaris-x86 solaris-sparc 32-bit Solaris-SPARC solaris-sparcv9 64-bit Solaris-SPARC windows-i586 32-bit Windows-x86 Thus, ant is used to provide a multi-platform native method distro. Neat. How do they do it? check this out: And: The core download does not contain any C source code (it was all pre-built). Basically, they are just copying .so and .dll files into build directories. I would love to see the C code for this...but Sun does not post it on the https://jai.dev.java.net site. I don't know why...Perhaps I missed it. - Doug >On Sun, 5 Feb 2006, Trent Jarvi wrote: > >>On Sun, 5 Feb 2006, Kim Lux wrote: >> >>>usb ? Tell me more... I need that too. >> >>usb is a very proper design. Thats all it is. >> > >Maybe rxtx could help usb. But it would start with helping bring >back the community that was already there. > >It's not something I'd love to do but maybe its the right thing to do. > >It would probably take 2 years to do right. But maybe thats better >than what we have now. > >I honestly don't know what IBM is doing which could just run over everything. > >Just some thoughts after some fine german wine. > >-- >Trent Jarvi >tjarvi at qbang.org > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tdelenik at gmail.com Mon Feb 6 05:56:32 2006 From: tdelenik at gmail.com (Thanasis Delenikas) Date: Mon, 6 Feb 2006 14:56:32 +0200 Subject: Fwd: [Rxtx] Documentation Wiki In-Reply-To: <1139157422.4553.9.camel@zd7280> References: <20060205113618.30274.qmail@web53501.mail.yahoo.com> <1139157422.4553.9.camel@zd7280> Message-ID: <310a1a930602060456t129f1dc6p5f2b908f13ab5a0b@mail.gmail.com> Hello all, Kim, this is a snippet from the code I use. The closest to directly opening a specific port without enumeration. << ... portId = CommPortIdentifier.getPortIdentifier(getPort()); serialPort = (SerialPort) portId.open("jSMSEngine", 1971); ... >> where getPort() return the string identifier of the port, i.e. "/dev/ttyS0" or "COM1" or whatever. Thanasis. ---------- Forwarded message ---------- From: Kim Lux Date: Feb 5, 2006 6:37 PM Subject: Re: [Rxtx] Documentation Wiki To: RXTX Developers and Users BTW: there is no way to open a port without going through the port list and finding it. Maybe sometime in the future someone (me ?) will write a method called openSerialPort that allows the user to give a port identifier, such as "/dev/tty1" and return a port ready to use. It wouldn't take much to write that and it would save users a lot of code. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/182ab5b8/attachment-0005.html From tjarvi at qbang.org Mon Feb 6 11:53:57 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 11:53:57 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: On Mon, 6 Feb 2006, Dr. Douglas Lyon wrote: > Hi All, > I have often thought about USB drivers being needed. > For example, the ironman watch will not interface > to a mac (windows only). It is USB. > My dymo label writer has no Java driver (native only). > Etc. > Most cheap web cameras are USB (and Java drivers go > through JAI, if it supports the camera at all). > The JAI code shows how sun did the USB drivers. > You have to be a member of the jai project to download > the source code. > https://jai.dev.java.net has the jai distro. > And then you are not allowed to redistribute it. However, > we can all learn from it (if so inclined). Basically: > cvs -d :pserver:lyon at cvs.dev.java.net:/cvs login > cvs -d :pserver:lyon at cvs.dev.java.net:/cvs checkout jai-core > You will need to user your own uid and pw to get in. > The ant build has over 100 warnings from sun deprecations > of its own code. > > You might say that they were hoisted on their own Picard ;) > > One interesting thing is that they support several platforms: > linux-amd64 64-bit Linux-AMD64 > linux-i586 32-bit Linux-x86 > solaris-amd64 64-bit Solaris-AMD64 > solaris-i586 32-bit Solaris-x86 > solaris-sparc 32-bit Solaris-SPARC > solaris-sparcv9 64-bit Solaris-SPARC > windows-i586 32-bit Windows-x86 > Thus, ant is used to provide a multi-platform native method distro. > Neat. > How do they do it? > check this out: > > > > > > > > > > > > > And: > > > > > > > > > > The core download does not contain any C source code (it was all pre-built). > Basically, they are just copying .so and .dll files into build directories. > > I would love to see the C code for this...but Sun does not post it on the > https://jai.dev.java.net site. > > I don't know why...Perhaps I missed it. > > - Doug > > I've looked at moving rxtx to Ant builds. I think that would help IDEs a great deal. I requested a evalutation desk copy the O'Reilly Ant book for some j2ee material I was teaching. http://www.oreilly.com/catalog/anttdg/ It has a one sentence mention of JNI. So there was not luck there. I saw that there is another Ant book that does mention JNI more. I can't find it now. Ant must be able to support it with extensions. http://ant.apache.org/manual/OptionalTasks/javah.html What the auto(break :) tools do in the rxtx build is 4 things really. 1) gcc compile flags 2) ld compile flags 3) config.h 4) compile flags for customizing rxtx (lockfiles, ...) See 1 All of this information except 4 can be static once obtained. So I'm not attached to the auto tools. If I could find an example of Ant being used for JNI code, I'd be one of the first to start moving that direction. Maybe someone saw an example someplace. The other thing we have not completed discussing is the directory structure. There is interest in making rxtx more IDE friendly. I get more mail about that off the list than how to install rxtx. And I see we have Ken Thompson in da house :) He is our trusted CVS maintainer and the guy that purchased the rxtx.org domain. Old community. We will need Ken for changing the directory structure of source. I would like to open up discussion about both of these as it is more than time. The problem is I have little experience with Ant and even less with IDEs. It would be nice if we could work with Eclipse and NetBeans. http://www.netbeans.org/ (sun and some community) http://www.eclipes.org (ibm,rhat,... perhaps more community) http://maven.apache.org/what-is-maven.html (apache. It is community) borland should sortof be here too but I think thats covered in eclipse. >From what I understand so far, we should morph rxtx to support those three maybe trusting apaches lead with maven. But I use vi. I have little to no clues beyond what people have fed me. Can we agree that thats the right direction to go? -- Trent Jarvi tjarvi at qbang.org From brian at mbari.org Mon Feb 6 14:57:50 2006 From: brian at mbari.org (Brian Schlining) Date: Mon, 6 Feb 2006 13:57:50 -0800 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> > The other thing we have not completed discussing is the directory > structure. There is interest in making rxtx more IDE friendly. I > get more mail about that off the list than how to install rxtx. > > And I see we have Ken Thompson in da house :) He is our trusted > CVS maintainer and the guy that purchased the rxtx.org domain. Old > community. We will need Ken for changing the directory structure of > source. > > I would like to open up discussion about both of these as it is > more than time. The problem is I have little experience with Ant > and even less with IDEs. It would be nice if we could work with > Eclipse and NetBeans. > > http://www.netbeans.org/ (sun and some community) > http://www.eclipes.org (ibm,rhat,... perhaps more community) > http://maven.apache.org/what-is-maven.html (apache. It is community) > borland should sortof be here too but I think thats covered in > eclipse. > >> From what I understand so far, we should morph rxtx to support >> those three > maybe trusting apaches lead with maven. But I use vi. I have > little to no clues beyond what people have fed me. > Maven likes the directory structure below for Java code. (From http:// maven.apache.org/guides/getting-started/index.html) This structure works fine with ant, netbeans, and eclipse. rxtx_root_directory `-- src |-- main | `-- java | `-- gnu | `-- io `-- test `-- java `-- gnu `-- io Brian Schlining Software Engineer http://www.mbari.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/d9451eba/attachment-0005.html From tjarvi at qbang.org Mon Feb 6 15:11:45 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 15:11:45 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: > rxtx_root_directory > `-- src > |-- main > | `-- java > | `-- gnu > | `-- io > `-- test > `-- java > `-- gnu > `-- io > >From what I understand this will just be good. For me it makes no difference. So lets do the rxtx thing. Let if fester for two weeks and if nobody objects, we will do it. I'm not doing this because I care. I'm doing this to eliminate much of my inbox. But test... man is rxtx lacking there in the community aspect. It is covered but not right. _maybe_ I can change that this year. -- Trent Jarvi tjarvi at qbang.org (cat hurding since 1997) From lux at diesel-research.com Mon Feb 6 21:38:49 2006 From: lux at diesel-research.com (Kim Lux) Date: Mon, 06 Feb 2006 21:38:49 -0700 Subject: [Rxtx] How can I use Lock Files with rxtx (in FC4) ? Message-ID: <1139287129.17031.3.camel@zd7280> I am now running an rxtx application on FC4. I am getting: ========================================================= check_group_uucp(): error testing lock file creation Error details: Permission denied check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL ========================================================= $ ls -al /var/lock total 32 drwxrwxr-x 4 root lock 4096 Feb 6 16:04 . drwxr-xr-x 24 root root 4096 Nov 14 01:19 .. drwx------ 2 root root 4096 Apr 27 2005 lvm drwxr-xr-x 2 root root 4096 Feb 6 16:04 subsys How do I fix this for regulator users ? -- Kim Lux, Diesel Research Inc. From dmarkman at mac.com Mon Feb 6 22:24:44 2006 From: dmarkman at mac.com (Dmitry Markman) Date: Tue, 7 Feb 2006 00:24:44 -0500 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: if I understands the issue right in order to be able to use ant for c/c++ compilation you have to install ant's cc task http://ant-contrib.sourceforge.net/cc.html it looks like it should work on mac os x (authors claim, that it's platform independent) but I never tested so all you have to do it's providing right command line for the gcc compiler On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: >> rxtx_root_directory >> `-- src >> |-- main >> | `-- java >> | `-- gnu >> | `-- io >> `-- test >> `-- java >> `-- gnu >> `-- io >> > > >> From what I understand this will just be good. > > For me it makes no difference. So lets do the rxtx thing. Let if > fester for two weeks and if nobody objects, we will do it. > > I'm not doing this because I care. I'm doing this to eliminate > much of my inbox. > > But test... man is rxtx lacking there in the community aspect. It > is covered but not right. _maybe_ I can change that this year. > > -- > Trent Jarvi > tjarvi at qbang.org > (cat hurding since 1997) > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx Dmitry Markman From lux at diesel-research.com Mon Feb 6 23:20:15 2006 From: lux at diesel-research.com (Kim Lux) Date: Mon, 06 Feb 2006 23:20:15 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? Message-ID: <1139293215.3689.4.camel@zd7280> I'm running the code below. portlist.hasMoreElements() is false. /dev has ports in it as listed below. What am I doing wrong ? ========================================================== // Step through the list of ports until we find one that matches // the one we are looking for. portList = CommPortIdentifier.getPortIdentifiers(); while(portList.hasMoreElements()) { portID = (CommPortIdentifier) portList.nextElement(); // if (portID.getName().equals("/dev/ttyUSB0")) { myTA.append("Serial port ttyUSB0 has been found\n"); break; }// if portID equals... }// End of while... ========================================================== ls -al /dev/tty* crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 ... crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 -- Kim Lux, Diesel Research Inc. From david.garnier at trusted-logic.com Tue Feb 7 00:46:30 2006 From: david.garnier at trusted-logic.com (David Garnier) Date: Tue, 07 Feb 2006 08:46:30 +0100 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: <43E85056.2090608@trusted-logic.com> Hello, I think that the make-based build process is fine as it is, apart from the location of the Java source files. It is true that putting the Java source in a directory structure that map 1-to-1 to the Java package structure is the norm and should make it easier for everyone to modify the Java source, with or without an IDE. Ant is a good tool, but in the RXTX case I fail to see the advantage of using it compared to the current make-based process. As Trent said, they are more pressing issues, like testing. Regards, David Dmitry Markman wrote: > if I understands the issue right > in order to be able to use ant for c/c++ compilation > you have to install ant's cc task > http://ant-contrib.sourceforge.net/cc.html > > it looks like it should work on mac os x > (authors claim, that it's platform independent) > but I never tested > > so all you have to do it's providing right command line > for the gcc compiler > > > > > On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: > >>> rxtx_root_directory >>> `-- src >>> |-- main >>> | `-- java >>> | `-- gnu >>> | `-- io >>> `-- test >>> `-- java >>> `-- gnu >>> `-- io >>> >> >> >>> From what I understand this will just be good. >> >> For me it makes no difference. So lets do the rxtx thing. Let if >> fester for two weeks and if nobody objects, we will do it. >> >> I'm not doing this because I care. I'm doing this to eliminate much >> of my inbox. >> >> But test... man is rxtx lacking there in the community aspect. It is >> covered but not right. _maybe_ I can change that this year. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> (cat hurding since 1997) From tjarvi at qbang.org Tue Feb 7 01:11:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 01:11:31 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <43E85056.2090608@trusted-logic.com> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: On Tue, 7 Feb 2006, David Garnier wrote: > Hello, > > I think that the make-based build process is fine as it is, apart from the location of the Java > source files. It is true that putting the Java source in a directory structure that map 1-to-1 to > the Java package structure is the norm and should make it easier for everyone to modify the Java > source, with or without an IDE. > > Ant is a good tool, but in the RXTX case I fail to see the advantage of using it compared to the > current make-based process. As Trent said, they are more pressing issues, like testing. > Hi David I have more experience with testing rxtx than I can talk about. But let it be known, rxtx has gone trough 100's of hours of testing. We are hobby folks interested in toys but there is more. rxtx has had some of the best guidance in the industry there. This is not an easy thing. I may be able to come back in a month from the other side of the corperate fence and help. I suspect the tests could just be made public but they are in a very unusual environment that just wont work in a wider sense. This is something I'll be trying to change. At one point it was agreed we could just make the results public so this isnt just noise.. There is interest and I think its safe to mention that much. The big problem with testing in the past is most of it is done with a loopback connection. So we *still* have major questions regarding things like flow control. rxtx talks to itself over a loopback and it works. regardless of right or wrong. This requires more thought to be done right. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Feb 7 02:46:34 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 02:46:34 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: > The big problem with testing in the past is most of it is done with a > loopback connection. So we *still* have major questions regarding things > like flow control. rxtx talks to itself over a loopback and it works. > regardless of right or wrong. With serial communication there are gold standards. ckermit is probably a definitive 'standard.' Maybe its possible to do ping/pong tests with ckermit? Is it scriptable? There are known issues in rxtx. Probably the worst is some threading issues regarding some JREs with multiple JNI threads setting java variables. Man did I get schooled there. Just switch the c functions to returning variables and things go away. Sometimes they work fine, sometimes they blow up. Without understanding everything, somehow rhat got it right and debian (and especially gentoo) grabbed kernel patches causing all sort of harm. Its not hard to fix once you understand whats going on but nearly impossible to track with a debugger. So I have a good idea what 2.1-8 will have outside of the IDE modifications. rxtx 2.1-7 is a release for everyone to sync with. Its not even as stable as -pre17 as far as I know - I ran no test suites. I'll be chasing it too. We just had so many contributions that it was time. It seriously broke internal scheduals but thats a great thing :) The other thing I want to do in 2.1-8 is automagic baud rates. It turns out lots of shops are doing really funky baud rates for things like automobile test equipment. It is possible but it requires a fair amount of change in the native code. Is anyone looking at this? -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Feb 7 02:57:21 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 07 Feb 2006 04:57:21 -0500 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <43E85056.2090608@trusted-logic.com> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: Hi All, I agree, testing is very important. The problem I have been trying to address is related to cross-platform testing and the robust nature of the installs. Typically, I visit 3 platforms to deploy my product, windows, linux and mac. A build is performed on each platform. The idea that you can build for many platforms from one copy the source code seems attractive. This should enable synchronized deployments of identical code. The question of how to achieve this goal remains open. As Trent mentioned, this is hard. Perhaps Ant will help here (but perhaps not). Ant does seem to help with running unit tests. However, it does not help with multi-platform tests. For that you need many machines and different operating environments. Toward that end, I have created a multi-platform test that can be run from web start, located at: http://show.docjava.com:8086/book/cgij/code/jnlp/serialPort.PortTest.jnlp This is interesting because many people in the community can run the test and we can improve the test, as time permits. No, it is not a perfect solution, however, the idea does help with multi-platform tests using many machines and different operating environments. If the group has a good test for a general serial port set-ups, i would be happy to deploy it, for general evaluation using web start. And as for ANT, it is just an idea. Not all my ideas are good ones! - Doug >Hello, > >I think that the make-based build process is fine as it is, apart >from the location of the Java >source files. It is true that putting the Java source in a directory >structure that map 1-to-1 to >the Java package structure is the norm and should make it easier for >everyone to modify the Java >source, with or without an IDE. > >Ant is a good tool, but in the RXTX case I fail to see the advantage >of using it compared to the >current make-based process. As Trent said, they are more pressing >issues, like testing. > >Regards, >David > >Dmitry Markman wrote: >> if I understands the issue right >> in order to be able to use ant for c/c++ compilation >> you have to install ant's cc task >> http://ant-contrib.sourceforge.net/cc.html >> >> it looks like it should work on mac os x >> (authors claim, that it's platform independent) >> but I never tested >> >> so all you have to do it's providing right command line >> for the gcc compiler >> >> >> >> >> On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: >> >>>> rxtx_root_directory >>>> `-- src >>>> |-- main >>>> | `-- java >>>> | `-- gnu >>>> | `-- io >>>> `-- test >>>> `-- java >>>> `-- gnu >>>> `-- io >>>> >>> >>> >>>> From what I understand this will just be good. >>> >>> For me it makes no difference. So lets do the rxtx thing. Let if >>> fester for two weeks and if nobody objects, we will do it. >>> >>> I'm not doing this because I care. I'm doing this to eliminate much >>> of my inbox. >>> >>> But test... man is rxtx lacking there in the community aspect. It is >>> covered but not right. _maybe_ I can change that this year. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> (cat hurding since 1997) > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From matt.higgins at gmail.com Tue Feb 7 08:28:34 2006 From: matt.higgins at gmail.com (Matt Higgins) Date: Tue, 7 Feb 2006 10:28:34 -0500 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final Message-ID: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? import java.io.*; import java.util.*; import gnu.io.*; public class MySimpleRead implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; public static void main(String[] args) { boolean portFound = false; String defaultPort = "COM1"; if (args.length > 0) { defaultPort = args[0]; } portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; MySimpleRead reader = new MySimpleRead(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } } public MySimpleRead() { try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) { e.printStackTrace(); } try { inputStream = serialPort.getInputStream(); } catch (IOException e) { e.printStackTrace(); } try { serialPort.addEventListener(this); } catch (TooManyListenersException e) { e.printStackTrace(); } try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { e.printStackTrace(); } System.out.println("Baud is " + serialPort.getBaudRate()); System.out.println("Bits is " + serialPort.getDataBits()); System.out.println("Stop is " + serialPort.getStopBits()); System.out.println("Par is " + serialPort.getParity()); serialPort.notifyOnDataAvailable(true); readThread = new Thread(this); readThread.start(); } public void run() { // Thread.sleep(20000); //} catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { System.out.println("An event occurred " + event.getEventType()); switch (event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: byte[] readBuffer = new byte[20]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } System.out.print(new String(readBuffer)); } catch (IOException e) {} break; } } } --------------- Result on windows ------------------------------ Stable Library ============================================================== Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port:: COM1 Baud is 9600 Bits is 8 Stop is 1 Par is 0 ----------------- End Results ----------------------------------------- ------------------ Result on Linux ----------------------------------- Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 Found port: /dev/ttyS0 Baud is 9600 Bits is 8 Stop is 1 Par is 0 An event occurred 1 043100066224 ------------------ End Results --------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/a1431630/attachment-0005.html From brian at mbari.org Tue Feb 7 09:48:37 2006 From: brian at mbari.org (Brian Schlining) Date: Tue, 7 Feb 2006 08:48:37 -0800 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> Message-ID: <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> Hi Matt > The following code works fine on Linux but I never see any data > when run on Windows. This is a cut and paste from the SimpleRead > example. > I am attempting to read data from a bar code scanner. I can fire > up HyperTermianl on windows and see that the device is working > properly as I see the barcodes are scanned and echoed back to the > terminal. However when I run the app I don't see any data. It is > however associating with the com port as the informational bits > print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. Cheers Brian Schlining Software Engineer http://www.mbari.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/16d07f37/attachment-0005.html From lux at diesel-research.com Tue Feb 7 11:59:58 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 11:59:58 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139293215.3689.4.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> Message-ID: <1139338798.8145.4.camel@zd7280> Any ideas on this ? Any reason why portList.hasMoreElements() should be false even though there are devices in /dev ? On Mon, 2006-02-06 at 23:20 -0700, Kim Lux wrote: > I'm running the code below. > > portlist.hasMoreElements() is false. > > /dev has ports in it as listed below. > > What am I doing wrong ? > > > ========================================================== > // Step through the list of ports until we find one that matches > // the one we are looking for. > > portList = CommPortIdentifier.getPortIdentifiers(); > > while(portList.hasMoreElements()) > { > portID = (CommPortIdentifier) portList.nextElement(); // > if (portID.getName().equals("/dev/ttyUSB0")) > { > myTA.append("Serial port ttyUSB0 has been found\n"); > break; > }// if portID equals... > }// End of while... > ========================================================== > > ls -al /dev/tty* > crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty > crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 > crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 > crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 > crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 > ... > crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 > crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 > crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 > > > -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 12:20:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 12:20:25 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139338798.8145.4.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> Message-ID: On Tue, 7 Feb 2006, Kim Lux wrote: > > Any ideas on this ? Any reason why portList.hasMoreElements() should be > false even though there are devices in /dev ? > > > On Mon, 2006-02-06 at 23:20 -0700, Kim Lux wrote: >> I'm running the code below. >> >> portlist.hasMoreElements() is false. >> >> /dev has ports in it as listed below. >> >> What am I doing wrong ? >> >> >> ========================================================== >> // Step through the list of ports until we find one that matches >> // the one we are looking for. >> >> portList = CommPortIdentifier.getPortIdentifiers(); >> >> while(portList.hasMoreElements()) >> { >> portID = (CommPortIdentifier) portList.nextElement(); // >> if (portID.getName().equals("/dev/ttyUSB0")) >> { >> myTA.append("Serial port ttyUSB0 has been found\n"); >> break; >> }// if portID equals... >> }// End of while... >> ========================================================== >> >> ls -al /dev/tty* >> crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty >> crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 >> crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 >> crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 >> crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 >> ... >> crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 >> crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 >> crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 >> >> >> > Hi Kim What rxtx does is try to open the port and do a timed out read. If the kernel/... do not complain it's enumarted. I suspect you could do a crude test by doing something like cat /dev/ttyS0 > /dev/null If that barfs then rxtx wont enumerate the port. hmm looking at your question again, I suspect it's a lockfile problem. This is documented in INSTALL with the source. Its easy enough to test this too.. touch /var/lock/testingrxtxlockfiles && rm -f /var/lock/testingrxtxlockfiles If you are not in the right group it will bail. Root will work regardless. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 12:37:56 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 12:37:56 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> Message-ID: <1139341076.8145.11.camel@zd7280> Exactly which ports does rxtx attempt to put into the list ? /dev/* or /dev/tty* or /dev/tty[0-9[0-9] ? or /dev/ttyS* ? For the record, only /dev/ttyUSB0 is a valid port on the machine I am presently on. Will this be a problem ? On Tue, 2006-02-07 at 12:20 -0700, Trent Jarvi wrote: > This is documented in INSTALL with the source. > I was wondering where that file was. I will download source and dig it up. Thanks. -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 12:51:09 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 12:51:09 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139341076.8145.11.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: On Tue, 7 Feb 2006, Kim Lux wrote: > > Exactly which ports does rxtx attempt to put into the list ? /dev/* > or /dev/tty* or /dev/tty[0-9[0-9] ? or /dev/ttyS* ? > > For the record, only /dev/ttyUSB0 is a valid port on the machine I am > presently on. Will this be a problem ? > > > On Tue, 2006-02-07 at 12:20 -0700, Trent Jarvi wrote: >> This is documented in INSTALL with the source. >> > I was wondering where that file was. I will download source and dig it > up. > > Thanks. > Hmm I'm looking at pre17 so this may have changed. (its just what I have on this machine) if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA" // for the IPAQs }; CandidatePortPrefixes=Temp; } So you may need to add "ttyUSB" to that list. RXTX used to enumerate _everything_ see if(osName.equals("Linux-all-ports") But it became less than practical. This is all in RXTXCommDriver.java hmm I just did a cvs update. if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have to get your fingers into the code. We aim for sane defaults. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 13:06:45 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 13:06:45 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139342805.8145.22.camel@zd7280> On Tue, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > Hmm I'm looking at pre17 so this may have changed. (its just what I have > on this machine) > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA" // for the IPAQs > }; > CandidatePortPrefixes=Temp; > } > > > So you may need to add "ttyUSB" to that list. RXTX used to enumerate > _everything_ see if(osName.equals("Linux-all-ports") But it became less > than practical. > > This is all in RXTXCommDriver.java > > hmm I just did a cvs update. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have > to get your fingers into the code. We aim for sane defaults. Excellent. Thanks for taking the time. -- Kim Lux, Diesel Research Inc. From ideiglenes1 at freemail.hu Tue Feb 7 13:53:39 2006 From: ideiglenes1 at freemail.hu (--) Date: Tue, 07 Feb 2006 21:53:39 +0100 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139345619.22534.2.camel@localhost> Hi! I use this code to get all the extra Linux devices. :) if ("Linux".equals(System.getProperty("os.name"))) { System.setProperty("os.name","Linux-all-ports"); } driver = new RXTXCommDriver(); On k, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > On Tue, 7 Feb 2006, Kim Lux wrote: > > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have > to get your fingers into the code. We aim for sane defaults. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From matt.higgins at gmail.com Tue Feb 7 13:45:54 2006 From: matt.higgins at gmail.com (Matt Higgins) Date: Tue, 7 Feb 2006 15:45:54 -0500 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> Message-ID: <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> Sweet this is exactly what I needed. I was searching the archives through marc.theamisgroup they only have archives back to 1/3/05. Should have hit the mailman archive! Thanks a lot! On 2/7/06, Brian Schlining wrote: > > Hi Matt > > The following code works fine on Linux but I never see any data when run > on Windows. This is a cut and paste from the SimpleRead example. > I am attempting to read data from a bar code scanner. I can fire up > HyperTermianl on windows and see that the device is working properly as I > see the barcodes are scanned and echoed back to the terminal. However when I > run the app I don't see any data. It is however associating with the com > port as the informational bits print fine? > > > You're not the only one whose had this problem, I don't know if Trent has > addressed this is the latest release of RXTX but there is a workaround. > Here's the recent thread from the RXTX mailing list regarding this issues: > > Thanasis Delenikas tdelenik at gmail.com > Wed Jan 18 13:56:23 MST 2006 > > * Previous message: [Rxtx] Re: More close() performance fixes > * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] > > Hi all. > (I've subscribed again from my other email account). > > Trent, > > You are right. Linux *always* works, no matter what flow control you set. > Windows *works only* with hardware flow control (I haven't tested what > happens with software XON/XOFF flow control). > > I assume (but I am not certain) that even with no flow control at all, all > platforms should work. Without flow control, you have the risk of bumping > into overflow or framing errors, but that's your (the end programmer, I > mean) problem. > > >From my side, I shouldn't be working without flow control. That was a bug > too... It was some code forgotten from the old times, when I used to work > with phone emulation drivers which didn't support flow control. The > correct > way is to have some flow control enabled and that's why I suppose this is > a > low-severity bug for RxTx. > > I have no idea which platform shows the correct behaviour, since > my knowledge about Linux and the inner workings of these low-level i/o > operations is limited. > > Regards, > Thanasis Delenikas. > > > > > Message: 2 > > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > > From: Trent Jarvi > > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > > To: RXTX Developers and Users > > Message-ID: > > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > > > Hi all, > > > > > > Trent, I have found something. > > > I read your comment about flow control, so I experimented a bit. > > > > > > If you remember, in my sample program I've used no flow control at all > ( > > i.e. > > > Java constant FLOWCONTROL_NONE). > > > > > > Now, during testing, I've switch to hardware inbound flow control (i.e > . > > Java > > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > > beautifully! > > > > > > I think I will switch to H/W flow control and test things for a while, > > but > > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > > > > > Hi Thanasis, > > > > I'm fairly sure you have identified a bug. I would not worry too much > > about what Sun CommAPI w32 defaults are. I think they did more or less > > whatever the port opened with. Just a guess. Linux tries to stomp on > > ports so they are all the same. > > > > So this started out with Linux worked, Windows XP/.. did not as I > recall. > > Something is wrong in rxtx. Do I understand this right? > > > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > > > Perhaps there is something Wayne or I did not understand when we wrote > > that code. I wasnt programming back in the BBS days so modems are not > my > > thing. I have a few questions. > > > > Is the above matrix confirmed by observation? > > Linux just always worked? > > Which one _should_ work? I'm guessing modems work with hardware flow > > control. I'll have to dig around. > > > > The windows flow control changes a couple things with hardware flow > > control. Following the w32 API documentation is confusing sometimes. > > But it looks like Linux could have a bug too. > > Cheers > > Brian Schlining > Software Engineer > http://www.mbari.org > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/9c989144/attachment-0005.html From tjarvi at qbang.org Tue Feb 7 14:06:14 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 14:06:14 -0700 (MST) Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> Message-ID: >> >> You're not the only one whose had this problem, I don't know if Trent has >> addressed this is the latest release of RXTX but there is a workaround. >> Here's the recent thread from the RXTX mailing list regarding this issues: >> I have not. I expect to have access to some test equipment next month and I'll go through all of this. I really don't know whats going on and I need a gold standard. I thought maybe linux was autodetecting the flow control. Your observations would certainly be welcome. I need to talk to Russell King and see what he is doing. Until then I'd just be toying around over a loopback as usual. This is very high on the list though. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 17:25:05 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 17:25:05 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139358305.17994.2.camel@zd7280> My application now works. I installed the libraries and jar from 2.1-7 (Final). portlist.hasMoreElements is no longer false. The application finds the port for /dev/ttyUSB0. Thanks for your help, Trent (et al) Sorry I bothered you with this. Next time I will look in the source first. I didn't think it was an rxtx issue, I thought it was a Linux setup issue . On Tue, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > Hmm I'm looking at pre17 so this may have changed. (its just what I > have > on this machine) > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux > Serial Ports > "ttySA" // for the > IPAQs > }; > > CandidatePortPrefixes=Temp; > } > > > So you may need to add "ttyUSB" to that list. RXTX used to enumerate > _everything_ see if(osName.equals("Linux-all-ports") But it became > less > than practical. > > This is all in RXTXCommDriver.java > > hmm I just did a cvs update. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux > Serial Ports > "ttySA", // for the > IPAQs > "ttyUSB" // for USB > frobs > }; > > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you > have > to get your fingers into the code. We aim for sane defaults. -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 19:21:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 19:21:54 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139358305.17994.2.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> <1139358305.17994.2.camel@zd7280> Message-ID: >Sorry I bothered you with this. Next time I will look in the source >first. I didn't think it was an rxtx issue, I thought it was a Linux >setup issue . Why would you be sorry? I would have done the same. I'm glad it's working :) -- Trent Jarvi tjarvi at qbang.org From tma at mail.island.net Wed Feb 8 13:39:35 2006 From: tma at mail.island.net (Tom Alldread) Date: Wed, 08 Feb 2006 12:39:35 -0800 Subject: [Rxtx] Win32/Linux Serial Port Data Dropouts In-Reply-To: <200602060702.k167255O007882@www.qbang.org> References: <200602060702.k167255O007882@www.qbang.org> Message-ID: <43EA5707.4020200@mail.island.net> Greetings Folks at RXTX: During the last couple of months I have been alternately testing with javax.comm 2 and RXTX 2.1 under Windows XP and CommApi 3 and RXTX 2.1 under Suse 10.0 Linux. In the process I have learned a little about java multi-threading under NetBeans 5 with Profiler. My java (jdk 1.5_06) application is used for data acquisition and provides a graphical display of A-D conversion data received from a 56KBaud serial port. The actual data throughput is about 10KBaud thus it is well below the speed of the port. I use hardware RTS/CTS flow control which can stall the data acquisition sample rate if necessary. This ensures the display computer has the ability to slow the data acquisition rate should it become too busy to accept the regular data flow. Both the serial port buffer and the java read buffer are set at 16KB. Usually the data transfers into the java read buffer are less than 100 bytes unless the data acquisition is recovering from a stall. The data flow normally hesitates after each 5 KB block as a continue command is needed from the display computer to start the drawing of a new graphics display line. Separate threads have been provided for the serial port event monitoring and data processing. The serial port event thread has been given the maximum priority and data processing thread the minimum priority provided by java. Thread yield statements have been placed within all data processing while/for loops as an effort to ensure quick access to CPU cycles for the serial port event thread. I have found that short data transmissions are essentially error free but occasional dropouts occur with continuous data flow especially under Windows XP. ....................................................................................................................................................................................... Linux results: I am happy to report that RXTX 2.1 appears to work very well under Linux although I did notice some errors when the screen savers were running with my dual monitors. I believe this is a local problem associated with my dual graphics which needs further attention. The recent CommApi 3 Linux release from Sun did not work at all with my program. It seemed to send commands out OK but did not receive any data. Although the serial port event triggered the ISR, the input stream appeared filled with nulls and thus did not contain any data. As my understanding is that CommApi 3 was tested with a Red Hat distribution of Linux I wonder if this problem is distro dependent? Although somewhat off topic here I wonder if anyone reading this has had similar experience? .................................................................................................................................................................................. Windows XP results: There are problems with occasional data dropouts which become more frequent as the sampling rate is increased or if the computer becomes busy with other duties. The dropouts typically consist of a half dozen byte block of lost data. It appears the lost bytes never get added to the java input stream. There has not been any indication of garbled data, overruns or framing errors which suggests the UART communications remains solid. Using javax.comm 2 I found that the setting of SerialPort 'enableReceiveThreshold' to 40 and 'enableReceiveTimeout' of 100mS reduced the dropouts error rate significantly. I found that I could not get RXTX 2.1 to function with the aforementioned threshold and timeout settings. The javax.comm 2 interface is consequently performing better for me under Windows than RXTX 2.1. I wonder if anyone here has any suggestions as to what I might try to improve RXTX 2.1? Although my settings are the same as under Suse 10.0, RXTX 2.1 performs much better for me under Linux than any of the alternatives that I have tried under Windows XP . ............................................................................................................................................................................... I would like to establish, based on the experience of others, if I have reached the normally expected performance limit of java serial port communications? Should I expect to achieve virtually error free serial port data input from a continuous stream under Windows XP java software? I am considering changing my protocol to packets with error checking if necessary but would like to know if the dropout problems I am experiencing are typical or not before I take this rather work intensive plunge. Many thanks in advance for any help! Best Regards, Tom Alldread -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.375 / Virus Database: 267.15.2/253 - Release Date: 2006-02-07 From jlaxson at mac.com Wed Feb 8 23:56:48 2006 From: jlaxson at mac.com (John Laxson) Date: Thu, 9 Feb 2006 00:56:48 -0600 Subject: [Rxtx] PortInUseException: Unknown Application on OSX Message-ID: Hi, I've been trying to get RXTX 2.1.7 going on Mac OS X for a while here, and am running up into a wall here. I've tried with pre- compiled and the source version and get the same problem, a gnu.io.PortInUseException: Unknown Application. I have run the fixperms script included with the source distribution, and id shows me as a member of the uucp group, and permissions on /var/spool/uucp are 775 root:uucp. Running a test program (included at the bottom for clarity) lets me enumerate all the serial ports correctly, but trying to open any of them gives the PortInUseException. If it helps, when I try to open a port that's set to make an outgoing bluetooth connection, there is no delay and no connection attempt at all. Thanks, John Laxson PS: The documentation wiki on qbang.org shows 404, and has for a few days now. My test code: public static void main(String[] args) { SerialPort serialPort; try { Enumeration e = CommPortIdentifier.getPortIdentifiers(); CommPortIdentifier ident; while (e.hasMoreElements()) { ident = (CommPortIdentifier)e.nextElement(); System.out.println(ident.getName()); } ident = CommPortIdentifier.getPortIdentifier("/dev/cu.modem"); serialPort = (SerialPort) ident.open("Me", 5000); } catch (Exception e) { e.printStackTrace(); } } From rajesh.invincible at gmail.com Thu Feb 9 03:39:38 2006 From: rajesh.invincible at gmail.com (Rajesh N) Date: Thu, 9 Feb 2006 16:09:38 +0530 Subject: [Rxtx] Re: Move .java Files in gnu.io filesystem hierarchy - Maven (2) In-Reply-To: <43DF21D2.7090200@ngi.it> References: <43DF21D2.7090200@ngi.it> Message-ID: <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Can anybody tell me how to overcome these EXCEPTIONS I AM WORKING ON SERIAL COMMN IN JAVA ON LINUX. 1. " NOT ALL PARAMETERS SUPPORTED BY THE KERNEL" This i came across the following statement inmy prog. SerialP is A SerialPort object SerialP.setSerialPortParams(9600(BAUDRATE),DATABITS_8,STOPBITS_1,PARITY_NONE) 2. NullPointer Exception at Event Dispatch Now i have checked all my object references for a null reference but i found none i have put up my entire code in try catch blocks but still I AM UNABLE TO CATCH THIS EXCEPTION AND HENCE MY APPLICATION CLOSES HOW DOES THESE GO? PLEASE HELP ME IT IS URGENTTTTTTTTTTTTTTTT yours sincerely RAJESH On 1/31/06, Fabio Frumento wrote: > Hi Xavier, > > I don't know maven at all but the directory hierarchy listed buy Trent > is fine for me... > > I'll take a look to maven, it seems an interesting project > > Regards > > Fabio Frumento > > Trent Jarvi wrote: > > On Tue, 31 Jan 2006, Xavier Frisaye wrote: > > > >> Hi all, > >> > >> If you are going to rearrange the src folder, i will propose to use > >> maven 2 and follow its directory structure > >> > (http://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html). > >> > >> Maven 2 simplify java project and give a standard way to make projects > >> (http://maven.apache.org/). > >> We are using it for internal projects and we are very satisfied. > >> > >> Is anybody interested? > >> > >> I'm not an expert in maven 2 (yet) but i'm agree to help using it if > >> you choose to make so. > >> > > > > so this would be: > > > > rxtx-devel/src/main/java/gnu.io > > rxtx-devel/src/test/java/ManIwish.java > > > > I don't use IDEs very much so I'll let others comment. But I don't see > > a problem with that. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Thu Feb 9 09:50:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 9 Feb 2006 09:50:31 -0700 (MST) Subject: [Rxtx] Re: Move .java Files in gnu.io filesystem hierarchy - Maven (2) In-Reply-To: <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Message-ID: On Thu, 9 Feb 2006, Rajesh N wrote: > Can anybody tell me how to overcome these EXCEPTIONS > I AM WORKING ON SERIAL COMMN IN JAVA ON LINUX. > > 1. " NOT ALL PARAMETERS SUPPORTED BY THE KERNEL" > > This i came across the following statement inmy prog. > SerialP is A SerialPort object > SerialP.setSerialPortParams(9600(BAUDRATE),DATABITS_8,STOPBITS_1,PARITY_NONE) > Strange. The parameters you use are the same the port should open with by default. Could you paste the actual exception you are getting? I don't see that in the rxtx source. Also it would help to know the rxtx version. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Fri Feb 10 15:29:05 2006 From: lux at diesel-research.com (Kim Lux) Date: Fri, 10 Feb 2006 15:29:05 -0700 Subject: [Rxtx] One serial port object for both sending and receiving ? Message-ID: <1139610545.18177.4.camel@zd7280> Is it OK to use one SerialPort ojbect (ex Serial Port serialPort;) and use it for both sending and receiving ? For example: ======================================================================== static SerialPort serialPort = null; static OutputStream serialOut = null; static InputStream serialIn = null; // assign it to an outputStream for use try{ serialOut = serialPort.getOutputStream(); System.out.println("Serial output stream has been assigned."); }//try catch(IOException e) { System.out.println("Error: Couldn't assign output stream to serial port."); }//catch //assign it to an inputStream for use try{ serialIn = serialPort.getInputStream(); System.out.println("Serial input stream has been assigned."); }//try catch(IOException e) { System.out.println("Error: Couldn't assign input stream to serial port."); }//catch ======================================================================== -- Kim Lux, Diesel Research Inc. From lux at diesel-research.com Fri Feb 10 21:23:00 2006 From: lux at diesel-research.com (Kim Lux) Date: Fri, 10 Feb 2006 21:23:00 -0700 Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Message-ID: <1139631780.23882.10.camel@zd7280> I've got a problem receiving chars with my version of serialRead, written in an SWT GUI. I had a Java pro have a good look at my code and he can't see anything wrong with it. I can send chars fine. When I receive a char the cpu usage for the app goes to 100% and the code in the serial event handler doesn't get executed. The instructions on the Java Comm Serial API How-To for Linux page state that I must install javacomm. Is that true ? Everything builds without it and I can send chars on rxtx just fine, but I can't receive them. Could this be the problem ? I downloaded and installed javacomm. I was not able to add "Driver=gnuio.RXTXCommDriver to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 installed in /usr/java/jre1.5.0_05. I added comm.jar to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext to the library paths. Is this OK ? Does it matter that I am receiving on /dev/ttyUSB0 ? Thanks. -- Kim Lux, Diesel Research Inc. From lunareclipse03 at web.de Sat Feb 11 09:44:46 2006 From: lunareclipse03 at web.de (lunareclipse03@web.de) Date: Sat, 11 Feb 2006 17:44:46 +0100 Subject: [Rxtx] Question about Serial I/O under Win32 Message-ID: <662084330@web.de> Hello everybody, I have a strange problem with a piece of code I made for myself. No, this is not really concerning rxtx, but nevertheless I post this to the list, hoping that some of you can help me. I've written two libraries, one for linux and one for win32. The linux port works quite well, I can send / receive faxes and / or replay voice messages over the telephone line using a voice modem. But the win32 port of the library causes some trouble. If, for example, I send out a fax with a certain modem under linux, it works well. The fax is complete when it comes out of the fax machine. If I then use the same modem to send out a fax under win32, the fax coming out of the fax machine gets "stuck" halfways, but the sending modem thinks that transmission was ok and drops the connection. The answering fax machine then gives me "error while receiving." The "upper layer" java code MUST be right, because if I do the same thing under linux (using the linux library), everything is alright. Now I have to ask: Can somebody please help me out with this??!? Could it be the case that some kind of flow control or COMMTIMEOUTS setting causes this behaviour? I set flow control to RTS/CTS before sending out a fax. How can I DISABLE flow control? Or what do you think? Can something else cause this problems? Thank you all for your time and PLEASE write back soon. Regards, --Sven Ahlemann Am Waldrand 31 45721 Haltern am See Germany ______________________________________________________________ Verschicken Sie romantische, coole und witzige Bilder per SMS! Jetzt bei WEB.DE FreeMail: http://f.web.de/?mc=021193 From lux at diesel-research.com Sat Feb 11 10:06:52 2006 From: lux at diesel-research.com (Kim Lux) Date: Sat, 11 Feb 2006 10:06:52 -0700 Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: <1139631780.23882.10.camel@zd7280> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> <1139631780.23882.10.camel@zd7280> Message-ID: <1139677612.3431.5.camel@zd7280> More on this problem. I copied and pasted simpleRead into a console based Eclipse project and I've got the same result, except that cpu usage doesn't go to 100%. I'm beginning to think there is an issue in rxtx. My imports for simpleRead are: ============================ import gnu.io.*; import java.util.*; //import javax.comm.*; import java.io.*; =========================== Any ideas ? I am trying to read from /dev/ttyUSB0 using a serial to USB adapter which has worked well with minicom and gtkterm. Thanks. On Fri, 2006-02-10 at 21:23 -0700, Kim Lux wrote: > I've got a problem receiving chars with my version of serialRead, > written in an SWT GUI. > > I had a Java pro have a good look at my code and he can't see anything > wrong with it. > > I can send chars fine. When I receive a char the cpu usage for the app > goes to 100% and the code in the serial event handler doesn't get > executed. > > The instructions on the Java Comm Serial API How-To for Linux page state > that I must install javacomm. Is that true ? Everything builds without > it and I can send chars on rxtx just fine, but I can't receive them. > Could this be the problem ? > > I downloaded and installed javacomm. I was not able to add > "Driver=gnuio.RXTXCommDriver > to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not > have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 > installed in /usr/java/jre1.5.0_05. I added comm.jar > to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext > to the library paths. Is this OK ? > > Does it matter that I am receiving on /dev/ttyUSB0 ? > > Thanks. > -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Sun Feb 12 21:01:33 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:01:33 -0700 (MST) Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: <1139677612.3431.5.camel@zd7280> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> <1139631780.23882.10.camel@zd7280> <1139677612.3431.5.camel@zd7280> Message-ID: I suspect what is happening is the select() is breaking out in the native code but the driver does not have support for notifying there are X bytes available. On some traditional Unix based systems, the only way you know data is available is the fd status changes and do an FIORDCHK ioctl. Or perhaps the only thing you can know is the fd status changed. It would take reading through the kernel driver code to know for sure. So on USB, depending upon the driver, the same may need to be done or the driver improved a bit if possible to support. Polling reads will also work but don't use the event driven model of CommAPI which isnt acceptable in the long run. The 100% cpu usage can then be explained because select no longer blocks until the data is read; the eventLoop spins loose. You can put a well placed sleep but rxtx only expects those are needed when it knows data is available. This may not be a super simple thing to understand and fix. I do have ideas to get you started. I'm going to be short on time the next couple weeks. I expect to put some good time in and answer some other questions I saw around the 25th. For now, I'd look at the following and go from there with the hints I've given. JNIEXPORT jint JNICALL RXTXPort(nativeavailable)( JNIEnv *env, jobject jobj ) { int fd = get_java_var( env, jobj,"fd","I" ); int result; /* char message[80]; ENTER( "RXTXPort:nativeavailable" ); On SCO OpenServer FIONREAD always fails for serial devices, so try ioctl FIORDCHK instead; will only tell us whether bytes are available, not how many, but better than nothing. This turns out to be true on Solaris also. taj. */ #ifdef FIORDCHK /* __unixware__ __sun__ probably others */ result = ioctl(fd, FIORDCHK, 0); #else if( ioctl( fd, FIONREAD, &result ) < 0 ) { goto fail; } #endif /* FIORDCHK */ On Sat, 11 Feb 2006, Kim Lux wrote: > > More on this problem. I copied and pasted simpleRead into a console > based Eclipse project and I've got the same result, except that cpu > usage doesn't go to 100%. I'm beginning to think there is an issue in > rxtx. > > My imports for simpleRead are: > > ============================ > import gnu.io.*; > import java.util.*; > //import javax.comm.*; > import java.io.*; > =========================== > > Any ideas ? I am trying to read from /dev/ttyUSB0 using a serial to > USB adapter which has worked well with minicom and gtkterm. > > Thanks. > > > > On Fri, 2006-02-10 at 21:23 -0700, Kim Lux wrote: >> I've got a problem receiving chars with my version of serialRead, >> written in an SWT GUI. >> >> I had a Java pro have a good look at my code and he can't see anything >> wrong with it. >> >> I can send chars fine. When I receive a char the cpu usage for the app >> goes to 100% and the code in the serial event handler doesn't get >> executed. >> >> The instructions on the Java Comm Serial API How-To for Linux page state >> that I must install javacomm. Is that true ? Everything builds without >> it and I can send chars on rxtx just fine, but I can't receive them. >> Could this be the problem ? >> >> I downloaded and installed javacomm. I was not able to add >> "Driver=gnuio.RXTXCommDriver >> to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not >> have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 >> installed in /usr/java/jre1.5.0_05. I added comm.jar >> to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext >> to the library paths. Is this OK ? >> >> Does it matter that I am receiving on /dev/ttyUSB0 ? >> >> Thanks. >> > From tjarvi at qbang.org Sun Feb 12 21:03:30 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:03:30 -0700 (MST) Subject: [Rxtx] One serial port object for both sending and receiving ? In-Reply-To: <1139610545.18177.4.camel@zd7280> References: <1139610545.18177.4.camel@zd7280> Message-ID: On Fri, 10 Feb 2006, Kim Lux wrote: > > Is it OK to use one SerialPort ojbect (ex Serial Port serialPort;) and > use it for both sending and receiving ? > > For example: > > ======================================================================== > static SerialPort serialPort = null; > static OutputStream serialOut = null; > static InputStream serialIn = null; > > > > > // assign it to an outputStream for use > try{ > serialOut = serialPort.getOutputStream(); > System.out.println("Serial output stream has been assigned."); > }//try > catch(IOException e) > { > System.out.println("Error: Couldn't assign output stream to serial > port."); > }//catch > > > //assign it to an inputStream for use > try{ > serialIn = serialPort.getInputStream(); > System.out.println("Serial input stream has been assigned."); > }//try > catch(IOException e) > { > System.out.println("Error: Couldn't assign input stream to serial > port."); > }//catch This should be fine. In fact trying to do it another way will probably not work as you will run into lockfile issues. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun Feb 12 21:13:13 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:13:13 -0700 (MST) Subject: [Rxtx] Question about Serial I/O under Win32 In-Reply-To: <662084330@web.de> References: <662084330@web.de> Message-ID: On Sat, 11 Feb 2006 lunareclipse03 at web.de wrote: > Hello everybody, > > I have a strange problem with a piece of code I made for myself. No, > this is not really concerning rxtx, but nevertheless I post this to the > list, hoping that some of you can help me. I've written two libraries, > one for linux and one for win32. The linux port works quite well, I can > send / receive faxes and / or replay voice messages over the telephone > line using a voice modem. But the win32 port of the library causes some > trouble. If, for example, I send out a fax with a certain modem under > linux, it works well. The fax is complete when it comes out of the fax > machine. If I then use the same modem to send out a fax under win32, the > fax coming out of the fax machine gets "stuck" halfways, but the sending > modem thinks that transmission was ok and drops the connection. The > answering fax machine then gives me "error while receiving." The "upper > layer" java code MUST be right, because if I do the same thing under > linux (using the linux library), everything is alright. Now I have to > ask: Can somebody please help me out with this??!? Could it be the case > that some kind of flow control or COMMTIMEOUTS setting causes this > behaviour? I set flow control to RTS/CTS before sending out a fax. How > can I DISABLE flow control? Or what do you think? Can something else > cause this problems? Thank you all for your time and PLEASE write back > soon. > Hi Sven I'm not too willing to talk about flow control at the low level until I confirm some things with test equipment later. It is not clear if you are using rxtx or writing your own native code. So I'm not sure how to answer much of this :) If you are wondering how to change the flow control using rxtx from java, The BlackBox example from Sun flips this back and forth. SerialPort.java in rxtx 2.1 uses the following: SerialPort.java: public static final int FLOWCONTROL_NONE =0; SerialPort.java: public static final int FLOWCONTROL_RTSCTS_IN =1; SerialPort.java: public static final int FLOWCONTROL_RTSCTS_OUT =2; SerialPort.java: public static final int FLOWCONTROL_XONXOFF_IN =4; SerialPort.java: public static final int FLOWCONTROL_XONXOFF_OUT=8; So if you set flowcontrol to RTSCTS, you can set it to NONE to turn it off. If you are looking for how to do it in native code, the rxtx Source is SerialImp.c (unix/linux/mac os x/w32) and termios.c (w32 only with SerialImp.c) You can track the code: SerialImp.c:JNIEXPORT void JNICALL RXTXPort(setflowcontrol)( JNIEnv *env, jobject jobj, jint flowmode ) termios.c:int tcgetattr( int fd, struct termios *s_termios ) termios.c:int tcsetattr( int fd, int when, struct termios *s_termios ) There may be a problem in the rxtx flow control code though. Rather than guess, I want to test this with a gold standard. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Feb 6 00:00:16 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 00:00:16 -0700 (MST) Subject: [Rxtx] wiki delay until tomorrow night. In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: On Sun, 5 Feb 2006, Trent Jarvi wrote: > On Sun, 5 Feb 2006, Kim Lux wrote: > >> usb ? Tell me more... I need that too. > > usb is a very proper design. Thats all it is. > Maybe rxtx could help usb. But it would start with helping bring back the community that was already there. It's not something I'd love to do but maybe its the right thing to do. It would probably take 2 years to do right. But maybe thats better than what we have now. I honestly don't know what IBM is doing which could just run over everything. Just some thoughts after some fine german wine. -- Trent Jarvi tjarvi at qbang.org From gadelavega at yahoo.com.ar Mon Feb 6 02:17:05 2006 From: gadelavega at yahoo.com.ar (Gonzalo A. de la Vega) Date: Mon, 06 Feb 2006 10:17:05 +0100 Subject: [Rxtx] Serial port ownership question In-Reply-To: References: <20060205113618.30274.qmail@web53501.mail.yahoo.com> <1139157422.4553.9.camel@zd7280> <1139158698.4936.9.camel@zd7280> Message-ID: <43E71411.4050402@yahoo.com.ar> On my Fedora Core 4: ls -l /dev/ttyS* crw-rw---- 1 root uucp 4, 64 Feb 6 2006 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Feb 6 2006 /dev/ttyS1 ... and: grep "ttyUSB" /etc/udev/rules.d/50-udev.rules KERNEL=="ttyUSB*", GROUP="uucp", MODE="0660" So anyone in the "uucp" group can use serial ports. On Gentoo the group is "tty". Trent Jarvi escribi?: > > > On Sun, 5 Feb 2006, Dr. Douglas Lyon wrote: > >> I can confirm that this is the case (only root ownership of >> serial ports, under fedora 4). >> Wow, what were they thinking?! >> - DL >> >>> I've found that the newer kernels have the serial ports owned by root. >>> For example, >>> >>> $ls -al /dev/tty* >>> crw-rw-rw- 1 root root 5, 0 Feb 5 02:06 /dev/tty >>> crw-rw---- 1 root root 4, 0 Feb 5 02:06 /dev/tty0 >>> crw------- 1 root root 4, 1 Feb 5 09:07 /dev/tty1 >>> crw-rw---- 1 root tty 4, 10 Feb 5 02:06 /dev/tty10 >>> crw-rw---- 1 root tty 4, 11 Feb 5 02:06 /dev/tty11 >>> ... > > > This is just not a problem jcp or such are going to solve. Its a > platform spitwad fight. But do look at pam. In fact thats what Sun > is doing too. Maybe Linux followed their lead.. I'm not a pam guy. > I've spent 16 hours trying to understand it but your users wont :) > > Solution? I have no clue. Its two tangent mentalities from my > perspective. > > -- > Trent Jarvi > tjarvi at qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mtnvega at yahoo.com.br Mon Feb 6 05:35:43 2006 From: mtnvega at yahoo.com.br (Luiz Jr) Date: Mon, 6 Feb 2006 12:35:43 +0000 (GMT) Subject: [Rxtx] Documentation Wiki In-Reply-To: <1139157422.4553.9.camel@zd7280> Message-ID: <20060206123543.57256.qmail@web53515.mail.yahoo.com> Hello, Thank you for you answer, but so the usage of the API is pretty much like the Java Communications Api? If yes, what version of the Java Comm Api? Thank you, Luiz A. Brandao Jr Kim Lux escreveu: On Sun, 2006-02-05 at 08:36 -0300, Luiz Jr wrote: > Hello, > > I want to start using the RXTX libraries, but I would to know how, > since I can not access the documentation wiki page I just started using them yesterday. Below is how I installed the libraries, if that helps. I used snippets of code from the SimpleWrite application here to get me going. http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html Instead of "import javax.comm.*;", use "import gnu.io.*;" which is gotten from RXTXcomm.jar, which you will need to include in your project references. I am working in Eclipse. BTW: there is no way to open a port without going through the port list and finding it. Maybe sometime in the future someone (me ?) will write a method called openSerialPort that allows the user to give a port identifier, such as "/dev/tty1" and return a port ready to use. It wouldn't take much to write that and it would save users a lot of code. Hope this helps. ======================================================================= 1) Figure out which java you are running, incase there is more than one installed. $ java -version java version "1.5.0_05" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_05-b05) Java HotSpot(TM) Client VM (build 1.5.0_05-b05, mixed mode, sharing) 2) Find all the jre directories and the one from which you are currently running. kfind (jre) 3) cd to that directory plus /lib/i386 cd /usr/java/jre1.5.0_05/lib/i386 4) Copy the library files (*.so) to that directory. cp /home/krlux/Desktop/'Java Controls'/rxtx-linux/bin/* . 5) Check that the copy was successful ls librxtx* librxtxI2C.so librxtxRaw.so librxtxSerial.so librxtxParallel.so librxtxRS485.so 6) cd to the /lib/ext directory for your java. cd /usr/java/jre1.5.0_05/lib/ext 7) Copy the Jar files there cp /home/krlux/Desktop/'Java Controls'/rxtx-linux/lib/ext/* . 8) Check that it was successful ls RXTX* RXTXcomm.jar Rxtx is now installed on your machine ready to use. =================================================================== -- Kim Lux, Diesel Research Inc. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx --------------------------------- Yahoo! Acesso Gr?tis - Internet r?pida e gr?tis. Instale o discador agora! -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/544aa403/attachment-0006.html From lyon at docjava.com Mon Feb 6 05:49:34 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 06 Feb 2006 07:49:34 -0500 Subject: [Rxtx] wiki delay until tomorrow night. In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: Hi All, I have often thought about USB drivers being needed. For example, the ironman watch will not interface to a mac (windows only). It is USB. My dymo label writer has no Java driver (native only). Etc. Most cheap web cameras are USB (and Java drivers go through JAI, if it supports the camera at all). The JAI code shows how sun did the USB drivers. You have to be a member of the jai project to download the source code. https://jai.dev.java.net has the jai distro. And then you are not allowed to redistribute it. However, we can all learn from it (if so inclined). Basically: cvs -d :pserver:lyon at cvs.dev.java.net:/cvs login cvs -d :pserver:lyon at cvs.dev.java.net:/cvs checkout jai-core You will need to user your own uid and pw to get in. The ant build has over 100 warnings from sun deprecations of its own code. You might say that they were hoisted on their own Picard ;) One interesting thing is that they support several platforms: linux-amd64 64-bit Linux-AMD64 linux-i586 32-bit Linux-x86 solaris-amd64 64-bit Solaris-AMD64 solaris-i586 32-bit Solaris-x86 solaris-sparc 32-bit Solaris-SPARC solaris-sparcv9 64-bit Solaris-SPARC windows-i586 32-bit Windows-x86 Thus, ant is used to provide a multi-platform native method distro. Neat. How do they do it? check this out: And: The core download does not contain any C source code (it was all pre-built). Basically, they are just copying .so and .dll files into build directories. I would love to see the C code for this...but Sun does not post it on the https://jai.dev.java.net site. I don't know why...Perhaps I missed it. - Doug >On Sun, 5 Feb 2006, Trent Jarvi wrote: > >>On Sun, 5 Feb 2006, Kim Lux wrote: >> >>>usb ? Tell me more... I need that too. >> >>usb is a very proper design. Thats all it is. >> > >Maybe rxtx could help usb. But it would start with helping bring >back the community that was already there. > >It's not something I'd love to do but maybe its the right thing to do. > >It would probably take 2 years to do right. But maybe thats better >than what we have now. > >I honestly don't know what IBM is doing which could just run over everything. > >Just some thoughts after some fine german wine. > >-- >Trent Jarvi >tjarvi at qbang.org > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tdelenik at gmail.com Mon Feb 6 05:56:32 2006 From: tdelenik at gmail.com (Thanasis Delenikas) Date: Mon, 6 Feb 2006 14:56:32 +0200 Subject: Fwd: [Rxtx] Documentation Wiki In-Reply-To: <1139157422.4553.9.camel@zd7280> References: <20060205113618.30274.qmail@web53501.mail.yahoo.com> <1139157422.4553.9.camel@zd7280> Message-ID: <310a1a930602060456t129f1dc6p5f2b908f13ab5a0b@mail.gmail.com> Hello all, Kim, this is a snippet from the code I use. The closest to directly opening a specific port without enumeration. << ... portId = CommPortIdentifier.getPortIdentifier(getPort()); serialPort = (SerialPort) portId.open("jSMSEngine", 1971); ... >> where getPort() return the string identifier of the port, i.e. "/dev/ttyS0" or "COM1" or whatever. Thanasis. ---------- Forwarded message ---------- From: Kim Lux Date: Feb 5, 2006 6:37 PM Subject: Re: [Rxtx] Documentation Wiki To: RXTX Developers and Users BTW: there is no way to open a port without going through the port list and finding it. Maybe sometime in the future someone (me ?) will write a method called openSerialPort that allows the user to give a port identifier, such as "/dev/tty1" and return a port ready to use. It wouldn't take much to write that and it would save users a lot of code. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/182ab5b8/attachment-0006.html From tjarvi at qbang.org Mon Feb 6 11:53:57 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 11:53:57 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: On Mon, 6 Feb 2006, Dr. Douglas Lyon wrote: > Hi All, > I have often thought about USB drivers being needed. > For example, the ironman watch will not interface > to a mac (windows only). It is USB. > My dymo label writer has no Java driver (native only). > Etc. > Most cheap web cameras are USB (and Java drivers go > through JAI, if it supports the camera at all). > The JAI code shows how sun did the USB drivers. > You have to be a member of the jai project to download > the source code. > https://jai.dev.java.net has the jai distro. > And then you are not allowed to redistribute it. However, > we can all learn from it (if so inclined). Basically: > cvs -d :pserver:lyon at cvs.dev.java.net:/cvs login > cvs -d :pserver:lyon at cvs.dev.java.net:/cvs checkout jai-core > You will need to user your own uid and pw to get in. > The ant build has over 100 warnings from sun deprecations > of its own code. > > You might say that they were hoisted on their own Picard ;) > > One interesting thing is that they support several platforms: > linux-amd64 64-bit Linux-AMD64 > linux-i586 32-bit Linux-x86 > solaris-amd64 64-bit Solaris-AMD64 > solaris-i586 32-bit Solaris-x86 > solaris-sparc 32-bit Solaris-SPARC > solaris-sparcv9 64-bit Solaris-SPARC > windows-i586 32-bit Windows-x86 > Thus, ant is used to provide a multi-platform native method distro. > Neat. > How do they do it? > check this out: > > > > > > > > > > > > > And: > > > > > > > > > > The core download does not contain any C source code (it was all pre-built). > Basically, they are just copying .so and .dll files into build directories. > > I would love to see the C code for this...but Sun does not post it on the > https://jai.dev.java.net site. > > I don't know why...Perhaps I missed it. > > - Doug > > I've looked at moving rxtx to Ant builds. I think that would help IDEs a great deal. I requested a evalutation desk copy the O'Reilly Ant book for some j2ee material I was teaching. http://www.oreilly.com/catalog/anttdg/ It has a one sentence mention of JNI. So there was not luck there. I saw that there is another Ant book that does mention JNI more. I can't find it now. Ant must be able to support it with extensions. http://ant.apache.org/manual/OptionalTasks/javah.html What the auto(break :) tools do in the rxtx build is 4 things really. 1) gcc compile flags 2) ld compile flags 3) config.h 4) compile flags for customizing rxtx (lockfiles, ...) See 1 All of this information except 4 can be static once obtained. So I'm not attached to the auto tools. If I could find an example of Ant being used for JNI code, I'd be one of the first to start moving that direction. Maybe someone saw an example someplace. The other thing we have not completed discussing is the directory structure. There is interest in making rxtx more IDE friendly. I get more mail about that off the list than how to install rxtx. And I see we have Ken Thompson in da house :) He is our trusted CVS maintainer and the guy that purchased the rxtx.org domain. Old community. We will need Ken for changing the directory structure of source. I would like to open up discussion about both of these as it is more than time. The problem is I have little experience with Ant and even less with IDEs. It would be nice if we could work with Eclipse and NetBeans. http://www.netbeans.org/ (sun and some community) http://www.eclipes.org (ibm,rhat,... perhaps more community) http://maven.apache.org/what-is-maven.html (apache. It is community) borland should sortof be here too but I think thats covered in eclipse. >From what I understand so far, we should morph rxtx to support those three maybe trusting apaches lead with maven. But I use vi. I have little to no clues beyond what people have fed me. Can we agree that thats the right direction to go? -- Trent Jarvi tjarvi at qbang.org From brian at mbari.org Mon Feb 6 14:57:50 2006 From: brian at mbari.org (Brian Schlining) Date: Mon, 6 Feb 2006 13:57:50 -0800 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> > The other thing we have not completed discussing is the directory > structure. There is interest in making rxtx more IDE friendly. I > get more mail about that off the list than how to install rxtx. > > And I see we have Ken Thompson in da house :) He is our trusted > CVS maintainer and the guy that purchased the rxtx.org domain. Old > community. We will need Ken for changing the directory structure of > source. > > I would like to open up discussion about both of these as it is > more than time. The problem is I have little experience with Ant > and even less with IDEs. It would be nice if we could work with > Eclipse and NetBeans. > > http://www.netbeans.org/ (sun and some community) > http://www.eclipes.org (ibm,rhat,... perhaps more community) > http://maven.apache.org/what-is-maven.html (apache. It is community) > borland should sortof be here too but I think thats covered in > eclipse. > >> From what I understand so far, we should morph rxtx to support >> those three > maybe trusting apaches lead with maven. But I use vi. I have > little to no clues beyond what people have fed me. > Maven likes the directory structure below for Java code. (From http:// maven.apache.org/guides/getting-started/index.html) This structure works fine with ant, netbeans, and eclipse. rxtx_root_directory `-- src |-- main | `-- java | `-- gnu | `-- io `-- test `-- java `-- gnu `-- io Brian Schlining Software Engineer http://www.mbari.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/d9451eba/attachment-0006.html From tjarvi at qbang.org Mon Feb 6 15:11:45 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 15:11:45 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: > rxtx_root_directory > `-- src > |-- main > | `-- java > | `-- gnu > | `-- io > `-- test > `-- java > `-- gnu > `-- io > >From what I understand this will just be good. For me it makes no difference. So lets do the rxtx thing. Let if fester for two weeks and if nobody objects, we will do it. I'm not doing this because I care. I'm doing this to eliminate much of my inbox. But test... man is rxtx lacking there in the community aspect. It is covered but not right. _maybe_ I can change that this year. -- Trent Jarvi tjarvi at qbang.org (cat hurding since 1997) From lux at diesel-research.com Mon Feb 6 21:38:49 2006 From: lux at diesel-research.com (Kim Lux) Date: Mon, 06 Feb 2006 21:38:49 -0700 Subject: [Rxtx] How can I use Lock Files with rxtx (in FC4) ? Message-ID: <1139287129.17031.3.camel@zd7280> I am now running an rxtx application on FC4. I am getting: ========================================================= check_group_uucp(): error testing lock file creation Error details: Permission denied check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL ========================================================= $ ls -al /var/lock total 32 drwxrwxr-x 4 root lock 4096 Feb 6 16:04 . drwxr-xr-x 24 root root 4096 Nov 14 01:19 .. drwx------ 2 root root 4096 Apr 27 2005 lvm drwxr-xr-x 2 root root 4096 Feb 6 16:04 subsys How do I fix this for regulator users ? -- Kim Lux, Diesel Research Inc. From dmarkman at mac.com Mon Feb 6 22:24:44 2006 From: dmarkman at mac.com (Dmitry Markman) Date: Tue, 7 Feb 2006 00:24:44 -0500 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: if I understands the issue right in order to be able to use ant for c/c++ compilation you have to install ant's cc task http://ant-contrib.sourceforge.net/cc.html it looks like it should work on mac os x (authors claim, that it's platform independent) but I never tested so all you have to do it's providing right command line for the gcc compiler On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: >> rxtx_root_directory >> `-- src >> |-- main >> | `-- java >> | `-- gnu >> | `-- io >> `-- test >> `-- java >> `-- gnu >> `-- io >> > > >> From what I understand this will just be good. > > For me it makes no difference. So lets do the rxtx thing. Let if > fester for two weeks and if nobody objects, we will do it. > > I'm not doing this because I care. I'm doing this to eliminate > much of my inbox. > > But test... man is rxtx lacking there in the community aspect. It > is covered but not right. _maybe_ I can change that this year. > > -- > Trent Jarvi > tjarvi at qbang.org > (cat hurding since 1997) > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx Dmitry Markman From lux at diesel-research.com Mon Feb 6 23:20:15 2006 From: lux at diesel-research.com (Kim Lux) Date: Mon, 06 Feb 2006 23:20:15 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? Message-ID: <1139293215.3689.4.camel@zd7280> I'm running the code below. portlist.hasMoreElements() is false. /dev has ports in it as listed below. What am I doing wrong ? ========================================================== // Step through the list of ports until we find one that matches // the one we are looking for. portList = CommPortIdentifier.getPortIdentifiers(); while(portList.hasMoreElements()) { portID = (CommPortIdentifier) portList.nextElement(); // if (portID.getName().equals("/dev/ttyUSB0")) { myTA.append("Serial port ttyUSB0 has been found\n"); break; }// if portID equals... }// End of while... ========================================================== ls -al /dev/tty* crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 ... crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 -- Kim Lux, Diesel Research Inc. From david.garnier at trusted-logic.com Tue Feb 7 00:46:30 2006 From: david.garnier at trusted-logic.com (David Garnier) Date: Tue, 07 Feb 2006 08:46:30 +0100 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: <43E85056.2090608@trusted-logic.com> Hello, I think that the make-based build process is fine as it is, apart from the location of the Java source files. It is true that putting the Java source in a directory structure that map 1-to-1 to the Java package structure is the norm and should make it easier for everyone to modify the Java source, with or without an IDE. Ant is a good tool, but in the RXTX case I fail to see the advantage of using it compared to the current make-based process. As Trent said, they are more pressing issues, like testing. Regards, David Dmitry Markman wrote: > if I understands the issue right > in order to be able to use ant for c/c++ compilation > you have to install ant's cc task > http://ant-contrib.sourceforge.net/cc.html > > it looks like it should work on mac os x > (authors claim, that it's platform independent) > but I never tested > > so all you have to do it's providing right command line > for the gcc compiler > > > > > On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: > >>> rxtx_root_directory >>> `-- src >>> |-- main >>> | `-- java >>> | `-- gnu >>> | `-- io >>> `-- test >>> `-- java >>> `-- gnu >>> `-- io >>> >> >> >>> From what I understand this will just be good. >> >> For me it makes no difference. So lets do the rxtx thing. Let if >> fester for two weeks and if nobody objects, we will do it. >> >> I'm not doing this because I care. I'm doing this to eliminate much >> of my inbox. >> >> But test... man is rxtx lacking there in the community aspect. It is >> covered but not right. _maybe_ I can change that this year. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> (cat hurding since 1997) From tjarvi at qbang.org Tue Feb 7 01:11:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 01:11:31 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <43E85056.2090608@trusted-logic.com> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: On Tue, 7 Feb 2006, David Garnier wrote: > Hello, > > I think that the make-based build process is fine as it is, apart from the location of the Java > source files. It is true that putting the Java source in a directory structure that map 1-to-1 to > the Java package structure is the norm and should make it easier for everyone to modify the Java > source, with or without an IDE. > > Ant is a good tool, but in the RXTX case I fail to see the advantage of using it compared to the > current make-based process. As Trent said, they are more pressing issues, like testing. > Hi David I have more experience with testing rxtx than I can talk about. But let it be known, rxtx has gone trough 100's of hours of testing. We are hobby folks interested in toys but there is more. rxtx has had some of the best guidance in the industry there. This is not an easy thing. I may be able to come back in a month from the other side of the corperate fence and help. I suspect the tests could just be made public but they are in a very unusual environment that just wont work in a wider sense. This is something I'll be trying to change. At one point it was agreed we could just make the results public so this isnt just noise.. There is interest and I think its safe to mention that much. The big problem with testing in the past is most of it is done with a loopback connection. So we *still* have major questions regarding things like flow control. rxtx talks to itself over a loopback and it works. regardless of right or wrong. This requires more thought to be done right. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Feb 7 02:46:34 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 02:46:34 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: > The big problem with testing in the past is most of it is done with a > loopback connection. So we *still* have major questions regarding things > like flow control. rxtx talks to itself over a loopback and it works. > regardless of right or wrong. With serial communication there are gold standards. ckermit is probably a definitive 'standard.' Maybe its possible to do ping/pong tests with ckermit? Is it scriptable? There are known issues in rxtx. Probably the worst is some threading issues regarding some JREs with multiple JNI threads setting java variables. Man did I get schooled there. Just switch the c functions to returning variables and things go away. Sometimes they work fine, sometimes they blow up. Without understanding everything, somehow rhat got it right and debian (and especially gentoo) grabbed kernel patches causing all sort of harm. Its not hard to fix once you understand whats going on but nearly impossible to track with a debugger. So I have a good idea what 2.1-8 will have outside of the IDE modifications. rxtx 2.1-7 is a release for everyone to sync with. Its not even as stable as -pre17 as far as I know - I ran no test suites. I'll be chasing it too. We just had so many contributions that it was time. It seriously broke internal scheduals but thats a great thing :) The other thing I want to do in 2.1-8 is automagic baud rates. It turns out lots of shops are doing really funky baud rates for things like automobile test equipment. It is possible but it requires a fair amount of change in the native code. Is anyone looking at this? -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Feb 7 02:57:21 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 07 Feb 2006 04:57:21 -0500 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <43E85056.2090608@trusted-logic.com> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: Hi All, I agree, testing is very important. The problem I have been trying to address is related to cross-platform testing and the robust nature of the installs. Typically, I visit 3 platforms to deploy my product, windows, linux and mac. A build is performed on each platform. The idea that you can build for many platforms from one copy the source code seems attractive. This should enable synchronized deployments of identical code. The question of how to achieve this goal remains open. As Trent mentioned, this is hard. Perhaps Ant will help here (but perhaps not). Ant does seem to help with running unit tests. However, it does not help with multi-platform tests. For that you need many machines and different operating environments. Toward that end, I have created a multi-platform test that can be run from web start, located at: http://show.docjava.com:8086/book/cgij/code/jnlp/serialPort.PortTest.jnlp This is interesting because many people in the community can run the test and we can improve the test, as time permits. No, it is not a perfect solution, however, the idea does help with multi-platform tests using many machines and different operating environments. If the group has a good test for a general serial port set-ups, i would be happy to deploy it, for general evaluation using web start. And as for ANT, it is just an idea. Not all my ideas are good ones! - Doug >Hello, > >I think that the make-based build process is fine as it is, apart >from the location of the Java >source files. It is true that putting the Java source in a directory >structure that map 1-to-1 to >the Java package structure is the norm and should make it easier for >everyone to modify the Java >source, with or without an IDE. > >Ant is a good tool, but in the RXTX case I fail to see the advantage >of using it compared to the >current make-based process. As Trent said, they are more pressing >issues, like testing. > >Regards, >David > >Dmitry Markman wrote: >> if I understands the issue right >> in order to be able to use ant for c/c++ compilation >> you have to install ant's cc task >> http://ant-contrib.sourceforge.net/cc.html >> >> it looks like it should work on mac os x >> (authors claim, that it's platform independent) >> but I never tested >> >> so all you have to do it's providing right command line >> for the gcc compiler >> >> >> >> >> On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: >> >>>> rxtx_root_directory >>>> `-- src >>>> |-- main >>>> | `-- java >>>> | `-- gnu >>>> | `-- io >>>> `-- test >>>> `-- java >>>> `-- gnu >>>> `-- io >>>> >>> >>> >>>> From what I understand this will just be good. >>> >>> For me it makes no difference. So lets do the rxtx thing. Let if >>> fester for two weeks and if nobody objects, we will do it. >>> >>> I'm not doing this because I care. I'm doing this to eliminate much >>> of my inbox. >>> >>> But test... man is rxtx lacking there in the community aspect. It is >>> covered but not right. _maybe_ I can change that this year. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> (cat hurding since 1997) > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From matt.higgins at gmail.com Tue Feb 7 08:28:34 2006 From: matt.higgins at gmail.com (Matt Higgins) Date: Tue, 7 Feb 2006 10:28:34 -0500 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final Message-ID: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? import java.io.*; import java.util.*; import gnu.io.*; public class MySimpleRead implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; public static void main(String[] args) { boolean portFound = false; String defaultPort = "COM1"; if (args.length > 0) { defaultPort = args[0]; } portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; MySimpleRead reader = new MySimpleRead(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } } public MySimpleRead() { try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) { e.printStackTrace(); } try { inputStream = serialPort.getInputStream(); } catch (IOException e) { e.printStackTrace(); } try { serialPort.addEventListener(this); } catch (TooManyListenersException e) { e.printStackTrace(); } try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { e.printStackTrace(); } System.out.println("Baud is " + serialPort.getBaudRate()); System.out.println("Bits is " + serialPort.getDataBits()); System.out.println("Stop is " + serialPort.getStopBits()); System.out.println("Par is " + serialPort.getParity()); serialPort.notifyOnDataAvailable(true); readThread = new Thread(this); readThread.start(); } public void run() { // Thread.sleep(20000); //} catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { System.out.println("An event occurred " + event.getEventType()); switch (event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: byte[] readBuffer = new byte[20]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } System.out.print(new String(readBuffer)); } catch (IOException e) {} break; } } } --------------- Result on windows ------------------------------ Stable Library ============================================================== Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port:: COM1 Baud is 9600 Bits is 8 Stop is 1 Par is 0 ----------------- End Results ----------------------------------------- ------------------ Result on Linux ----------------------------------- Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 Found port: /dev/ttyS0 Baud is 9600 Bits is 8 Stop is 1 Par is 0 An event occurred 1 043100066224 ------------------ End Results --------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/a1431630/attachment-0006.html From brian at mbari.org Tue Feb 7 09:48:37 2006 From: brian at mbari.org (Brian Schlining) Date: Tue, 7 Feb 2006 08:48:37 -0800 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> Message-ID: <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> Hi Matt > The following code works fine on Linux but I never see any data > when run on Windows. This is a cut and paste from the SimpleRead > example. > I am attempting to read data from a bar code scanner. I can fire > up HyperTermianl on windows and see that the device is working > properly as I see the barcodes are scanned and echoed back to the > terminal. However when I run the app I don't see any data. It is > however associating with the com port as the informational bits > print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. Cheers Brian Schlining Software Engineer http://www.mbari.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/16d07f37/attachment-0006.html From lux at diesel-research.com Tue Feb 7 11:59:58 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 11:59:58 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139293215.3689.4.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> Message-ID: <1139338798.8145.4.camel@zd7280> Any ideas on this ? Any reason why portList.hasMoreElements() should be false even though there are devices in /dev ? On Mon, 2006-02-06 at 23:20 -0700, Kim Lux wrote: > I'm running the code below. > > portlist.hasMoreElements() is false. > > /dev has ports in it as listed below. > > What am I doing wrong ? > > > ========================================================== > // Step through the list of ports until we find one that matches > // the one we are looking for. > > portList = CommPortIdentifier.getPortIdentifiers(); > > while(portList.hasMoreElements()) > { > portID = (CommPortIdentifier) portList.nextElement(); // > if (portID.getName().equals("/dev/ttyUSB0")) > { > myTA.append("Serial port ttyUSB0 has been found\n"); > break; > }// if portID equals... > }// End of while... > ========================================================== > > ls -al /dev/tty* > crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty > crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 > crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 > crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 > crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 > ... > crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 > crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 > crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 > > > -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 12:20:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 12:20:25 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139338798.8145.4.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> Message-ID: On Tue, 7 Feb 2006, Kim Lux wrote: > > Any ideas on this ? Any reason why portList.hasMoreElements() should be > false even though there are devices in /dev ? > > > On Mon, 2006-02-06 at 23:20 -0700, Kim Lux wrote: >> I'm running the code below. >> >> portlist.hasMoreElements() is false. >> >> /dev has ports in it as listed below. >> >> What am I doing wrong ? >> >> >> ========================================================== >> // Step through the list of ports until we find one that matches >> // the one we are looking for. >> >> portList = CommPortIdentifier.getPortIdentifiers(); >> >> while(portList.hasMoreElements()) >> { >> portID = (CommPortIdentifier) portList.nextElement(); // >> if (portID.getName().equals("/dev/ttyUSB0")) >> { >> myTA.append("Serial port ttyUSB0 has been found\n"); >> break; >> }// if portID equals... >> }// End of while... >> ========================================================== >> >> ls -al /dev/tty* >> crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty >> crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 >> crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 >> crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 >> crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 >> ... >> crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 >> crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 >> crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 >> >> >> > Hi Kim What rxtx does is try to open the port and do a timed out read. If the kernel/... do not complain it's enumarted. I suspect you could do a crude test by doing something like cat /dev/ttyS0 > /dev/null If that barfs then rxtx wont enumerate the port. hmm looking at your question again, I suspect it's a lockfile problem. This is documented in INSTALL with the source. Its easy enough to test this too.. touch /var/lock/testingrxtxlockfiles && rm -f /var/lock/testingrxtxlockfiles If you are not in the right group it will bail. Root will work regardless. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 12:37:56 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 12:37:56 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> Message-ID: <1139341076.8145.11.camel@zd7280> Exactly which ports does rxtx attempt to put into the list ? /dev/* or /dev/tty* or /dev/tty[0-9[0-9] ? or /dev/ttyS* ? For the record, only /dev/ttyUSB0 is a valid port on the machine I am presently on. Will this be a problem ? On Tue, 2006-02-07 at 12:20 -0700, Trent Jarvi wrote: > This is documented in INSTALL with the source. > I was wondering where that file was. I will download source and dig it up. Thanks. -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 12:51:09 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 12:51:09 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139341076.8145.11.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: On Tue, 7 Feb 2006, Kim Lux wrote: > > Exactly which ports does rxtx attempt to put into the list ? /dev/* > or /dev/tty* or /dev/tty[0-9[0-9] ? or /dev/ttyS* ? > > For the record, only /dev/ttyUSB0 is a valid port on the machine I am > presently on. Will this be a problem ? > > > On Tue, 2006-02-07 at 12:20 -0700, Trent Jarvi wrote: >> This is documented in INSTALL with the source. >> > I was wondering where that file was. I will download source and dig it > up. > > Thanks. > Hmm I'm looking at pre17 so this may have changed. (its just what I have on this machine) if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA" // for the IPAQs }; CandidatePortPrefixes=Temp; } So you may need to add "ttyUSB" to that list. RXTX used to enumerate _everything_ see if(osName.equals("Linux-all-ports") But it became less than practical. This is all in RXTXCommDriver.java hmm I just did a cvs update. if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have to get your fingers into the code. We aim for sane defaults. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 13:06:45 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 13:06:45 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139342805.8145.22.camel@zd7280> On Tue, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > Hmm I'm looking at pre17 so this may have changed. (its just what I have > on this machine) > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA" // for the IPAQs > }; > CandidatePortPrefixes=Temp; > } > > > So you may need to add "ttyUSB" to that list. RXTX used to enumerate > _everything_ see if(osName.equals("Linux-all-ports") But it became less > than practical. > > This is all in RXTXCommDriver.java > > hmm I just did a cvs update. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have > to get your fingers into the code. We aim for sane defaults. Excellent. Thanks for taking the time. -- Kim Lux, Diesel Research Inc. From ideiglenes1 at freemail.hu Tue Feb 7 13:53:39 2006 From: ideiglenes1 at freemail.hu (--) Date: Tue, 07 Feb 2006 21:53:39 +0100 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139345619.22534.2.camel@localhost> Hi! I use this code to get all the extra Linux devices. :) if ("Linux".equals(System.getProperty("os.name"))) { System.setProperty("os.name","Linux-all-ports"); } driver = new RXTXCommDriver(); On k, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > On Tue, 7 Feb 2006, Kim Lux wrote: > > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have > to get your fingers into the code. We aim for sane defaults. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From matt.higgins at gmail.com Tue Feb 7 13:45:54 2006 From: matt.higgins at gmail.com (Matt Higgins) Date: Tue, 7 Feb 2006 15:45:54 -0500 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> Message-ID: <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> Sweet this is exactly what I needed. I was searching the archives through marc.theamisgroup they only have archives back to 1/3/05. Should have hit the mailman archive! Thanks a lot! On 2/7/06, Brian Schlining wrote: > > Hi Matt > > The following code works fine on Linux but I never see any data when run > on Windows. This is a cut and paste from the SimpleRead example. > I am attempting to read data from a bar code scanner. I can fire up > HyperTermianl on windows and see that the device is working properly as I > see the barcodes are scanned and echoed back to the terminal. However when I > run the app I don't see any data. It is however associating with the com > port as the informational bits print fine? > > > You're not the only one whose had this problem, I don't know if Trent has > addressed this is the latest release of RXTX but there is a workaround. > Here's the recent thread from the RXTX mailing list regarding this issues: > > Thanasis Delenikas tdelenik at gmail.com > Wed Jan 18 13:56:23 MST 2006 > > * Previous message: [Rxtx] Re: More close() performance fixes > * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] > > Hi all. > (I've subscribed again from my other email account). > > Trent, > > You are right. Linux *always* works, no matter what flow control you set. > Windows *works only* with hardware flow control (I haven't tested what > happens with software XON/XOFF flow control). > > I assume (but I am not certain) that even with no flow control at all, all > platforms should work. Without flow control, you have the risk of bumping > into overflow or framing errors, but that's your (the end programmer, I > mean) problem. > > >From my side, I shouldn't be working without flow control. That was a bug > too... It was some code forgotten from the old times, when I used to work > with phone emulation drivers which didn't support flow control. The > correct > way is to have some flow control enabled and that's why I suppose this is > a > low-severity bug for RxTx. > > I have no idea which platform shows the correct behaviour, since > my knowledge about Linux and the inner workings of these low-level i/o > operations is limited. > > Regards, > Thanasis Delenikas. > > > > > Message: 2 > > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > > From: Trent Jarvi > > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > > To: RXTX Developers and Users > > Message-ID: > > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > > > Hi all, > > > > > > Trent, I have found something. > > > I read your comment about flow control, so I experimented a bit. > > > > > > If you remember, in my sample program I've used no flow control at all > ( > > i.e. > > > Java constant FLOWCONTROL_NONE). > > > > > > Now, during testing, I've switch to hardware inbound flow control (i.e > . > > Java > > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > > beautifully! > > > > > > I think I will switch to H/W flow control and test things for a while, > > but > > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > > > > > Hi Thanasis, > > > > I'm fairly sure you have identified a bug. I would not worry too much > > about what Sun CommAPI w32 defaults are. I think they did more or less > > whatever the port opened with. Just a guess. Linux tries to stomp on > > ports so they are all the same. > > > > So this started out with Linux worked, Windows XP/.. did not as I > recall. > > Something is wrong in rxtx. Do I understand this right? > > > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > > > Perhaps there is something Wayne or I did not understand when we wrote > > that code. I wasnt programming back in the BBS days so modems are not > my > > thing. I have a few questions. > > > > Is the above matrix confirmed by observation? > > Linux just always worked? > > Which one _should_ work? I'm guessing modems work with hardware flow > > control. I'll have to dig around. > > > > The windows flow control changes a couple things with hardware flow > > control. Following the w32 API documentation is confusing sometimes. > > But it looks like Linux could have a bug too. > > Cheers > > Brian Schlining > Software Engineer > http://www.mbari.org > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/9c989144/attachment-0006.html From tjarvi at qbang.org Tue Feb 7 14:06:14 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 14:06:14 -0700 (MST) Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> Message-ID: >> >> You're not the only one whose had this problem, I don't know if Trent has >> addressed this is the latest release of RXTX but there is a workaround. >> Here's the recent thread from the RXTX mailing list regarding this issues: >> I have not. I expect to have access to some test equipment next month and I'll go through all of this. I really don't know whats going on and I need a gold standard. I thought maybe linux was autodetecting the flow control. Your observations would certainly be welcome. I need to talk to Russell King and see what he is doing. Until then I'd just be toying around over a loopback as usual. This is very high on the list though. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 17:25:05 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 17:25:05 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139358305.17994.2.camel@zd7280> My application now works. I installed the libraries and jar from 2.1-7 (Final). portlist.hasMoreElements is no longer false. The application finds the port for /dev/ttyUSB0. Thanks for your help, Trent (et al) Sorry I bothered you with this. Next time I will look in the source first. I didn't think it was an rxtx issue, I thought it was a Linux setup issue . On Tue, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > Hmm I'm looking at pre17 so this may have changed. (its just what I > have > on this machine) > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux > Serial Ports > "ttySA" // for the > IPAQs > }; > > CandidatePortPrefixes=Temp; > } > > > So you may need to add "ttyUSB" to that list. RXTX used to enumerate > _everything_ see if(osName.equals("Linux-all-ports") But it became > less > than practical. > > This is all in RXTXCommDriver.java > > hmm I just did a cvs update. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux > Serial Ports > "ttySA", // for the > IPAQs > "ttyUSB" // for USB > frobs > }; > > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you > have > to get your fingers into the code. We aim for sane defaults. -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 19:21:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 19:21:54 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139358305.17994.2.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> <1139358305.17994.2.camel@zd7280> Message-ID: >Sorry I bothered you with this. Next time I will look in the source >first. I didn't think it was an rxtx issue, I thought it was a Linux >setup issue . Why would you be sorry? I would have done the same. I'm glad it's working :) -- Trent Jarvi tjarvi at qbang.org From tma at mail.island.net Wed Feb 8 13:39:35 2006 From: tma at mail.island.net (Tom Alldread) Date: Wed, 08 Feb 2006 12:39:35 -0800 Subject: [Rxtx] Win32/Linux Serial Port Data Dropouts In-Reply-To: <200602060702.k167255O007882@www.qbang.org> References: <200602060702.k167255O007882@www.qbang.org> Message-ID: <43EA5707.4020200@mail.island.net> Greetings Folks at RXTX: During the last couple of months I have been alternately testing with javax.comm 2 and RXTX 2.1 under Windows XP and CommApi 3 and RXTX 2.1 under Suse 10.0 Linux. In the process I have learned a little about java multi-threading under NetBeans 5 with Profiler. My java (jdk 1.5_06) application is used for data acquisition and provides a graphical display of A-D conversion data received from a 56KBaud serial port. The actual data throughput is about 10KBaud thus it is well below the speed of the port. I use hardware RTS/CTS flow control which can stall the data acquisition sample rate if necessary. This ensures the display computer has the ability to slow the data acquisition rate should it become too busy to accept the regular data flow. Both the serial port buffer and the java read buffer are set at 16KB. Usually the data transfers into the java read buffer are less than 100 bytes unless the data acquisition is recovering from a stall. The data flow normally hesitates after each 5 KB block as a continue command is needed from the display computer to start the drawing of a new graphics display line. Separate threads have been provided for the serial port event monitoring and data processing. The serial port event thread has been given the maximum priority and data processing thread the minimum priority provided by java. Thread yield statements have been placed within all data processing while/for loops as an effort to ensure quick access to CPU cycles for the serial port event thread. I have found that short data transmissions are essentially error free but occasional dropouts occur with continuous data flow especially under Windows XP. ....................................................................................................................................................................................... Linux results: I am happy to report that RXTX 2.1 appears to work very well under Linux although I did notice some errors when the screen savers were running with my dual monitors. I believe this is a local problem associated with my dual graphics which needs further attention. The recent CommApi 3 Linux release from Sun did not work at all with my program. It seemed to send commands out OK but did not receive any data. Although the serial port event triggered the ISR, the input stream appeared filled with nulls and thus did not contain any data. As my understanding is that CommApi 3 was tested with a Red Hat distribution of Linux I wonder if this problem is distro dependent? Although somewhat off topic here I wonder if anyone reading this has had similar experience? .................................................................................................................................................................................. Windows XP results: There are problems with occasional data dropouts which become more frequent as the sampling rate is increased or if the computer becomes busy with other duties. The dropouts typically consist of a half dozen byte block of lost data. It appears the lost bytes never get added to the java input stream. There has not been any indication of garbled data, overruns or framing errors which suggests the UART communications remains solid. Using javax.comm 2 I found that the setting of SerialPort 'enableReceiveThreshold' to 40 and 'enableReceiveTimeout' of 100mS reduced the dropouts error rate significantly. I found that I could not get RXTX 2.1 to function with the aforementioned threshold and timeout settings. The javax.comm 2 interface is consequently performing better for me under Windows than RXTX 2.1. I wonder if anyone here has any suggestions as to what I might try to improve RXTX 2.1? Although my settings are the same as under Suse 10.0, RXTX 2.1 performs much better for me under Linux than any of the alternatives that I have tried under Windows XP . ............................................................................................................................................................................... I would like to establish, based on the experience of others, if I have reached the normally expected performance limit of java serial port communications? Should I expect to achieve virtually error free serial port data input from a continuous stream under Windows XP java software? I am considering changing my protocol to packets with error checking if necessary but would like to know if the dropout problems I am experiencing are typical or not before I take this rather work intensive plunge. Many thanks in advance for any help! Best Regards, Tom Alldread -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.375 / Virus Database: 267.15.2/253 - Release Date: 2006-02-07 From jlaxson at mac.com Wed Feb 8 23:56:48 2006 From: jlaxson at mac.com (John Laxson) Date: Thu, 9 Feb 2006 00:56:48 -0600 Subject: [Rxtx] PortInUseException: Unknown Application on OSX Message-ID: Hi, I've been trying to get RXTX 2.1.7 going on Mac OS X for a while here, and am running up into a wall here. I've tried with pre- compiled and the source version and get the same problem, a gnu.io.PortInUseException: Unknown Application. I have run the fixperms script included with the source distribution, and id shows me as a member of the uucp group, and permissions on /var/spool/uucp are 775 root:uucp. Running a test program (included at the bottom for clarity) lets me enumerate all the serial ports correctly, but trying to open any of them gives the PortInUseException. If it helps, when I try to open a port that's set to make an outgoing bluetooth connection, there is no delay and no connection attempt at all. Thanks, John Laxson PS: The documentation wiki on qbang.org shows 404, and has for a few days now. My test code: public static void main(String[] args) { SerialPort serialPort; try { Enumeration e = CommPortIdentifier.getPortIdentifiers(); CommPortIdentifier ident; while (e.hasMoreElements()) { ident = (CommPortIdentifier)e.nextElement(); System.out.println(ident.getName()); } ident = CommPortIdentifier.getPortIdentifier("/dev/cu.modem"); serialPort = (SerialPort) ident.open("Me", 5000); } catch (Exception e) { e.printStackTrace(); } } From rajesh.invincible at gmail.com Thu Feb 9 03:39:38 2006 From: rajesh.invincible at gmail.com (Rajesh N) Date: Thu, 9 Feb 2006 16:09:38 +0530 Subject: [Rxtx] Re: Move .java Files in gnu.io filesystem hierarchy - Maven (2) In-Reply-To: <43DF21D2.7090200@ngi.it> References: <43DF21D2.7090200@ngi.it> Message-ID: <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Can anybody tell me how to overcome these EXCEPTIONS I AM WORKING ON SERIAL COMMN IN JAVA ON LINUX. 1. " NOT ALL PARAMETERS SUPPORTED BY THE KERNEL" This i came across the following statement inmy prog. SerialP is A SerialPort object SerialP.setSerialPortParams(9600(BAUDRATE),DATABITS_8,STOPBITS_1,PARITY_NONE) 2. NullPointer Exception at Event Dispatch Now i have checked all my object references for a null reference but i found none i have put up my entire code in try catch blocks but still I AM UNABLE TO CATCH THIS EXCEPTION AND HENCE MY APPLICATION CLOSES HOW DOES THESE GO? PLEASE HELP ME IT IS URGENTTTTTTTTTTTTTTTT yours sincerely RAJESH On 1/31/06, Fabio Frumento wrote: > Hi Xavier, > > I don't know maven at all but the directory hierarchy listed buy Trent > is fine for me... > > I'll take a look to maven, it seems an interesting project > > Regards > > Fabio Frumento > > Trent Jarvi wrote: > > On Tue, 31 Jan 2006, Xavier Frisaye wrote: > > > >> Hi all, > >> > >> If you are going to rearrange the src folder, i will propose to use > >> maven 2 and follow its directory structure > >> > (http://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html). > >> > >> Maven 2 simplify java project and give a standard way to make projects > >> (http://maven.apache.org/). > >> We are using it for internal projects and we are very satisfied. > >> > >> Is anybody interested? > >> > >> I'm not an expert in maven 2 (yet) but i'm agree to help using it if > >> you choose to make so. > >> > > > > so this would be: > > > > rxtx-devel/src/main/java/gnu.io > > rxtx-devel/src/test/java/ManIwish.java > > > > I don't use IDEs very much so I'll let others comment. But I don't see > > a problem with that. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Thu Feb 9 09:50:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 9 Feb 2006 09:50:31 -0700 (MST) Subject: [Rxtx] Re: Move .java Files in gnu.io filesystem hierarchy - Maven (2) In-Reply-To: <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Message-ID: On Thu, 9 Feb 2006, Rajesh N wrote: > Can anybody tell me how to overcome these EXCEPTIONS > I AM WORKING ON SERIAL COMMN IN JAVA ON LINUX. > > 1. " NOT ALL PARAMETERS SUPPORTED BY THE KERNEL" > > This i came across the following statement inmy prog. > SerialP is A SerialPort object > SerialP.setSerialPortParams(9600(BAUDRATE),DATABITS_8,STOPBITS_1,PARITY_NONE) > Strange. The parameters you use are the same the port should open with by default. Could you paste the actual exception you are getting? I don't see that in the rxtx source. Also it would help to know the rxtx version. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Fri Feb 10 15:29:05 2006 From: lux at diesel-research.com (Kim Lux) Date: Fri, 10 Feb 2006 15:29:05 -0700 Subject: [Rxtx] One serial port object for both sending and receiving ? Message-ID: <1139610545.18177.4.camel@zd7280> Is it OK to use one SerialPort ojbect (ex Serial Port serialPort;) and use it for both sending and receiving ? For example: ======================================================================== static SerialPort serialPort = null; static OutputStream serialOut = null; static InputStream serialIn = null; // assign it to an outputStream for use try{ serialOut = serialPort.getOutputStream(); System.out.println("Serial output stream has been assigned."); }//try catch(IOException e) { System.out.println("Error: Couldn't assign output stream to serial port."); }//catch //assign it to an inputStream for use try{ serialIn = serialPort.getInputStream(); System.out.println("Serial input stream has been assigned."); }//try catch(IOException e) { System.out.println("Error: Couldn't assign input stream to serial port."); }//catch ======================================================================== -- Kim Lux, Diesel Research Inc. From lux at diesel-research.com Fri Feb 10 21:23:00 2006 From: lux at diesel-research.com (Kim Lux) Date: Fri, 10 Feb 2006 21:23:00 -0700 Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Message-ID: <1139631780.23882.10.camel@zd7280> I've got a problem receiving chars with my version of serialRead, written in an SWT GUI. I had a Java pro have a good look at my code and he can't see anything wrong with it. I can send chars fine. When I receive a char the cpu usage for the app goes to 100% and the code in the serial event handler doesn't get executed. The instructions on the Java Comm Serial API How-To for Linux page state that I must install javacomm. Is that true ? Everything builds without it and I can send chars on rxtx just fine, but I can't receive them. Could this be the problem ? I downloaded and installed javacomm. I was not able to add "Driver=gnuio.RXTXCommDriver to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 installed in /usr/java/jre1.5.0_05. I added comm.jar to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext to the library paths. Is this OK ? Does it matter that I am receiving on /dev/ttyUSB0 ? Thanks. -- Kim Lux, Diesel Research Inc. From lunareclipse03 at web.de Sat Feb 11 09:44:46 2006 From: lunareclipse03 at web.de (lunareclipse03@web.de) Date: Sat, 11 Feb 2006 17:44:46 +0100 Subject: [Rxtx] Question about Serial I/O under Win32 Message-ID: <662084330@web.de> Hello everybody, I have a strange problem with a piece of code I made for myself. No, this is not really concerning rxtx, but nevertheless I post this to the list, hoping that some of you can help me. I've written two libraries, one for linux and one for win32. The linux port works quite well, I can send / receive faxes and / or replay voice messages over the telephone line using a voice modem. But the win32 port of the library causes some trouble. If, for example, I send out a fax with a certain modem under linux, it works well. The fax is complete when it comes out of the fax machine. If I then use the same modem to send out a fax under win32, the fax coming out of the fax machine gets "stuck" halfways, but the sending modem thinks that transmission was ok and drops the connection. The answering fax machine then gives me "error while receiving." The "upper layer" java code MUST be right, because if I do the same thing under linux (using the linux library), everything is alright. Now I have to ask: Can somebody please help me out with this??!? Could it be the case that some kind of flow control or COMMTIMEOUTS setting causes this behaviour? I set flow control to RTS/CTS before sending out a fax. How can I DISABLE flow control? Or what do you think? Can something else cause this problems? Thank you all for your time and PLEASE write back soon. Regards, --Sven Ahlemann Am Waldrand 31 45721 Haltern am See Germany ______________________________________________________________ Verschicken Sie romantische, coole und witzige Bilder per SMS! Jetzt bei WEB.DE FreeMail: http://f.web.de/?mc=021193 From lux at diesel-research.com Sat Feb 11 10:06:52 2006 From: lux at diesel-research.com (Kim Lux) Date: Sat, 11 Feb 2006 10:06:52 -0700 Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: <1139631780.23882.10.camel@zd7280> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> <1139631780.23882.10.camel@zd7280> Message-ID: <1139677612.3431.5.camel@zd7280> More on this problem. I copied and pasted simpleRead into a console based Eclipse project and I've got the same result, except that cpu usage doesn't go to 100%. I'm beginning to think there is an issue in rxtx. My imports for simpleRead are: ============================ import gnu.io.*; import java.util.*; //import javax.comm.*; import java.io.*; =========================== Any ideas ? I am trying to read from /dev/ttyUSB0 using a serial to USB adapter which has worked well with minicom and gtkterm. Thanks. On Fri, 2006-02-10 at 21:23 -0700, Kim Lux wrote: > I've got a problem receiving chars with my version of serialRead, > written in an SWT GUI. > > I had a Java pro have a good look at my code and he can't see anything > wrong with it. > > I can send chars fine. When I receive a char the cpu usage for the app > goes to 100% and the code in the serial event handler doesn't get > executed. > > The instructions on the Java Comm Serial API How-To for Linux page state > that I must install javacomm. Is that true ? Everything builds without > it and I can send chars on rxtx just fine, but I can't receive them. > Could this be the problem ? > > I downloaded and installed javacomm. I was not able to add > "Driver=gnuio.RXTXCommDriver > to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not > have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 > installed in /usr/java/jre1.5.0_05. I added comm.jar > to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext > to the library paths. Is this OK ? > > Does it matter that I am receiving on /dev/ttyUSB0 ? > > Thanks. > -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Sun Feb 12 21:01:33 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:01:33 -0700 (MST) Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: <1139677612.3431.5.camel@zd7280> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> <1139631780.23882.10.camel@zd7280> <1139677612.3431.5.camel@zd7280> Message-ID: I suspect what is happening is the select() is breaking out in the native code but the driver does not have support for notifying there are X bytes available. On some traditional Unix based systems, the only way you know data is available is the fd status changes and do an FIORDCHK ioctl. Or perhaps the only thing you can know is the fd status changed. It would take reading through the kernel driver code to know for sure. So on USB, depending upon the driver, the same may need to be done or the driver improved a bit if possible to support. Polling reads will also work but don't use the event driven model of CommAPI which isnt acceptable in the long run. The 100% cpu usage can then be explained because select no longer blocks until the data is read; the eventLoop spins loose. You can put a well placed sleep but rxtx only expects those are needed when it knows data is available. This may not be a super simple thing to understand and fix. I do have ideas to get you started. I'm going to be short on time the next couple weeks. I expect to put some good time in and answer some other questions I saw around the 25th. For now, I'd look at the following and go from there with the hints I've given. JNIEXPORT jint JNICALL RXTXPort(nativeavailable)( JNIEnv *env, jobject jobj ) { int fd = get_java_var( env, jobj,"fd","I" ); int result; /* char message[80]; ENTER( "RXTXPort:nativeavailable" ); On SCO OpenServer FIONREAD always fails for serial devices, so try ioctl FIORDCHK instead; will only tell us whether bytes are available, not how many, but better than nothing. This turns out to be true on Solaris also. taj. */ #ifdef FIORDCHK /* __unixware__ __sun__ probably others */ result = ioctl(fd, FIORDCHK, 0); #else if( ioctl( fd, FIONREAD, &result ) < 0 ) { goto fail; } #endif /* FIORDCHK */ On Sat, 11 Feb 2006, Kim Lux wrote: > > More on this problem. I copied and pasted simpleRead into a console > based Eclipse project and I've got the same result, except that cpu > usage doesn't go to 100%. I'm beginning to think there is an issue in > rxtx. > > My imports for simpleRead are: > > ============================ > import gnu.io.*; > import java.util.*; > //import javax.comm.*; > import java.io.*; > =========================== > > Any ideas ? I am trying to read from /dev/ttyUSB0 using a serial to > USB adapter which has worked well with minicom and gtkterm. > > Thanks. > > > > On Fri, 2006-02-10 at 21:23 -0700, Kim Lux wrote: >> I've got a problem receiving chars with my version of serialRead, >> written in an SWT GUI. >> >> I had a Java pro have a good look at my code and he can't see anything >> wrong with it. >> >> I can send chars fine. When I receive a char the cpu usage for the app >> goes to 100% and the code in the serial event handler doesn't get >> executed. >> >> The instructions on the Java Comm Serial API How-To for Linux page state >> that I must install javacomm. Is that true ? Everything builds without >> it and I can send chars on rxtx just fine, but I can't receive them. >> Could this be the problem ? >> >> I downloaded and installed javacomm. I was not able to add >> "Driver=gnuio.RXTXCommDriver >> to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not >> have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 >> installed in /usr/java/jre1.5.0_05. I added comm.jar >> to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext >> to the library paths. Is this OK ? >> >> Does it matter that I am receiving on /dev/ttyUSB0 ? >> >> Thanks. >> > From tjarvi at qbang.org Sun Feb 12 21:03:30 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:03:30 -0700 (MST) Subject: [Rxtx] One serial port object for both sending and receiving ? In-Reply-To: <1139610545.18177.4.camel@zd7280> References: <1139610545.18177.4.camel@zd7280> Message-ID: On Fri, 10 Feb 2006, Kim Lux wrote: > > Is it OK to use one SerialPort ojbect (ex Serial Port serialPort;) and > use it for both sending and receiving ? > > For example: > > ======================================================================== > static SerialPort serialPort = null; > static OutputStream serialOut = null; > static InputStream serialIn = null; > > > > > // assign it to an outputStream for use > try{ > serialOut = serialPort.getOutputStream(); > System.out.println("Serial output stream has been assigned."); > }//try > catch(IOException e) > { > System.out.println("Error: Couldn't assign output stream to serial > port."); > }//catch > > > //assign it to an inputStream for use > try{ > serialIn = serialPort.getInputStream(); > System.out.println("Serial input stream has been assigned."); > }//try > catch(IOException e) > { > System.out.println("Error: Couldn't assign input stream to serial > port."); > }//catch This should be fine. In fact trying to do it another way will probably not work as you will run into lockfile issues. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun Feb 12 21:13:13 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:13:13 -0700 (MST) Subject: [Rxtx] Question about Serial I/O under Win32 In-Reply-To: <662084330@web.de> References: <662084330@web.de> Message-ID: On Sat, 11 Feb 2006 lunareclipse03 at web.de wrote: > Hello everybody, > > I have a strange problem with a piece of code I made for myself. No, > this is not really concerning rxtx, but nevertheless I post this to the > list, hoping that some of you can help me. I've written two libraries, > one for linux and one for win32. The linux port works quite well, I can > send / receive faxes and / or replay voice messages over the telephone > line using a voice modem. But the win32 port of the library causes some > trouble. If, for example, I send out a fax with a certain modem under > linux, it works well. The fax is complete when it comes out of the fax > machine. If I then use the same modem to send out a fax under win32, the > fax coming out of the fax machine gets "stuck" halfways, but the sending > modem thinks that transmission was ok and drops the connection. The > answering fax machine then gives me "error while receiving." The "upper > layer" java code MUST be right, because if I do the same thing under > linux (using the linux library), everything is alright. Now I have to > ask: Can somebody please help me out with this??!? Could it be the case > that some kind of flow control or COMMTIMEOUTS setting causes this > behaviour? I set flow control to RTS/CTS before sending out a fax. How > can I DISABLE flow control? Or what do you think? Can something else > cause this problems? Thank you all for your time and PLEASE write back > soon. > Hi Sven I'm not too willing to talk about flow control at the low level until I confirm some things with test equipment later. It is not clear if you are using rxtx or writing your own native code. So I'm not sure how to answer much of this :) If you are wondering how to change the flow control using rxtx from java, The BlackBox example from Sun flips this back and forth. SerialPort.java in rxtx 2.1 uses the following: SerialPort.java: public static final int FLOWCONTROL_NONE =0; SerialPort.java: public static final int FLOWCONTROL_RTSCTS_IN =1; SerialPort.java: public static final int FLOWCONTROL_RTSCTS_OUT =2; SerialPort.java: public static final int FLOWCONTROL_XONXOFF_IN =4; SerialPort.java: public static final int FLOWCONTROL_XONXOFF_OUT=8; So if you set flowcontrol to RTSCTS, you can set it to NONE to turn it off. If you are looking for how to do it in native code, the rxtx Source is SerialImp.c (unix/linux/mac os x/w32) and termios.c (w32 only with SerialImp.c) You can track the code: SerialImp.c:JNIEXPORT void JNICALL RXTXPort(setflowcontrol)( JNIEnv *env, jobject jobj, jint flowmode ) termios.c:int tcgetattr( int fd, struct termios *s_termios ) termios.c:int tcsetattr( int fd, int when, struct termios *s_termios ) There may be a problem in the rxtx flow control code though. Rather than guess, I want to test this with a gold standard. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Feb 6 00:00:16 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 00:00:16 -0700 (MST) Subject: [Rxtx] wiki delay until tomorrow night. In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: On Sun, 5 Feb 2006, Trent Jarvi wrote: > On Sun, 5 Feb 2006, Kim Lux wrote: > >> usb ? Tell me more... I need that too. > > usb is a very proper design. Thats all it is. > Maybe rxtx could help usb. But it would start with helping bring back the community that was already there. It's not something I'd love to do but maybe its the right thing to do. It would probably take 2 years to do right. But maybe thats better than what we have now. I honestly don't know what IBM is doing which could just run over everything. Just some thoughts after some fine german wine. -- Trent Jarvi tjarvi at qbang.org From gadelavega at yahoo.com.ar Mon Feb 6 02:17:05 2006 From: gadelavega at yahoo.com.ar (Gonzalo A. de la Vega) Date: Mon, 06 Feb 2006 10:17:05 +0100 Subject: [Rxtx] Serial port ownership question In-Reply-To: References: <20060205113618.30274.qmail@web53501.mail.yahoo.com> <1139157422.4553.9.camel@zd7280> <1139158698.4936.9.camel@zd7280> Message-ID: <43E71411.4050402@yahoo.com.ar> On my Fedora Core 4: ls -l /dev/ttyS* crw-rw---- 1 root uucp 4, 64 Feb 6 2006 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Feb 6 2006 /dev/ttyS1 ... and: grep "ttyUSB" /etc/udev/rules.d/50-udev.rules KERNEL=="ttyUSB*", GROUP="uucp", MODE="0660" So anyone in the "uucp" group can use serial ports. On Gentoo the group is "tty". Trent Jarvi escribi?: > > > On Sun, 5 Feb 2006, Dr. Douglas Lyon wrote: > >> I can confirm that this is the case (only root ownership of >> serial ports, under fedora 4). >> Wow, what were they thinking?! >> - DL >> >>> I've found that the newer kernels have the serial ports owned by root. >>> For example, >>> >>> $ls -al /dev/tty* >>> crw-rw-rw- 1 root root 5, 0 Feb 5 02:06 /dev/tty >>> crw-rw---- 1 root root 4, 0 Feb 5 02:06 /dev/tty0 >>> crw------- 1 root root 4, 1 Feb 5 09:07 /dev/tty1 >>> crw-rw---- 1 root tty 4, 10 Feb 5 02:06 /dev/tty10 >>> crw-rw---- 1 root tty 4, 11 Feb 5 02:06 /dev/tty11 >>> ... > > > This is just not a problem jcp or such are going to solve. Its a > platform spitwad fight. But do look at pam. In fact thats what Sun > is doing too. Maybe Linux followed their lead.. I'm not a pam guy. > I've spent 16 hours trying to understand it but your users wont :) > > Solution? I have no clue. Its two tangent mentalities from my > perspective. > > -- > Trent Jarvi > tjarvi at qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mtnvega at yahoo.com.br Mon Feb 6 05:35:43 2006 From: mtnvega at yahoo.com.br (Luiz Jr) Date: Mon, 6 Feb 2006 12:35:43 +0000 (GMT) Subject: [Rxtx] Documentation Wiki In-Reply-To: <1139157422.4553.9.camel@zd7280> Message-ID: <20060206123543.57256.qmail@web53515.mail.yahoo.com> Hello, Thank you for you answer, but so the usage of the API is pretty much like the Java Communications Api? If yes, what version of the Java Comm Api? Thank you, Luiz A. Brandao Jr Kim Lux escreveu: On Sun, 2006-02-05 at 08:36 -0300, Luiz Jr wrote: > Hello, > > I want to start using the RXTX libraries, but I would to know how, > since I can not access the documentation wiki page I just started using them yesterday. Below is how I installed the libraries, if that helps. I used snippets of code from the SimpleWrite application here to get me going. http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html Instead of "import javax.comm.*;", use "import gnu.io.*;" which is gotten from RXTXcomm.jar, which you will need to include in your project references. I am working in Eclipse. BTW: there is no way to open a port without going through the port list and finding it. Maybe sometime in the future someone (me ?) will write a method called openSerialPort that allows the user to give a port identifier, such as "/dev/tty1" and return a port ready to use. It wouldn't take much to write that and it would save users a lot of code. Hope this helps. ======================================================================= 1) Figure out which java you are running, incase there is more than one installed. $ java -version java version "1.5.0_05" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_05-b05) Java HotSpot(TM) Client VM (build 1.5.0_05-b05, mixed mode, sharing) 2) Find all the jre directories and the one from which you are currently running. kfind (jre) 3) cd to that directory plus /lib/i386 cd /usr/java/jre1.5.0_05/lib/i386 4) Copy the library files (*.so) to that directory. cp /home/krlux/Desktop/'Java Controls'/rxtx-linux/bin/* . 5) Check that the copy was successful ls librxtx* librxtxI2C.so librxtxRaw.so librxtxSerial.so librxtxParallel.so librxtxRS485.so 6) cd to the /lib/ext directory for your java. cd /usr/java/jre1.5.0_05/lib/ext 7) Copy the Jar files there cp /home/krlux/Desktop/'Java Controls'/rxtx-linux/lib/ext/* . 8) Check that it was successful ls RXTX* RXTXcomm.jar Rxtx is now installed on your machine ready to use. =================================================================== -- Kim Lux, Diesel Research Inc. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx --------------------------------- Yahoo! Acesso Gr?tis - Internet r?pida e gr?tis. Instale o discador agora! -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/544aa403/attachment-0007.html From lyon at docjava.com Mon Feb 6 05:49:34 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 06 Feb 2006 07:49:34 -0500 Subject: [Rxtx] wiki delay until tomorrow night. In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: Hi All, I have often thought about USB drivers being needed. For example, the ironman watch will not interface to a mac (windows only). It is USB. My dymo label writer has no Java driver (native only). Etc. Most cheap web cameras are USB (and Java drivers go through JAI, if it supports the camera at all). The JAI code shows how sun did the USB drivers. You have to be a member of the jai project to download the source code. https://jai.dev.java.net has the jai distro. And then you are not allowed to redistribute it. However, we can all learn from it (if so inclined). Basically: cvs -d :pserver:lyon at cvs.dev.java.net:/cvs login cvs -d :pserver:lyon at cvs.dev.java.net:/cvs checkout jai-core You will need to user your own uid and pw to get in. The ant build has over 100 warnings from sun deprecations of its own code. You might say that they were hoisted on their own Picard ;) One interesting thing is that they support several platforms: linux-amd64 64-bit Linux-AMD64 linux-i586 32-bit Linux-x86 solaris-amd64 64-bit Solaris-AMD64 solaris-i586 32-bit Solaris-x86 solaris-sparc 32-bit Solaris-SPARC solaris-sparcv9 64-bit Solaris-SPARC windows-i586 32-bit Windows-x86 Thus, ant is used to provide a multi-platform native method distro. Neat. How do they do it? check this out: And: The core download does not contain any C source code (it was all pre-built). Basically, they are just copying .so and .dll files into build directories. I would love to see the C code for this...but Sun does not post it on the https://jai.dev.java.net site. I don't know why...Perhaps I missed it. - Doug >On Sun, 5 Feb 2006, Trent Jarvi wrote: > >>On Sun, 5 Feb 2006, Kim Lux wrote: >> >>>usb ? Tell me more... I need that too. >> >>usb is a very proper design. Thats all it is. >> > >Maybe rxtx could help usb. But it would start with helping bring >back the community that was already there. > >It's not something I'd love to do but maybe its the right thing to do. > >It would probably take 2 years to do right. But maybe thats better >than what we have now. > >I honestly don't know what IBM is doing which could just run over everything. > >Just some thoughts after some fine german wine. > >-- >Trent Jarvi >tjarvi at qbang.org > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tdelenik at gmail.com Mon Feb 6 05:56:32 2006 From: tdelenik at gmail.com (Thanasis Delenikas) Date: Mon, 6 Feb 2006 14:56:32 +0200 Subject: Fwd: [Rxtx] Documentation Wiki In-Reply-To: <1139157422.4553.9.camel@zd7280> References: <20060205113618.30274.qmail@web53501.mail.yahoo.com> <1139157422.4553.9.camel@zd7280> Message-ID: <310a1a930602060456t129f1dc6p5f2b908f13ab5a0b@mail.gmail.com> Hello all, Kim, this is a snippet from the code I use. The closest to directly opening a specific port without enumeration. << ... portId = CommPortIdentifier.getPortIdentifier(getPort()); serialPort = (SerialPort) portId.open("jSMSEngine", 1971); ... >> where getPort() return the string identifier of the port, i.e. "/dev/ttyS0" or "COM1" or whatever. Thanasis. ---------- Forwarded message ---------- From: Kim Lux Date: Feb 5, 2006 6:37 PM Subject: Re: [Rxtx] Documentation Wiki To: RXTX Developers and Users BTW: there is no way to open a port without going through the port list and finding it. Maybe sometime in the future someone (me ?) will write a method called openSerialPort that allows the user to give a port identifier, such as "/dev/tty1" and return a port ready to use. It wouldn't take much to write that and it would save users a lot of code. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/182ab5b8/attachment-0007.html From tjarvi at qbang.org Mon Feb 6 11:53:57 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 11:53:57 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: On Mon, 6 Feb 2006, Dr. Douglas Lyon wrote: > Hi All, > I have often thought about USB drivers being needed. > For example, the ironman watch will not interface > to a mac (windows only). It is USB. > My dymo label writer has no Java driver (native only). > Etc. > Most cheap web cameras are USB (and Java drivers go > through JAI, if it supports the camera at all). > The JAI code shows how sun did the USB drivers. > You have to be a member of the jai project to download > the source code. > https://jai.dev.java.net has the jai distro. > And then you are not allowed to redistribute it. However, > we can all learn from it (if so inclined). Basically: > cvs -d :pserver:lyon at cvs.dev.java.net:/cvs login > cvs -d :pserver:lyon at cvs.dev.java.net:/cvs checkout jai-core > You will need to user your own uid and pw to get in. > The ant build has over 100 warnings from sun deprecations > of its own code. > > You might say that they were hoisted on their own Picard ;) > > One interesting thing is that they support several platforms: > linux-amd64 64-bit Linux-AMD64 > linux-i586 32-bit Linux-x86 > solaris-amd64 64-bit Solaris-AMD64 > solaris-i586 32-bit Solaris-x86 > solaris-sparc 32-bit Solaris-SPARC > solaris-sparcv9 64-bit Solaris-SPARC > windows-i586 32-bit Windows-x86 > Thus, ant is used to provide a multi-platform native method distro. > Neat. > How do they do it? > check this out: > > > > > > > > > > > > > And: > > > > > > > > > > The core download does not contain any C source code (it was all pre-built). > Basically, they are just copying .so and .dll files into build directories. > > I would love to see the C code for this...but Sun does not post it on the > https://jai.dev.java.net site. > > I don't know why...Perhaps I missed it. > > - Doug > > I've looked at moving rxtx to Ant builds. I think that would help IDEs a great deal. I requested a evalutation desk copy the O'Reilly Ant book for some j2ee material I was teaching. http://www.oreilly.com/catalog/anttdg/ It has a one sentence mention of JNI. So there was not luck there. I saw that there is another Ant book that does mention JNI more. I can't find it now. Ant must be able to support it with extensions. http://ant.apache.org/manual/OptionalTasks/javah.html What the auto(break :) tools do in the rxtx build is 4 things really. 1) gcc compile flags 2) ld compile flags 3) config.h 4) compile flags for customizing rxtx (lockfiles, ...) See 1 All of this information except 4 can be static once obtained. So I'm not attached to the auto tools. If I could find an example of Ant being used for JNI code, I'd be one of the first to start moving that direction. Maybe someone saw an example someplace. The other thing we have not completed discussing is the directory structure. There is interest in making rxtx more IDE friendly. I get more mail about that off the list than how to install rxtx. And I see we have Ken Thompson in da house :) He is our trusted CVS maintainer and the guy that purchased the rxtx.org domain. Old community. We will need Ken for changing the directory structure of source. I would like to open up discussion about both of these as it is more than time. The problem is I have little experience with Ant and even less with IDEs. It would be nice if we could work with Eclipse and NetBeans. http://www.netbeans.org/ (sun and some community) http://www.eclipes.org (ibm,rhat,... perhaps more community) http://maven.apache.org/what-is-maven.html (apache. It is community) borland should sortof be here too but I think thats covered in eclipse. >From what I understand so far, we should morph rxtx to support those three maybe trusting apaches lead with maven. But I use vi. I have little to no clues beyond what people have fed me. Can we agree that thats the right direction to go? -- Trent Jarvi tjarvi at qbang.org From brian at mbari.org Mon Feb 6 14:57:50 2006 From: brian at mbari.org (Brian Schlining) Date: Mon, 6 Feb 2006 13:57:50 -0800 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> > The other thing we have not completed discussing is the directory > structure. There is interest in making rxtx more IDE friendly. I > get more mail about that off the list than how to install rxtx. > > And I see we have Ken Thompson in da house :) He is our trusted > CVS maintainer and the guy that purchased the rxtx.org domain. Old > community. We will need Ken for changing the directory structure of > source. > > I would like to open up discussion about both of these as it is > more than time. The problem is I have little experience with Ant > and even less with IDEs. It would be nice if we could work with > Eclipse and NetBeans. > > http://www.netbeans.org/ (sun and some community) > http://www.eclipes.org (ibm,rhat,... perhaps more community) > http://maven.apache.org/what-is-maven.html (apache. It is community) > borland should sortof be here too but I think thats covered in > eclipse. > >> From what I understand so far, we should morph rxtx to support >> those three > maybe trusting apaches lead with maven. But I use vi. I have > little to no clues beyond what people have fed me. > Maven likes the directory structure below for Java code. (From http:// maven.apache.org/guides/getting-started/index.html) This structure works fine with ant, netbeans, and eclipse. rxtx_root_directory `-- src |-- main | `-- java | `-- gnu | `-- io `-- test `-- java `-- gnu `-- io Brian Schlining Software Engineer http://www.mbari.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/d9451eba/attachment-0007.html From tjarvi at qbang.org Mon Feb 6 15:11:45 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 15:11:45 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: > rxtx_root_directory > `-- src > |-- main > | `-- java > | `-- gnu > | `-- io > `-- test > `-- java > `-- gnu > `-- io > >From what I understand this will just be good. For me it makes no difference. So lets do the rxtx thing. Let if fester for two weeks and if nobody objects, we will do it. I'm not doing this because I care. I'm doing this to eliminate much of my inbox. But test... man is rxtx lacking there in the community aspect. It is covered but not right. _maybe_ I can change that this year. -- Trent Jarvi tjarvi at qbang.org (cat hurding since 1997) From lux at diesel-research.com Mon Feb 6 21:38:49 2006 From: lux at diesel-research.com (Kim Lux) Date: Mon, 06 Feb 2006 21:38:49 -0700 Subject: [Rxtx] How can I use Lock Files with rxtx (in FC4) ? Message-ID: <1139287129.17031.3.camel@zd7280> I am now running an rxtx application on FC4. I am getting: ========================================================= check_group_uucp(): error testing lock file creation Error details: Permission denied check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL ========================================================= $ ls -al /var/lock total 32 drwxrwxr-x 4 root lock 4096 Feb 6 16:04 . drwxr-xr-x 24 root root 4096 Nov 14 01:19 .. drwx------ 2 root root 4096 Apr 27 2005 lvm drwxr-xr-x 2 root root 4096 Feb 6 16:04 subsys How do I fix this for regulator users ? -- Kim Lux, Diesel Research Inc. From dmarkman at mac.com Mon Feb 6 22:24:44 2006 From: dmarkman at mac.com (Dmitry Markman) Date: Tue, 7 Feb 2006 00:24:44 -0500 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: if I understands the issue right in order to be able to use ant for c/c++ compilation you have to install ant's cc task http://ant-contrib.sourceforge.net/cc.html it looks like it should work on mac os x (authors claim, that it's platform independent) but I never tested so all you have to do it's providing right command line for the gcc compiler On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: >> rxtx_root_directory >> `-- src >> |-- main >> | `-- java >> | `-- gnu >> | `-- io >> `-- test >> `-- java >> `-- gnu >> `-- io >> > > >> From what I understand this will just be good. > > For me it makes no difference. So lets do the rxtx thing. Let if > fester for two weeks and if nobody objects, we will do it. > > I'm not doing this because I care. I'm doing this to eliminate > much of my inbox. > > But test... man is rxtx lacking there in the community aspect. It > is covered but not right. _maybe_ I can change that this year. > > -- > Trent Jarvi > tjarvi at qbang.org > (cat hurding since 1997) > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx Dmitry Markman From lux at diesel-research.com Mon Feb 6 23:20:15 2006 From: lux at diesel-research.com (Kim Lux) Date: Mon, 06 Feb 2006 23:20:15 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? Message-ID: <1139293215.3689.4.camel@zd7280> I'm running the code below. portlist.hasMoreElements() is false. /dev has ports in it as listed below. What am I doing wrong ? ========================================================== // Step through the list of ports until we find one that matches // the one we are looking for. portList = CommPortIdentifier.getPortIdentifiers(); while(portList.hasMoreElements()) { portID = (CommPortIdentifier) portList.nextElement(); // if (portID.getName().equals("/dev/ttyUSB0")) { myTA.append("Serial port ttyUSB0 has been found\n"); break; }// if portID equals... }// End of while... ========================================================== ls -al /dev/tty* crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 ... crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 -- Kim Lux, Diesel Research Inc. From david.garnier at trusted-logic.com Tue Feb 7 00:46:30 2006 From: david.garnier at trusted-logic.com (David Garnier) Date: Tue, 07 Feb 2006 08:46:30 +0100 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: <43E85056.2090608@trusted-logic.com> Hello, I think that the make-based build process is fine as it is, apart from the location of the Java source files. It is true that putting the Java source in a directory structure that map 1-to-1 to the Java package structure is the norm and should make it easier for everyone to modify the Java source, with or without an IDE. Ant is a good tool, but in the RXTX case I fail to see the advantage of using it compared to the current make-based process. As Trent said, they are more pressing issues, like testing. Regards, David Dmitry Markman wrote: > if I understands the issue right > in order to be able to use ant for c/c++ compilation > you have to install ant's cc task > http://ant-contrib.sourceforge.net/cc.html > > it looks like it should work on mac os x > (authors claim, that it's platform independent) > but I never tested > > so all you have to do it's providing right command line > for the gcc compiler > > > > > On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: > >>> rxtx_root_directory >>> `-- src >>> |-- main >>> | `-- java >>> | `-- gnu >>> | `-- io >>> `-- test >>> `-- java >>> `-- gnu >>> `-- io >>> >> >> >>> From what I understand this will just be good. >> >> For me it makes no difference. So lets do the rxtx thing. Let if >> fester for two weeks and if nobody objects, we will do it. >> >> I'm not doing this because I care. I'm doing this to eliminate much >> of my inbox. >> >> But test... man is rxtx lacking there in the community aspect. It is >> covered but not right. _maybe_ I can change that this year. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> (cat hurding since 1997) From tjarvi at qbang.org Tue Feb 7 01:11:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 01:11:31 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <43E85056.2090608@trusted-logic.com> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: On Tue, 7 Feb 2006, David Garnier wrote: > Hello, > > I think that the make-based build process is fine as it is, apart from the location of the Java > source files. It is true that putting the Java source in a directory structure that map 1-to-1 to > the Java package structure is the norm and should make it easier for everyone to modify the Java > source, with or without an IDE. > > Ant is a good tool, but in the RXTX case I fail to see the advantage of using it compared to the > current make-based process. As Trent said, they are more pressing issues, like testing. > Hi David I have more experience with testing rxtx than I can talk about. But let it be known, rxtx has gone trough 100's of hours of testing. We are hobby folks interested in toys but there is more. rxtx has had some of the best guidance in the industry there. This is not an easy thing. I may be able to come back in a month from the other side of the corperate fence and help. I suspect the tests could just be made public but they are in a very unusual environment that just wont work in a wider sense. This is something I'll be trying to change. At one point it was agreed we could just make the results public so this isnt just noise.. There is interest and I think its safe to mention that much. The big problem with testing in the past is most of it is done with a loopback connection. So we *still* have major questions regarding things like flow control. rxtx talks to itself over a loopback and it works. regardless of right or wrong. This requires more thought to be done right. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Feb 7 02:46:34 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 02:46:34 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: > The big problem with testing in the past is most of it is done with a > loopback connection. So we *still* have major questions regarding things > like flow control. rxtx talks to itself over a loopback and it works. > regardless of right or wrong. With serial communication there are gold standards. ckermit is probably a definitive 'standard.' Maybe its possible to do ping/pong tests with ckermit? Is it scriptable? There are known issues in rxtx. Probably the worst is some threading issues regarding some JREs with multiple JNI threads setting java variables. Man did I get schooled there. Just switch the c functions to returning variables and things go away. Sometimes they work fine, sometimes they blow up. Without understanding everything, somehow rhat got it right and debian (and especially gentoo) grabbed kernel patches causing all sort of harm. Its not hard to fix once you understand whats going on but nearly impossible to track with a debugger. So I have a good idea what 2.1-8 will have outside of the IDE modifications. rxtx 2.1-7 is a release for everyone to sync with. Its not even as stable as -pre17 as far as I know - I ran no test suites. I'll be chasing it too. We just had so many contributions that it was time. It seriously broke internal scheduals but thats a great thing :) The other thing I want to do in 2.1-8 is automagic baud rates. It turns out lots of shops are doing really funky baud rates for things like automobile test equipment. It is possible but it requires a fair amount of change in the native code. Is anyone looking at this? -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Feb 7 02:57:21 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 07 Feb 2006 04:57:21 -0500 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <43E85056.2090608@trusted-logic.com> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: Hi All, I agree, testing is very important. The problem I have been trying to address is related to cross-platform testing and the robust nature of the installs. Typically, I visit 3 platforms to deploy my product, windows, linux and mac. A build is performed on each platform. The idea that you can build for many platforms from one copy the source code seems attractive. This should enable synchronized deployments of identical code. The question of how to achieve this goal remains open. As Trent mentioned, this is hard. Perhaps Ant will help here (but perhaps not). Ant does seem to help with running unit tests. However, it does not help with multi-platform tests. For that you need many machines and different operating environments. Toward that end, I have created a multi-platform test that can be run from web start, located at: http://show.docjava.com:8086/book/cgij/code/jnlp/serialPort.PortTest.jnlp This is interesting because many people in the community can run the test and we can improve the test, as time permits. No, it is not a perfect solution, however, the idea does help with multi-platform tests using many machines and different operating environments. If the group has a good test for a general serial port set-ups, i would be happy to deploy it, for general evaluation using web start. And as for ANT, it is just an idea. Not all my ideas are good ones! - Doug >Hello, > >I think that the make-based build process is fine as it is, apart >from the location of the Java >source files. It is true that putting the Java source in a directory >structure that map 1-to-1 to >the Java package structure is the norm and should make it easier for >everyone to modify the Java >source, with or without an IDE. > >Ant is a good tool, but in the RXTX case I fail to see the advantage >of using it compared to the >current make-based process. As Trent said, they are more pressing >issues, like testing. > >Regards, >David > >Dmitry Markman wrote: >> if I understands the issue right >> in order to be able to use ant for c/c++ compilation >> you have to install ant's cc task >> http://ant-contrib.sourceforge.net/cc.html >> >> it looks like it should work on mac os x >> (authors claim, that it's platform independent) >> but I never tested >> >> so all you have to do it's providing right command line >> for the gcc compiler >> >> >> >> >> On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: >> >>>> rxtx_root_directory >>>> `-- src >>>> |-- main >>>> | `-- java >>>> | `-- gnu >>>> | `-- io >>>> `-- test >>>> `-- java >>>> `-- gnu >>>> `-- io >>>> >>> >>> >>>> From what I understand this will just be good. >>> >>> For me it makes no difference. So lets do the rxtx thing. Let if >>> fester for two weeks and if nobody objects, we will do it. >>> >>> I'm not doing this because I care. I'm doing this to eliminate much >>> of my inbox. >>> >>> But test... man is rxtx lacking there in the community aspect. It is >>> covered but not right. _maybe_ I can change that this year. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> (cat hurding since 1997) > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From matt.higgins at gmail.com Tue Feb 7 08:28:34 2006 From: matt.higgins at gmail.com (Matt Higgins) Date: Tue, 7 Feb 2006 10:28:34 -0500 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final Message-ID: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? import java.io.*; import java.util.*; import gnu.io.*; public class MySimpleRead implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; public static void main(String[] args) { boolean portFound = false; String defaultPort = "COM1"; if (args.length > 0) { defaultPort = args[0]; } portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; MySimpleRead reader = new MySimpleRead(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } } public MySimpleRead() { try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) { e.printStackTrace(); } try { inputStream = serialPort.getInputStream(); } catch (IOException e) { e.printStackTrace(); } try { serialPort.addEventListener(this); } catch (TooManyListenersException e) { e.printStackTrace(); } try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { e.printStackTrace(); } System.out.println("Baud is " + serialPort.getBaudRate()); System.out.println("Bits is " + serialPort.getDataBits()); System.out.println("Stop is " + serialPort.getStopBits()); System.out.println("Par is " + serialPort.getParity()); serialPort.notifyOnDataAvailable(true); readThread = new Thread(this); readThread.start(); } public void run() { // Thread.sleep(20000); //} catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { System.out.println("An event occurred " + event.getEventType()); switch (event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: byte[] readBuffer = new byte[20]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } System.out.print(new String(readBuffer)); } catch (IOException e) {} break; } } } --------------- Result on windows ------------------------------ Stable Library ============================================================== Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port:: COM1 Baud is 9600 Bits is 8 Stop is 1 Par is 0 ----------------- End Results ----------------------------------------- ------------------ Result on Linux ----------------------------------- Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 Found port: /dev/ttyS0 Baud is 9600 Bits is 8 Stop is 1 Par is 0 An event occurred 1 043100066224 ------------------ End Results --------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/a1431630/attachment-0007.html From brian at mbari.org Tue Feb 7 09:48:37 2006 From: brian at mbari.org (Brian Schlining) Date: Tue, 7 Feb 2006 08:48:37 -0800 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> Message-ID: <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> Hi Matt > The following code works fine on Linux but I never see any data > when run on Windows. This is a cut and paste from the SimpleRead > example. > I am attempting to read data from a bar code scanner. I can fire > up HyperTermianl on windows and see that the device is working > properly as I see the barcodes are scanned and echoed back to the > terminal. However when I run the app I don't see any data. It is > however associating with the com port as the informational bits > print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. Cheers Brian Schlining Software Engineer http://www.mbari.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/16d07f37/attachment-0007.html From lux at diesel-research.com Tue Feb 7 11:59:58 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 11:59:58 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139293215.3689.4.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> Message-ID: <1139338798.8145.4.camel@zd7280> Any ideas on this ? Any reason why portList.hasMoreElements() should be false even though there are devices in /dev ? On Mon, 2006-02-06 at 23:20 -0700, Kim Lux wrote: > I'm running the code below. > > portlist.hasMoreElements() is false. > > /dev has ports in it as listed below. > > What am I doing wrong ? > > > ========================================================== > // Step through the list of ports until we find one that matches > // the one we are looking for. > > portList = CommPortIdentifier.getPortIdentifiers(); > > while(portList.hasMoreElements()) > { > portID = (CommPortIdentifier) portList.nextElement(); // > if (portID.getName().equals("/dev/ttyUSB0")) > { > myTA.append("Serial port ttyUSB0 has been found\n"); > break; > }// if portID equals... > }// End of while... > ========================================================== > > ls -al /dev/tty* > crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty > crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 > crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 > crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 > crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 > ... > crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 > crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 > crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 > > > -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 12:20:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 12:20:25 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139338798.8145.4.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> Message-ID: On Tue, 7 Feb 2006, Kim Lux wrote: > > Any ideas on this ? Any reason why portList.hasMoreElements() should be > false even though there are devices in /dev ? > > > On Mon, 2006-02-06 at 23:20 -0700, Kim Lux wrote: >> I'm running the code below. >> >> portlist.hasMoreElements() is false. >> >> /dev has ports in it as listed below. >> >> What am I doing wrong ? >> >> >> ========================================================== >> // Step through the list of ports until we find one that matches >> // the one we are looking for. >> >> portList = CommPortIdentifier.getPortIdentifiers(); >> >> while(portList.hasMoreElements()) >> { >> portID = (CommPortIdentifier) portList.nextElement(); // >> if (portID.getName().equals("/dev/ttyUSB0")) >> { >> myTA.append("Serial port ttyUSB0 has been found\n"); >> break; >> }// if portID equals... >> }// End of while... >> ========================================================== >> >> ls -al /dev/tty* >> crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty >> crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 >> crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 >> crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 >> crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 >> ... >> crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 >> crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 >> crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 >> >> >> > Hi Kim What rxtx does is try to open the port and do a timed out read. If the kernel/... do not complain it's enumarted. I suspect you could do a crude test by doing something like cat /dev/ttyS0 > /dev/null If that barfs then rxtx wont enumerate the port. hmm looking at your question again, I suspect it's a lockfile problem. This is documented in INSTALL with the source. Its easy enough to test this too.. touch /var/lock/testingrxtxlockfiles && rm -f /var/lock/testingrxtxlockfiles If you are not in the right group it will bail. Root will work regardless. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 12:37:56 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 12:37:56 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> Message-ID: <1139341076.8145.11.camel@zd7280> Exactly which ports does rxtx attempt to put into the list ? /dev/* or /dev/tty* or /dev/tty[0-9[0-9] ? or /dev/ttyS* ? For the record, only /dev/ttyUSB0 is a valid port on the machine I am presently on. Will this be a problem ? On Tue, 2006-02-07 at 12:20 -0700, Trent Jarvi wrote: > This is documented in INSTALL with the source. > I was wondering where that file was. I will download source and dig it up. Thanks. -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 12:51:09 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 12:51:09 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139341076.8145.11.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: On Tue, 7 Feb 2006, Kim Lux wrote: > > Exactly which ports does rxtx attempt to put into the list ? /dev/* > or /dev/tty* or /dev/tty[0-9[0-9] ? or /dev/ttyS* ? > > For the record, only /dev/ttyUSB0 is a valid port on the machine I am > presently on. Will this be a problem ? > > > On Tue, 2006-02-07 at 12:20 -0700, Trent Jarvi wrote: >> This is documented in INSTALL with the source. >> > I was wondering where that file was. I will download source and dig it > up. > > Thanks. > Hmm I'm looking at pre17 so this may have changed. (its just what I have on this machine) if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA" // for the IPAQs }; CandidatePortPrefixes=Temp; } So you may need to add "ttyUSB" to that list. RXTX used to enumerate _everything_ see if(osName.equals("Linux-all-ports") But it became less than practical. This is all in RXTXCommDriver.java hmm I just did a cvs update. if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have to get your fingers into the code. We aim for sane defaults. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 13:06:45 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 13:06:45 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139342805.8145.22.camel@zd7280> On Tue, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > Hmm I'm looking at pre17 so this may have changed. (its just what I have > on this machine) > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA" // for the IPAQs > }; > CandidatePortPrefixes=Temp; > } > > > So you may need to add "ttyUSB" to that list. RXTX used to enumerate > _everything_ see if(osName.equals("Linux-all-ports") But it became less > than practical. > > This is all in RXTXCommDriver.java > > hmm I just did a cvs update. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have > to get your fingers into the code. We aim for sane defaults. Excellent. Thanks for taking the time. -- Kim Lux, Diesel Research Inc. From ideiglenes1 at freemail.hu Tue Feb 7 13:53:39 2006 From: ideiglenes1 at freemail.hu (--) Date: Tue, 07 Feb 2006 21:53:39 +0100 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139345619.22534.2.camel@localhost> Hi! I use this code to get all the extra Linux devices. :) if ("Linux".equals(System.getProperty("os.name"))) { System.setProperty("os.name","Linux-all-ports"); } driver = new RXTXCommDriver(); On k, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > On Tue, 7 Feb 2006, Kim Lux wrote: > > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have > to get your fingers into the code. We aim for sane defaults. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From matt.higgins at gmail.com Tue Feb 7 13:45:54 2006 From: matt.higgins at gmail.com (Matt Higgins) Date: Tue, 7 Feb 2006 15:45:54 -0500 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> Message-ID: <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> Sweet this is exactly what I needed. I was searching the archives through marc.theamisgroup they only have archives back to 1/3/05. Should have hit the mailman archive! Thanks a lot! On 2/7/06, Brian Schlining wrote: > > Hi Matt > > The following code works fine on Linux but I never see any data when run > on Windows. This is a cut and paste from the SimpleRead example. > I am attempting to read data from a bar code scanner. I can fire up > HyperTermianl on windows and see that the device is working properly as I > see the barcodes are scanned and echoed back to the terminal. However when I > run the app I don't see any data. It is however associating with the com > port as the informational bits print fine? > > > You're not the only one whose had this problem, I don't know if Trent has > addressed this is the latest release of RXTX but there is a workaround. > Here's the recent thread from the RXTX mailing list regarding this issues: > > Thanasis Delenikas tdelenik at gmail.com > Wed Jan 18 13:56:23 MST 2006 > > * Previous message: [Rxtx] Re: More close() performance fixes > * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] > > Hi all. > (I've subscribed again from my other email account). > > Trent, > > You are right. Linux *always* works, no matter what flow control you set. > Windows *works only* with hardware flow control (I haven't tested what > happens with software XON/XOFF flow control). > > I assume (but I am not certain) that even with no flow control at all, all > platforms should work. Without flow control, you have the risk of bumping > into overflow or framing errors, but that's your (the end programmer, I > mean) problem. > > >From my side, I shouldn't be working without flow control. That was a bug > too... It was some code forgotten from the old times, when I used to work > with phone emulation drivers which didn't support flow control. The > correct > way is to have some flow control enabled and that's why I suppose this is > a > low-severity bug for RxTx. > > I have no idea which platform shows the correct behaviour, since > my knowledge about Linux and the inner workings of these low-level i/o > operations is limited. > > Regards, > Thanasis Delenikas. > > > > > Message: 2 > > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > > From: Trent Jarvi > > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > > To: RXTX Developers and Users > > Message-ID: > > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > > > Hi all, > > > > > > Trent, I have found something. > > > I read your comment about flow control, so I experimented a bit. > > > > > > If you remember, in my sample program I've used no flow control at all > ( > > i.e. > > > Java constant FLOWCONTROL_NONE). > > > > > > Now, during testing, I've switch to hardware inbound flow control (i.e > . > > Java > > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > > beautifully! > > > > > > I think I will switch to H/W flow control and test things for a while, > > but > > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > > > > > Hi Thanasis, > > > > I'm fairly sure you have identified a bug. I would not worry too much > > about what Sun CommAPI w32 defaults are. I think they did more or less > > whatever the port opened with. Just a guess. Linux tries to stomp on > > ports so they are all the same. > > > > So this started out with Linux worked, Windows XP/.. did not as I > recall. > > Something is wrong in rxtx. Do I understand this right? > > > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > > > Perhaps there is something Wayne or I did not understand when we wrote > > that code. I wasnt programming back in the BBS days so modems are not > my > > thing. I have a few questions. > > > > Is the above matrix confirmed by observation? > > Linux just always worked? > > Which one _should_ work? I'm guessing modems work with hardware flow > > control. I'll have to dig around. > > > > The windows flow control changes a couple things with hardware flow > > control. Following the w32 API documentation is confusing sometimes. > > But it looks like Linux could have a bug too. > > Cheers > > Brian Schlining > Software Engineer > http://www.mbari.org > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/9c989144/attachment-0007.html From tjarvi at qbang.org Tue Feb 7 14:06:14 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 14:06:14 -0700 (MST) Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> Message-ID: >> >> You're not the only one whose had this problem, I don't know if Trent has >> addressed this is the latest release of RXTX but there is a workaround. >> Here's the recent thread from the RXTX mailing list regarding this issues: >> I have not. I expect to have access to some test equipment next month and I'll go through all of this. I really don't know whats going on and I need a gold standard. I thought maybe linux was autodetecting the flow control. Your observations would certainly be welcome. I need to talk to Russell King and see what he is doing. Until then I'd just be toying around over a loopback as usual. This is very high on the list though. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 17:25:05 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 17:25:05 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139358305.17994.2.camel@zd7280> My application now works. I installed the libraries and jar from 2.1-7 (Final). portlist.hasMoreElements is no longer false. The application finds the port for /dev/ttyUSB0. Thanks for your help, Trent (et al) Sorry I bothered you with this. Next time I will look in the source first. I didn't think it was an rxtx issue, I thought it was a Linux setup issue . On Tue, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > Hmm I'm looking at pre17 so this may have changed. (its just what I > have > on this machine) > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux > Serial Ports > "ttySA" // for the > IPAQs > }; > > CandidatePortPrefixes=Temp; > } > > > So you may need to add "ttyUSB" to that list. RXTX used to enumerate > _everything_ see if(osName.equals("Linux-all-ports") But it became > less > than practical. > > This is all in RXTXCommDriver.java > > hmm I just did a cvs update. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux > Serial Ports > "ttySA", // for the > IPAQs > "ttyUSB" // for USB > frobs > }; > > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you > have > to get your fingers into the code. We aim for sane defaults. -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 19:21:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 19:21:54 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139358305.17994.2.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> <1139358305.17994.2.camel@zd7280> Message-ID: >Sorry I bothered you with this. Next time I will look in the source >first. I didn't think it was an rxtx issue, I thought it was a Linux >setup issue . Why would you be sorry? I would have done the same. I'm glad it's working :) -- Trent Jarvi tjarvi at qbang.org From tma at mail.island.net Wed Feb 8 13:39:35 2006 From: tma at mail.island.net (Tom Alldread) Date: Wed, 08 Feb 2006 12:39:35 -0800 Subject: [Rxtx] Win32/Linux Serial Port Data Dropouts In-Reply-To: <200602060702.k167255O007882@www.qbang.org> References: <200602060702.k167255O007882@www.qbang.org> Message-ID: <43EA5707.4020200@mail.island.net> Greetings Folks at RXTX: During the last couple of months I have been alternately testing with javax.comm 2 and RXTX 2.1 under Windows XP and CommApi 3 and RXTX 2.1 under Suse 10.0 Linux. In the process I have learned a little about java multi-threading under NetBeans 5 with Profiler. My java (jdk 1.5_06) application is used for data acquisition and provides a graphical display of A-D conversion data received from a 56KBaud serial port. The actual data throughput is about 10KBaud thus it is well below the speed of the port. I use hardware RTS/CTS flow control which can stall the data acquisition sample rate if necessary. This ensures the display computer has the ability to slow the data acquisition rate should it become too busy to accept the regular data flow. Both the serial port buffer and the java read buffer are set at 16KB. Usually the data transfers into the java read buffer are less than 100 bytes unless the data acquisition is recovering from a stall. The data flow normally hesitates after each 5 KB block as a continue command is needed from the display computer to start the drawing of a new graphics display line. Separate threads have been provided for the serial port event monitoring and data processing. The serial port event thread has been given the maximum priority and data processing thread the minimum priority provided by java. Thread yield statements have been placed within all data processing while/for loops as an effort to ensure quick access to CPU cycles for the serial port event thread. I have found that short data transmissions are essentially error free but occasional dropouts occur with continuous data flow especially under Windows XP. ....................................................................................................................................................................................... Linux results: I am happy to report that RXTX 2.1 appears to work very well under Linux although I did notice some errors when the screen savers were running with my dual monitors. I believe this is a local problem associated with my dual graphics which needs further attention. The recent CommApi 3 Linux release from Sun did not work at all with my program. It seemed to send commands out OK but did not receive any data. Although the serial port event triggered the ISR, the input stream appeared filled with nulls and thus did not contain any data. As my understanding is that CommApi 3 was tested with a Red Hat distribution of Linux I wonder if this problem is distro dependent? Although somewhat off topic here I wonder if anyone reading this has had similar experience? .................................................................................................................................................................................. Windows XP results: There are problems with occasional data dropouts which become more frequent as the sampling rate is increased or if the computer becomes busy with other duties. The dropouts typically consist of a half dozen byte block of lost data. It appears the lost bytes never get added to the java input stream. There has not been any indication of garbled data, overruns or framing errors which suggests the UART communications remains solid. Using javax.comm 2 I found that the setting of SerialPort 'enableReceiveThreshold' to 40 and 'enableReceiveTimeout' of 100mS reduced the dropouts error rate significantly. I found that I could not get RXTX 2.1 to function with the aforementioned threshold and timeout settings. The javax.comm 2 interface is consequently performing better for me under Windows than RXTX 2.1. I wonder if anyone here has any suggestions as to what I might try to improve RXTX 2.1? Although my settings are the same as under Suse 10.0, RXTX 2.1 performs much better for me under Linux than any of the alternatives that I have tried under Windows XP . ............................................................................................................................................................................... I would like to establish, based on the experience of others, if I have reached the normally expected performance limit of java serial port communications? Should I expect to achieve virtually error free serial port data input from a continuous stream under Windows XP java software? I am considering changing my protocol to packets with error checking if necessary but would like to know if the dropout problems I am experiencing are typical or not before I take this rather work intensive plunge. Many thanks in advance for any help! Best Regards, Tom Alldread -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.375 / Virus Database: 267.15.2/253 - Release Date: 2006-02-07 From jlaxson at mac.com Wed Feb 8 23:56:48 2006 From: jlaxson at mac.com (John Laxson) Date: Thu, 9 Feb 2006 00:56:48 -0600 Subject: [Rxtx] PortInUseException: Unknown Application on OSX Message-ID: Hi, I've been trying to get RXTX 2.1.7 going on Mac OS X for a while here, and am running up into a wall here. I've tried with pre- compiled and the source version and get the same problem, a gnu.io.PortInUseException: Unknown Application. I have run the fixperms script included with the source distribution, and id shows me as a member of the uucp group, and permissions on /var/spool/uucp are 775 root:uucp. Running a test program (included at the bottom for clarity) lets me enumerate all the serial ports correctly, but trying to open any of them gives the PortInUseException. If it helps, when I try to open a port that's set to make an outgoing bluetooth connection, there is no delay and no connection attempt at all. Thanks, John Laxson PS: The documentation wiki on qbang.org shows 404, and has for a few days now. My test code: public static void main(String[] args) { SerialPort serialPort; try { Enumeration e = CommPortIdentifier.getPortIdentifiers(); CommPortIdentifier ident; while (e.hasMoreElements()) { ident = (CommPortIdentifier)e.nextElement(); System.out.println(ident.getName()); } ident = CommPortIdentifier.getPortIdentifier("/dev/cu.modem"); serialPort = (SerialPort) ident.open("Me", 5000); } catch (Exception e) { e.printStackTrace(); } } From rajesh.invincible at gmail.com Thu Feb 9 03:39:38 2006 From: rajesh.invincible at gmail.com (Rajesh N) Date: Thu, 9 Feb 2006 16:09:38 +0530 Subject: [Rxtx] Re: Move .java Files in gnu.io filesystem hierarchy - Maven (2) In-Reply-To: <43DF21D2.7090200@ngi.it> References: <43DF21D2.7090200@ngi.it> Message-ID: <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Can anybody tell me how to overcome these EXCEPTIONS I AM WORKING ON SERIAL COMMN IN JAVA ON LINUX. 1. " NOT ALL PARAMETERS SUPPORTED BY THE KERNEL" This i came across the following statement inmy prog. SerialP is A SerialPort object SerialP.setSerialPortParams(9600(BAUDRATE),DATABITS_8,STOPBITS_1,PARITY_NONE) 2. NullPointer Exception at Event Dispatch Now i have checked all my object references for a null reference but i found none i have put up my entire code in try catch blocks but still I AM UNABLE TO CATCH THIS EXCEPTION AND HENCE MY APPLICATION CLOSES HOW DOES THESE GO? PLEASE HELP ME IT IS URGENTTTTTTTTTTTTTTTT yours sincerely RAJESH On 1/31/06, Fabio Frumento wrote: > Hi Xavier, > > I don't know maven at all but the directory hierarchy listed buy Trent > is fine for me... > > I'll take a look to maven, it seems an interesting project > > Regards > > Fabio Frumento > > Trent Jarvi wrote: > > On Tue, 31 Jan 2006, Xavier Frisaye wrote: > > > >> Hi all, > >> > >> If you are going to rearrange the src folder, i will propose to use > >> maven 2 and follow its directory structure > >> > (http://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html). > >> > >> Maven 2 simplify java project and give a standard way to make projects > >> (http://maven.apache.org/). > >> We are using it for internal projects and we are very satisfied. > >> > >> Is anybody interested? > >> > >> I'm not an expert in maven 2 (yet) but i'm agree to help using it if > >> you choose to make so. > >> > > > > so this would be: > > > > rxtx-devel/src/main/java/gnu.io > > rxtx-devel/src/test/java/ManIwish.java > > > > I don't use IDEs very much so I'll let others comment. But I don't see > > a problem with that. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Thu Feb 9 09:50:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 9 Feb 2006 09:50:31 -0700 (MST) Subject: [Rxtx] Re: Move .java Files in gnu.io filesystem hierarchy - Maven (2) In-Reply-To: <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Message-ID: On Thu, 9 Feb 2006, Rajesh N wrote: > Can anybody tell me how to overcome these EXCEPTIONS > I AM WORKING ON SERIAL COMMN IN JAVA ON LINUX. > > 1. " NOT ALL PARAMETERS SUPPORTED BY THE KERNEL" > > This i came across the following statement inmy prog. > SerialP is A SerialPort object > SerialP.setSerialPortParams(9600(BAUDRATE),DATABITS_8,STOPBITS_1,PARITY_NONE) > Strange. The parameters you use are the same the port should open with by default. Could you paste the actual exception you are getting? I don't see that in the rxtx source. Also it would help to know the rxtx version. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Fri Feb 10 15:29:05 2006 From: lux at diesel-research.com (Kim Lux) Date: Fri, 10 Feb 2006 15:29:05 -0700 Subject: [Rxtx] One serial port object for both sending and receiving ? Message-ID: <1139610545.18177.4.camel@zd7280> Is it OK to use one SerialPort ojbect (ex Serial Port serialPort;) and use it for both sending and receiving ? For example: ======================================================================== static SerialPort serialPort = null; static OutputStream serialOut = null; static InputStream serialIn = null; // assign it to an outputStream for use try{ serialOut = serialPort.getOutputStream(); System.out.println("Serial output stream has been assigned."); }//try catch(IOException e) { System.out.println("Error: Couldn't assign output stream to serial port."); }//catch //assign it to an inputStream for use try{ serialIn = serialPort.getInputStream(); System.out.println("Serial input stream has been assigned."); }//try catch(IOException e) { System.out.println("Error: Couldn't assign input stream to serial port."); }//catch ======================================================================== -- Kim Lux, Diesel Research Inc. From lux at diesel-research.com Fri Feb 10 21:23:00 2006 From: lux at diesel-research.com (Kim Lux) Date: Fri, 10 Feb 2006 21:23:00 -0700 Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Message-ID: <1139631780.23882.10.camel@zd7280> I've got a problem receiving chars with my version of serialRead, written in an SWT GUI. I had a Java pro have a good look at my code and he can't see anything wrong with it. I can send chars fine. When I receive a char the cpu usage for the app goes to 100% and the code in the serial event handler doesn't get executed. The instructions on the Java Comm Serial API How-To for Linux page state that I must install javacomm. Is that true ? Everything builds without it and I can send chars on rxtx just fine, but I can't receive them. Could this be the problem ? I downloaded and installed javacomm. I was not able to add "Driver=gnuio.RXTXCommDriver to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 installed in /usr/java/jre1.5.0_05. I added comm.jar to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext to the library paths. Is this OK ? Does it matter that I am receiving on /dev/ttyUSB0 ? Thanks. -- Kim Lux, Diesel Research Inc. From lunareclipse03 at web.de Sat Feb 11 09:44:46 2006 From: lunareclipse03 at web.de (lunareclipse03@web.de) Date: Sat, 11 Feb 2006 17:44:46 +0100 Subject: [Rxtx] Question about Serial I/O under Win32 Message-ID: <662084330@web.de> Hello everybody, I have a strange problem with a piece of code I made for myself. No, this is not really concerning rxtx, but nevertheless I post this to the list, hoping that some of you can help me. I've written two libraries, one for linux and one for win32. The linux port works quite well, I can send / receive faxes and / or replay voice messages over the telephone line using a voice modem. But the win32 port of the library causes some trouble. If, for example, I send out a fax with a certain modem under linux, it works well. The fax is complete when it comes out of the fax machine. If I then use the same modem to send out a fax under win32, the fax coming out of the fax machine gets "stuck" halfways, but the sending modem thinks that transmission was ok and drops the connection. The answering fax machine then gives me "error while receiving." The "upper layer" java code MUST be right, because if I do the same thing under linux (using the linux library), everything is alright. Now I have to ask: Can somebody please help me out with this??!? Could it be the case that some kind of flow control or COMMTIMEOUTS setting causes this behaviour? I set flow control to RTS/CTS before sending out a fax. How can I DISABLE flow control? Or what do you think? Can something else cause this problems? Thank you all for your time and PLEASE write back soon. Regards, --Sven Ahlemann Am Waldrand 31 45721 Haltern am See Germany ______________________________________________________________ Verschicken Sie romantische, coole und witzige Bilder per SMS! Jetzt bei WEB.DE FreeMail: http://f.web.de/?mc=021193 From lux at diesel-research.com Sat Feb 11 10:06:52 2006 From: lux at diesel-research.com (Kim Lux) Date: Sat, 11 Feb 2006 10:06:52 -0700 Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: <1139631780.23882.10.camel@zd7280> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> <1139631780.23882.10.camel@zd7280> Message-ID: <1139677612.3431.5.camel@zd7280> More on this problem. I copied and pasted simpleRead into a console based Eclipse project and I've got the same result, except that cpu usage doesn't go to 100%. I'm beginning to think there is an issue in rxtx. My imports for simpleRead are: ============================ import gnu.io.*; import java.util.*; //import javax.comm.*; import java.io.*; =========================== Any ideas ? I am trying to read from /dev/ttyUSB0 using a serial to USB adapter which has worked well with minicom and gtkterm. Thanks. On Fri, 2006-02-10 at 21:23 -0700, Kim Lux wrote: > I've got a problem receiving chars with my version of serialRead, > written in an SWT GUI. > > I had a Java pro have a good look at my code and he can't see anything > wrong with it. > > I can send chars fine. When I receive a char the cpu usage for the app > goes to 100% and the code in the serial event handler doesn't get > executed. > > The instructions on the Java Comm Serial API How-To for Linux page state > that I must install javacomm. Is that true ? Everything builds without > it and I can send chars on rxtx just fine, but I can't receive them. > Could this be the problem ? > > I downloaded and installed javacomm. I was not able to add > "Driver=gnuio.RXTXCommDriver > to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not > have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 > installed in /usr/java/jre1.5.0_05. I added comm.jar > to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext > to the library paths. Is this OK ? > > Does it matter that I am receiving on /dev/ttyUSB0 ? > > Thanks. > -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Sun Feb 12 21:01:33 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:01:33 -0700 (MST) Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: <1139677612.3431.5.camel@zd7280> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> <1139631780.23882.10.camel@zd7280> <1139677612.3431.5.camel@zd7280> Message-ID: I suspect what is happening is the select() is breaking out in the native code but the driver does not have support for notifying there are X bytes available. On some traditional Unix based systems, the only way you know data is available is the fd status changes and do an FIORDCHK ioctl. Or perhaps the only thing you can know is the fd status changed. It would take reading through the kernel driver code to know for sure. So on USB, depending upon the driver, the same may need to be done or the driver improved a bit if possible to support. Polling reads will also work but don't use the event driven model of CommAPI which isnt acceptable in the long run. The 100% cpu usage can then be explained because select no longer blocks until the data is read; the eventLoop spins loose. You can put a well placed sleep but rxtx only expects those are needed when it knows data is available. This may not be a super simple thing to understand and fix. I do have ideas to get you started. I'm going to be short on time the next couple weeks. I expect to put some good time in and answer some other questions I saw around the 25th. For now, I'd look at the following and go from there with the hints I've given. JNIEXPORT jint JNICALL RXTXPort(nativeavailable)( JNIEnv *env, jobject jobj ) { int fd = get_java_var( env, jobj,"fd","I" ); int result; /* char message[80]; ENTER( "RXTXPort:nativeavailable" ); On SCO OpenServer FIONREAD always fails for serial devices, so try ioctl FIORDCHK instead; will only tell us whether bytes are available, not how many, but better than nothing. This turns out to be true on Solaris also. taj. */ #ifdef FIORDCHK /* __unixware__ __sun__ probably others */ result = ioctl(fd, FIORDCHK, 0); #else if( ioctl( fd, FIONREAD, &result ) < 0 ) { goto fail; } #endif /* FIORDCHK */ On Sat, 11 Feb 2006, Kim Lux wrote: > > More on this problem. I copied and pasted simpleRead into a console > based Eclipse project and I've got the same result, except that cpu > usage doesn't go to 100%. I'm beginning to think there is an issue in > rxtx. > > My imports for simpleRead are: > > ============================ > import gnu.io.*; > import java.util.*; > //import javax.comm.*; > import java.io.*; > =========================== > > Any ideas ? I am trying to read from /dev/ttyUSB0 using a serial to > USB adapter which has worked well with minicom and gtkterm. > > Thanks. > > > > On Fri, 2006-02-10 at 21:23 -0700, Kim Lux wrote: >> I've got a problem receiving chars with my version of serialRead, >> written in an SWT GUI. >> >> I had a Java pro have a good look at my code and he can't see anything >> wrong with it. >> >> I can send chars fine. When I receive a char the cpu usage for the app >> goes to 100% and the code in the serial event handler doesn't get >> executed. >> >> The instructions on the Java Comm Serial API How-To for Linux page state >> that I must install javacomm. Is that true ? Everything builds without >> it and I can send chars on rxtx just fine, but I can't receive them. >> Could this be the problem ? >> >> I downloaded and installed javacomm. I was not able to add >> "Driver=gnuio.RXTXCommDriver >> to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not >> have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 >> installed in /usr/java/jre1.5.0_05. I added comm.jar >> to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext >> to the library paths. Is this OK ? >> >> Does it matter that I am receiving on /dev/ttyUSB0 ? >> >> Thanks. >> > From tjarvi at qbang.org Sun Feb 12 21:03:30 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:03:30 -0700 (MST) Subject: [Rxtx] One serial port object for both sending and receiving ? In-Reply-To: <1139610545.18177.4.camel@zd7280> References: <1139610545.18177.4.camel@zd7280> Message-ID: On Fri, 10 Feb 2006, Kim Lux wrote: > > Is it OK to use one SerialPort ojbect (ex Serial Port serialPort;) and > use it for both sending and receiving ? > > For example: > > ======================================================================== > static SerialPort serialPort = null; > static OutputStream serialOut = null; > static InputStream serialIn = null; > > > > > // assign it to an outputStream for use > try{ > serialOut = serialPort.getOutputStream(); > System.out.println("Serial output stream has been assigned."); > }//try > catch(IOException e) > { > System.out.println("Error: Couldn't assign output stream to serial > port."); > }//catch > > > //assign it to an inputStream for use > try{ > serialIn = serialPort.getInputStream(); > System.out.println("Serial input stream has been assigned."); > }//try > catch(IOException e) > { > System.out.println("Error: Couldn't assign input stream to serial > port."); > }//catch This should be fine. In fact trying to do it another way will probably not work as you will run into lockfile issues. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun Feb 12 21:13:13 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:13:13 -0700 (MST) Subject: [Rxtx] Question about Serial I/O under Win32 In-Reply-To: <662084330@web.de> References: <662084330@web.de> Message-ID: On Sat, 11 Feb 2006 lunareclipse03 at web.de wrote: > Hello everybody, > > I have a strange problem with a piece of code I made for myself. No, > this is not really concerning rxtx, but nevertheless I post this to the > list, hoping that some of you can help me. I've written two libraries, > one for linux and one for win32. The linux port works quite well, I can > send / receive faxes and / or replay voice messages over the telephone > line using a voice modem. But the win32 port of the library causes some > trouble. If, for example, I send out a fax with a certain modem under > linux, it works well. The fax is complete when it comes out of the fax > machine. If I then use the same modem to send out a fax under win32, the > fax coming out of the fax machine gets "stuck" halfways, but the sending > modem thinks that transmission was ok and drops the connection. The > answering fax machine then gives me "error while receiving." The "upper > layer" java code MUST be right, because if I do the same thing under > linux (using the linux library), everything is alright. Now I have to > ask: Can somebody please help me out with this??!? Could it be the case > that some kind of flow control or COMMTIMEOUTS setting causes this > behaviour? I set flow control to RTS/CTS before sending out a fax. How > can I DISABLE flow control? Or what do you think? Can something else > cause this problems? Thank you all for your time and PLEASE write back > soon. > Hi Sven I'm not too willing to talk about flow control at the low level until I confirm some things with test equipment later. It is not clear if you are using rxtx or writing your own native code. So I'm not sure how to answer much of this :) If you are wondering how to change the flow control using rxtx from java, The BlackBox example from Sun flips this back and forth. SerialPort.java in rxtx 2.1 uses the following: SerialPort.java: public static final int FLOWCONTROL_NONE =0; SerialPort.java: public static final int FLOWCONTROL_RTSCTS_IN =1; SerialPort.java: public static final int FLOWCONTROL_RTSCTS_OUT =2; SerialPort.java: public static final int FLOWCONTROL_XONXOFF_IN =4; SerialPort.java: public static final int FLOWCONTROL_XONXOFF_OUT=8; So if you set flowcontrol to RTSCTS, you can set it to NONE to turn it off. If you are looking for how to do it in native code, the rxtx Source is SerialImp.c (unix/linux/mac os x/w32) and termios.c (w32 only with SerialImp.c) You can track the code: SerialImp.c:JNIEXPORT void JNICALL RXTXPort(setflowcontrol)( JNIEnv *env, jobject jobj, jint flowmode ) termios.c:int tcgetattr( int fd, struct termios *s_termios ) termios.c:int tcsetattr( int fd, int when, struct termios *s_termios ) There may be a problem in the rxtx flow control code though. Rather than guess, I want to test this with a gold standard. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Feb 6 00:00:16 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 00:00:16 -0700 (MST) Subject: [Rxtx] wiki delay until tomorrow night. In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: On Sun, 5 Feb 2006, Trent Jarvi wrote: > On Sun, 5 Feb 2006, Kim Lux wrote: > >> usb ? Tell me more... I need that too. > > usb is a very proper design. Thats all it is. > Maybe rxtx could help usb. But it would start with helping bring back the community that was already there. It's not something I'd love to do but maybe its the right thing to do. It would probably take 2 years to do right. But maybe thats better than what we have now. I honestly don't know what IBM is doing which could just run over everything. Just some thoughts after some fine german wine. -- Trent Jarvi tjarvi at qbang.org From gadelavega at yahoo.com.ar Mon Feb 6 02:17:05 2006 From: gadelavega at yahoo.com.ar (Gonzalo A. de la Vega) Date: Mon, 06 Feb 2006 10:17:05 +0100 Subject: [Rxtx] Serial port ownership question In-Reply-To: References: <20060205113618.30274.qmail@web53501.mail.yahoo.com> <1139157422.4553.9.camel@zd7280> <1139158698.4936.9.camel@zd7280> Message-ID: <43E71411.4050402@yahoo.com.ar> On my Fedora Core 4: ls -l /dev/ttyS* crw-rw---- 1 root uucp 4, 64 Feb 6 2006 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Feb 6 2006 /dev/ttyS1 ... and: grep "ttyUSB" /etc/udev/rules.d/50-udev.rules KERNEL=="ttyUSB*", GROUP="uucp", MODE="0660" So anyone in the "uucp" group can use serial ports. On Gentoo the group is "tty". Trent Jarvi escribi?: > > > On Sun, 5 Feb 2006, Dr. Douglas Lyon wrote: > >> I can confirm that this is the case (only root ownership of >> serial ports, under fedora 4). >> Wow, what were they thinking?! >> - DL >> >>> I've found that the newer kernels have the serial ports owned by root. >>> For example, >>> >>> $ls -al /dev/tty* >>> crw-rw-rw- 1 root root 5, 0 Feb 5 02:06 /dev/tty >>> crw-rw---- 1 root root 4, 0 Feb 5 02:06 /dev/tty0 >>> crw------- 1 root root 4, 1 Feb 5 09:07 /dev/tty1 >>> crw-rw---- 1 root tty 4, 10 Feb 5 02:06 /dev/tty10 >>> crw-rw---- 1 root tty 4, 11 Feb 5 02:06 /dev/tty11 >>> ... > > > This is just not a problem jcp or such are going to solve. Its a > platform spitwad fight. But do look at pam. In fact thats what Sun > is doing too. Maybe Linux followed their lead.. I'm not a pam guy. > I've spent 16 hours trying to understand it but your users wont :) > > Solution? I have no clue. Its two tangent mentalities from my > perspective. > > -- > Trent Jarvi > tjarvi at qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mtnvega at yahoo.com.br Mon Feb 6 05:35:43 2006 From: mtnvega at yahoo.com.br (Luiz Jr) Date: Mon, 6 Feb 2006 12:35:43 +0000 (GMT) Subject: [Rxtx] Documentation Wiki In-Reply-To: <1139157422.4553.9.camel@zd7280> Message-ID: <20060206123543.57256.qmail@web53515.mail.yahoo.com> Hello, Thank you for you answer, but so the usage of the API is pretty much like the Java Communications Api? If yes, what version of the Java Comm Api? Thank you, Luiz A. Brandao Jr Kim Lux escreveu: On Sun, 2006-02-05 at 08:36 -0300, Luiz Jr wrote: > Hello, > > I want to start using the RXTX libraries, but I would to know how, > since I can not access the documentation wiki page I just started using them yesterday. Below is how I installed the libraries, if that helps. I used snippets of code from the SimpleWrite application here to get me going. http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html Instead of "import javax.comm.*;", use "import gnu.io.*;" which is gotten from RXTXcomm.jar, which you will need to include in your project references. I am working in Eclipse. BTW: there is no way to open a port without going through the port list and finding it. Maybe sometime in the future someone (me ?) will write a method called openSerialPort that allows the user to give a port identifier, such as "/dev/tty1" and return a port ready to use. It wouldn't take much to write that and it would save users a lot of code. Hope this helps. ======================================================================= 1) Figure out which java you are running, incase there is more than one installed. $ java -version java version "1.5.0_05" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_05-b05) Java HotSpot(TM) Client VM (build 1.5.0_05-b05, mixed mode, sharing) 2) Find all the jre directories and the one from which you are currently running. kfind (jre) 3) cd to that directory plus /lib/i386 cd /usr/java/jre1.5.0_05/lib/i386 4) Copy the library files (*.so) to that directory. cp /home/krlux/Desktop/'Java Controls'/rxtx-linux/bin/* . 5) Check that the copy was successful ls librxtx* librxtxI2C.so librxtxRaw.so librxtxSerial.so librxtxParallel.so librxtxRS485.so 6) cd to the /lib/ext directory for your java. cd /usr/java/jre1.5.0_05/lib/ext 7) Copy the Jar files there cp /home/krlux/Desktop/'Java Controls'/rxtx-linux/lib/ext/* . 8) Check that it was successful ls RXTX* RXTXcomm.jar Rxtx is now installed on your machine ready to use. =================================================================== -- Kim Lux, Diesel Research Inc. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx --------------------------------- Yahoo! Acesso Gr?tis - Internet r?pida e gr?tis. Instale o discador agora! -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/544aa403/attachment-0008.html From lyon at docjava.com Mon Feb 6 05:49:34 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 06 Feb 2006 07:49:34 -0500 Subject: [Rxtx] wiki delay until tomorrow night. In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: Hi All, I have often thought about USB drivers being needed. For example, the ironman watch will not interface to a mac (windows only). It is USB. My dymo label writer has no Java driver (native only). Etc. Most cheap web cameras are USB (and Java drivers go through JAI, if it supports the camera at all). The JAI code shows how sun did the USB drivers. You have to be a member of the jai project to download the source code. https://jai.dev.java.net has the jai distro. And then you are not allowed to redistribute it. However, we can all learn from it (if so inclined). Basically: cvs -d :pserver:lyon at cvs.dev.java.net:/cvs login cvs -d :pserver:lyon at cvs.dev.java.net:/cvs checkout jai-core You will need to user your own uid and pw to get in. The ant build has over 100 warnings from sun deprecations of its own code. You might say that they were hoisted on their own Picard ;) One interesting thing is that they support several platforms: linux-amd64 64-bit Linux-AMD64 linux-i586 32-bit Linux-x86 solaris-amd64 64-bit Solaris-AMD64 solaris-i586 32-bit Solaris-x86 solaris-sparc 32-bit Solaris-SPARC solaris-sparcv9 64-bit Solaris-SPARC windows-i586 32-bit Windows-x86 Thus, ant is used to provide a multi-platform native method distro. Neat. How do they do it? check this out: And: The core download does not contain any C source code (it was all pre-built). Basically, they are just copying .so and .dll files into build directories. I would love to see the C code for this...but Sun does not post it on the https://jai.dev.java.net site. I don't know why...Perhaps I missed it. - Doug >On Sun, 5 Feb 2006, Trent Jarvi wrote: > >>On Sun, 5 Feb 2006, Kim Lux wrote: >> >>>usb ? Tell me more... I need that too. >> >>usb is a very proper design. Thats all it is. >> > >Maybe rxtx could help usb. But it would start with helping bring >back the community that was already there. > >It's not something I'd love to do but maybe its the right thing to do. > >It would probably take 2 years to do right. But maybe thats better >than what we have now. > >I honestly don't know what IBM is doing which could just run over everything. > >Just some thoughts after some fine german wine. > >-- >Trent Jarvi >tjarvi at qbang.org > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tdelenik at gmail.com Mon Feb 6 05:56:32 2006 From: tdelenik at gmail.com (Thanasis Delenikas) Date: Mon, 6 Feb 2006 14:56:32 +0200 Subject: Fwd: [Rxtx] Documentation Wiki In-Reply-To: <1139157422.4553.9.camel@zd7280> References: <20060205113618.30274.qmail@web53501.mail.yahoo.com> <1139157422.4553.9.camel@zd7280> Message-ID: <310a1a930602060456t129f1dc6p5f2b908f13ab5a0b@mail.gmail.com> Hello all, Kim, this is a snippet from the code I use. The closest to directly opening a specific port without enumeration. << ... portId = CommPortIdentifier.getPortIdentifier(getPort()); serialPort = (SerialPort) portId.open("jSMSEngine", 1971); ... >> where getPort() return the string identifier of the port, i.e. "/dev/ttyS0" or "COM1" or whatever. Thanasis. ---------- Forwarded message ---------- From: Kim Lux Date: Feb 5, 2006 6:37 PM Subject: Re: [Rxtx] Documentation Wiki To: RXTX Developers and Users BTW: there is no way to open a port without going through the port list and finding it. Maybe sometime in the future someone (me ?) will write a method called openSerialPort that allows the user to give a port identifier, such as "/dev/tty1" and return a port ready to use. It wouldn't take much to write that and it would save users a lot of code. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/182ab5b8/attachment-0008.html From tjarvi at qbang.org Mon Feb 6 11:53:57 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 11:53:57 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: On Mon, 6 Feb 2006, Dr. Douglas Lyon wrote: > Hi All, > I have often thought about USB drivers being needed. > For example, the ironman watch will not interface > to a mac (windows only). It is USB. > My dymo label writer has no Java driver (native only). > Etc. > Most cheap web cameras are USB (and Java drivers go > through JAI, if it supports the camera at all). > The JAI code shows how sun did the USB drivers. > You have to be a member of the jai project to download > the source code. > https://jai.dev.java.net has the jai distro. > And then you are not allowed to redistribute it. However, > we can all learn from it (if so inclined). Basically: > cvs -d :pserver:lyon at cvs.dev.java.net:/cvs login > cvs -d :pserver:lyon at cvs.dev.java.net:/cvs checkout jai-core > You will need to user your own uid and pw to get in. > The ant build has over 100 warnings from sun deprecations > of its own code. > > You might say that they were hoisted on their own Picard ;) > > One interesting thing is that they support several platforms: > linux-amd64 64-bit Linux-AMD64 > linux-i586 32-bit Linux-x86 > solaris-amd64 64-bit Solaris-AMD64 > solaris-i586 32-bit Solaris-x86 > solaris-sparc 32-bit Solaris-SPARC > solaris-sparcv9 64-bit Solaris-SPARC > windows-i586 32-bit Windows-x86 > Thus, ant is used to provide a multi-platform native method distro. > Neat. > How do they do it? > check this out: > > > > > > > > > > > > > And: > > > > > > > > > > The core download does not contain any C source code (it was all pre-built). > Basically, they are just copying .so and .dll files into build directories. > > I would love to see the C code for this...but Sun does not post it on the > https://jai.dev.java.net site. > > I don't know why...Perhaps I missed it. > > - Doug > > I've looked at moving rxtx to Ant builds. I think that would help IDEs a great deal. I requested a evalutation desk copy the O'Reilly Ant book for some j2ee material I was teaching. http://www.oreilly.com/catalog/anttdg/ It has a one sentence mention of JNI. So there was not luck there. I saw that there is another Ant book that does mention JNI more. I can't find it now. Ant must be able to support it with extensions. http://ant.apache.org/manual/OptionalTasks/javah.html What the auto(break :) tools do in the rxtx build is 4 things really. 1) gcc compile flags 2) ld compile flags 3) config.h 4) compile flags for customizing rxtx (lockfiles, ...) See 1 All of this information except 4 can be static once obtained. So I'm not attached to the auto tools. If I could find an example of Ant being used for JNI code, I'd be one of the first to start moving that direction. Maybe someone saw an example someplace. The other thing we have not completed discussing is the directory structure. There is interest in making rxtx more IDE friendly. I get more mail about that off the list than how to install rxtx. And I see we have Ken Thompson in da house :) He is our trusted CVS maintainer and the guy that purchased the rxtx.org domain. Old community. We will need Ken for changing the directory structure of source. I would like to open up discussion about both of these as it is more than time. The problem is I have little experience with Ant and even less with IDEs. It would be nice if we could work with Eclipse and NetBeans. http://www.netbeans.org/ (sun and some community) http://www.eclipes.org (ibm,rhat,... perhaps more community) http://maven.apache.org/what-is-maven.html (apache. It is community) borland should sortof be here too but I think thats covered in eclipse. >From what I understand so far, we should morph rxtx to support those three maybe trusting apaches lead with maven. But I use vi. I have little to no clues beyond what people have fed me. Can we agree that thats the right direction to go? -- Trent Jarvi tjarvi at qbang.org From brian at mbari.org Mon Feb 6 14:57:50 2006 From: brian at mbari.org (Brian Schlining) Date: Mon, 6 Feb 2006 13:57:50 -0800 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> > The other thing we have not completed discussing is the directory > structure. There is interest in making rxtx more IDE friendly. I > get more mail about that off the list than how to install rxtx. > > And I see we have Ken Thompson in da house :) He is our trusted > CVS maintainer and the guy that purchased the rxtx.org domain. Old > community. We will need Ken for changing the directory structure of > source. > > I would like to open up discussion about both of these as it is > more than time. The problem is I have little experience with Ant > and even less with IDEs. It would be nice if we could work with > Eclipse and NetBeans. > > http://www.netbeans.org/ (sun and some community) > http://www.eclipes.org (ibm,rhat,... perhaps more community) > http://maven.apache.org/what-is-maven.html (apache. It is community) > borland should sortof be here too but I think thats covered in > eclipse. > >> From what I understand so far, we should morph rxtx to support >> those three > maybe trusting apaches lead with maven. But I use vi. I have > little to no clues beyond what people have fed me. > Maven likes the directory structure below for Java code. (From http:// maven.apache.org/guides/getting-started/index.html) This structure works fine with ant, netbeans, and eclipse. rxtx_root_directory `-- src |-- main | `-- java | `-- gnu | `-- io `-- test `-- java `-- gnu `-- io Brian Schlining Software Engineer http://www.mbari.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/d9451eba/attachment-0008.html From tjarvi at qbang.org Mon Feb 6 15:11:45 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 15:11:45 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: > rxtx_root_directory > `-- src > |-- main > | `-- java > | `-- gnu > | `-- io > `-- test > `-- java > `-- gnu > `-- io > >From what I understand this will just be good. For me it makes no difference. So lets do the rxtx thing. Let if fester for two weeks and if nobody objects, we will do it. I'm not doing this because I care. I'm doing this to eliminate much of my inbox. But test... man is rxtx lacking there in the community aspect. It is covered but not right. _maybe_ I can change that this year. -- Trent Jarvi tjarvi at qbang.org (cat hurding since 1997) From lux at diesel-research.com Mon Feb 6 21:38:49 2006 From: lux at diesel-research.com (Kim Lux) Date: Mon, 06 Feb 2006 21:38:49 -0700 Subject: [Rxtx] How can I use Lock Files with rxtx (in FC4) ? Message-ID: <1139287129.17031.3.camel@zd7280> I am now running an rxtx application on FC4. I am getting: ========================================================= check_group_uucp(): error testing lock file creation Error details: Permission denied check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL ========================================================= $ ls -al /var/lock total 32 drwxrwxr-x 4 root lock 4096 Feb 6 16:04 . drwxr-xr-x 24 root root 4096 Nov 14 01:19 .. drwx------ 2 root root 4096 Apr 27 2005 lvm drwxr-xr-x 2 root root 4096 Feb 6 16:04 subsys How do I fix this for regulator users ? -- Kim Lux, Diesel Research Inc. From dmarkman at mac.com Mon Feb 6 22:24:44 2006 From: dmarkman at mac.com (Dmitry Markman) Date: Tue, 7 Feb 2006 00:24:44 -0500 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: if I understands the issue right in order to be able to use ant for c/c++ compilation you have to install ant's cc task http://ant-contrib.sourceforge.net/cc.html it looks like it should work on mac os x (authors claim, that it's platform independent) but I never tested so all you have to do it's providing right command line for the gcc compiler On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: >> rxtx_root_directory >> `-- src >> |-- main >> | `-- java >> | `-- gnu >> | `-- io >> `-- test >> `-- java >> `-- gnu >> `-- io >> > > >> From what I understand this will just be good. > > For me it makes no difference. So lets do the rxtx thing. Let if > fester for two weeks and if nobody objects, we will do it. > > I'm not doing this because I care. I'm doing this to eliminate > much of my inbox. > > But test... man is rxtx lacking there in the community aspect. It > is covered but not right. _maybe_ I can change that this year. > > -- > Trent Jarvi > tjarvi at qbang.org > (cat hurding since 1997) > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx Dmitry Markman From lux at diesel-research.com Mon Feb 6 23:20:15 2006 From: lux at diesel-research.com (Kim Lux) Date: Mon, 06 Feb 2006 23:20:15 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? Message-ID: <1139293215.3689.4.camel@zd7280> I'm running the code below. portlist.hasMoreElements() is false. /dev has ports in it as listed below. What am I doing wrong ? ========================================================== // Step through the list of ports until we find one that matches // the one we are looking for. portList = CommPortIdentifier.getPortIdentifiers(); while(portList.hasMoreElements()) { portID = (CommPortIdentifier) portList.nextElement(); // if (portID.getName().equals("/dev/ttyUSB0")) { myTA.append("Serial port ttyUSB0 has been found\n"); break; }// if portID equals... }// End of while... ========================================================== ls -al /dev/tty* crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 ... crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 -- Kim Lux, Diesel Research Inc. From david.garnier at trusted-logic.com Tue Feb 7 00:46:30 2006 From: david.garnier at trusted-logic.com (David Garnier) Date: Tue, 07 Feb 2006 08:46:30 +0100 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: <43E85056.2090608@trusted-logic.com> Hello, I think that the make-based build process is fine as it is, apart from the location of the Java source files. It is true that putting the Java source in a directory structure that map 1-to-1 to the Java package structure is the norm and should make it easier for everyone to modify the Java source, with or without an IDE. Ant is a good tool, but in the RXTX case I fail to see the advantage of using it compared to the current make-based process. As Trent said, they are more pressing issues, like testing. Regards, David Dmitry Markman wrote: > if I understands the issue right > in order to be able to use ant for c/c++ compilation > you have to install ant's cc task > http://ant-contrib.sourceforge.net/cc.html > > it looks like it should work on mac os x > (authors claim, that it's platform independent) > but I never tested > > so all you have to do it's providing right command line > for the gcc compiler > > > > > On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: > >>> rxtx_root_directory >>> `-- src >>> |-- main >>> | `-- java >>> | `-- gnu >>> | `-- io >>> `-- test >>> `-- java >>> `-- gnu >>> `-- io >>> >> >> >>> From what I understand this will just be good. >> >> For me it makes no difference. So lets do the rxtx thing. Let if >> fester for two weeks and if nobody objects, we will do it. >> >> I'm not doing this because I care. I'm doing this to eliminate much >> of my inbox. >> >> But test... man is rxtx lacking there in the community aspect. It is >> covered but not right. _maybe_ I can change that this year. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> (cat hurding since 1997) From tjarvi at qbang.org Tue Feb 7 01:11:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 01:11:31 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <43E85056.2090608@trusted-logic.com> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: On Tue, 7 Feb 2006, David Garnier wrote: > Hello, > > I think that the make-based build process is fine as it is, apart from the location of the Java > source files. It is true that putting the Java source in a directory structure that map 1-to-1 to > the Java package structure is the norm and should make it easier for everyone to modify the Java > source, with or without an IDE. > > Ant is a good tool, but in the RXTX case I fail to see the advantage of using it compared to the > current make-based process. As Trent said, they are more pressing issues, like testing. > Hi David I have more experience with testing rxtx than I can talk about. But let it be known, rxtx has gone trough 100's of hours of testing. We are hobby folks interested in toys but there is more. rxtx has had some of the best guidance in the industry there. This is not an easy thing. I may be able to come back in a month from the other side of the corperate fence and help. I suspect the tests could just be made public but they are in a very unusual environment that just wont work in a wider sense. This is something I'll be trying to change. At one point it was agreed we could just make the results public so this isnt just noise.. There is interest and I think its safe to mention that much. The big problem with testing in the past is most of it is done with a loopback connection. So we *still* have major questions regarding things like flow control. rxtx talks to itself over a loopback and it works. regardless of right or wrong. This requires more thought to be done right. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Feb 7 02:46:34 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 02:46:34 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: > The big problem with testing in the past is most of it is done with a > loopback connection. So we *still* have major questions regarding things > like flow control. rxtx talks to itself over a loopback and it works. > regardless of right or wrong. With serial communication there are gold standards. ckermit is probably a definitive 'standard.' Maybe its possible to do ping/pong tests with ckermit? Is it scriptable? There are known issues in rxtx. Probably the worst is some threading issues regarding some JREs with multiple JNI threads setting java variables. Man did I get schooled there. Just switch the c functions to returning variables and things go away. Sometimes they work fine, sometimes they blow up. Without understanding everything, somehow rhat got it right and debian (and especially gentoo) grabbed kernel patches causing all sort of harm. Its not hard to fix once you understand whats going on but nearly impossible to track with a debugger. So I have a good idea what 2.1-8 will have outside of the IDE modifications. rxtx 2.1-7 is a release for everyone to sync with. Its not even as stable as -pre17 as far as I know - I ran no test suites. I'll be chasing it too. We just had so many contributions that it was time. It seriously broke internal scheduals but thats a great thing :) The other thing I want to do in 2.1-8 is automagic baud rates. It turns out lots of shops are doing really funky baud rates for things like automobile test equipment. It is possible but it requires a fair amount of change in the native code. Is anyone looking at this? -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Feb 7 02:57:21 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 07 Feb 2006 04:57:21 -0500 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <43E85056.2090608@trusted-logic.com> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: Hi All, I agree, testing is very important. The problem I have been trying to address is related to cross-platform testing and the robust nature of the installs. Typically, I visit 3 platforms to deploy my product, windows, linux and mac. A build is performed on each platform. The idea that you can build for many platforms from one copy the source code seems attractive. This should enable synchronized deployments of identical code. The question of how to achieve this goal remains open. As Trent mentioned, this is hard. Perhaps Ant will help here (but perhaps not). Ant does seem to help with running unit tests. However, it does not help with multi-platform tests. For that you need many machines and different operating environments. Toward that end, I have created a multi-platform test that can be run from web start, located at: http://show.docjava.com:8086/book/cgij/code/jnlp/serialPort.PortTest.jnlp This is interesting because many people in the community can run the test and we can improve the test, as time permits. No, it is not a perfect solution, however, the idea does help with multi-platform tests using many machines and different operating environments. If the group has a good test for a general serial port set-ups, i would be happy to deploy it, for general evaluation using web start. And as for ANT, it is just an idea. Not all my ideas are good ones! - Doug >Hello, > >I think that the make-based build process is fine as it is, apart >from the location of the Java >source files. It is true that putting the Java source in a directory >structure that map 1-to-1 to >the Java package structure is the norm and should make it easier for >everyone to modify the Java >source, with or without an IDE. > >Ant is a good tool, but in the RXTX case I fail to see the advantage >of using it compared to the >current make-based process. As Trent said, they are more pressing >issues, like testing. > >Regards, >David > >Dmitry Markman wrote: >> if I understands the issue right >> in order to be able to use ant for c/c++ compilation >> you have to install ant's cc task >> http://ant-contrib.sourceforge.net/cc.html >> >> it looks like it should work on mac os x >> (authors claim, that it's platform independent) >> but I never tested >> >> so all you have to do it's providing right command line >> for the gcc compiler >> >> >> >> >> On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: >> >>>> rxtx_root_directory >>>> `-- src >>>> |-- main >>>> | `-- java >>>> | `-- gnu >>>> | `-- io >>>> `-- test >>>> `-- java >>>> `-- gnu >>>> `-- io >>>> >>> >>> >>>> From what I understand this will just be good. >>> >>> For me it makes no difference. So lets do the rxtx thing. Let if >>> fester for two weeks and if nobody objects, we will do it. >>> >>> I'm not doing this because I care. I'm doing this to eliminate much >>> of my inbox. >>> >>> But test... man is rxtx lacking there in the community aspect. It is >>> covered but not right. _maybe_ I can change that this year. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> (cat hurding since 1997) > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From matt.higgins at gmail.com Tue Feb 7 08:28:34 2006 From: matt.higgins at gmail.com (Matt Higgins) Date: Tue, 7 Feb 2006 10:28:34 -0500 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final Message-ID: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? import java.io.*; import java.util.*; import gnu.io.*; public class MySimpleRead implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; public static void main(String[] args) { boolean portFound = false; String defaultPort = "COM1"; if (args.length > 0) { defaultPort = args[0]; } portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; MySimpleRead reader = new MySimpleRead(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } } public MySimpleRead() { try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) { e.printStackTrace(); } try { inputStream = serialPort.getInputStream(); } catch (IOException e) { e.printStackTrace(); } try { serialPort.addEventListener(this); } catch (TooManyListenersException e) { e.printStackTrace(); } try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { e.printStackTrace(); } System.out.println("Baud is " + serialPort.getBaudRate()); System.out.println("Bits is " + serialPort.getDataBits()); System.out.println("Stop is " + serialPort.getStopBits()); System.out.println("Par is " + serialPort.getParity()); serialPort.notifyOnDataAvailable(true); readThread = new Thread(this); readThread.start(); } public void run() { // Thread.sleep(20000); //} catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { System.out.println("An event occurred " + event.getEventType()); switch (event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: byte[] readBuffer = new byte[20]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } System.out.print(new String(readBuffer)); } catch (IOException e) {} break; } } } --------------- Result on windows ------------------------------ Stable Library ============================================================== Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port:: COM1 Baud is 9600 Bits is 8 Stop is 1 Par is 0 ----------------- End Results ----------------------------------------- ------------------ Result on Linux ----------------------------------- Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 Found port: /dev/ttyS0 Baud is 9600 Bits is 8 Stop is 1 Par is 0 An event occurred 1 043100066224 ------------------ End Results --------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/a1431630/attachment-0008.html From brian at mbari.org Tue Feb 7 09:48:37 2006 From: brian at mbari.org (Brian Schlining) Date: Tue, 7 Feb 2006 08:48:37 -0800 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> Message-ID: <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> Hi Matt > The following code works fine on Linux but I never see any data > when run on Windows. This is a cut and paste from the SimpleRead > example. > I am attempting to read data from a bar code scanner. I can fire > up HyperTermianl on windows and see that the device is working > properly as I see the barcodes are scanned and echoed back to the > terminal. However when I run the app I don't see any data. It is > however associating with the com port as the informational bits > print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. Cheers Brian Schlining Software Engineer http://www.mbari.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/16d07f37/attachment-0008.html From lux at diesel-research.com Tue Feb 7 11:59:58 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 11:59:58 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139293215.3689.4.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> Message-ID: <1139338798.8145.4.camel@zd7280> Any ideas on this ? Any reason why portList.hasMoreElements() should be false even though there are devices in /dev ? On Mon, 2006-02-06 at 23:20 -0700, Kim Lux wrote: > I'm running the code below. > > portlist.hasMoreElements() is false. > > /dev has ports in it as listed below. > > What am I doing wrong ? > > > ========================================================== > // Step through the list of ports until we find one that matches > // the one we are looking for. > > portList = CommPortIdentifier.getPortIdentifiers(); > > while(portList.hasMoreElements()) > { > portID = (CommPortIdentifier) portList.nextElement(); // > if (portID.getName().equals("/dev/ttyUSB0")) > { > myTA.append("Serial port ttyUSB0 has been found\n"); > break; > }// if portID equals... > }// End of while... > ========================================================== > > ls -al /dev/tty* > crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty > crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 > crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 > crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 > crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 > ... > crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 > crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 > crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 > > > -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 12:20:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 12:20:25 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139338798.8145.4.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> Message-ID: On Tue, 7 Feb 2006, Kim Lux wrote: > > Any ideas on this ? Any reason why portList.hasMoreElements() should be > false even though there are devices in /dev ? > > > On Mon, 2006-02-06 at 23:20 -0700, Kim Lux wrote: >> I'm running the code below. >> >> portlist.hasMoreElements() is false. >> >> /dev has ports in it as listed below. >> >> What am I doing wrong ? >> >> >> ========================================================== >> // Step through the list of ports until we find one that matches >> // the one we are looking for. >> >> portList = CommPortIdentifier.getPortIdentifiers(); >> >> while(portList.hasMoreElements()) >> { >> portID = (CommPortIdentifier) portList.nextElement(); // >> if (portID.getName().equals("/dev/ttyUSB0")) >> { >> myTA.append("Serial port ttyUSB0 has been found\n"); >> break; >> }// if portID equals... >> }// End of while... >> ========================================================== >> >> ls -al /dev/tty* >> crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty >> crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 >> crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 >> crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 >> crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 >> ... >> crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 >> crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 >> crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 >> >> >> > Hi Kim What rxtx does is try to open the port and do a timed out read. If the kernel/... do not complain it's enumarted. I suspect you could do a crude test by doing something like cat /dev/ttyS0 > /dev/null If that barfs then rxtx wont enumerate the port. hmm looking at your question again, I suspect it's a lockfile problem. This is documented in INSTALL with the source. Its easy enough to test this too.. touch /var/lock/testingrxtxlockfiles && rm -f /var/lock/testingrxtxlockfiles If you are not in the right group it will bail. Root will work regardless. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 12:37:56 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 12:37:56 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> Message-ID: <1139341076.8145.11.camel@zd7280> Exactly which ports does rxtx attempt to put into the list ? /dev/* or /dev/tty* or /dev/tty[0-9[0-9] ? or /dev/ttyS* ? For the record, only /dev/ttyUSB0 is a valid port on the machine I am presently on. Will this be a problem ? On Tue, 2006-02-07 at 12:20 -0700, Trent Jarvi wrote: > This is documented in INSTALL with the source. > I was wondering where that file was. I will download source and dig it up. Thanks. -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 12:51:09 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 12:51:09 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139341076.8145.11.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: On Tue, 7 Feb 2006, Kim Lux wrote: > > Exactly which ports does rxtx attempt to put into the list ? /dev/* > or /dev/tty* or /dev/tty[0-9[0-9] ? or /dev/ttyS* ? > > For the record, only /dev/ttyUSB0 is a valid port on the machine I am > presently on. Will this be a problem ? > > > On Tue, 2006-02-07 at 12:20 -0700, Trent Jarvi wrote: >> This is documented in INSTALL with the source. >> > I was wondering where that file was. I will download source and dig it > up. > > Thanks. > Hmm I'm looking at pre17 so this may have changed. (its just what I have on this machine) if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA" // for the IPAQs }; CandidatePortPrefixes=Temp; } So you may need to add "ttyUSB" to that list. RXTX used to enumerate _everything_ see if(osName.equals("Linux-all-ports") But it became less than practical. This is all in RXTXCommDriver.java hmm I just did a cvs update. if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have to get your fingers into the code. We aim for sane defaults. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 13:06:45 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 13:06:45 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139342805.8145.22.camel@zd7280> On Tue, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > Hmm I'm looking at pre17 so this may have changed. (its just what I have > on this machine) > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA" // for the IPAQs > }; > CandidatePortPrefixes=Temp; > } > > > So you may need to add "ttyUSB" to that list. RXTX used to enumerate > _everything_ see if(osName.equals("Linux-all-ports") But it became less > than practical. > > This is all in RXTXCommDriver.java > > hmm I just did a cvs update. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have > to get your fingers into the code. We aim for sane defaults. Excellent. Thanks for taking the time. -- Kim Lux, Diesel Research Inc. From ideiglenes1 at freemail.hu Tue Feb 7 13:53:39 2006 From: ideiglenes1 at freemail.hu (--) Date: Tue, 07 Feb 2006 21:53:39 +0100 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139345619.22534.2.camel@localhost> Hi! I use this code to get all the extra Linux devices. :) if ("Linux".equals(System.getProperty("os.name"))) { System.setProperty("os.name","Linux-all-ports"); } driver = new RXTXCommDriver(); On k, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > On Tue, 7 Feb 2006, Kim Lux wrote: > > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have > to get your fingers into the code. We aim for sane defaults. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From matt.higgins at gmail.com Tue Feb 7 13:45:54 2006 From: matt.higgins at gmail.com (Matt Higgins) Date: Tue, 7 Feb 2006 15:45:54 -0500 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> Message-ID: <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> Sweet this is exactly what I needed. I was searching the archives through marc.theamisgroup they only have archives back to 1/3/05. Should have hit the mailman archive! Thanks a lot! On 2/7/06, Brian Schlining wrote: > > Hi Matt > > The following code works fine on Linux but I never see any data when run > on Windows. This is a cut and paste from the SimpleRead example. > I am attempting to read data from a bar code scanner. I can fire up > HyperTermianl on windows and see that the device is working properly as I > see the barcodes are scanned and echoed back to the terminal. However when I > run the app I don't see any data. It is however associating with the com > port as the informational bits print fine? > > > You're not the only one whose had this problem, I don't know if Trent has > addressed this is the latest release of RXTX but there is a workaround. > Here's the recent thread from the RXTX mailing list regarding this issues: > > Thanasis Delenikas tdelenik at gmail.com > Wed Jan 18 13:56:23 MST 2006 > > * Previous message: [Rxtx] Re: More close() performance fixes > * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] > > Hi all. > (I've subscribed again from my other email account). > > Trent, > > You are right. Linux *always* works, no matter what flow control you set. > Windows *works only* with hardware flow control (I haven't tested what > happens with software XON/XOFF flow control). > > I assume (but I am not certain) that even with no flow control at all, all > platforms should work. Without flow control, you have the risk of bumping > into overflow or framing errors, but that's your (the end programmer, I > mean) problem. > > >From my side, I shouldn't be working without flow control. That was a bug > too... It was some code forgotten from the old times, when I used to work > with phone emulation drivers which didn't support flow control. The > correct > way is to have some flow control enabled and that's why I suppose this is > a > low-severity bug for RxTx. > > I have no idea which platform shows the correct behaviour, since > my knowledge about Linux and the inner workings of these low-level i/o > operations is limited. > > Regards, > Thanasis Delenikas. > > > > > Message: 2 > > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > > From: Trent Jarvi > > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > > To: RXTX Developers and Users > > Message-ID: > > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > > > Hi all, > > > > > > Trent, I have found something. > > > I read your comment about flow control, so I experimented a bit. > > > > > > If you remember, in my sample program I've used no flow control at all > ( > > i.e. > > > Java constant FLOWCONTROL_NONE). > > > > > > Now, during testing, I've switch to hardware inbound flow control (i.e > . > > Java > > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > > beautifully! > > > > > > I think I will switch to H/W flow control and test things for a while, > > but > > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > > > > > Hi Thanasis, > > > > I'm fairly sure you have identified a bug. I would not worry too much > > about what Sun CommAPI w32 defaults are. I think they did more or less > > whatever the port opened with. Just a guess. Linux tries to stomp on > > ports so they are all the same. > > > > So this started out with Linux worked, Windows XP/.. did not as I > recall. > > Something is wrong in rxtx. Do I understand this right? > > > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > > > Perhaps there is something Wayne or I did not understand when we wrote > > that code. I wasnt programming back in the BBS days so modems are not > my > > thing. I have a few questions. > > > > Is the above matrix confirmed by observation? > > Linux just always worked? > > Which one _should_ work? I'm guessing modems work with hardware flow > > control. I'll have to dig around. > > > > The windows flow control changes a couple things with hardware flow > > control. Following the w32 API documentation is confusing sometimes. > > But it looks like Linux could have a bug too. > > Cheers > > Brian Schlining > Software Engineer > http://www.mbari.org > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/9c989144/attachment-0008.html From tjarvi at qbang.org Tue Feb 7 14:06:14 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 14:06:14 -0700 (MST) Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> Message-ID: >> >> You're not the only one whose had this problem, I don't know if Trent has >> addressed this is the latest release of RXTX but there is a workaround. >> Here's the recent thread from the RXTX mailing list regarding this issues: >> I have not. I expect to have access to some test equipment next month and I'll go through all of this. I really don't know whats going on and I need a gold standard. I thought maybe linux was autodetecting the flow control. Your observations would certainly be welcome. I need to talk to Russell King and see what he is doing. Until then I'd just be toying around over a loopback as usual. This is very high on the list though. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 17:25:05 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 17:25:05 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139358305.17994.2.camel@zd7280> My application now works. I installed the libraries and jar from 2.1-7 (Final). portlist.hasMoreElements is no longer false. The application finds the port for /dev/ttyUSB0. Thanks for your help, Trent (et al) Sorry I bothered you with this. Next time I will look in the source first. I didn't think it was an rxtx issue, I thought it was a Linux setup issue . On Tue, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > Hmm I'm looking at pre17 so this may have changed. (its just what I > have > on this machine) > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux > Serial Ports > "ttySA" // for the > IPAQs > }; > > CandidatePortPrefixes=Temp; > } > > > So you may need to add "ttyUSB" to that list. RXTX used to enumerate > _everything_ see if(osName.equals("Linux-all-ports") But it became > less > than practical. > > This is all in RXTXCommDriver.java > > hmm I just did a cvs update. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux > Serial Ports > "ttySA", // for the > IPAQs > "ttyUSB" // for USB > frobs > }; > > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you > have > to get your fingers into the code. We aim for sane defaults. -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 19:21:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 19:21:54 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139358305.17994.2.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> <1139358305.17994.2.camel@zd7280> Message-ID: >Sorry I bothered you with this. Next time I will look in the source >first. I didn't think it was an rxtx issue, I thought it was a Linux >setup issue . Why would you be sorry? I would have done the same. I'm glad it's working :) -- Trent Jarvi tjarvi at qbang.org From tma at mail.island.net Wed Feb 8 13:39:35 2006 From: tma at mail.island.net (Tom Alldread) Date: Wed, 08 Feb 2006 12:39:35 -0800 Subject: [Rxtx] Win32/Linux Serial Port Data Dropouts In-Reply-To: <200602060702.k167255O007882@www.qbang.org> References: <200602060702.k167255O007882@www.qbang.org> Message-ID: <43EA5707.4020200@mail.island.net> Greetings Folks at RXTX: During the last couple of months I have been alternately testing with javax.comm 2 and RXTX 2.1 under Windows XP and CommApi 3 and RXTX 2.1 under Suse 10.0 Linux. In the process I have learned a little about java multi-threading under NetBeans 5 with Profiler. My java (jdk 1.5_06) application is used for data acquisition and provides a graphical display of A-D conversion data received from a 56KBaud serial port. The actual data throughput is about 10KBaud thus it is well below the speed of the port. I use hardware RTS/CTS flow control which can stall the data acquisition sample rate if necessary. This ensures the display computer has the ability to slow the data acquisition rate should it become too busy to accept the regular data flow. Both the serial port buffer and the java read buffer are set at 16KB. Usually the data transfers into the java read buffer are less than 100 bytes unless the data acquisition is recovering from a stall. The data flow normally hesitates after each 5 KB block as a continue command is needed from the display computer to start the drawing of a new graphics display line. Separate threads have been provided for the serial port event monitoring and data processing. The serial port event thread has been given the maximum priority and data processing thread the minimum priority provided by java. Thread yield statements have been placed within all data processing while/for loops as an effort to ensure quick access to CPU cycles for the serial port event thread. I have found that short data transmissions are essentially error free but occasional dropouts occur with continuous data flow especially under Windows XP. ....................................................................................................................................................................................... Linux results: I am happy to report that RXTX 2.1 appears to work very well under Linux although I did notice some errors when the screen savers were running with my dual monitors. I believe this is a local problem associated with my dual graphics which needs further attention. The recent CommApi 3 Linux release from Sun did not work at all with my program. It seemed to send commands out OK but did not receive any data. Although the serial port event triggered the ISR, the input stream appeared filled with nulls and thus did not contain any data. As my understanding is that CommApi 3 was tested with a Red Hat distribution of Linux I wonder if this problem is distro dependent? Although somewhat off topic here I wonder if anyone reading this has had similar experience? .................................................................................................................................................................................. Windows XP results: There are problems with occasional data dropouts which become more frequent as the sampling rate is increased or if the computer becomes busy with other duties. The dropouts typically consist of a half dozen byte block of lost data. It appears the lost bytes never get added to the java input stream. There has not been any indication of garbled data, overruns or framing errors which suggests the UART communications remains solid. Using javax.comm 2 I found that the setting of SerialPort 'enableReceiveThreshold' to 40 and 'enableReceiveTimeout' of 100mS reduced the dropouts error rate significantly. I found that I could not get RXTX 2.1 to function with the aforementioned threshold and timeout settings. The javax.comm 2 interface is consequently performing better for me under Windows than RXTX 2.1. I wonder if anyone here has any suggestions as to what I might try to improve RXTX 2.1? Although my settings are the same as under Suse 10.0, RXTX 2.1 performs much better for me under Linux than any of the alternatives that I have tried under Windows XP . ............................................................................................................................................................................... I would like to establish, based on the experience of others, if I have reached the normally expected performance limit of java serial port communications? Should I expect to achieve virtually error free serial port data input from a continuous stream under Windows XP java software? I am considering changing my protocol to packets with error checking if necessary but would like to know if the dropout problems I am experiencing are typical or not before I take this rather work intensive plunge. Many thanks in advance for any help! Best Regards, Tom Alldread -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.375 / Virus Database: 267.15.2/253 - Release Date: 2006-02-07 From jlaxson at mac.com Wed Feb 8 23:56:48 2006 From: jlaxson at mac.com (John Laxson) Date: Thu, 9 Feb 2006 00:56:48 -0600 Subject: [Rxtx] PortInUseException: Unknown Application on OSX Message-ID: Hi, I've been trying to get RXTX 2.1.7 going on Mac OS X for a while here, and am running up into a wall here. I've tried with pre- compiled and the source version and get the same problem, a gnu.io.PortInUseException: Unknown Application. I have run the fixperms script included with the source distribution, and id shows me as a member of the uucp group, and permissions on /var/spool/uucp are 775 root:uucp. Running a test program (included at the bottom for clarity) lets me enumerate all the serial ports correctly, but trying to open any of them gives the PortInUseException. If it helps, when I try to open a port that's set to make an outgoing bluetooth connection, there is no delay and no connection attempt at all. Thanks, John Laxson PS: The documentation wiki on qbang.org shows 404, and has for a few days now. My test code: public static void main(String[] args) { SerialPort serialPort; try { Enumeration e = CommPortIdentifier.getPortIdentifiers(); CommPortIdentifier ident; while (e.hasMoreElements()) { ident = (CommPortIdentifier)e.nextElement(); System.out.println(ident.getName()); } ident = CommPortIdentifier.getPortIdentifier("/dev/cu.modem"); serialPort = (SerialPort) ident.open("Me", 5000); } catch (Exception e) { e.printStackTrace(); } } From rajesh.invincible at gmail.com Thu Feb 9 03:39:38 2006 From: rajesh.invincible at gmail.com (Rajesh N) Date: Thu, 9 Feb 2006 16:09:38 +0530 Subject: [Rxtx] Re: Move .java Files in gnu.io filesystem hierarchy - Maven (2) In-Reply-To: <43DF21D2.7090200@ngi.it> References: <43DF21D2.7090200@ngi.it> Message-ID: <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Can anybody tell me how to overcome these EXCEPTIONS I AM WORKING ON SERIAL COMMN IN JAVA ON LINUX. 1. " NOT ALL PARAMETERS SUPPORTED BY THE KERNEL" This i came across the following statement inmy prog. SerialP is A SerialPort object SerialP.setSerialPortParams(9600(BAUDRATE),DATABITS_8,STOPBITS_1,PARITY_NONE) 2. NullPointer Exception at Event Dispatch Now i have checked all my object references for a null reference but i found none i have put up my entire code in try catch blocks but still I AM UNABLE TO CATCH THIS EXCEPTION AND HENCE MY APPLICATION CLOSES HOW DOES THESE GO? PLEASE HELP ME IT IS URGENTTTTTTTTTTTTTTTT yours sincerely RAJESH On 1/31/06, Fabio Frumento wrote: > Hi Xavier, > > I don't know maven at all but the directory hierarchy listed buy Trent > is fine for me... > > I'll take a look to maven, it seems an interesting project > > Regards > > Fabio Frumento > > Trent Jarvi wrote: > > On Tue, 31 Jan 2006, Xavier Frisaye wrote: > > > >> Hi all, > >> > >> If you are going to rearrange the src folder, i will propose to use > >> maven 2 and follow its directory structure > >> > (http://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html). > >> > >> Maven 2 simplify java project and give a standard way to make projects > >> (http://maven.apache.org/). > >> We are using it for internal projects and we are very satisfied. > >> > >> Is anybody interested? > >> > >> I'm not an expert in maven 2 (yet) but i'm agree to help using it if > >> you choose to make so. > >> > > > > so this would be: > > > > rxtx-devel/src/main/java/gnu.io > > rxtx-devel/src/test/java/ManIwish.java > > > > I don't use IDEs very much so I'll let others comment. But I don't see > > a problem with that. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Thu Feb 9 09:50:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 9 Feb 2006 09:50:31 -0700 (MST) Subject: [Rxtx] Re: Move .java Files in gnu.io filesystem hierarchy - Maven (2) In-Reply-To: <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Message-ID: On Thu, 9 Feb 2006, Rajesh N wrote: > Can anybody tell me how to overcome these EXCEPTIONS > I AM WORKING ON SERIAL COMMN IN JAVA ON LINUX. > > 1. " NOT ALL PARAMETERS SUPPORTED BY THE KERNEL" > > This i came across the following statement inmy prog. > SerialP is A SerialPort object > SerialP.setSerialPortParams(9600(BAUDRATE),DATABITS_8,STOPBITS_1,PARITY_NONE) > Strange. The parameters you use are the same the port should open with by default. Could you paste the actual exception you are getting? I don't see that in the rxtx source. Also it would help to know the rxtx version. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Fri Feb 10 15:29:05 2006 From: lux at diesel-research.com (Kim Lux) Date: Fri, 10 Feb 2006 15:29:05 -0700 Subject: [Rxtx] One serial port object for both sending and receiving ? Message-ID: <1139610545.18177.4.camel@zd7280> Is it OK to use one SerialPort ojbect (ex Serial Port serialPort;) and use it for both sending and receiving ? For example: ======================================================================== static SerialPort serialPort = null; static OutputStream serialOut = null; static InputStream serialIn = null; // assign it to an outputStream for use try{ serialOut = serialPort.getOutputStream(); System.out.println("Serial output stream has been assigned."); }//try catch(IOException e) { System.out.println("Error: Couldn't assign output stream to serial port."); }//catch //assign it to an inputStream for use try{ serialIn = serialPort.getInputStream(); System.out.println("Serial input stream has been assigned."); }//try catch(IOException e) { System.out.println("Error: Couldn't assign input stream to serial port."); }//catch ======================================================================== -- Kim Lux, Diesel Research Inc. From lux at diesel-research.com Fri Feb 10 21:23:00 2006 From: lux at diesel-research.com (Kim Lux) Date: Fri, 10 Feb 2006 21:23:00 -0700 Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Message-ID: <1139631780.23882.10.camel@zd7280> I've got a problem receiving chars with my version of serialRead, written in an SWT GUI. I had a Java pro have a good look at my code and he can't see anything wrong with it. I can send chars fine. When I receive a char the cpu usage for the app goes to 100% and the code in the serial event handler doesn't get executed. The instructions on the Java Comm Serial API How-To for Linux page state that I must install javacomm. Is that true ? Everything builds without it and I can send chars on rxtx just fine, but I can't receive them. Could this be the problem ? I downloaded and installed javacomm. I was not able to add "Driver=gnuio.RXTXCommDriver to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 installed in /usr/java/jre1.5.0_05. I added comm.jar to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext to the library paths. Is this OK ? Does it matter that I am receiving on /dev/ttyUSB0 ? Thanks. -- Kim Lux, Diesel Research Inc. From lunareclipse03 at web.de Sat Feb 11 09:44:46 2006 From: lunareclipse03 at web.de (lunareclipse03@web.de) Date: Sat, 11 Feb 2006 17:44:46 +0100 Subject: [Rxtx] Question about Serial I/O under Win32 Message-ID: <662084330@web.de> Hello everybody, I have a strange problem with a piece of code I made for myself. No, this is not really concerning rxtx, but nevertheless I post this to the list, hoping that some of you can help me. I've written two libraries, one for linux and one for win32. The linux port works quite well, I can send / receive faxes and / or replay voice messages over the telephone line using a voice modem. But the win32 port of the library causes some trouble. If, for example, I send out a fax with a certain modem under linux, it works well. The fax is complete when it comes out of the fax machine. If I then use the same modem to send out a fax under win32, the fax coming out of the fax machine gets "stuck" halfways, but the sending modem thinks that transmission was ok and drops the connection. The answering fax machine then gives me "error while receiving." The "upper layer" java code MUST be right, because if I do the same thing under linux (using the linux library), everything is alright. Now I have to ask: Can somebody please help me out with this??!? Could it be the case that some kind of flow control or COMMTIMEOUTS setting causes this behaviour? I set flow control to RTS/CTS before sending out a fax. How can I DISABLE flow control? Or what do you think? Can something else cause this problems? Thank you all for your time and PLEASE write back soon. Regards, --Sven Ahlemann Am Waldrand 31 45721 Haltern am See Germany ______________________________________________________________ Verschicken Sie romantische, coole und witzige Bilder per SMS! Jetzt bei WEB.DE FreeMail: http://f.web.de/?mc=021193 From lux at diesel-research.com Sat Feb 11 10:06:52 2006 From: lux at diesel-research.com (Kim Lux) Date: Sat, 11 Feb 2006 10:06:52 -0700 Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: <1139631780.23882.10.camel@zd7280> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> <1139631780.23882.10.camel@zd7280> Message-ID: <1139677612.3431.5.camel@zd7280> More on this problem. I copied and pasted simpleRead into a console based Eclipse project and I've got the same result, except that cpu usage doesn't go to 100%. I'm beginning to think there is an issue in rxtx. My imports for simpleRead are: ============================ import gnu.io.*; import java.util.*; //import javax.comm.*; import java.io.*; =========================== Any ideas ? I am trying to read from /dev/ttyUSB0 using a serial to USB adapter which has worked well with minicom and gtkterm. Thanks. On Fri, 2006-02-10 at 21:23 -0700, Kim Lux wrote: > I've got a problem receiving chars with my version of serialRead, > written in an SWT GUI. > > I had a Java pro have a good look at my code and he can't see anything > wrong with it. > > I can send chars fine. When I receive a char the cpu usage for the app > goes to 100% and the code in the serial event handler doesn't get > executed. > > The instructions on the Java Comm Serial API How-To for Linux page state > that I must install javacomm. Is that true ? Everything builds without > it and I can send chars on rxtx just fine, but I can't receive them. > Could this be the problem ? > > I downloaded and installed javacomm. I was not able to add > "Driver=gnuio.RXTXCommDriver > to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not > have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 > installed in /usr/java/jre1.5.0_05. I added comm.jar > to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext > to the library paths. Is this OK ? > > Does it matter that I am receiving on /dev/ttyUSB0 ? > > Thanks. > -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Sun Feb 12 21:01:33 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:01:33 -0700 (MST) Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: <1139677612.3431.5.camel@zd7280> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> <1139631780.23882.10.camel@zd7280> <1139677612.3431.5.camel@zd7280> Message-ID: I suspect what is happening is the select() is breaking out in the native code but the driver does not have support for notifying there are X bytes available. On some traditional Unix based systems, the only way you know data is available is the fd status changes and do an FIORDCHK ioctl. Or perhaps the only thing you can know is the fd status changed. It would take reading through the kernel driver code to know for sure. So on USB, depending upon the driver, the same may need to be done or the driver improved a bit if possible to support. Polling reads will also work but don't use the event driven model of CommAPI which isnt acceptable in the long run. The 100% cpu usage can then be explained because select no longer blocks until the data is read; the eventLoop spins loose. You can put a well placed sleep but rxtx only expects those are needed when it knows data is available. This may not be a super simple thing to understand and fix. I do have ideas to get you started. I'm going to be short on time the next couple weeks. I expect to put some good time in and answer some other questions I saw around the 25th. For now, I'd look at the following and go from there with the hints I've given. JNIEXPORT jint JNICALL RXTXPort(nativeavailable)( JNIEnv *env, jobject jobj ) { int fd = get_java_var( env, jobj,"fd","I" ); int result; /* char message[80]; ENTER( "RXTXPort:nativeavailable" ); On SCO OpenServer FIONREAD always fails for serial devices, so try ioctl FIORDCHK instead; will only tell us whether bytes are available, not how many, but better than nothing. This turns out to be true on Solaris also. taj. */ #ifdef FIORDCHK /* __unixware__ __sun__ probably others */ result = ioctl(fd, FIORDCHK, 0); #else if( ioctl( fd, FIONREAD, &result ) < 0 ) { goto fail; } #endif /* FIORDCHK */ On Sat, 11 Feb 2006, Kim Lux wrote: > > More on this problem. I copied and pasted simpleRead into a console > based Eclipse project and I've got the same result, except that cpu > usage doesn't go to 100%. I'm beginning to think there is an issue in > rxtx. > > My imports for simpleRead are: > > ============================ > import gnu.io.*; > import java.util.*; > //import javax.comm.*; > import java.io.*; > =========================== > > Any ideas ? I am trying to read from /dev/ttyUSB0 using a serial to > USB adapter which has worked well with minicom and gtkterm. > > Thanks. > > > > On Fri, 2006-02-10 at 21:23 -0700, Kim Lux wrote: >> I've got a problem receiving chars with my version of serialRead, >> written in an SWT GUI. >> >> I had a Java pro have a good look at my code and he can't see anything >> wrong with it. >> >> I can send chars fine. When I receive a char the cpu usage for the app >> goes to 100% and the code in the serial event handler doesn't get >> executed. >> >> The instructions on the Java Comm Serial API How-To for Linux page state >> that I must install javacomm. Is that true ? Everything builds without >> it and I can send chars on rxtx just fine, but I can't receive them. >> Could this be the problem ? >> >> I downloaded and installed javacomm. I was not able to add >> "Driver=gnuio.RXTXCommDriver >> to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not >> have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 >> installed in /usr/java/jre1.5.0_05. I added comm.jar >> to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext >> to the library paths. Is this OK ? >> >> Does it matter that I am receiving on /dev/ttyUSB0 ? >> >> Thanks. >> > From tjarvi at qbang.org Sun Feb 12 21:03:30 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:03:30 -0700 (MST) Subject: [Rxtx] One serial port object for both sending and receiving ? In-Reply-To: <1139610545.18177.4.camel@zd7280> References: <1139610545.18177.4.camel@zd7280> Message-ID: On Fri, 10 Feb 2006, Kim Lux wrote: > > Is it OK to use one SerialPort ojbect (ex Serial Port serialPort;) and > use it for both sending and receiving ? > > For example: > > ======================================================================== > static SerialPort serialPort = null; > static OutputStream serialOut = null; > static InputStream serialIn = null; > > > > > // assign it to an outputStream for use > try{ > serialOut = serialPort.getOutputStream(); > System.out.println("Serial output stream has been assigned."); > }//try > catch(IOException e) > { > System.out.println("Error: Couldn't assign output stream to serial > port."); > }//catch > > > //assign it to an inputStream for use > try{ > serialIn = serialPort.getInputStream(); > System.out.println("Serial input stream has been assigned."); > }//try > catch(IOException e) > { > System.out.println("Error: Couldn't assign input stream to serial > port."); > }//catch This should be fine. In fact trying to do it another way will probably not work as you will run into lockfile issues. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun Feb 12 21:13:13 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:13:13 -0700 (MST) Subject: [Rxtx] Question about Serial I/O under Win32 In-Reply-To: <662084330@web.de> References: <662084330@web.de> Message-ID: On Sat, 11 Feb 2006 lunareclipse03 at web.de wrote: > Hello everybody, > > I have a strange problem with a piece of code I made for myself. No, > this is not really concerning rxtx, but nevertheless I post this to the > list, hoping that some of you can help me. I've written two libraries, > one for linux and one for win32. The linux port works quite well, I can > send / receive faxes and / or replay voice messages over the telephone > line using a voice modem. But the win32 port of the library causes some > trouble. If, for example, I send out a fax with a certain modem under > linux, it works well. The fax is complete when it comes out of the fax > machine. If I then use the same modem to send out a fax under win32, the > fax coming out of the fax machine gets "stuck" halfways, but the sending > modem thinks that transmission was ok and drops the connection. The > answering fax machine then gives me "error while receiving." The "upper > layer" java code MUST be right, because if I do the same thing under > linux (using the linux library), everything is alright. Now I have to > ask: Can somebody please help me out with this??!? Could it be the case > that some kind of flow control or COMMTIMEOUTS setting causes this > behaviour? I set flow control to RTS/CTS before sending out a fax. How > can I DISABLE flow control? Or what do you think? Can something else > cause this problems? Thank you all for your time and PLEASE write back > soon. > Hi Sven I'm not too willing to talk about flow control at the low level until I confirm some things with test equipment later. It is not clear if you are using rxtx or writing your own native code. So I'm not sure how to answer much of this :) If you are wondering how to change the flow control using rxtx from java, The BlackBox example from Sun flips this back and forth. SerialPort.java in rxtx 2.1 uses the following: SerialPort.java: public static final int FLOWCONTROL_NONE =0; SerialPort.java: public static final int FLOWCONTROL_RTSCTS_IN =1; SerialPort.java: public static final int FLOWCONTROL_RTSCTS_OUT =2; SerialPort.java: public static final int FLOWCONTROL_XONXOFF_IN =4; SerialPort.java: public static final int FLOWCONTROL_XONXOFF_OUT=8; So if you set flowcontrol to RTSCTS, you can set it to NONE to turn it off. If you are looking for how to do it in native code, the rxtx Source is SerialImp.c (unix/linux/mac os x/w32) and termios.c (w32 only with SerialImp.c) You can track the code: SerialImp.c:JNIEXPORT void JNICALL RXTXPort(setflowcontrol)( JNIEnv *env, jobject jobj, jint flowmode ) termios.c:int tcgetattr( int fd, struct termios *s_termios ) termios.c:int tcsetattr( int fd, int when, struct termios *s_termios ) There may be a problem in the rxtx flow control code though. Rather than guess, I want to test this with a gold standard. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Feb 6 00:00:16 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 00:00:16 -0700 (MST) Subject: [Rxtx] wiki delay until tomorrow night. In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: On Sun, 5 Feb 2006, Trent Jarvi wrote: > On Sun, 5 Feb 2006, Kim Lux wrote: > >> usb ? Tell me more... I need that too. > > usb is a very proper design. Thats all it is. > Maybe rxtx could help usb. But it would start with helping bring back the community that was already there. It's not something I'd love to do but maybe its the right thing to do. It would probably take 2 years to do right. But maybe thats better than what we have now. I honestly don't know what IBM is doing which could just run over everything. Just some thoughts after some fine german wine. -- Trent Jarvi tjarvi at qbang.org From gadelavega at yahoo.com.ar Mon Feb 6 02:17:05 2006 From: gadelavega at yahoo.com.ar (Gonzalo A. de la Vega) Date: Mon, 06 Feb 2006 10:17:05 +0100 Subject: [Rxtx] Serial port ownership question In-Reply-To: References: <20060205113618.30274.qmail@web53501.mail.yahoo.com> <1139157422.4553.9.camel@zd7280> <1139158698.4936.9.camel@zd7280> Message-ID: <43E71411.4050402@yahoo.com.ar> On my Fedora Core 4: ls -l /dev/ttyS* crw-rw---- 1 root uucp 4, 64 Feb 6 2006 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Feb 6 2006 /dev/ttyS1 ... and: grep "ttyUSB" /etc/udev/rules.d/50-udev.rules KERNEL=="ttyUSB*", GROUP="uucp", MODE="0660" So anyone in the "uucp" group can use serial ports. On Gentoo the group is "tty". Trent Jarvi escribi?: > > > On Sun, 5 Feb 2006, Dr. Douglas Lyon wrote: > >> I can confirm that this is the case (only root ownership of >> serial ports, under fedora 4). >> Wow, what were they thinking?! >> - DL >> >>> I've found that the newer kernels have the serial ports owned by root. >>> For example, >>> >>> $ls -al /dev/tty* >>> crw-rw-rw- 1 root root 5, 0 Feb 5 02:06 /dev/tty >>> crw-rw---- 1 root root 4, 0 Feb 5 02:06 /dev/tty0 >>> crw------- 1 root root 4, 1 Feb 5 09:07 /dev/tty1 >>> crw-rw---- 1 root tty 4, 10 Feb 5 02:06 /dev/tty10 >>> crw-rw---- 1 root tty 4, 11 Feb 5 02:06 /dev/tty11 >>> ... > > > This is just not a problem jcp or such are going to solve. Its a > platform spitwad fight. But do look at pam. In fact thats what Sun > is doing too. Maybe Linux followed their lead.. I'm not a pam guy. > I've spent 16 hours trying to understand it but your users wont :) > > Solution? I have no clue. Its two tangent mentalities from my > perspective. > > -- > Trent Jarvi > tjarvi at qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mtnvega at yahoo.com.br Mon Feb 6 05:35:43 2006 From: mtnvega at yahoo.com.br (Luiz Jr) Date: Mon, 6 Feb 2006 12:35:43 +0000 (GMT) Subject: [Rxtx] Documentation Wiki In-Reply-To: <1139157422.4553.9.camel@zd7280> Message-ID: <20060206123543.57256.qmail@web53515.mail.yahoo.com> Hello, Thank you for you answer, but so the usage of the API is pretty much like the Java Communications Api? If yes, what version of the Java Comm Api? Thank you, Luiz A. Brandao Jr Kim Lux escreveu: On Sun, 2006-02-05 at 08:36 -0300, Luiz Jr wrote: > Hello, > > I want to start using the RXTX libraries, but I would to know how, > since I can not access the documentation wiki page I just started using them yesterday. Below is how I installed the libraries, if that helps. I used snippets of code from the SimpleWrite application here to get me going. http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html Instead of "import javax.comm.*;", use "import gnu.io.*;" which is gotten from RXTXcomm.jar, which you will need to include in your project references. I am working in Eclipse. BTW: there is no way to open a port without going through the port list and finding it. Maybe sometime in the future someone (me ?) will write a method called openSerialPort that allows the user to give a port identifier, such as "/dev/tty1" and return a port ready to use. It wouldn't take much to write that and it would save users a lot of code. Hope this helps. ======================================================================= 1) Figure out which java you are running, incase there is more than one installed. $ java -version java version "1.5.0_05" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_05-b05) Java HotSpot(TM) Client VM (build 1.5.0_05-b05, mixed mode, sharing) 2) Find all the jre directories and the one from which you are currently running. kfind (jre) 3) cd to that directory plus /lib/i386 cd /usr/java/jre1.5.0_05/lib/i386 4) Copy the library files (*.so) to that directory. cp /home/krlux/Desktop/'Java Controls'/rxtx-linux/bin/* . 5) Check that the copy was successful ls librxtx* librxtxI2C.so librxtxRaw.so librxtxSerial.so librxtxParallel.so librxtxRS485.so 6) cd to the /lib/ext directory for your java. cd /usr/java/jre1.5.0_05/lib/ext 7) Copy the Jar files there cp /home/krlux/Desktop/'Java Controls'/rxtx-linux/lib/ext/* . 8) Check that it was successful ls RXTX* RXTXcomm.jar Rxtx is now installed on your machine ready to use. =================================================================== -- Kim Lux, Diesel Research Inc. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx --------------------------------- Yahoo! Acesso Gr?tis - Internet r?pida e gr?tis. Instale o discador agora! -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/544aa403/attachment-0009.html From lyon at docjava.com Mon Feb 6 05:49:34 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 06 Feb 2006 07:49:34 -0500 Subject: [Rxtx] wiki delay until tomorrow night. In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: Hi All, I have often thought about USB drivers being needed. For example, the ironman watch will not interface to a mac (windows only). It is USB. My dymo label writer has no Java driver (native only). Etc. Most cheap web cameras are USB (and Java drivers go through JAI, if it supports the camera at all). The JAI code shows how sun did the USB drivers. You have to be a member of the jai project to download the source code. https://jai.dev.java.net has the jai distro. And then you are not allowed to redistribute it. However, we can all learn from it (if so inclined). Basically: cvs -d :pserver:lyon at cvs.dev.java.net:/cvs login cvs -d :pserver:lyon at cvs.dev.java.net:/cvs checkout jai-core You will need to user your own uid and pw to get in. The ant build has over 100 warnings from sun deprecations of its own code. You might say that they were hoisted on their own Picard ;) One interesting thing is that they support several platforms: linux-amd64 64-bit Linux-AMD64 linux-i586 32-bit Linux-x86 solaris-amd64 64-bit Solaris-AMD64 solaris-i586 32-bit Solaris-x86 solaris-sparc 32-bit Solaris-SPARC solaris-sparcv9 64-bit Solaris-SPARC windows-i586 32-bit Windows-x86 Thus, ant is used to provide a multi-platform native method distro. Neat. How do they do it? check this out: And: The core download does not contain any C source code (it was all pre-built). Basically, they are just copying .so and .dll files into build directories. I would love to see the C code for this...but Sun does not post it on the https://jai.dev.java.net site. I don't know why...Perhaps I missed it. - Doug >On Sun, 5 Feb 2006, Trent Jarvi wrote: > >>On Sun, 5 Feb 2006, Kim Lux wrote: >> >>>usb ? Tell me more... I need that too. >> >>usb is a very proper design. Thats all it is. >> > >Maybe rxtx could help usb. But it would start with helping bring >back the community that was already there. > >It's not something I'd love to do but maybe its the right thing to do. > >It would probably take 2 years to do right. But maybe thats better >than what we have now. > >I honestly don't know what IBM is doing which could just run over everything. > >Just some thoughts after some fine german wine. > >-- >Trent Jarvi >tjarvi at qbang.org > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tdelenik at gmail.com Mon Feb 6 05:56:32 2006 From: tdelenik at gmail.com (Thanasis Delenikas) Date: Mon, 6 Feb 2006 14:56:32 +0200 Subject: Fwd: [Rxtx] Documentation Wiki In-Reply-To: <1139157422.4553.9.camel@zd7280> References: <20060205113618.30274.qmail@web53501.mail.yahoo.com> <1139157422.4553.9.camel@zd7280> Message-ID: <310a1a930602060456t129f1dc6p5f2b908f13ab5a0b@mail.gmail.com> Hello all, Kim, this is a snippet from the code I use. The closest to directly opening a specific port without enumeration. << ... portId = CommPortIdentifier.getPortIdentifier(getPort()); serialPort = (SerialPort) portId.open("jSMSEngine", 1971); ... >> where getPort() return the string identifier of the port, i.e. "/dev/ttyS0" or "COM1" or whatever. Thanasis. ---------- Forwarded message ---------- From: Kim Lux Date: Feb 5, 2006 6:37 PM Subject: Re: [Rxtx] Documentation Wiki To: RXTX Developers and Users BTW: there is no way to open a port without going through the port list and finding it. Maybe sometime in the future someone (me ?) will write a method called openSerialPort that allows the user to give a port identifier, such as "/dev/tty1" and return a port ready to use. It wouldn't take much to write that and it would save users a lot of code. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/182ab5b8/attachment-0009.html From tjarvi at qbang.org Mon Feb 6 11:53:57 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 11:53:57 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: On Mon, 6 Feb 2006, Dr. Douglas Lyon wrote: > Hi All, > I have often thought about USB drivers being needed. > For example, the ironman watch will not interface > to a mac (windows only). It is USB. > My dymo label writer has no Java driver (native only). > Etc. > Most cheap web cameras are USB (and Java drivers go > through JAI, if it supports the camera at all). > The JAI code shows how sun did the USB drivers. > You have to be a member of the jai project to download > the source code. > https://jai.dev.java.net has the jai distro. > And then you are not allowed to redistribute it. However, > we can all learn from it (if so inclined). Basically: > cvs -d :pserver:lyon at cvs.dev.java.net:/cvs login > cvs -d :pserver:lyon at cvs.dev.java.net:/cvs checkout jai-core > You will need to user your own uid and pw to get in. > The ant build has over 100 warnings from sun deprecations > of its own code. > > You might say that they were hoisted on their own Picard ;) > > One interesting thing is that they support several platforms: > linux-amd64 64-bit Linux-AMD64 > linux-i586 32-bit Linux-x86 > solaris-amd64 64-bit Solaris-AMD64 > solaris-i586 32-bit Solaris-x86 > solaris-sparc 32-bit Solaris-SPARC > solaris-sparcv9 64-bit Solaris-SPARC > windows-i586 32-bit Windows-x86 > Thus, ant is used to provide a multi-platform native method distro. > Neat. > How do they do it? > check this out: > > > > > > > > > > > > > And: > > > > > > > > > > The core download does not contain any C source code (it was all pre-built). > Basically, they are just copying .so and .dll files into build directories. > > I would love to see the C code for this...but Sun does not post it on the > https://jai.dev.java.net site. > > I don't know why...Perhaps I missed it. > > - Doug > > I've looked at moving rxtx to Ant builds. I think that would help IDEs a great deal. I requested a evalutation desk copy the O'Reilly Ant book for some j2ee material I was teaching. http://www.oreilly.com/catalog/anttdg/ It has a one sentence mention of JNI. So there was not luck there. I saw that there is another Ant book that does mention JNI more. I can't find it now. Ant must be able to support it with extensions. http://ant.apache.org/manual/OptionalTasks/javah.html What the auto(break :) tools do in the rxtx build is 4 things really. 1) gcc compile flags 2) ld compile flags 3) config.h 4) compile flags for customizing rxtx (lockfiles, ...) See 1 All of this information except 4 can be static once obtained. So I'm not attached to the auto tools. If I could find an example of Ant being used for JNI code, I'd be one of the first to start moving that direction. Maybe someone saw an example someplace. The other thing we have not completed discussing is the directory structure. There is interest in making rxtx more IDE friendly. I get more mail about that off the list than how to install rxtx. And I see we have Ken Thompson in da house :) He is our trusted CVS maintainer and the guy that purchased the rxtx.org domain. Old community. We will need Ken for changing the directory structure of source. I would like to open up discussion about both of these as it is more than time. The problem is I have little experience with Ant and even less with IDEs. It would be nice if we could work with Eclipse and NetBeans. http://www.netbeans.org/ (sun and some community) http://www.eclipes.org (ibm,rhat,... perhaps more community) http://maven.apache.org/what-is-maven.html (apache. It is community) borland should sortof be here too but I think thats covered in eclipse. >From what I understand so far, we should morph rxtx to support those three maybe trusting apaches lead with maven. But I use vi. I have little to no clues beyond what people have fed me. Can we agree that thats the right direction to go? -- Trent Jarvi tjarvi at qbang.org From brian at mbari.org Mon Feb 6 14:57:50 2006 From: brian at mbari.org (Brian Schlining) Date: Mon, 6 Feb 2006 13:57:50 -0800 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> > The other thing we have not completed discussing is the directory > structure. There is interest in making rxtx more IDE friendly. I > get more mail about that off the list than how to install rxtx. > > And I see we have Ken Thompson in da house :) He is our trusted > CVS maintainer and the guy that purchased the rxtx.org domain. Old > community. We will need Ken for changing the directory structure of > source. > > I would like to open up discussion about both of these as it is > more than time. The problem is I have little experience with Ant > and even less with IDEs. It would be nice if we could work with > Eclipse and NetBeans. > > http://www.netbeans.org/ (sun and some community) > http://www.eclipes.org (ibm,rhat,... perhaps more community) > http://maven.apache.org/what-is-maven.html (apache. It is community) > borland should sortof be here too but I think thats covered in > eclipse. > >> From what I understand so far, we should morph rxtx to support >> those three > maybe trusting apaches lead with maven. But I use vi. I have > little to no clues beyond what people have fed me. > Maven likes the directory structure below for Java code. (From http:// maven.apache.org/guides/getting-started/index.html) This structure works fine with ant, netbeans, and eclipse. rxtx_root_directory `-- src |-- main | `-- java | `-- gnu | `-- io `-- test `-- java `-- gnu `-- io Brian Schlining Software Engineer http://www.mbari.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/d9451eba/attachment-0009.html From tjarvi at qbang.org Mon Feb 6 15:11:45 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 15:11:45 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: > rxtx_root_directory > `-- src > |-- main > | `-- java > | `-- gnu > | `-- io > `-- test > `-- java > `-- gnu > `-- io > >From what I understand this will just be good. For me it makes no difference. So lets do the rxtx thing. Let if fester for two weeks and if nobody objects, we will do it. I'm not doing this because I care. I'm doing this to eliminate much of my inbox. But test... man is rxtx lacking there in the community aspect. It is covered but not right. _maybe_ I can change that this year. -- Trent Jarvi tjarvi at qbang.org (cat hurding since 1997) From lux at diesel-research.com Mon Feb 6 21:38:49 2006 From: lux at diesel-research.com (Kim Lux) Date: Mon, 06 Feb 2006 21:38:49 -0700 Subject: [Rxtx] How can I use Lock Files with rxtx (in FC4) ? Message-ID: <1139287129.17031.3.camel@zd7280> I am now running an rxtx application on FC4. I am getting: ========================================================= check_group_uucp(): error testing lock file creation Error details: Permission denied check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL ========================================================= $ ls -al /var/lock total 32 drwxrwxr-x 4 root lock 4096 Feb 6 16:04 . drwxr-xr-x 24 root root 4096 Nov 14 01:19 .. drwx------ 2 root root 4096 Apr 27 2005 lvm drwxr-xr-x 2 root root 4096 Feb 6 16:04 subsys How do I fix this for regulator users ? -- Kim Lux, Diesel Research Inc. From dmarkman at mac.com Mon Feb 6 22:24:44 2006 From: dmarkman at mac.com (Dmitry Markman) Date: Tue, 7 Feb 2006 00:24:44 -0500 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: if I understands the issue right in order to be able to use ant for c/c++ compilation you have to install ant's cc task http://ant-contrib.sourceforge.net/cc.html it looks like it should work on mac os x (authors claim, that it's platform independent) but I never tested so all you have to do it's providing right command line for the gcc compiler On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: >> rxtx_root_directory >> `-- src >> |-- main >> | `-- java >> | `-- gnu >> | `-- io >> `-- test >> `-- java >> `-- gnu >> `-- io >> > > >> From what I understand this will just be good. > > For me it makes no difference. So lets do the rxtx thing. Let if > fester for two weeks and if nobody objects, we will do it. > > I'm not doing this because I care. I'm doing this to eliminate > much of my inbox. > > But test... man is rxtx lacking there in the community aspect. It > is covered but not right. _maybe_ I can change that this year. > > -- > Trent Jarvi > tjarvi at qbang.org > (cat hurding since 1997) > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx Dmitry Markman From lux at diesel-research.com Mon Feb 6 23:20:15 2006 From: lux at diesel-research.com (Kim Lux) Date: Mon, 06 Feb 2006 23:20:15 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? Message-ID: <1139293215.3689.4.camel@zd7280> I'm running the code below. portlist.hasMoreElements() is false. /dev has ports in it as listed below. What am I doing wrong ? ========================================================== // Step through the list of ports until we find one that matches // the one we are looking for. portList = CommPortIdentifier.getPortIdentifiers(); while(portList.hasMoreElements()) { portID = (CommPortIdentifier) portList.nextElement(); // if (portID.getName().equals("/dev/ttyUSB0")) { myTA.append("Serial port ttyUSB0 has been found\n"); break; }// if portID equals... }// End of while... ========================================================== ls -al /dev/tty* crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 ... crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 -- Kim Lux, Diesel Research Inc. From david.garnier at trusted-logic.com Tue Feb 7 00:46:30 2006 From: david.garnier at trusted-logic.com (David Garnier) Date: Tue, 07 Feb 2006 08:46:30 +0100 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: <43E85056.2090608@trusted-logic.com> Hello, I think that the make-based build process is fine as it is, apart from the location of the Java source files. It is true that putting the Java source in a directory structure that map 1-to-1 to the Java package structure is the norm and should make it easier for everyone to modify the Java source, with or without an IDE. Ant is a good tool, but in the RXTX case I fail to see the advantage of using it compared to the current make-based process. As Trent said, they are more pressing issues, like testing. Regards, David Dmitry Markman wrote: > if I understands the issue right > in order to be able to use ant for c/c++ compilation > you have to install ant's cc task > http://ant-contrib.sourceforge.net/cc.html > > it looks like it should work on mac os x > (authors claim, that it's platform independent) > but I never tested > > so all you have to do it's providing right command line > for the gcc compiler > > > > > On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: > >>> rxtx_root_directory >>> `-- src >>> |-- main >>> | `-- java >>> | `-- gnu >>> | `-- io >>> `-- test >>> `-- java >>> `-- gnu >>> `-- io >>> >> >> >>> From what I understand this will just be good. >> >> For me it makes no difference. So lets do the rxtx thing. Let if >> fester for two weeks and if nobody objects, we will do it. >> >> I'm not doing this because I care. I'm doing this to eliminate much >> of my inbox. >> >> But test... man is rxtx lacking there in the community aspect. It is >> covered but not right. _maybe_ I can change that this year. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> (cat hurding since 1997) From tjarvi at qbang.org Tue Feb 7 01:11:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 01:11:31 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <43E85056.2090608@trusted-logic.com> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: On Tue, 7 Feb 2006, David Garnier wrote: > Hello, > > I think that the make-based build process is fine as it is, apart from the location of the Java > source files. It is true that putting the Java source in a directory structure that map 1-to-1 to > the Java package structure is the norm and should make it easier for everyone to modify the Java > source, with or without an IDE. > > Ant is a good tool, but in the RXTX case I fail to see the advantage of using it compared to the > current make-based process. As Trent said, they are more pressing issues, like testing. > Hi David I have more experience with testing rxtx than I can talk about. But let it be known, rxtx has gone trough 100's of hours of testing. We are hobby folks interested in toys but there is more. rxtx has had some of the best guidance in the industry there. This is not an easy thing. I may be able to come back in a month from the other side of the corperate fence and help. I suspect the tests could just be made public but they are in a very unusual environment that just wont work in a wider sense. This is something I'll be trying to change. At one point it was agreed we could just make the results public so this isnt just noise.. There is interest and I think its safe to mention that much. The big problem with testing in the past is most of it is done with a loopback connection. So we *still* have major questions regarding things like flow control. rxtx talks to itself over a loopback and it works. regardless of right or wrong. This requires more thought to be done right. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Feb 7 02:46:34 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 02:46:34 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: > The big problem with testing in the past is most of it is done with a > loopback connection. So we *still* have major questions regarding things > like flow control. rxtx talks to itself over a loopback and it works. > regardless of right or wrong. With serial communication there are gold standards. ckermit is probably a definitive 'standard.' Maybe its possible to do ping/pong tests with ckermit? Is it scriptable? There are known issues in rxtx. Probably the worst is some threading issues regarding some JREs with multiple JNI threads setting java variables. Man did I get schooled there. Just switch the c functions to returning variables and things go away. Sometimes they work fine, sometimes they blow up. Without understanding everything, somehow rhat got it right and debian (and especially gentoo) grabbed kernel patches causing all sort of harm. Its not hard to fix once you understand whats going on but nearly impossible to track with a debugger. So I have a good idea what 2.1-8 will have outside of the IDE modifications. rxtx 2.1-7 is a release for everyone to sync with. Its not even as stable as -pre17 as far as I know - I ran no test suites. I'll be chasing it too. We just had so many contributions that it was time. It seriously broke internal scheduals but thats a great thing :) The other thing I want to do in 2.1-8 is automagic baud rates. It turns out lots of shops are doing really funky baud rates for things like automobile test equipment. It is possible but it requires a fair amount of change in the native code. Is anyone looking at this? -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Feb 7 02:57:21 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 07 Feb 2006 04:57:21 -0500 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <43E85056.2090608@trusted-logic.com> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: Hi All, I agree, testing is very important. The problem I have been trying to address is related to cross-platform testing and the robust nature of the installs. Typically, I visit 3 platforms to deploy my product, windows, linux and mac. A build is performed on each platform. The idea that you can build for many platforms from one copy the source code seems attractive. This should enable synchronized deployments of identical code. The question of how to achieve this goal remains open. As Trent mentioned, this is hard. Perhaps Ant will help here (but perhaps not). Ant does seem to help with running unit tests. However, it does not help with multi-platform tests. For that you need many machines and different operating environments. Toward that end, I have created a multi-platform test that can be run from web start, located at: http://show.docjava.com:8086/book/cgij/code/jnlp/serialPort.PortTest.jnlp This is interesting because many people in the community can run the test and we can improve the test, as time permits. No, it is not a perfect solution, however, the idea does help with multi-platform tests using many machines and different operating environments. If the group has a good test for a general serial port set-ups, i would be happy to deploy it, for general evaluation using web start. And as for ANT, it is just an idea. Not all my ideas are good ones! - Doug >Hello, > >I think that the make-based build process is fine as it is, apart >from the location of the Java >source files. It is true that putting the Java source in a directory >structure that map 1-to-1 to >the Java package structure is the norm and should make it easier for >everyone to modify the Java >source, with or without an IDE. > >Ant is a good tool, but in the RXTX case I fail to see the advantage >of using it compared to the >current make-based process. As Trent said, they are more pressing >issues, like testing. > >Regards, >David > >Dmitry Markman wrote: >> if I understands the issue right >> in order to be able to use ant for c/c++ compilation >> you have to install ant's cc task >> http://ant-contrib.sourceforge.net/cc.html >> >> it looks like it should work on mac os x >> (authors claim, that it's platform independent) >> but I never tested >> >> so all you have to do it's providing right command line >> for the gcc compiler >> >> >> >> >> On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: >> >>>> rxtx_root_directory >>>> `-- src >>>> |-- main >>>> | `-- java >>>> | `-- gnu >>>> | `-- io >>>> `-- test >>>> `-- java >>>> `-- gnu >>>> `-- io >>>> >>> >>> >>>> From what I understand this will just be good. >>> >>> For me it makes no difference. So lets do the rxtx thing. Let if >>> fester for two weeks and if nobody objects, we will do it. >>> >>> I'm not doing this because I care. I'm doing this to eliminate much >>> of my inbox. >>> >>> But test... man is rxtx lacking there in the community aspect. It is >>> covered but not right. _maybe_ I can change that this year. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> (cat hurding since 1997) > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From matt.higgins at gmail.com Tue Feb 7 08:28:34 2006 From: matt.higgins at gmail.com (Matt Higgins) Date: Tue, 7 Feb 2006 10:28:34 -0500 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final Message-ID: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? import java.io.*; import java.util.*; import gnu.io.*; public class MySimpleRead implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; public static void main(String[] args) { boolean portFound = false; String defaultPort = "COM1"; if (args.length > 0) { defaultPort = args[0]; } portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; MySimpleRead reader = new MySimpleRead(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } } public MySimpleRead() { try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) { e.printStackTrace(); } try { inputStream = serialPort.getInputStream(); } catch (IOException e) { e.printStackTrace(); } try { serialPort.addEventListener(this); } catch (TooManyListenersException e) { e.printStackTrace(); } try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { e.printStackTrace(); } System.out.println("Baud is " + serialPort.getBaudRate()); System.out.println("Bits is " + serialPort.getDataBits()); System.out.println("Stop is " + serialPort.getStopBits()); System.out.println("Par is " + serialPort.getParity()); serialPort.notifyOnDataAvailable(true); readThread = new Thread(this); readThread.start(); } public void run() { // Thread.sleep(20000); //} catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { System.out.println("An event occurred " + event.getEventType()); switch (event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: byte[] readBuffer = new byte[20]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } System.out.print(new String(readBuffer)); } catch (IOException e) {} break; } } } --------------- Result on windows ------------------------------ Stable Library ============================================================== Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port:: COM1 Baud is 9600 Bits is 8 Stop is 1 Par is 0 ----------------- End Results ----------------------------------------- ------------------ Result on Linux ----------------------------------- Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 Found port: /dev/ttyS0 Baud is 9600 Bits is 8 Stop is 1 Par is 0 An event occurred 1 043100066224 ------------------ End Results --------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/a1431630/attachment-0009.html From brian at mbari.org Tue Feb 7 09:48:37 2006 From: brian at mbari.org (Brian Schlining) Date: Tue, 7 Feb 2006 08:48:37 -0800 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> Message-ID: <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> Hi Matt > The following code works fine on Linux but I never see any data > when run on Windows. This is a cut and paste from the SimpleRead > example. > I am attempting to read data from a bar code scanner. I can fire > up HyperTermianl on windows and see that the device is working > properly as I see the barcodes are scanned and echoed back to the > terminal. However when I run the app I don't see any data. It is > however associating with the com port as the informational bits > print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. Cheers Brian Schlining Software Engineer http://www.mbari.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/16d07f37/attachment-0009.html From lux at diesel-research.com Tue Feb 7 11:59:58 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 11:59:58 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139293215.3689.4.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> Message-ID: <1139338798.8145.4.camel@zd7280> Any ideas on this ? Any reason why portList.hasMoreElements() should be false even though there are devices in /dev ? On Mon, 2006-02-06 at 23:20 -0700, Kim Lux wrote: > I'm running the code below. > > portlist.hasMoreElements() is false. > > /dev has ports in it as listed below. > > What am I doing wrong ? > > > ========================================================== > // Step through the list of ports until we find one that matches > // the one we are looking for. > > portList = CommPortIdentifier.getPortIdentifiers(); > > while(portList.hasMoreElements()) > { > portID = (CommPortIdentifier) portList.nextElement(); // > if (portID.getName().equals("/dev/ttyUSB0")) > { > myTA.append("Serial port ttyUSB0 has been found\n"); > break; > }// if portID equals... > }// End of while... > ========================================================== > > ls -al /dev/tty* > crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty > crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 > crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 > crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 > crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 > ... > crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 > crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 > crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 > > > -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 12:20:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 12:20:25 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139338798.8145.4.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> Message-ID: On Tue, 7 Feb 2006, Kim Lux wrote: > > Any ideas on this ? Any reason why portList.hasMoreElements() should be > false even though there are devices in /dev ? > > > On Mon, 2006-02-06 at 23:20 -0700, Kim Lux wrote: >> I'm running the code below. >> >> portlist.hasMoreElements() is false. >> >> /dev has ports in it as listed below. >> >> What am I doing wrong ? >> >> >> ========================================================== >> // Step through the list of ports until we find one that matches >> // the one we are looking for. >> >> portList = CommPortIdentifier.getPortIdentifiers(); >> >> while(portList.hasMoreElements()) >> { >> portID = (CommPortIdentifier) portList.nextElement(); // >> if (portID.getName().equals("/dev/ttyUSB0")) >> { >> myTA.append("Serial port ttyUSB0 has been found\n"); >> break; >> }// if portID equals... >> }// End of while... >> ========================================================== >> >> ls -al /dev/tty* >> crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty >> crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 >> crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 >> crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 >> crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 >> ... >> crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 >> crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 >> crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 >> >> >> > Hi Kim What rxtx does is try to open the port and do a timed out read. If the kernel/... do not complain it's enumarted. I suspect you could do a crude test by doing something like cat /dev/ttyS0 > /dev/null If that barfs then rxtx wont enumerate the port. hmm looking at your question again, I suspect it's a lockfile problem. This is documented in INSTALL with the source. Its easy enough to test this too.. touch /var/lock/testingrxtxlockfiles && rm -f /var/lock/testingrxtxlockfiles If you are not in the right group it will bail. Root will work regardless. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 12:37:56 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 12:37:56 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> Message-ID: <1139341076.8145.11.camel@zd7280> Exactly which ports does rxtx attempt to put into the list ? /dev/* or /dev/tty* or /dev/tty[0-9[0-9] ? or /dev/ttyS* ? For the record, only /dev/ttyUSB0 is a valid port on the machine I am presently on. Will this be a problem ? On Tue, 2006-02-07 at 12:20 -0700, Trent Jarvi wrote: > This is documented in INSTALL with the source. > I was wondering where that file was. I will download source and dig it up. Thanks. -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 12:51:09 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 12:51:09 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139341076.8145.11.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: On Tue, 7 Feb 2006, Kim Lux wrote: > > Exactly which ports does rxtx attempt to put into the list ? /dev/* > or /dev/tty* or /dev/tty[0-9[0-9] ? or /dev/ttyS* ? > > For the record, only /dev/ttyUSB0 is a valid port on the machine I am > presently on. Will this be a problem ? > > > On Tue, 2006-02-07 at 12:20 -0700, Trent Jarvi wrote: >> This is documented in INSTALL with the source. >> > I was wondering where that file was. I will download source and dig it > up. > > Thanks. > Hmm I'm looking at pre17 so this may have changed. (its just what I have on this machine) if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA" // for the IPAQs }; CandidatePortPrefixes=Temp; } So you may need to add "ttyUSB" to that list. RXTX used to enumerate _everything_ see if(osName.equals("Linux-all-ports") But it became less than practical. This is all in RXTXCommDriver.java hmm I just did a cvs update. if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have to get your fingers into the code. We aim for sane defaults. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 13:06:45 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 13:06:45 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139342805.8145.22.camel@zd7280> On Tue, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > Hmm I'm looking at pre17 so this may have changed. (its just what I have > on this machine) > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA" // for the IPAQs > }; > CandidatePortPrefixes=Temp; > } > > > So you may need to add "ttyUSB" to that list. RXTX used to enumerate > _everything_ see if(osName.equals("Linux-all-ports") But it became less > than practical. > > This is all in RXTXCommDriver.java > > hmm I just did a cvs update. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have > to get your fingers into the code. We aim for sane defaults. Excellent. Thanks for taking the time. -- Kim Lux, Diesel Research Inc. From ideiglenes1 at freemail.hu Tue Feb 7 13:53:39 2006 From: ideiglenes1 at freemail.hu (--) Date: Tue, 07 Feb 2006 21:53:39 +0100 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139345619.22534.2.camel@localhost> Hi! I use this code to get all the extra Linux devices. :) if ("Linux".equals(System.getProperty("os.name"))) { System.setProperty("os.name","Linux-all-ports"); } driver = new RXTXCommDriver(); On k, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > On Tue, 7 Feb 2006, Kim Lux wrote: > > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have > to get your fingers into the code. We aim for sane defaults. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From matt.higgins at gmail.com Tue Feb 7 13:45:54 2006 From: matt.higgins at gmail.com (Matt Higgins) Date: Tue, 7 Feb 2006 15:45:54 -0500 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> Message-ID: <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> Sweet this is exactly what I needed. I was searching the archives through marc.theamisgroup they only have archives back to 1/3/05. Should have hit the mailman archive! Thanks a lot! On 2/7/06, Brian Schlining wrote: > > Hi Matt > > The following code works fine on Linux but I never see any data when run > on Windows. This is a cut and paste from the SimpleRead example. > I am attempting to read data from a bar code scanner. I can fire up > HyperTermianl on windows and see that the device is working properly as I > see the barcodes are scanned and echoed back to the terminal. However when I > run the app I don't see any data. It is however associating with the com > port as the informational bits print fine? > > > You're not the only one whose had this problem, I don't know if Trent has > addressed this is the latest release of RXTX but there is a workaround. > Here's the recent thread from the RXTX mailing list regarding this issues: > > Thanasis Delenikas tdelenik at gmail.com > Wed Jan 18 13:56:23 MST 2006 > > * Previous message: [Rxtx] Re: More close() performance fixes > * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] > > Hi all. > (I've subscribed again from my other email account). > > Trent, > > You are right. Linux *always* works, no matter what flow control you set. > Windows *works only* with hardware flow control (I haven't tested what > happens with software XON/XOFF flow control). > > I assume (but I am not certain) that even with no flow control at all, all > platforms should work. Without flow control, you have the risk of bumping > into overflow or framing errors, but that's your (the end programmer, I > mean) problem. > > >From my side, I shouldn't be working without flow control. That was a bug > too... It was some code forgotten from the old times, when I used to work > with phone emulation drivers which didn't support flow control. The > correct > way is to have some flow control enabled and that's why I suppose this is > a > low-severity bug for RxTx. > > I have no idea which platform shows the correct behaviour, since > my knowledge about Linux and the inner workings of these low-level i/o > operations is limited. > > Regards, > Thanasis Delenikas. > > > > > Message: 2 > > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > > From: Trent Jarvi > > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > > To: RXTX Developers and Users > > Message-ID: > > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > > > Hi all, > > > > > > Trent, I have found something. > > > I read your comment about flow control, so I experimented a bit. > > > > > > If you remember, in my sample program I've used no flow control at all > ( > > i.e. > > > Java constant FLOWCONTROL_NONE). > > > > > > Now, during testing, I've switch to hardware inbound flow control (i.e > . > > Java > > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > > beautifully! > > > > > > I think I will switch to H/W flow control and test things for a while, > > but > > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > > > > > Hi Thanasis, > > > > I'm fairly sure you have identified a bug. I would not worry too much > > about what Sun CommAPI w32 defaults are. I think they did more or less > > whatever the port opened with. Just a guess. Linux tries to stomp on > > ports so they are all the same. > > > > So this started out with Linux worked, Windows XP/.. did not as I > recall. > > Something is wrong in rxtx. Do I understand this right? > > > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > > > Perhaps there is something Wayne or I did not understand when we wrote > > that code. I wasnt programming back in the BBS days so modems are not > my > > thing. I have a few questions. > > > > Is the above matrix confirmed by observation? > > Linux just always worked? > > Which one _should_ work? I'm guessing modems work with hardware flow > > control. I'll have to dig around. > > > > The windows flow control changes a couple things with hardware flow > > control. Following the w32 API documentation is confusing sometimes. > > But it looks like Linux could have a bug too. > > Cheers > > Brian Schlining > Software Engineer > http://www.mbari.org > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/9c989144/attachment-0009.html From tjarvi at qbang.org Tue Feb 7 14:06:14 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 14:06:14 -0700 (MST) Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> Message-ID: >> >> You're not the only one whose had this problem, I don't know if Trent has >> addressed this is the latest release of RXTX but there is a workaround. >> Here's the recent thread from the RXTX mailing list regarding this issues: >> I have not. I expect to have access to some test equipment next month and I'll go through all of this. I really don't know whats going on and I need a gold standard. I thought maybe linux was autodetecting the flow control. Your observations would certainly be welcome. I need to talk to Russell King and see what he is doing. Until then I'd just be toying around over a loopback as usual. This is very high on the list though. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 17:25:05 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 17:25:05 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139358305.17994.2.camel@zd7280> My application now works. I installed the libraries and jar from 2.1-7 (Final). portlist.hasMoreElements is no longer false. The application finds the port for /dev/ttyUSB0. Thanks for your help, Trent (et al) Sorry I bothered you with this. Next time I will look in the source first. I didn't think it was an rxtx issue, I thought it was a Linux setup issue . On Tue, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > Hmm I'm looking at pre17 so this may have changed. (its just what I > have > on this machine) > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux > Serial Ports > "ttySA" // for the > IPAQs > }; > > CandidatePortPrefixes=Temp; > } > > > So you may need to add "ttyUSB" to that list. RXTX used to enumerate > _everything_ see if(osName.equals("Linux-all-ports") But it became > less > than practical. > > This is all in RXTXCommDriver.java > > hmm I just did a cvs update. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux > Serial Ports > "ttySA", // for the > IPAQs > "ttyUSB" // for USB > frobs > }; > > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you > have > to get your fingers into the code. We aim for sane defaults. -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 19:21:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 19:21:54 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139358305.17994.2.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> <1139358305.17994.2.camel@zd7280> Message-ID: >Sorry I bothered you with this. Next time I will look in the source >first. I didn't think it was an rxtx issue, I thought it was a Linux >setup issue . Why would you be sorry? I would have done the same. I'm glad it's working :) -- Trent Jarvi tjarvi at qbang.org From tma at mail.island.net Wed Feb 8 13:39:35 2006 From: tma at mail.island.net (Tom Alldread) Date: Wed, 08 Feb 2006 12:39:35 -0800 Subject: [Rxtx] Win32/Linux Serial Port Data Dropouts In-Reply-To: <200602060702.k167255O007882@www.qbang.org> References: <200602060702.k167255O007882@www.qbang.org> Message-ID: <43EA5707.4020200@mail.island.net> Greetings Folks at RXTX: During the last couple of months I have been alternately testing with javax.comm 2 and RXTX 2.1 under Windows XP and CommApi 3 and RXTX 2.1 under Suse 10.0 Linux. In the process I have learned a little about java multi-threading under NetBeans 5 with Profiler. My java (jdk 1.5_06) application is used for data acquisition and provides a graphical display of A-D conversion data received from a 56KBaud serial port. The actual data throughput is about 10KBaud thus it is well below the speed of the port. I use hardware RTS/CTS flow control which can stall the data acquisition sample rate if necessary. This ensures the display computer has the ability to slow the data acquisition rate should it become too busy to accept the regular data flow. Both the serial port buffer and the java read buffer are set at 16KB. Usually the data transfers into the java read buffer are less than 100 bytes unless the data acquisition is recovering from a stall. The data flow normally hesitates after each 5 KB block as a continue command is needed from the display computer to start the drawing of a new graphics display line. Separate threads have been provided for the serial port event monitoring and data processing. The serial port event thread has been given the maximum priority and data processing thread the minimum priority provided by java. Thread yield statements have been placed within all data processing while/for loops as an effort to ensure quick access to CPU cycles for the serial port event thread. I have found that short data transmissions are essentially error free but occasional dropouts occur with continuous data flow especially under Windows XP. ....................................................................................................................................................................................... Linux results: I am happy to report that RXTX 2.1 appears to work very well under Linux although I did notice some errors when the screen savers were running with my dual monitors. I believe this is a local problem associated with my dual graphics which needs further attention. The recent CommApi 3 Linux release from Sun did not work at all with my program. It seemed to send commands out OK but did not receive any data. Although the serial port event triggered the ISR, the input stream appeared filled with nulls and thus did not contain any data. As my understanding is that CommApi 3 was tested with a Red Hat distribution of Linux I wonder if this problem is distro dependent? Although somewhat off topic here I wonder if anyone reading this has had similar experience? .................................................................................................................................................................................. Windows XP results: There are problems with occasional data dropouts which become more frequent as the sampling rate is increased or if the computer becomes busy with other duties. The dropouts typically consist of a half dozen byte block of lost data. It appears the lost bytes never get added to the java input stream. There has not been any indication of garbled data, overruns or framing errors which suggests the UART communications remains solid. Using javax.comm 2 I found that the setting of SerialPort 'enableReceiveThreshold' to 40 and 'enableReceiveTimeout' of 100mS reduced the dropouts error rate significantly. I found that I could not get RXTX 2.1 to function with the aforementioned threshold and timeout settings. The javax.comm 2 interface is consequently performing better for me under Windows than RXTX 2.1. I wonder if anyone here has any suggestions as to what I might try to improve RXTX 2.1? Although my settings are the same as under Suse 10.0, RXTX 2.1 performs much better for me under Linux than any of the alternatives that I have tried under Windows XP . ............................................................................................................................................................................... I would like to establish, based on the experience of others, if I have reached the normally expected performance limit of java serial port communications? Should I expect to achieve virtually error free serial port data input from a continuous stream under Windows XP java software? I am considering changing my protocol to packets with error checking if necessary but would like to know if the dropout problems I am experiencing are typical or not before I take this rather work intensive plunge. Many thanks in advance for any help! Best Regards, Tom Alldread -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.375 / Virus Database: 267.15.2/253 - Release Date: 2006-02-07 From jlaxson at mac.com Wed Feb 8 23:56:48 2006 From: jlaxson at mac.com (John Laxson) Date: Thu, 9 Feb 2006 00:56:48 -0600 Subject: [Rxtx] PortInUseException: Unknown Application on OSX Message-ID: Hi, I've been trying to get RXTX 2.1.7 going on Mac OS X for a while here, and am running up into a wall here. I've tried with pre- compiled and the source version and get the same problem, a gnu.io.PortInUseException: Unknown Application. I have run the fixperms script included with the source distribution, and id shows me as a member of the uucp group, and permissions on /var/spool/uucp are 775 root:uucp. Running a test program (included at the bottom for clarity) lets me enumerate all the serial ports correctly, but trying to open any of them gives the PortInUseException. If it helps, when I try to open a port that's set to make an outgoing bluetooth connection, there is no delay and no connection attempt at all. Thanks, John Laxson PS: The documentation wiki on qbang.org shows 404, and has for a few days now. My test code: public static void main(String[] args) { SerialPort serialPort; try { Enumeration e = CommPortIdentifier.getPortIdentifiers(); CommPortIdentifier ident; while (e.hasMoreElements()) { ident = (CommPortIdentifier)e.nextElement(); System.out.println(ident.getName()); } ident = CommPortIdentifier.getPortIdentifier("/dev/cu.modem"); serialPort = (SerialPort) ident.open("Me", 5000); } catch (Exception e) { e.printStackTrace(); } } From rajesh.invincible at gmail.com Thu Feb 9 03:39:38 2006 From: rajesh.invincible at gmail.com (Rajesh N) Date: Thu, 9 Feb 2006 16:09:38 +0530 Subject: [Rxtx] Re: Move .java Files in gnu.io filesystem hierarchy - Maven (2) In-Reply-To: <43DF21D2.7090200@ngi.it> References: <43DF21D2.7090200@ngi.it> Message-ID: <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Can anybody tell me how to overcome these EXCEPTIONS I AM WORKING ON SERIAL COMMN IN JAVA ON LINUX. 1. " NOT ALL PARAMETERS SUPPORTED BY THE KERNEL" This i came across the following statement inmy prog. SerialP is A SerialPort object SerialP.setSerialPortParams(9600(BAUDRATE),DATABITS_8,STOPBITS_1,PARITY_NONE) 2. NullPointer Exception at Event Dispatch Now i have checked all my object references for a null reference but i found none i have put up my entire code in try catch blocks but still I AM UNABLE TO CATCH THIS EXCEPTION AND HENCE MY APPLICATION CLOSES HOW DOES THESE GO? PLEASE HELP ME IT IS URGENTTTTTTTTTTTTTTTT yours sincerely RAJESH On 1/31/06, Fabio Frumento wrote: > Hi Xavier, > > I don't know maven at all but the directory hierarchy listed buy Trent > is fine for me... > > I'll take a look to maven, it seems an interesting project > > Regards > > Fabio Frumento > > Trent Jarvi wrote: > > On Tue, 31 Jan 2006, Xavier Frisaye wrote: > > > >> Hi all, > >> > >> If you are going to rearrange the src folder, i will propose to use > >> maven 2 and follow its directory structure > >> > (http://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html). > >> > >> Maven 2 simplify java project and give a standard way to make projects > >> (http://maven.apache.org/). > >> We are using it for internal projects and we are very satisfied. > >> > >> Is anybody interested? > >> > >> I'm not an expert in maven 2 (yet) but i'm agree to help using it if > >> you choose to make so. > >> > > > > so this would be: > > > > rxtx-devel/src/main/java/gnu.io > > rxtx-devel/src/test/java/ManIwish.java > > > > I don't use IDEs very much so I'll let others comment. But I don't see > > a problem with that. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Thu Feb 9 09:50:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 9 Feb 2006 09:50:31 -0700 (MST) Subject: [Rxtx] Re: Move .java Files in gnu.io filesystem hierarchy - Maven (2) In-Reply-To: <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Message-ID: On Thu, 9 Feb 2006, Rajesh N wrote: > Can anybody tell me how to overcome these EXCEPTIONS > I AM WORKING ON SERIAL COMMN IN JAVA ON LINUX. > > 1. " NOT ALL PARAMETERS SUPPORTED BY THE KERNEL" > > This i came across the following statement inmy prog. > SerialP is A SerialPort object > SerialP.setSerialPortParams(9600(BAUDRATE),DATABITS_8,STOPBITS_1,PARITY_NONE) > Strange. The parameters you use are the same the port should open with by default. Could you paste the actual exception you are getting? I don't see that in the rxtx source. Also it would help to know the rxtx version. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Fri Feb 10 15:29:05 2006 From: lux at diesel-research.com (Kim Lux) Date: Fri, 10 Feb 2006 15:29:05 -0700 Subject: [Rxtx] One serial port object for both sending and receiving ? Message-ID: <1139610545.18177.4.camel@zd7280> Is it OK to use one SerialPort ojbect (ex Serial Port serialPort;) and use it for both sending and receiving ? For example: ======================================================================== static SerialPort serialPort = null; static OutputStream serialOut = null; static InputStream serialIn = null; // assign it to an outputStream for use try{ serialOut = serialPort.getOutputStream(); System.out.println("Serial output stream has been assigned."); }//try catch(IOException e) { System.out.println("Error: Couldn't assign output stream to serial port."); }//catch //assign it to an inputStream for use try{ serialIn = serialPort.getInputStream(); System.out.println("Serial input stream has been assigned."); }//try catch(IOException e) { System.out.println("Error: Couldn't assign input stream to serial port."); }//catch ======================================================================== -- Kim Lux, Diesel Research Inc. From lux at diesel-research.com Fri Feb 10 21:23:00 2006 From: lux at diesel-research.com (Kim Lux) Date: Fri, 10 Feb 2006 21:23:00 -0700 Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Message-ID: <1139631780.23882.10.camel@zd7280> I've got a problem receiving chars with my version of serialRead, written in an SWT GUI. I had a Java pro have a good look at my code and he can't see anything wrong with it. I can send chars fine. When I receive a char the cpu usage for the app goes to 100% and the code in the serial event handler doesn't get executed. The instructions on the Java Comm Serial API How-To for Linux page state that I must install javacomm. Is that true ? Everything builds without it and I can send chars on rxtx just fine, but I can't receive them. Could this be the problem ? I downloaded and installed javacomm. I was not able to add "Driver=gnuio.RXTXCommDriver to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 installed in /usr/java/jre1.5.0_05. I added comm.jar to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext to the library paths. Is this OK ? Does it matter that I am receiving on /dev/ttyUSB0 ? Thanks. -- Kim Lux, Diesel Research Inc. From lunareclipse03 at web.de Sat Feb 11 09:44:46 2006 From: lunareclipse03 at web.de (lunareclipse03@web.de) Date: Sat, 11 Feb 2006 17:44:46 +0100 Subject: [Rxtx] Question about Serial I/O under Win32 Message-ID: <662084330@web.de> Hello everybody, I have a strange problem with a piece of code I made for myself. No, this is not really concerning rxtx, but nevertheless I post this to the list, hoping that some of you can help me. I've written two libraries, one for linux and one for win32. The linux port works quite well, I can send / receive faxes and / or replay voice messages over the telephone line using a voice modem. But the win32 port of the library causes some trouble. If, for example, I send out a fax with a certain modem under linux, it works well. The fax is complete when it comes out of the fax machine. If I then use the same modem to send out a fax under win32, the fax coming out of the fax machine gets "stuck" halfways, but the sending modem thinks that transmission was ok and drops the connection. The answering fax machine then gives me "error while receiving." The "upper layer" java code MUST be right, because if I do the same thing under linux (using the linux library), everything is alright. Now I have to ask: Can somebody please help me out with this??!? Could it be the case that some kind of flow control or COMMTIMEOUTS setting causes this behaviour? I set flow control to RTS/CTS before sending out a fax. How can I DISABLE flow control? Or what do you think? Can something else cause this problems? Thank you all for your time and PLEASE write back soon. Regards, --Sven Ahlemann Am Waldrand 31 45721 Haltern am See Germany ______________________________________________________________ Verschicken Sie romantische, coole und witzige Bilder per SMS! Jetzt bei WEB.DE FreeMail: http://f.web.de/?mc=021193 From lux at diesel-research.com Sat Feb 11 10:06:52 2006 From: lux at diesel-research.com (Kim Lux) Date: Sat, 11 Feb 2006 10:06:52 -0700 Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: <1139631780.23882.10.camel@zd7280> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> <1139631780.23882.10.camel@zd7280> Message-ID: <1139677612.3431.5.camel@zd7280> More on this problem. I copied and pasted simpleRead into a console based Eclipse project and I've got the same result, except that cpu usage doesn't go to 100%. I'm beginning to think there is an issue in rxtx. My imports for simpleRead are: ============================ import gnu.io.*; import java.util.*; //import javax.comm.*; import java.io.*; =========================== Any ideas ? I am trying to read from /dev/ttyUSB0 using a serial to USB adapter which has worked well with minicom and gtkterm. Thanks. On Fri, 2006-02-10 at 21:23 -0700, Kim Lux wrote: > I've got a problem receiving chars with my version of serialRead, > written in an SWT GUI. > > I had a Java pro have a good look at my code and he can't see anything > wrong with it. > > I can send chars fine. When I receive a char the cpu usage for the app > goes to 100% and the code in the serial event handler doesn't get > executed. > > The instructions on the Java Comm Serial API How-To for Linux page state > that I must install javacomm. Is that true ? Everything builds without > it and I can send chars on rxtx just fine, but I can't receive them. > Could this be the problem ? > > I downloaded and installed javacomm. I was not able to add > "Driver=gnuio.RXTXCommDriver > to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not > have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 > installed in /usr/java/jre1.5.0_05. I added comm.jar > to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext > to the library paths. Is this OK ? > > Does it matter that I am receiving on /dev/ttyUSB0 ? > > Thanks. > -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Sun Feb 12 21:01:33 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:01:33 -0700 (MST) Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: <1139677612.3431.5.camel@zd7280> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> <1139631780.23882.10.camel@zd7280> <1139677612.3431.5.camel@zd7280> Message-ID: I suspect what is happening is the select() is breaking out in the native code but the driver does not have support for notifying there are X bytes available. On some traditional Unix based systems, the only way you know data is available is the fd status changes and do an FIORDCHK ioctl. Or perhaps the only thing you can know is the fd status changed. It would take reading through the kernel driver code to know for sure. So on USB, depending upon the driver, the same may need to be done or the driver improved a bit if possible to support. Polling reads will also work but don't use the event driven model of CommAPI which isnt acceptable in the long run. The 100% cpu usage can then be explained because select no longer blocks until the data is read; the eventLoop spins loose. You can put a well placed sleep but rxtx only expects those are needed when it knows data is available. This may not be a super simple thing to understand and fix. I do have ideas to get you started. I'm going to be short on time the next couple weeks. I expect to put some good time in and answer some other questions I saw around the 25th. For now, I'd look at the following and go from there with the hints I've given. JNIEXPORT jint JNICALL RXTXPort(nativeavailable)( JNIEnv *env, jobject jobj ) { int fd = get_java_var( env, jobj,"fd","I" ); int result; /* char message[80]; ENTER( "RXTXPort:nativeavailable" ); On SCO OpenServer FIONREAD always fails for serial devices, so try ioctl FIORDCHK instead; will only tell us whether bytes are available, not how many, but better than nothing. This turns out to be true on Solaris also. taj. */ #ifdef FIORDCHK /* __unixware__ __sun__ probably others */ result = ioctl(fd, FIORDCHK, 0); #else if( ioctl( fd, FIONREAD, &result ) < 0 ) { goto fail; } #endif /* FIORDCHK */ On Sat, 11 Feb 2006, Kim Lux wrote: > > More on this problem. I copied and pasted simpleRead into a console > based Eclipse project and I've got the same result, except that cpu > usage doesn't go to 100%. I'm beginning to think there is an issue in > rxtx. > > My imports for simpleRead are: > > ============================ > import gnu.io.*; > import java.util.*; > //import javax.comm.*; > import java.io.*; > =========================== > > Any ideas ? I am trying to read from /dev/ttyUSB0 using a serial to > USB adapter which has worked well with minicom and gtkterm. > > Thanks. > > > > On Fri, 2006-02-10 at 21:23 -0700, Kim Lux wrote: >> I've got a problem receiving chars with my version of serialRead, >> written in an SWT GUI. >> >> I had a Java pro have a good look at my code and he can't see anything >> wrong with it. >> >> I can send chars fine. When I receive a char the cpu usage for the app >> goes to 100% and the code in the serial event handler doesn't get >> executed. >> >> The instructions on the Java Comm Serial API How-To for Linux page state >> that I must install javacomm. Is that true ? Everything builds without >> it and I can send chars on rxtx just fine, but I can't receive them. >> Could this be the problem ? >> >> I downloaded and installed javacomm. I was not able to add >> "Driver=gnuio.RXTXCommDriver >> to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not >> have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 >> installed in /usr/java/jre1.5.0_05. I added comm.jar >> to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext >> to the library paths. Is this OK ? >> >> Does it matter that I am receiving on /dev/ttyUSB0 ? >> >> Thanks. >> > From tjarvi at qbang.org Sun Feb 12 21:03:30 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:03:30 -0700 (MST) Subject: [Rxtx] One serial port object for both sending and receiving ? In-Reply-To: <1139610545.18177.4.camel@zd7280> References: <1139610545.18177.4.camel@zd7280> Message-ID: On Fri, 10 Feb 2006, Kim Lux wrote: > > Is it OK to use one SerialPort ojbect (ex Serial Port serialPort;) and > use it for both sending and receiving ? > > For example: > > ======================================================================== > static SerialPort serialPort = null; > static OutputStream serialOut = null; > static InputStream serialIn = null; > > > > > // assign it to an outputStream for use > try{ > serialOut = serialPort.getOutputStream(); > System.out.println("Serial output stream has been assigned."); > }//try > catch(IOException e) > { > System.out.println("Error: Couldn't assign output stream to serial > port."); > }//catch > > > //assign it to an inputStream for use > try{ > serialIn = serialPort.getInputStream(); > System.out.println("Serial input stream has been assigned."); > }//try > catch(IOException e) > { > System.out.println("Error: Couldn't assign input stream to serial > port."); > }//catch This should be fine. In fact trying to do it another way will probably not work as you will run into lockfile issues. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun Feb 12 21:13:13 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:13:13 -0700 (MST) Subject: [Rxtx] Question about Serial I/O under Win32 In-Reply-To: <662084330@web.de> References: <662084330@web.de> Message-ID: On Sat, 11 Feb 2006 lunareclipse03 at web.de wrote: > Hello everybody, > > I have a strange problem with a piece of code I made for myself. No, > this is not really concerning rxtx, but nevertheless I post this to the > list, hoping that some of you can help me. I've written two libraries, > one for linux and one for win32. The linux port works quite well, I can > send / receive faxes and / or replay voice messages over the telephone > line using a voice modem. But the win32 port of the library causes some > trouble. If, for example, I send out a fax with a certain modem under > linux, it works well. The fax is complete when it comes out of the fax > machine. If I then use the same modem to send out a fax under win32, the > fax coming out of the fax machine gets "stuck" halfways, but the sending > modem thinks that transmission was ok and drops the connection. The > answering fax machine then gives me "error while receiving." The "upper > layer" java code MUST be right, because if I do the same thing under > linux (using the linux library), everything is alright. Now I have to > ask: Can somebody please help me out with this??!? Could it be the case > that some kind of flow control or COMMTIMEOUTS setting causes this > behaviour? I set flow control to RTS/CTS before sending out a fax. How > can I DISABLE flow control? Or what do you think? Can something else > cause this problems? Thank you all for your time and PLEASE write back > soon. > Hi Sven I'm not too willing to talk about flow control at the low level until I confirm some things with test equipment later. It is not clear if you are using rxtx or writing your own native code. So I'm not sure how to answer much of this :) If you are wondering how to change the flow control using rxtx from java, The BlackBox example from Sun flips this back and forth. SerialPort.java in rxtx 2.1 uses the following: SerialPort.java: public static final int FLOWCONTROL_NONE =0; SerialPort.java: public static final int FLOWCONTROL_RTSCTS_IN =1; SerialPort.java: public static final int FLOWCONTROL_RTSCTS_OUT =2; SerialPort.java: public static final int FLOWCONTROL_XONXOFF_IN =4; SerialPort.java: public static final int FLOWCONTROL_XONXOFF_OUT=8; So if you set flowcontrol to RTSCTS, you can set it to NONE to turn it off. If you are looking for how to do it in native code, the rxtx Source is SerialImp.c (unix/linux/mac os x/w32) and termios.c (w32 only with SerialImp.c) You can track the code: SerialImp.c:JNIEXPORT void JNICALL RXTXPort(setflowcontrol)( JNIEnv *env, jobject jobj, jint flowmode ) termios.c:int tcgetattr( int fd, struct termios *s_termios ) termios.c:int tcsetattr( int fd, int when, struct termios *s_termios ) There may be a problem in the rxtx flow control code though. Rather than guess, I want to test this with a gold standard. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Feb 6 00:00:16 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 00:00:16 -0700 (MST) Subject: [Rxtx] wiki delay until tomorrow night. In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: On Sun, 5 Feb 2006, Trent Jarvi wrote: > On Sun, 5 Feb 2006, Kim Lux wrote: > >> usb ? Tell me more... I need that too. > > usb is a very proper design. Thats all it is. > Maybe rxtx could help usb. But it would start with helping bring back the community that was already there. It's not something I'd love to do but maybe its the right thing to do. It would probably take 2 years to do right. But maybe thats better than what we have now. I honestly don't know what IBM is doing which could just run over everything. Just some thoughts after some fine german wine. -- Trent Jarvi tjarvi at qbang.org From gadelavega at yahoo.com.ar Mon Feb 6 02:17:05 2006 From: gadelavega at yahoo.com.ar (Gonzalo A. de la Vega) Date: Mon, 06 Feb 2006 10:17:05 +0100 Subject: [Rxtx] Serial port ownership question In-Reply-To: References: <20060205113618.30274.qmail@web53501.mail.yahoo.com> <1139157422.4553.9.camel@zd7280> <1139158698.4936.9.camel@zd7280> Message-ID: <43E71411.4050402@yahoo.com.ar> On my Fedora Core 4: ls -l /dev/ttyS* crw-rw---- 1 root uucp 4, 64 Feb 6 2006 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Feb 6 2006 /dev/ttyS1 ... and: grep "ttyUSB" /etc/udev/rules.d/50-udev.rules KERNEL=="ttyUSB*", GROUP="uucp", MODE="0660" So anyone in the "uucp" group can use serial ports. On Gentoo the group is "tty". Trent Jarvi escribi?: > > > On Sun, 5 Feb 2006, Dr. Douglas Lyon wrote: > >> I can confirm that this is the case (only root ownership of >> serial ports, under fedora 4). >> Wow, what were they thinking?! >> - DL >> >>> I've found that the newer kernels have the serial ports owned by root. >>> For example, >>> >>> $ls -al /dev/tty* >>> crw-rw-rw- 1 root root 5, 0 Feb 5 02:06 /dev/tty >>> crw-rw---- 1 root root 4, 0 Feb 5 02:06 /dev/tty0 >>> crw------- 1 root root 4, 1 Feb 5 09:07 /dev/tty1 >>> crw-rw---- 1 root tty 4, 10 Feb 5 02:06 /dev/tty10 >>> crw-rw---- 1 root tty 4, 11 Feb 5 02:06 /dev/tty11 >>> ... > > > This is just not a problem jcp or such are going to solve. Its a > platform spitwad fight. But do look at pam. In fact thats what Sun > is doing too. Maybe Linux followed their lead.. I'm not a pam guy. > I've spent 16 hours trying to understand it but your users wont :) > > Solution? I have no clue. Its two tangent mentalities from my > perspective. > > -- > Trent Jarvi > tjarvi at qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mtnvega at yahoo.com.br Mon Feb 6 05:35:43 2006 From: mtnvega at yahoo.com.br (Luiz Jr) Date: Mon, 6 Feb 2006 12:35:43 +0000 (GMT) Subject: [Rxtx] Documentation Wiki In-Reply-To: <1139157422.4553.9.camel@zd7280> Message-ID: <20060206123543.57256.qmail@web53515.mail.yahoo.com> Hello, Thank you for you answer, but so the usage of the API is pretty much like the Java Communications Api? If yes, what version of the Java Comm Api? Thank you, Luiz A. Brandao Jr Kim Lux escreveu: On Sun, 2006-02-05 at 08:36 -0300, Luiz Jr wrote: > Hello, > > I want to start using the RXTX libraries, but I would to know how, > since I can not access the documentation wiki page I just started using them yesterday. Below is how I installed the libraries, if that helps. I used snippets of code from the SimpleWrite application here to get me going. http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html Instead of "import javax.comm.*;", use "import gnu.io.*;" which is gotten from RXTXcomm.jar, which you will need to include in your project references. I am working in Eclipse. BTW: there is no way to open a port without going through the port list and finding it. Maybe sometime in the future someone (me ?) will write a method called openSerialPort that allows the user to give a port identifier, such as "/dev/tty1" and return a port ready to use. It wouldn't take much to write that and it would save users a lot of code. Hope this helps. ======================================================================= 1) Figure out which java you are running, incase there is more than one installed. $ java -version java version "1.5.0_05" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_05-b05) Java HotSpot(TM) Client VM (build 1.5.0_05-b05, mixed mode, sharing) 2) Find all the jre directories and the one from which you are currently running. kfind (jre) 3) cd to that directory plus /lib/i386 cd /usr/java/jre1.5.0_05/lib/i386 4) Copy the library files (*.so) to that directory. cp /home/krlux/Desktop/'Java Controls'/rxtx-linux/bin/* . 5) Check that the copy was successful ls librxtx* librxtxI2C.so librxtxRaw.so librxtxSerial.so librxtxParallel.so librxtxRS485.so 6) cd to the /lib/ext directory for your java. cd /usr/java/jre1.5.0_05/lib/ext 7) Copy the Jar files there cp /home/krlux/Desktop/'Java Controls'/rxtx-linux/lib/ext/* . 8) Check that it was successful ls RXTX* RXTXcomm.jar Rxtx is now installed on your machine ready to use. =================================================================== -- Kim Lux, Diesel Research Inc. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx --------------------------------- Yahoo! Acesso Gr?tis - Internet r?pida e gr?tis. Instale o discador agora! -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/544aa403/attachment-0010.html From lyon at docjava.com Mon Feb 6 05:49:34 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 06 Feb 2006 07:49:34 -0500 Subject: [Rxtx] wiki delay until tomorrow night. In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: Hi All, I have often thought about USB drivers being needed. For example, the ironman watch will not interface to a mac (windows only). It is USB. My dymo label writer has no Java driver (native only). Etc. Most cheap web cameras are USB (and Java drivers go through JAI, if it supports the camera at all). The JAI code shows how sun did the USB drivers. You have to be a member of the jai project to download the source code. https://jai.dev.java.net has the jai distro. And then you are not allowed to redistribute it. However, we can all learn from it (if so inclined). Basically: cvs -d :pserver:lyon at cvs.dev.java.net:/cvs login cvs -d :pserver:lyon at cvs.dev.java.net:/cvs checkout jai-core You will need to user your own uid and pw to get in. The ant build has over 100 warnings from sun deprecations of its own code. You might say that they were hoisted on their own Picard ;) One interesting thing is that they support several platforms: linux-amd64 64-bit Linux-AMD64 linux-i586 32-bit Linux-x86 solaris-amd64 64-bit Solaris-AMD64 solaris-i586 32-bit Solaris-x86 solaris-sparc 32-bit Solaris-SPARC solaris-sparcv9 64-bit Solaris-SPARC windows-i586 32-bit Windows-x86 Thus, ant is used to provide a multi-platform native method distro. Neat. How do they do it? check this out: And: The core download does not contain any C source code (it was all pre-built). Basically, they are just copying .so and .dll files into build directories. I would love to see the C code for this...but Sun does not post it on the https://jai.dev.java.net site. I don't know why...Perhaps I missed it. - Doug >On Sun, 5 Feb 2006, Trent Jarvi wrote: > >>On Sun, 5 Feb 2006, Kim Lux wrote: >> >>>usb ? Tell me more... I need that too. >> >>usb is a very proper design. Thats all it is. >> > >Maybe rxtx could help usb. But it would start with helping bring >back the community that was already there. > >It's not something I'd love to do but maybe its the right thing to do. > >It would probably take 2 years to do right. But maybe thats better >than what we have now. > >I honestly don't know what IBM is doing which could just run over everything. > >Just some thoughts after some fine german wine. > >-- >Trent Jarvi >tjarvi at qbang.org > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tdelenik at gmail.com Mon Feb 6 05:56:32 2006 From: tdelenik at gmail.com (Thanasis Delenikas) Date: Mon, 6 Feb 2006 14:56:32 +0200 Subject: Fwd: [Rxtx] Documentation Wiki In-Reply-To: <1139157422.4553.9.camel@zd7280> References: <20060205113618.30274.qmail@web53501.mail.yahoo.com> <1139157422.4553.9.camel@zd7280> Message-ID: <310a1a930602060456t129f1dc6p5f2b908f13ab5a0b@mail.gmail.com> Hello all, Kim, this is a snippet from the code I use. The closest to directly opening a specific port without enumeration. << ... portId = CommPortIdentifier.getPortIdentifier(getPort()); serialPort = (SerialPort) portId.open("jSMSEngine", 1971); ... >> where getPort() return the string identifier of the port, i.e. "/dev/ttyS0" or "COM1" or whatever. Thanasis. ---------- Forwarded message ---------- From: Kim Lux Date: Feb 5, 2006 6:37 PM Subject: Re: [Rxtx] Documentation Wiki To: RXTX Developers and Users BTW: there is no way to open a port without going through the port list and finding it. Maybe sometime in the future someone (me ?) will write a method called openSerialPort that allows the user to give a port identifier, such as "/dev/tty1" and return a port ready to use. It wouldn't take much to write that and it would save users a lot of code. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/182ab5b8/attachment-0010.html From tjarvi at qbang.org Mon Feb 6 11:53:57 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 11:53:57 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: On Mon, 6 Feb 2006, Dr. Douglas Lyon wrote: > Hi All, > I have often thought about USB drivers being needed. > For example, the ironman watch will not interface > to a mac (windows only). It is USB. > My dymo label writer has no Java driver (native only). > Etc. > Most cheap web cameras are USB (and Java drivers go > through JAI, if it supports the camera at all). > The JAI code shows how sun did the USB drivers. > You have to be a member of the jai project to download > the source code. > https://jai.dev.java.net has the jai distro. > And then you are not allowed to redistribute it. However, > we can all learn from it (if so inclined). Basically: > cvs -d :pserver:lyon at cvs.dev.java.net:/cvs login > cvs -d :pserver:lyon at cvs.dev.java.net:/cvs checkout jai-core > You will need to user your own uid and pw to get in. > The ant build has over 100 warnings from sun deprecations > of its own code. > > You might say that they were hoisted on their own Picard ;) > > One interesting thing is that they support several platforms: > linux-amd64 64-bit Linux-AMD64 > linux-i586 32-bit Linux-x86 > solaris-amd64 64-bit Solaris-AMD64 > solaris-i586 32-bit Solaris-x86 > solaris-sparc 32-bit Solaris-SPARC > solaris-sparcv9 64-bit Solaris-SPARC > windows-i586 32-bit Windows-x86 > Thus, ant is used to provide a multi-platform native method distro. > Neat. > How do they do it? > check this out: > > > > > > > > > > > > > And: > > > > > > > > > > The core download does not contain any C source code (it was all pre-built). > Basically, they are just copying .so and .dll files into build directories. > > I would love to see the C code for this...but Sun does not post it on the > https://jai.dev.java.net site. > > I don't know why...Perhaps I missed it. > > - Doug > > I've looked at moving rxtx to Ant builds. I think that would help IDEs a great deal. I requested a evalutation desk copy the O'Reilly Ant book for some j2ee material I was teaching. http://www.oreilly.com/catalog/anttdg/ It has a one sentence mention of JNI. So there was not luck there. I saw that there is another Ant book that does mention JNI more. I can't find it now. Ant must be able to support it with extensions. http://ant.apache.org/manual/OptionalTasks/javah.html What the auto(break :) tools do in the rxtx build is 4 things really. 1) gcc compile flags 2) ld compile flags 3) config.h 4) compile flags for customizing rxtx (lockfiles, ...) See 1 All of this information except 4 can be static once obtained. So I'm not attached to the auto tools. If I could find an example of Ant being used for JNI code, I'd be one of the first to start moving that direction. Maybe someone saw an example someplace. The other thing we have not completed discussing is the directory structure. There is interest in making rxtx more IDE friendly. I get more mail about that off the list than how to install rxtx. And I see we have Ken Thompson in da house :) He is our trusted CVS maintainer and the guy that purchased the rxtx.org domain. Old community. We will need Ken for changing the directory structure of source. I would like to open up discussion about both of these as it is more than time. The problem is I have little experience with Ant and even less with IDEs. It would be nice if we could work with Eclipse and NetBeans. http://www.netbeans.org/ (sun and some community) http://www.eclipes.org (ibm,rhat,... perhaps more community) http://maven.apache.org/what-is-maven.html (apache. It is community) borland should sortof be here too but I think thats covered in eclipse. >From what I understand so far, we should morph rxtx to support those three maybe trusting apaches lead with maven. But I use vi. I have little to no clues beyond what people have fed me. Can we agree that thats the right direction to go? -- Trent Jarvi tjarvi at qbang.org From brian at mbari.org Mon Feb 6 14:57:50 2006 From: brian at mbari.org (Brian Schlining) Date: Mon, 6 Feb 2006 13:57:50 -0800 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> > The other thing we have not completed discussing is the directory > structure. There is interest in making rxtx more IDE friendly. I > get more mail about that off the list than how to install rxtx. > > And I see we have Ken Thompson in da house :) He is our trusted > CVS maintainer and the guy that purchased the rxtx.org domain. Old > community. We will need Ken for changing the directory structure of > source. > > I would like to open up discussion about both of these as it is > more than time. The problem is I have little experience with Ant > and even less with IDEs. It would be nice if we could work with > Eclipse and NetBeans. > > http://www.netbeans.org/ (sun and some community) > http://www.eclipes.org (ibm,rhat,... perhaps more community) > http://maven.apache.org/what-is-maven.html (apache. It is community) > borland should sortof be here too but I think thats covered in > eclipse. > >> From what I understand so far, we should morph rxtx to support >> those three > maybe trusting apaches lead with maven. But I use vi. I have > little to no clues beyond what people have fed me. > Maven likes the directory structure below for Java code. (From http:// maven.apache.org/guides/getting-started/index.html) This structure works fine with ant, netbeans, and eclipse. rxtx_root_directory `-- src |-- main | `-- java | `-- gnu | `-- io `-- test `-- java `-- gnu `-- io Brian Schlining Software Engineer http://www.mbari.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/d9451eba/attachment-0010.html From tjarvi at qbang.org Mon Feb 6 15:11:45 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 15:11:45 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: > rxtx_root_directory > `-- src > |-- main > | `-- java > | `-- gnu > | `-- io > `-- test > `-- java > `-- gnu > `-- io > >From what I understand this will just be good. For me it makes no difference. So lets do the rxtx thing. Let if fester for two weeks and if nobody objects, we will do it. I'm not doing this because I care. I'm doing this to eliminate much of my inbox. But test... man is rxtx lacking there in the community aspect. It is covered but not right. _maybe_ I can change that this year. -- Trent Jarvi tjarvi at qbang.org (cat hurding since 1997) From lux at diesel-research.com Mon Feb 6 21:38:49 2006 From: lux at diesel-research.com (Kim Lux) Date: Mon, 06 Feb 2006 21:38:49 -0700 Subject: [Rxtx] How can I use Lock Files with rxtx (in FC4) ? Message-ID: <1139287129.17031.3.camel@zd7280> I am now running an rxtx application on FC4. I am getting: ========================================================= check_group_uucp(): error testing lock file creation Error details: Permission denied check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL ========================================================= $ ls -al /var/lock total 32 drwxrwxr-x 4 root lock 4096 Feb 6 16:04 . drwxr-xr-x 24 root root 4096 Nov 14 01:19 .. drwx------ 2 root root 4096 Apr 27 2005 lvm drwxr-xr-x 2 root root 4096 Feb 6 16:04 subsys How do I fix this for regulator users ? -- Kim Lux, Diesel Research Inc. From dmarkman at mac.com Mon Feb 6 22:24:44 2006 From: dmarkman at mac.com (Dmitry Markman) Date: Tue, 7 Feb 2006 00:24:44 -0500 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: if I understands the issue right in order to be able to use ant for c/c++ compilation you have to install ant's cc task http://ant-contrib.sourceforge.net/cc.html it looks like it should work on mac os x (authors claim, that it's platform independent) but I never tested so all you have to do it's providing right command line for the gcc compiler On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: >> rxtx_root_directory >> `-- src >> |-- main >> | `-- java >> | `-- gnu >> | `-- io >> `-- test >> `-- java >> `-- gnu >> `-- io >> > > >> From what I understand this will just be good. > > For me it makes no difference. So lets do the rxtx thing. Let if > fester for two weeks and if nobody objects, we will do it. > > I'm not doing this because I care. I'm doing this to eliminate > much of my inbox. > > But test... man is rxtx lacking there in the community aspect. It > is covered but not right. _maybe_ I can change that this year. > > -- > Trent Jarvi > tjarvi at qbang.org > (cat hurding since 1997) > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx Dmitry Markman From lux at diesel-research.com Mon Feb 6 23:20:15 2006 From: lux at diesel-research.com (Kim Lux) Date: Mon, 06 Feb 2006 23:20:15 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? Message-ID: <1139293215.3689.4.camel@zd7280> I'm running the code below. portlist.hasMoreElements() is false. /dev has ports in it as listed below. What am I doing wrong ? ========================================================== // Step through the list of ports until we find one that matches // the one we are looking for. portList = CommPortIdentifier.getPortIdentifiers(); while(portList.hasMoreElements()) { portID = (CommPortIdentifier) portList.nextElement(); // if (portID.getName().equals("/dev/ttyUSB0")) { myTA.append("Serial port ttyUSB0 has been found\n"); break; }// if portID equals... }// End of while... ========================================================== ls -al /dev/tty* crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 ... crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 -- Kim Lux, Diesel Research Inc. From david.garnier at trusted-logic.com Tue Feb 7 00:46:30 2006 From: david.garnier at trusted-logic.com (David Garnier) Date: Tue, 07 Feb 2006 08:46:30 +0100 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: <43E85056.2090608@trusted-logic.com> Hello, I think that the make-based build process is fine as it is, apart from the location of the Java source files. It is true that putting the Java source in a directory structure that map 1-to-1 to the Java package structure is the norm and should make it easier for everyone to modify the Java source, with or without an IDE. Ant is a good tool, but in the RXTX case I fail to see the advantage of using it compared to the current make-based process. As Trent said, they are more pressing issues, like testing. Regards, David Dmitry Markman wrote: > if I understands the issue right > in order to be able to use ant for c/c++ compilation > you have to install ant's cc task > http://ant-contrib.sourceforge.net/cc.html > > it looks like it should work on mac os x > (authors claim, that it's platform independent) > but I never tested > > so all you have to do it's providing right command line > for the gcc compiler > > > > > On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: > >>> rxtx_root_directory >>> `-- src >>> |-- main >>> | `-- java >>> | `-- gnu >>> | `-- io >>> `-- test >>> `-- java >>> `-- gnu >>> `-- io >>> >> >> >>> From what I understand this will just be good. >> >> For me it makes no difference. So lets do the rxtx thing. Let if >> fester for two weeks and if nobody objects, we will do it. >> >> I'm not doing this because I care. I'm doing this to eliminate much >> of my inbox. >> >> But test... man is rxtx lacking there in the community aspect. It is >> covered but not right. _maybe_ I can change that this year. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> (cat hurding since 1997) From tjarvi at qbang.org Tue Feb 7 01:11:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 01:11:31 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <43E85056.2090608@trusted-logic.com> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: On Tue, 7 Feb 2006, David Garnier wrote: > Hello, > > I think that the make-based build process is fine as it is, apart from the location of the Java > source files. It is true that putting the Java source in a directory structure that map 1-to-1 to > the Java package structure is the norm and should make it easier for everyone to modify the Java > source, with or without an IDE. > > Ant is a good tool, but in the RXTX case I fail to see the advantage of using it compared to the > current make-based process. As Trent said, they are more pressing issues, like testing. > Hi David I have more experience with testing rxtx than I can talk about. But let it be known, rxtx has gone trough 100's of hours of testing. We are hobby folks interested in toys but there is more. rxtx has had some of the best guidance in the industry there. This is not an easy thing. I may be able to come back in a month from the other side of the corperate fence and help. I suspect the tests could just be made public but they are in a very unusual environment that just wont work in a wider sense. This is something I'll be trying to change. At one point it was agreed we could just make the results public so this isnt just noise.. There is interest and I think its safe to mention that much. The big problem with testing in the past is most of it is done with a loopback connection. So we *still* have major questions regarding things like flow control. rxtx talks to itself over a loopback and it works. regardless of right or wrong. This requires more thought to be done right. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Feb 7 02:46:34 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 02:46:34 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: > The big problem with testing in the past is most of it is done with a > loopback connection. So we *still* have major questions regarding things > like flow control. rxtx talks to itself over a loopback and it works. > regardless of right or wrong. With serial communication there are gold standards. ckermit is probably a definitive 'standard.' Maybe its possible to do ping/pong tests with ckermit? Is it scriptable? There are known issues in rxtx. Probably the worst is some threading issues regarding some JREs with multiple JNI threads setting java variables. Man did I get schooled there. Just switch the c functions to returning variables and things go away. Sometimes they work fine, sometimes they blow up. Without understanding everything, somehow rhat got it right and debian (and especially gentoo) grabbed kernel patches causing all sort of harm. Its not hard to fix once you understand whats going on but nearly impossible to track with a debugger. So I have a good idea what 2.1-8 will have outside of the IDE modifications. rxtx 2.1-7 is a release for everyone to sync with. Its not even as stable as -pre17 as far as I know - I ran no test suites. I'll be chasing it too. We just had so many contributions that it was time. It seriously broke internal scheduals but thats a great thing :) The other thing I want to do in 2.1-8 is automagic baud rates. It turns out lots of shops are doing really funky baud rates for things like automobile test equipment. It is possible but it requires a fair amount of change in the native code. Is anyone looking at this? -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Feb 7 02:57:21 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 07 Feb 2006 04:57:21 -0500 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <43E85056.2090608@trusted-logic.com> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: Hi All, I agree, testing is very important. The problem I have been trying to address is related to cross-platform testing and the robust nature of the installs. Typically, I visit 3 platforms to deploy my product, windows, linux and mac. A build is performed on each platform. The idea that you can build for many platforms from one copy the source code seems attractive. This should enable synchronized deployments of identical code. The question of how to achieve this goal remains open. As Trent mentioned, this is hard. Perhaps Ant will help here (but perhaps not). Ant does seem to help with running unit tests. However, it does not help with multi-platform tests. For that you need many machines and different operating environments. Toward that end, I have created a multi-platform test that can be run from web start, located at: http://show.docjava.com:8086/book/cgij/code/jnlp/serialPort.PortTest.jnlp This is interesting because many people in the community can run the test and we can improve the test, as time permits. No, it is not a perfect solution, however, the idea does help with multi-platform tests using many machines and different operating environments. If the group has a good test for a general serial port set-ups, i would be happy to deploy it, for general evaluation using web start. And as for ANT, it is just an idea. Not all my ideas are good ones! - Doug >Hello, > >I think that the make-based build process is fine as it is, apart >from the location of the Java >source files. It is true that putting the Java source in a directory >structure that map 1-to-1 to >the Java package structure is the norm and should make it easier for >everyone to modify the Java >source, with or without an IDE. > >Ant is a good tool, but in the RXTX case I fail to see the advantage >of using it compared to the >current make-based process. As Trent said, they are more pressing >issues, like testing. > >Regards, >David > >Dmitry Markman wrote: >> if I understands the issue right >> in order to be able to use ant for c/c++ compilation >> you have to install ant's cc task >> http://ant-contrib.sourceforge.net/cc.html >> >> it looks like it should work on mac os x >> (authors claim, that it's platform independent) >> but I never tested >> >> so all you have to do it's providing right command line >> for the gcc compiler >> >> >> >> >> On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: >> >>>> rxtx_root_directory >>>> `-- src >>>> |-- main >>>> | `-- java >>>> | `-- gnu >>>> | `-- io >>>> `-- test >>>> `-- java >>>> `-- gnu >>>> `-- io >>>> >>> >>> >>>> From what I understand this will just be good. >>> >>> For me it makes no difference. So lets do the rxtx thing. Let if >>> fester for two weeks and if nobody objects, we will do it. >>> >>> I'm not doing this because I care. I'm doing this to eliminate much >>> of my inbox. >>> >>> But test... man is rxtx lacking there in the community aspect. It is >>> covered but not right. _maybe_ I can change that this year. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> (cat hurding since 1997) > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From matt.higgins at gmail.com Tue Feb 7 08:28:34 2006 From: matt.higgins at gmail.com (Matt Higgins) Date: Tue, 7 Feb 2006 10:28:34 -0500 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final Message-ID: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? import java.io.*; import java.util.*; import gnu.io.*; public class MySimpleRead implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; public static void main(String[] args) { boolean portFound = false; String defaultPort = "COM1"; if (args.length > 0) { defaultPort = args[0]; } portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; MySimpleRead reader = new MySimpleRead(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } } public MySimpleRead() { try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) { e.printStackTrace(); } try { inputStream = serialPort.getInputStream(); } catch (IOException e) { e.printStackTrace(); } try { serialPort.addEventListener(this); } catch (TooManyListenersException e) { e.printStackTrace(); } try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { e.printStackTrace(); } System.out.println("Baud is " + serialPort.getBaudRate()); System.out.println("Bits is " + serialPort.getDataBits()); System.out.println("Stop is " + serialPort.getStopBits()); System.out.println("Par is " + serialPort.getParity()); serialPort.notifyOnDataAvailable(true); readThread = new Thread(this); readThread.start(); } public void run() { // Thread.sleep(20000); //} catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { System.out.println("An event occurred " + event.getEventType()); switch (event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: byte[] readBuffer = new byte[20]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } System.out.print(new String(readBuffer)); } catch (IOException e) {} break; } } } --------------- Result on windows ------------------------------ Stable Library ============================================================== Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port:: COM1 Baud is 9600 Bits is 8 Stop is 1 Par is 0 ----------------- End Results ----------------------------------------- ------------------ Result on Linux ----------------------------------- Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 Found port: /dev/ttyS0 Baud is 9600 Bits is 8 Stop is 1 Par is 0 An event occurred 1 043100066224 ------------------ End Results --------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/a1431630/attachment-0010.html From brian at mbari.org Tue Feb 7 09:48:37 2006 From: brian at mbari.org (Brian Schlining) Date: Tue, 7 Feb 2006 08:48:37 -0800 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> Message-ID: <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> Hi Matt > The following code works fine on Linux but I never see any data > when run on Windows. This is a cut and paste from the SimpleRead > example. > I am attempting to read data from a bar code scanner. I can fire > up HyperTermianl on windows and see that the device is working > properly as I see the barcodes are scanned and echoed back to the > terminal. However when I run the app I don't see any data. It is > however associating with the com port as the informational bits > print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. Cheers Brian Schlining Software Engineer http://www.mbari.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/16d07f37/attachment-0010.html From lux at diesel-research.com Tue Feb 7 11:59:58 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 11:59:58 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139293215.3689.4.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> Message-ID: <1139338798.8145.4.camel@zd7280> Any ideas on this ? Any reason why portList.hasMoreElements() should be false even though there are devices in /dev ? On Mon, 2006-02-06 at 23:20 -0700, Kim Lux wrote: > I'm running the code below. > > portlist.hasMoreElements() is false. > > /dev has ports in it as listed below. > > What am I doing wrong ? > > > ========================================================== > // Step through the list of ports until we find one that matches > // the one we are looking for. > > portList = CommPortIdentifier.getPortIdentifiers(); > > while(portList.hasMoreElements()) > { > portID = (CommPortIdentifier) portList.nextElement(); // > if (portID.getName().equals("/dev/ttyUSB0")) > { > myTA.append("Serial port ttyUSB0 has been found\n"); > break; > }// if portID equals... > }// End of while... > ========================================================== > > ls -al /dev/tty* > crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty > crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 > crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 > crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 > crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 > ... > crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 > crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 > crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 > > > -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 12:20:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 12:20:25 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139338798.8145.4.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> Message-ID: On Tue, 7 Feb 2006, Kim Lux wrote: > > Any ideas on this ? Any reason why portList.hasMoreElements() should be > false even though there are devices in /dev ? > > > On Mon, 2006-02-06 at 23:20 -0700, Kim Lux wrote: >> I'm running the code below. >> >> portlist.hasMoreElements() is false. >> >> /dev has ports in it as listed below. >> >> What am I doing wrong ? >> >> >> ========================================================== >> // Step through the list of ports until we find one that matches >> // the one we are looking for. >> >> portList = CommPortIdentifier.getPortIdentifiers(); >> >> while(portList.hasMoreElements()) >> { >> portID = (CommPortIdentifier) portList.nextElement(); // >> if (portID.getName().equals("/dev/ttyUSB0")) >> { >> myTA.append("Serial port ttyUSB0 has been found\n"); >> break; >> }// if portID equals... >> }// End of while... >> ========================================================== >> >> ls -al /dev/tty* >> crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty >> crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 >> crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 >> crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 >> crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 >> ... >> crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 >> crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 >> crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 >> >> >> > Hi Kim What rxtx does is try to open the port and do a timed out read. If the kernel/... do not complain it's enumarted. I suspect you could do a crude test by doing something like cat /dev/ttyS0 > /dev/null If that barfs then rxtx wont enumerate the port. hmm looking at your question again, I suspect it's a lockfile problem. This is documented in INSTALL with the source. Its easy enough to test this too.. touch /var/lock/testingrxtxlockfiles && rm -f /var/lock/testingrxtxlockfiles If you are not in the right group it will bail. Root will work regardless. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 12:37:56 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 12:37:56 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> Message-ID: <1139341076.8145.11.camel@zd7280> Exactly which ports does rxtx attempt to put into the list ? /dev/* or /dev/tty* or /dev/tty[0-9[0-9] ? or /dev/ttyS* ? For the record, only /dev/ttyUSB0 is a valid port on the machine I am presently on. Will this be a problem ? On Tue, 2006-02-07 at 12:20 -0700, Trent Jarvi wrote: > This is documented in INSTALL with the source. > I was wondering where that file was. I will download source and dig it up. Thanks. -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 12:51:09 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 12:51:09 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139341076.8145.11.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: On Tue, 7 Feb 2006, Kim Lux wrote: > > Exactly which ports does rxtx attempt to put into the list ? /dev/* > or /dev/tty* or /dev/tty[0-9[0-9] ? or /dev/ttyS* ? > > For the record, only /dev/ttyUSB0 is a valid port on the machine I am > presently on. Will this be a problem ? > > > On Tue, 2006-02-07 at 12:20 -0700, Trent Jarvi wrote: >> This is documented in INSTALL with the source. >> > I was wondering where that file was. I will download source and dig it > up. > > Thanks. > Hmm I'm looking at pre17 so this may have changed. (its just what I have on this machine) if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA" // for the IPAQs }; CandidatePortPrefixes=Temp; } So you may need to add "ttyUSB" to that list. RXTX used to enumerate _everything_ see if(osName.equals("Linux-all-ports") But it became less than practical. This is all in RXTXCommDriver.java hmm I just did a cvs update. if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have to get your fingers into the code. We aim for sane defaults. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 13:06:45 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 13:06:45 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139342805.8145.22.camel@zd7280> On Tue, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > Hmm I'm looking at pre17 so this may have changed. (its just what I have > on this machine) > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA" // for the IPAQs > }; > CandidatePortPrefixes=Temp; > } > > > So you may need to add "ttyUSB" to that list. RXTX used to enumerate > _everything_ see if(osName.equals("Linux-all-ports") But it became less > than practical. > > This is all in RXTXCommDriver.java > > hmm I just did a cvs update. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have > to get your fingers into the code. We aim for sane defaults. Excellent. Thanks for taking the time. -- Kim Lux, Diesel Research Inc. From ideiglenes1 at freemail.hu Tue Feb 7 13:53:39 2006 From: ideiglenes1 at freemail.hu (--) Date: Tue, 07 Feb 2006 21:53:39 +0100 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139345619.22534.2.camel@localhost> Hi! I use this code to get all the extra Linux devices. :) if ("Linux".equals(System.getProperty("os.name"))) { System.setProperty("os.name","Linux-all-ports"); } driver = new RXTXCommDriver(); On k, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > On Tue, 7 Feb 2006, Kim Lux wrote: > > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have > to get your fingers into the code. We aim for sane defaults. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From matt.higgins at gmail.com Tue Feb 7 13:45:54 2006 From: matt.higgins at gmail.com (Matt Higgins) Date: Tue, 7 Feb 2006 15:45:54 -0500 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> Message-ID: <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> Sweet this is exactly what I needed. I was searching the archives through marc.theamisgroup they only have archives back to 1/3/05. Should have hit the mailman archive! Thanks a lot! On 2/7/06, Brian Schlining wrote: > > Hi Matt > > The following code works fine on Linux but I never see any data when run > on Windows. This is a cut and paste from the SimpleRead example. > I am attempting to read data from a bar code scanner. I can fire up > HyperTermianl on windows and see that the device is working properly as I > see the barcodes are scanned and echoed back to the terminal. However when I > run the app I don't see any data. It is however associating with the com > port as the informational bits print fine? > > > You're not the only one whose had this problem, I don't know if Trent has > addressed this is the latest release of RXTX but there is a workaround. > Here's the recent thread from the RXTX mailing list regarding this issues: > > Thanasis Delenikas tdelenik at gmail.com > Wed Jan 18 13:56:23 MST 2006 > > * Previous message: [Rxtx] Re: More close() performance fixes > * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] > > Hi all. > (I've subscribed again from my other email account). > > Trent, > > You are right. Linux *always* works, no matter what flow control you set. > Windows *works only* with hardware flow control (I haven't tested what > happens with software XON/XOFF flow control). > > I assume (but I am not certain) that even with no flow control at all, all > platforms should work. Without flow control, you have the risk of bumping > into overflow or framing errors, but that's your (the end programmer, I > mean) problem. > > >From my side, I shouldn't be working without flow control. That was a bug > too... It was some code forgotten from the old times, when I used to work > with phone emulation drivers which didn't support flow control. The > correct > way is to have some flow control enabled and that's why I suppose this is > a > low-severity bug for RxTx. > > I have no idea which platform shows the correct behaviour, since > my knowledge about Linux and the inner workings of these low-level i/o > operations is limited. > > Regards, > Thanasis Delenikas. > > > > > Message: 2 > > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > > From: Trent Jarvi > > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > > To: RXTX Developers and Users > > Message-ID: > > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > > > Hi all, > > > > > > Trent, I have found something. > > > I read your comment about flow control, so I experimented a bit. > > > > > > If you remember, in my sample program I've used no flow control at all > ( > > i.e. > > > Java constant FLOWCONTROL_NONE). > > > > > > Now, during testing, I've switch to hardware inbound flow control (i.e > . > > Java > > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > > beautifully! > > > > > > I think I will switch to H/W flow control and test things for a while, > > but > > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > > > > > Hi Thanasis, > > > > I'm fairly sure you have identified a bug. I would not worry too much > > about what Sun CommAPI w32 defaults are. I think they did more or less > > whatever the port opened with. Just a guess. Linux tries to stomp on > > ports so they are all the same. > > > > So this started out with Linux worked, Windows XP/.. did not as I > recall. > > Something is wrong in rxtx. Do I understand this right? > > > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > > > Perhaps there is something Wayne or I did not understand when we wrote > > that code. I wasnt programming back in the BBS days so modems are not > my > > thing. I have a few questions. > > > > Is the above matrix confirmed by observation? > > Linux just always worked? > > Which one _should_ work? I'm guessing modems work with hardware flow > > control. I'll have to dig around. > > > > The windows flow control changes a couple things with hardware flow > > control. Following the w32 API documentation is confusing sometimes. > > But it looks like Linux could have a bug too. > > Cheers > > Brian Schlining > Software Engineer > http://www.mbari.org > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/9c989144/attachment-0010.html From tjarvi at qbang.org Tue Feb 7 14:06:14 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 14:06:14 -0700 (MST) Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> Message-ID: >> >> You're not the only one whose had this problem, I don't know if Trent has >> addressed this is the latest release of RXTX but there is a workaround. >> Here's the recent thread from the RXTX mailing list regarding this issues: >> I have not. I expect to have access to some test equipment next month and I'll go through all of this. I really don't know whats going on and I need a gold standard. I thought maybe linux was autodetecting the flow control. Your observations would certainly be welcome. I need to talk to Russell King and see what he is doing. Until then I'd just be toying around over a loopback as usual. This is very high on the list though. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 17:25:05 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 17:25:05 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139358305.17994.2.camel@zd7280> My application now works. I installed the libraries and jar from 2.1-7 (Final). portlist.hasMoreElements is no longer false. The application finds the port for /dev/ttyUSB0. Thanks for your help, Trent (et al) Sorry I bothered you with this. Next time I will look in the source first. I didn't think it was an rxtx issue, I thought it was a Linux setup issue . On Tue, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > Hmm I'm looking at pre17 so this may have changed. (its just what I > have > on this machine) > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux > Serial Ports > "ttySA" // for the > IPAQs > }; > > CandidatePortPrefixes=Temp; > } > > > So you may need to add "ttyUSB" to that list. RXTX used to enumerate > _everything_ see if(osName.equals("Linux-all-ports") But it became > less > than practical. > > This is all in RXTXCommDriver.java > > hmm I just did a cvs update. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux > Serial Ports > "ttySA", // for the > IPAQs > "ttyUSB" // for USB > frobs > }; > > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you > have > to get your fingers into the code. We aim for sane defaults. -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 19:21:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 19:21:54 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139358305.17994.2.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> <1139358305.17994.2.camel@zd7280> Message-ID: >Sorry I bothered you with this. Next time I will look in the source >first. I didn't think it was an rxtx issue, I thought it was a Linux >setup issue . Why would you be sorry? I would have done the same. I'm glad it's working :) -- Trent Jarvi tjarvi at qbang.org From tma at mail.island.net Wed Feb 8 13:39:35 2006 From: tma at mail.island.net (Tom Alldread) Date: Wed, 08 Feb 2006 12:39:35 -0800 Subject: [Rxtx] Win32/Linux Serial Port Data Dropouts In-Reply-To: <200602060702.k167255O007882@www.qbang.org> References: <200602060702.k167255O007882@www.qbang.org> Message-ID: <43EA5707.4020200@mail.island.net> Greetings Folks at RXTX: During the last couple of months I have been alternately testing with javax.comm 2 and RXTX 2.1 under Windows XP and CommApi 3 and RXTX 2.1 under Suse 10.0 Linux. In the process I have learned a little about java multi-threading under NetBeans 5 with Profiler. My java (jdk 1.5_06) application is used for data acquisition and provides a graphical display of A-D conversion data received from a 56KBaud serial port. The actual data throughput is about 10KBaud thus it is well below the speed of the port. I use hardware RTS/CTS flow control which can stall the data acquisition sample rate if necessary. This ensures the display computer has the ability to slow the data acquisition rate should it become too busy to accept the regular data flow. Both the serial port buffer and the java read buffer are set at 16KB. Usually the data transfers into the java read buffer are less than 100 bytes unless the data acquisition is recovering from a stall. The data flow normally hesitates after each 5 KB block as a continue command is needed from the display computer to start the drawing of a new graphics display line. Separate threads have been provided for the serial port event monitoring and data processing. The serial port event thread has been given the maximum priority and data processing thread the minimum priority provided by java. Thread yield statements have been placed within all data processing while/for loops as an effort to ensure quick access to CPU cycles for the serial port event thread. I have found that short data transmissions are essentially error free but occasional dropouts occur with continuous data flow especially under Windows XP. ....................................................................................................................................................................................... Linux results: I am happy to report that RXTX 2.1 appears to work very well under Linux although I did notice some errors when the screen savers were running with my dual monitors. I believe this is a local problem associated with my dual graphics which needs further attention. The recent CommApi 3 Linux release from Sun did not work at all with my program. It seemed to send commands out OK but did not receive any data. Although the serial port event triggered the ISR, the input stream appeared filled with nulls and thus did not contain any data. As my understanding is that CommApi 3 was tested with a Red Hat distribution of Linux I wonder if this problem is distro dependent? Although somewhat off topic here I wonder if anyone reading this has had similar experience? .................................................................................................................................................................................. Windows XP results: There are problems with occasional data dropouts which become more frequent as the sampling rate is increased or if the computer becomes busy with other duties. The dropouts typically consist of a half dozen byte block of lost data. It appears the lost bytes never get added to the java input stream. There has not been any indication of garbled data, overruns or framing errors which suggests the UART communications remains solid. Using javax.comm 2 I found that the setting of SerialPort 'enableReceiveThreshold' to 40 and 'enableReceiveTimeout' of 100mS reduced the dropouts error rate significantly. I found that I could not get RXTX 2.1 to function with the aforementioned threshold and timeout settings. The javax.comm 2 interface is consequently performing better for me under Windows than RXTX 2.1. I wonder if anyone here has any suggestions as to what I might try to improve RXTX 2.1? Although my settings are the same as under Suse 10.0, RXTX 2.1 performs much better for me under Linux than any of the alternatives that I have tried under Windows XP . ............................................................................................................................................................................... I would like to establish, based on the experience of others, if I have reached the normally expected performance limit of java serial port communications? Should I expect to achieve virtually error free serial port data input from a continuous stream under Windows XP java software? I am considering changing my protocol to packets with error checking if necessary but would like to know if the dropout problems I am experiencing are typical or not before I take this rather work intensive plunge. Many thanks in advance for any help! Best Regards, Tom Alldread -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.375 / Virus Database: 267.15.2/253 - Release Date: 2006-02-07 From jlaxson at mac.com Wed Feb 8 23:56:48 2006 From: jlaxson at mac.com (John Laxson) Date: Thu, 9 Feb 2006 00:56:48 -0600 Subject: [Rxtx] PortInUseException: Unknown Application on OSX Message-ID: Hi, I've been trying to get RXTX 2.1.7 going on Mac OS X for a while here, and am running up into a wall here. I've tried with pre- compiled and the source version and get the same problem, a gnu.io.PortInUseException: Unknown Application. I have run the fixperms script included with the source distribution, and id shows me as a member of the uucp group, and permissions on /var/spool/uucp are 775 root:uucp. Running a test program (included at the bottom for clarity) lets me enumerate all the serial ports correctly, but trying to open any of them gives the PortInUseException. If it helps, when I try to open a port that's set to make an outgoing bluetooth connection, there is no delay and no connection attempt at all. Thanks, John Laxson PS: The documentation wiki on qbang.org shows 404, and has for a few days now. My test code: public static void main(String[] args) { SerialPort serialPort; try { Enumeration e = CommPortIdentifier.getPortIdentifiers(); CommPortIdentifier ident; while (e.hasMoreElements()) { ident = (CommPortIdentifier)e.nextElement(); System.out.println(ident.getName()); } ident = CommPortIdentifier.getPortIdentifier("/dev/cu.modem"); serialPort = (SerialPort) ident.open("Me", 5000); } catch (Exception e) { e.printStackTrace(); } } From rajesh.invincible at gmail.com Thu Feb 9 03:39:38 2006 From: rajesh.invincible at gmail.com (Rajesh N) Date: Thu, 9 Feb 2006 16:09:38 +0530 Subject: [Rxtx] Re: Move .java Files in gnu.io filesystem hierarchy - Maven (2) In-Reply-To: <43DF21D2.7090200@ngi.it> References: <43DF21D2.7090200@ngi.it> Message-ID: <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Can anybody tell me how to overcome these EXCEPTIONS I AM WORKING ON SERIAL COMMN IN JAVA ON LINUX. 1. " NOT ALL PARAMETERS SUPPORTED BY THE KERNEL" This i came across the following statement inmy prog. SerialP is A SerialPort object SerialP.setSerialPortParams(9600(BAUDRATE),DATABITS_8,STOPBITS_1,PARITY_NONE) 2. NullPointer Exception at Event Dispatch Now i have checked all my object references for a null reference but i found none i have put up my entire code in try catch blocks but still I AM UNABLE TO CATCH THIS EXCEPTION AND HENCE MY APPLICATION CLOSES HOW DOES THESE GO? PLEASE HELP ME IT IS URGENTTTTTTTTTTTTTTTT yours sincerely RAJESH On 1/31/06, Fabio Frumento wrote: > Hi Xavier, > > I don't know maven at all but the directory hierarchy listed buy Trent > is fine for me... > > I'll take a look to maven, it seems an interesting project > > Regards > > Fabio Frumento > > Trent Jarvi wrote: > > On Tue, 31 Jan 2006, Xavier Frisaye wrote: > > > >> Hi all, > >> > >> If you are going to rearrange the src folder, i will propose to use > >> maven 2 and follow its directory structure > >> > (http://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html). > >> > >> Maven 2 simplify java project and give a standard way to make projects > >> (http://maven.apache.org/). > >> We are using it for internal projects and we are very satisfied. > >> > >> Is anybody interested? > >> > >> I'm not an expert in maven 2 (yet) but i'm agree to help using it if > >> you choose to make so. > >> > > > > so this would be: > > > > rxtx-devel/src/main/java/gnu.io > > rxtx-devel/src/test/java/ManIwish.java > > > > I don't use IDEs very much so I'll let others comment. But I don't see > > a problem with that. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Thu Feb 9 09:50:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 9 Feb 2006 09:50:31 -0700 (MST) Subject: [Rxtx] Re: Move .java Files in gnu.io filesystem hierarchy - Maven (2) In-Reply-To: <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Message-ID: On Thu, 9 Feb 2006, Rajesh N wrote: > Can anybody tell me how to overcome these EXCEPTIONS > I AM WORKING ON SERIAL COMMN IN JAVA ON LINUX. > > 1. " NOT ALL PARAMETERS SUPPORTED BY THE KERNEL" > > This i came across the following statement inmy prog. > SerialP is A SerialPort object > SerialP.setSerialPortParams(9600(BAUDRATE),DATABITS_8,STOPBITS_1,PARITY_NONE) > Strange. The parameters you use are the same the port should open with by default. Could you paste the actual exception you are getting? I don't see that in the rxtx source. Also it would help to know the rxtx version. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Fri Feb 10 15:29:05 2006 From: lux at diesel-research.com (Kim Lux) Date: Fri, 10 Feb 2006 15:29:05 -0700 Subject: [Rxtx] One serial port object for both sending and receiving ? Message-ID: <1139610545.18177.4.camel@zd7280> Is it OK to use one SerialPort ojbect (ex Serial Port serialPort;) and use it for both sending and receiving ? For example: ======================================================================== static SerialPort serialPort = null; static OutputStream serialOut = null; static InputStream serialIn = null; // assign it to an outputStream for use try{ serialOut = serialPort.getOutputStream(); System.out.println("Serial output stream has been assigned."); }//try catch(IOException e) { System.out.println("Error: Couldn't assign output stream to serial port."); }//catch //assign it to an inputStream for use try{ serialIn = serialPort.getInputStream(); System.out.println("Serial input stream has been assigned."); }//try catch(IOException e) { System.out.println("Error: Couldn't assign input stream to serial port."); }//catch ======================================================================== -- Kim Lux, Diesel Research Inc. From lux at diesel-research.com Fri Feb 10 21:23:00 2006 From: lux at diesel-research.com (Kim Lux) Date: Fri, 10 Feb 2006 21:23:00 -0700 Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Message-ID: <1139631780.23882.10.camel@zd7280> I've got a problem receiving chars with my version of serialRead, written in an SWT GUI. I had a Java pro have a good look at my code and he can't see anything wrong with it. I can send chars fine. When I receive a char the cpu usage for the app goes to 100% and the code in the serial event handler doesn't get executed. The instructions on the Java Comm Serial API How-To for Linux page state that I must install javacomm. Is that true ? Everything builds without it and I can send chars on rxtx just fine, but I can't receive them. Could this be the problem ? I downloaded and installed javacomm. I was not able to add "Driver=gnuio.RXTXCommDriver to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 installed in /usr/java/jre1.5.0_05. I added comm.jar to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext to the library paths. Is this OK ? Does it matter that I am receiving on /dev/ttyUSB0 ? Thanks. -- Kim Lux, Diesel Research Inc. From lunareclipse03 at web.de Sat Feb 11 09:44:46 2006 From: lunareclipse03 at web.de (lunareclipse03@web.de) Date: Sat, 11 Feb 2006 17:44:46 +0100 Subject: [Rxtx] Question about Serial I/O under Win32 Message-ID: <662084330@web.de> Hello everybody, I have a strange problem with a piece of code I made for myself. No, this is not really concerning rxtx, but nevertheless I post this to the list, hoping that some of you can help me. I've written two libraries, one for linux and one for win32. The linux port works quite well, I can send / receive faxes and / or replay voice messages over the telephone line using a voice modem. But the win32 port of the library causes some trouble. If, for example, I send out a fax with a certain modem under linux, it works well. The fax is complete when it comes out of the fax machine. If I then use the same modem to send out a fax under win32, the fax coming out of the fax machine gets "stuck" halfways, but the sending modem thinks that transmission was ok and drops the connection. The answering fax machine then gives me "error while receiving." The "upper layer" java code MUST be right, because if I do the same thing under linux (using the linux library), everything is alright. Now I have to ask: Can somebody please help me out with this??!? Could it be the case that some kind of flow control or COMMTIMEOUTS setting causes this behaviour? I set flow control to RTS/CTS before sending out a fax. How can I DISABLE flow control? Or what do you think? Can something else cause this problems? Thank you all for your time and PLEASE write back soon. Regards, --Sven Ahlemann Am Waldrand 31 45721 Haltern am See Germany ______________________________________________________________ Verschicken Sie romantische, coole und witzige Bilder per SMS! Jetzt bei WEB.DE FreeMail: http://f.web.de/?mc=021193 From lux at diesel-research.com Sat Feb 11 10:06:52 2006 From: lux at diesel-research.com (Kim Lux) Date: Sat, 11 Feb 2006 10:06:52 -0700 Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: <1139631780.23882.10.camel@zd7280> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> <1139631780.23882.10.camel@zd7280> Message-ID: <1139677612.3431.5.camel@zd7280> More on this problem. I copied and pasted simpleRead into a console based Eclipse project and I've got the same result, except that cpu usage doesn't go to 100%. I'm beginning to think there is an issue in rxtx. My imports for simpleRead are: ============================ import gnu.io.*; import java.util.*; //import javax.comm.*; import java.io.*; =========================== Any ideas ? I am trying to read from /dev/ttyUSB0 using a serial to USB adapter which has worked well with minicom and gtkterm. Thanks. On Fri, 2006-02-10 at 21:23 -0700, Kim Lux wrote: > I've got a problem receiving chars with my version of serialRead, > written in an SWT GUI. > > I had a Java pro have a good look at my code and he can't see anything > wrong with it. > > I can send chars fine. When I receive a char the cpu usage for the app > goes to 100% and the code in the serial event handler doesn't get > executed. > > The instructions on the Java Comm Serial API How-To for Linux page state > that I must install javacomm. Is that true ? Everything builds without > it and I can send chars on rxtx just fine, but I can't receive them. > Could this be the problem ? > > I downloaded and installed javacomm. I was not able to add > "Driver=gnuio.RXTXCommDriver > to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not > have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 > installed in /usr/java/jre1.5.0_05. I added comm.jar > to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext > to the library paths. Is this OK ? > > Does it matter that I am receiving on /dev/ttyUSB0 ? > > Thanks. > -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Sun Feb 12 21:01:33 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:01:33 -0700 (MST) Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: <1139677612.3431.5.camel@zd7280> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> <1139631780.23882.10.camel@zd7280> <1139677612.3431.5.camel@zd7280> Message-ID: I suspect what is happening is the select() is breaking out in the native code but the driver does not have support for notifying there are X bytes available. On some traditional Unix based systems, the only way you know data is available is the fd status changes and do an FIORDCHK ioctl. Or perhaps the only thing you can know is the fd status changed. It would take reading through the kernel driver code to know for sure. So on USB, depending upon the driver, the same may need to be done or the driver improved a bit if possible to support. Polling reads will also work but don't use the event driven model of CommAPI which isnt acceptable in the long run. The 100% cpu usage can then be explained because select no longer blocks until the data is read; the eventLoop spins loose. You can put a well placed sleep but rxtx only expects those are needed when it knows data is available. This may not be a super simple thing to understand and fix. I do have ideas to get you started. I'm going to be short on time the next couple weeks. I expect to put some good time in and answer some other questions I saw around the 25th. For now, I'd look at the following and go from there with the hints I've given. JNIEXPORT jint JNICALL RXTXPort(nativeavailable)( JNIEnv *env, jobject jobj ) { int fd = get_java_var( env, jobj,"fd","I" ); int result; /* char message[80]; ENTER( "RXTXPort:nativeavailable" ); On SCO OpenServer FIONREAD always fails for serial devices, so try ioctl FIORDCHK instead; will only tell us whether bytes are available, not how many, but better than nothing. This turns out to be true on Solaris also. taj. */ #ifdef FIORDCHK /* __unixware__ __sun__ probably others */ result = ioctl(fd, FIORDCHK, 0); #else if( ioctl( fd, FIONREAD, &result ) < 0 ) { goto fail; } #endif /* FIORDCHK */ On Sat, 11 Feb 2006, Kim Lux wrote: > > More on this problem. I copied and pasted simpleRead into a console > based Eclipse project and I've got the same result, except that cpu > usage doesn't go to 100%. I'm beginning to think there is an issue in > rxtx. > > My imports for simpleRead are: > > ============================ > import gnu.io.*; > import java.util.*; > //import javax.comm.*; > import java.io.*; > =========================== > > Any ideas ? I am trying to read from /dev/ttyUSB0 using a serial to > USB adapter which has worked well with minicom and gtkterm. > > Thanks. > > > > On Fri, 2006-02-10 at 21:23 -0700, Kim Lux wrote: >> I've got a problem receiving chars with my version of serialRead, >> written in an SWT GUI. >> >> I had a Java pro have a good look at my code and he can't see anything >> wrong with it. >> >> I can send chars fine. When I receive a char the cpu usage for the app >> goes to 100% and the code in the serial event handler doesn't get >> executed. >> >> The instructions on the Java Comm Serial API How-To for Linux page state >> that I must install javacomm. Is that true ? Everything builds without >> it and I can send chars on rxtx just fine, but I can't receive them. >> Could this be the problem ? >> >> I downloaded and installed javacomm. I was not able to add >> "Driver=gnuio.RXTXCommDriver >> to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not >> have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 >> installed in /usr/java/jre1.5.0_05. I added comm.jar >> to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext >> to the library paths. Is this OK ? >> >> Does it matter that I am receiving on /dev/ttyUSB0 ? >> >> Thanks. >> > From tjarvi at qbang.org Sun Feb 12 21:03:30 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:03:30 -0700 (MST) Subject: [Rxtx] One serial port object for both sending and receiving ? In-Reply-To: <1139610545.18177.4.camel@zd7280> References: <1139610545.18177.4.camel@zd7280> Message-ID: On Fri, 10 Feb 2006, Kim Lux wrote: > > Is it OK to use one SerialPort ojbect (ex Serial Port serialPort;) and > use it for both sending and receiving ? > > For example: > > ======================================================================== > static SerialPort serialPort = null; > static OutputStream serialOut = null; > static InputStream serialIn = null; > > > > > // assign it to an outputStream for use > try{ > serialOut = serialPort.getOutputStream(); > System.out.println("Serial output stream has been assigned."); > }//try > catch(IOException e) > { > System.out.println("Error: Couldn't assign output stream to serial > port."); > }//catch > > > //assign it to an inputStream for use > try{ > serialIn = serialPort.getInputStream(); > System.out.println("Serial input stream has been assigned."); > }//try > catch(IOException e) > { > System.out.println("Error: Couldn't assign input stream to serial > port."); > }//catch This should be fine. In fact trying to do it another way will probably not work as you will run into lockfile issues. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun Feb 12 21:13:13 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:13:13 -0700 (MST) Subject: [Rxtx] Question about Serial I/O under Win32 In-Reply-To: <662084330@web.de> References: <662084330@web.de> Message-ID: On Sat, 11 Feb 2006 lunareclipse03 at web.de wrote: > Hello everybody, > > I have a strange problem with a piece of code I made for myself. No, > this is not really concerning rxtx, but nevertheless I post this to the > list, hoping that some of you can help me. I've written two libraries, > one for linux and one for win32. The linux port works quite well, I can > send / receive faxes and / or replay voice messages over the telephone > line using a voice modem. But the win32 port of the library causes some > trouble. If, for example, I send out a fax with a certain modem under > linux, it works well. The fax is complete when it comes out of the fax > machine. If I then use the same modem to send out a fax under win32, the > fax coming out of the fax machine gets "stuck" halfways, but the sending > modem thinks that transmission was ok and drops the connection. The > answering fax machine then gives me "error while receiving." The "upper > layer" java code MUST be right, because if I do the same thing under > linux (using the linux library), everything is alright. Now I have to > ask: Can somebody please help me out with this??!? Could it be the case > that some kind of flow control or COMMTIMEOUTS setting causes this > behaviour? I set flow control to RTS/CTS before sending out a fax. How > can I DISABLE flow control? Or what do you think? Can something else > cause this problems? Thank you all for your time and PLEASE write back > soon. > Hi Sven I'm not too willing to talk about flow control at the low level until I confirm some things with test equipment later. It is not clear if you are using rxtx or writing your own native code. So I'm not sure how to answer much of this :) If you are wondering how to change the flow control using rxtx from java, The BlackBox example from Sun flips this back and forth. SerialPort.java in rxtx 2.1 uses the following: SerialPort.java: public static final int FLOWCONTROL_NONE =0; SerialPort.java: public static final int FLOWCONTROL_RTSCTS_IN =1; SerialPort.java: public static final int FLOWCONTROL_RTSCTS_OUT =2; SerialPort.java: public static final int FLOWCONTROL_XONXOFF_IN =4; SerialPort.java: public static final int FLOWCONTROL_XONXOFF_OUT=8; So if you set flowcontrol to RTSCTS, you can set it to NONE to turn it off. If you are looking for how to do it in native code, the rxtx Source is SerialImp.c (unix/linux/mac os x/w32) and termios.c (w32 only with SerialImp.c) You can track the code: SerialImp.c:JNIEXPORT void JNICALL RXTXPort(setflowcontrol)( JNIEnv *env, jobject jobj, jint flowmode ) termios.c:int tcgetattr( int fd, struct termios *s_termios ) termios.c:int tcsetattr( int fd, int when, struct termios *s_termios ) There may be a problem in the rxtx flow control code though. Rather than guess, I want to test this with a gold standard. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Feb 6 00:00:16 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 00:00:16 -0700 (MST) Subject: [Rxtx] wiki delay until tomorrow night. In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: On Sun, 5 Feb 2006, Trent Jarvi wrote: > On Sun, 5 Feb 2006, Kim Lux wrote: > >> usb ? Tell me more... I need that too. > > usb is a very proper design. Thats all it is. > Maybe rxtx could help usb. But it would start with helping bring back the community that was already there. It's not something I'd love to do but maybe its the right thing to do. It would probably take 2 years to do right. But maybe thats better than what we have now. I honestly don't know what IBM is doing which could just run over everything. Just some thoughts after some fine german wine. -- Trent Jarvi tjarvi at qbang.org From gadelavega at yahoo.com.ar Mon Feb 6 02:17:05 2006 From: gadelavega at yahoo.com.ar (Gonzalo A. de la Vega) Date: Mon, 06 Feb 2006 10:17:05 +0100 Subject: [Rxtx] Serial port ownership question In-Reply-To: References: <20060205113618.30274.qmail@web53501.mail.yahoo.com> <1139157422.4553.9.camel@zd7280> <1139158698.4936.9.camel@zd7280> Message-ID: <43E71411.4050402@yahoo.com.ar> On my Fedora Core 4: ls -l /dev/ttyS* crw-rw---- 1 root uucp 4, 64 Feb 6 2006 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Feb 6 2006 /dev/ttyS1 ... and: grep "ttyUSB" /etc/udev/rules.d/50-udev.rules KERNEL=="ttyUSB*", GROUP="uucp", MODE="0660" So anyone in the "uucp" group can use serial ports. On Gentoo the group is "tty". Trent Jarvi escribi?: > > > On Sun, 5 Feb 2006, Dr. Douglas Lyon wrote: > >> I can confirm that this is the case (only root ownership of >> serial ports, under fedora 4). >> Wow, what were they thinking?! >> - DL >> >>> I've found that the newer kernels have the serial ports owned by root. >>> For example, >>> >>> $ls -al /dev/tty* >>> crw-rw-rw- 1 root root 5, 0 Feb 5 02:06 /dev/tty >>> crw-rw---- 1 root root 4, 0 Feb 5 02:06 /dev/tty0 >>> crw------- 1 root root 4, 1 Feb 5 09:07 /dev/tty1 >>> crw-rw---- 1 root tty 4, 10 Feb 5 02:06 /dev/tty10 >>> crw-rw---- 1 root tty 4, 11 Feb 5 02:06 /dev/tty11 >>> ... > > > This is just not a problem jcp or such are going to solve. Its a > platform spitwad fight. But do look at pam. In fact thats what Sun > is doing too. Maybe Linux followed their lead.. I'm not a pam guy. > I've spent 16 hours trying to understand it but your users wont :) > > Solution? I have no clue. Its two tangent mentalities from my > perspective. > > -- > Trent Jarvi > tjarvi at qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mtnvega at yahoo.com.br Mon Feb 6 05:35:43 2006 From: mtnvega at yahoo.com.br (Luiz Jr) Date: Mon, 6 Feb 2006 12:35:43 +0000 (GMT) Subject: [Rxtx] Documentation Wiki In-Reply-To: <1139157422.4553.9.camel@zd7280> Message-ID: <20060206123543.57256.qmail@web53515.mail.yahoo.com> Hello, Thank you for you answer, but so the usage of the API is pretty much like the Java Communications Api? If yes, what version of the Java Comm Api? Thank you, Luiz A. Brandao Jr Kim Lux escreveu: On Sun, 2006-02-05 at 08:36 -0300, Luiz Jr wrote: > Hello, > > I want to start using the RXTX libraries, but I would to know how, > since I can not access the documentation wiki page I just started using them yesterday. Below is how I installed the libraries, if that helps. I used snippets of code from the SimpleWrite application here to get me going. http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html Instead of "import javax.comm.*;", use "import gnu.io.*;" which is gotten from RXTXcomm.jar, which you will need to include in your project references. I am working in Eclipse. BTW: there is no way to open a port without going through the port list and finding it. Maybe sometime in the future someone (me ?) will write a method called openSerialPort that allows the user to give a port identifier, such as "/dev/tty1" and return a port ready to use. It wouldn't take much to write that and it would save users a lot of code. Hope this helps. ======================================================================= 1) Figure out which java you are running, incase there is more than one installed. $ java -version java version "1.5.0_05" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_05-b05) Java HotSpot(TM) Client VM (build 1.5.0_05-b05, mixed mode, sharing) 2) Find all the jre directories and the one from which you are currently running. kfind (jre) 3) cd to that directory plus /lib/i386 cd /usr/java/jre1.5.0_05/lib/i386 4) Copy the library files (*.so) to that directory. cp /home/krlux/Desktop/'Java Controls'/rxtx-linux/bin/* . 5) Check that the copy was successful ls librxtx* librxtxI2C.so librxtxRaw.so librxtxSerial.so librxtxParallel.so librxtxRS485.so 6) cd to the /lib/ext directory for your java. cd /usr/java/jre1.5.0_05/lib/ext 7) Copy the Jar files there cp /home/krlux/Desktop/'Java Controls'/rxtx-linux/lib/ext/* . 8) Check that it was successful ls RXTX* RXTXcomm.jar Rxtx is now installed on your machine ready to use. =================================================================== -- Kim Lux, Diesel Research Inc. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx --------------------------------- Yahoo! Acesso Gr?tis - Internet r?pida e gr?tis. Instale o discador agora! -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/544aa403/attachment-0011.html From lyon at docjava.com Mon Feb 6 05:49:34 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 06 Feb 2006 07:49:34 -0500 Subject: [Rxtx] wiki delay until tomorrow night. In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: Hi All, I have often thought about USB drivers being needed. For example, the ironman watch will not interface to a mac (windows only). It is USB. My dymo label writer has no Java driver (native only). Etc. Most cheap web cameras are USB (and Java drivers go through JAI, if it supports the camera at all). The JAI code shows how sun did the USB drivers. You have to be a member of the jai project to download the source code. https://jai.dev.java.net has the jai distro. And then you are not allowed to redistribute it. However, we can all learn from it (if so inclined). Basically: cvs -d :pserver:lyon at cvs.dev.java.net:/cvs login cvs -d :pserver:lyon at cvs.dev.java.net:/cvs checkout jai-core You will need to user your own uid and pw to get in. The ant build has over 100 warnings from sun deprecations of its own code. You might say that they were hoisted on their own Picard ;) One interesting thing is that they support several platforms: linux-amd64 64-bit Linux-AMD64 linux-i586 32-bit Linux-x86 solaris-amd64 64-bit Solaris-AMD64 solaris-i586 32-bit Solaris-x86 solaris-sparc 32-bit Solaris-SPARC solaris-sparcv9 64-bit Solaris-SPARC windows-i586 32-bit Windows-x86 Thus, ant is used to provide a multi-platform native method distro. Neat. How do they do it? check this out: And: The core download does not contain any C source code (it was all pre-built). Basically, they are just copying .so and .dll files into build directories. I would love to see the C code for this...but Sun does not post it on the https://jai.dev.java.net site. I don't know why...Perhaps I missed it. - Doug >On Sun, 5 Feb 2006, Trent Jarvi wrote: > >>On Sun, 5 Feb 2006, Kim Lux wrote: >> >>>usb ? Tell me more... I need that too. >> >>usb is a very proper design. Thats all it is. >> > >Maybe rxtx could help usb. But it would start with helping bring >back the community that was already there. > >It's not something I'd love to do but maybe its the right thing to do. > >It would probably take 2 years to do right. But maybe thats better >than what we have now. > >I honestly don't know what IBM is doing which could just run over everything. > >Just some thoughts after some fine german wine. > >-- >Trent Jarvi >tjarvi at qbang.org > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tdelenik at gmail.com Mon Feb 6 05:56:32 2006 From: tdelenik at gmail.com (Thanasis Delenikas) Date: Mon, 6 Feb 2006 14:56:32 +0200 Subject: Fwd: [Rxtx] Documentation Wiki In-Reply-To: <1139157422.4553.9.camel@zd7280> References: <20060205113618.30274.qmail@web53501.mail.yahoo.com> <1139157422.4553.9.camel@zd7280> Message-ID: <310a1a930602060456t129f1dc6p5f2b908f13ab5a0b@mail.gmail.com> Hello all, Kim, this is a snippet from the code I use. The closest to directly opening a specific port without enumeration. << ... portId = CommPortIdentifier.getPortIdentifier(getPort()); serialPort = (SerialPort) portId.open("jSMSEngine", 1971); ... >> where getPort() return the string identifier of the port, i.e. "/dev/ttyS0" or "COM1" or whatever. Thanasis. ---------- Forwarded message ---------- From: Kim Lux Date: Feb 5, 2006 6:37 PM Subject: Re: [Rxtx] Documentation Wiki To: RXTX Developers and Users BTW: there is no way to open a port without going through the port list and finding it. Maybe sometime in the future someone (me ?) will write a method called openSerialPort that allows the user to give a port identifier, such as "/dev/tty1" and return a port ready to use. It wouldn't take much to write that and it would save users a lot of code. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/182ab5b8/attachment-0011.html From tjarvi at qbang.org Mon Feb 6 11:53:57 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 11:53:57 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: On Mon, 6 Feb 2006, Dr. Douglas Lyon wrote: > Hi All, > I have often thought about USB drivers being needed. > For example, the ironman watch will not interface > to a mac (windows only). It is USB. > My dymo label writer has no Java driver (native only). > Etc. > Most cheap web cameras are USB (and Java drivers go > through JAI, if it supports the camera at all). > The JAI code shows how sun did the USB drivers. > You have to be a member of the jai project to download > the source code. > https://jai.dev.java.net has the jai distro. > And then you are not allowed to redistribute it. However, > we can all learn from it (if so inclined). Basically: > cvs -d :pserver:lyon at cvs.dev.java.net:/cvs login > cvs -d :pserver:lyon at cvs.dev.java.net:/cvs checkout jai-core > You will need to user your own uid and pw to get in. > The ant build has over 100 warnings from sun deprecations > of its own code. > > You might say that they were hoisted on their own Picard ;) > > One interesting thing is that they support several platforms: > linux-amd64 64-bit Linux-AMD64 > linux-i586 32-bit Linux-x86 > solaris-amd64 64-bit Solaris-AMD64 > solaris-i586 32-bit Solaris-x86 > solaris-sparc 32-bit Solaris-SPARC > solaris-sparcv9 64-bit Solaris-SPARC > windows-i586 32-bit Windows-x86 > Thus, ant is used to provide a multi-platform native method distro. > Neat. > How do they do it? > check this out: > > > > > > > > > > > > > And: > > > > > > > > > > The core download does not contain any C source code (it was all pre-built). > Basically, they are just copying .so and .dll files into build directories. > > I would love to see the C code for this...but Sun does not post it on the > https://jai.dev.java.net site. > > I don't know why...Perhaps I missed it. > > - Doug > > I've looked at moving rxtx to Ant builds. I think that would help IDEs a great deal. I requested a evalutation desk copy the O'Reilly Ant book for some j2ee material I was teaching. http://www.oreilly.com/catalog/anttdg/ It has a one sentence mention of JNI. So there was not luck there. I saw that there is another Ant book that does mention JNI more. I can't find it now. Ant must be able to support it with extensions. http://ant.apache.org/manual/OptionalTasks/javah.html What the auto(break :) tools do in the rxtx build is 4 things really. 1) gcc compile flags 2) ld compile flags 3) config.h 4) compile flags for customizing rxtx (lockfiles, ...) See 1 All of this information except 4 can be static once obtained. So I'm not attached to the auto tools. If I could find an example of Ant being used for JNI code, I'd be one of the first to start moving that direction. Maybe someone saw an example someplace. The other thing we have not completed discussing is the directory structure. There is interest in making rxtx more IDE friendly. I get more mail about that off the list than how to install rxtx. And I see we have Ken Thompson in da house :) He is our trusted CVS maintainer and the guy that purchased the rxtx.org domain. Old community. We will need Ken for changing the directory structure of source. I would like to open up discussion about both of these as it is more than time. The problem is I have little experience with Ant and even less with IDEs. It would be nice if we could work with Eclipse and NetBeans. http://www.netbeans.org/ (sun and some community) http://www.eclipes.org (ibm,rhat,... perhaps more community) http://maven.apache.org/what-is-maven.html (apache. It is community) borland should sortof be here too but I think thats covered in eclipse. >From what I understand so far, we should morph rxtx to support those three maybe trusting apaches lead with maven. But I use vi. I have little to no clues beyond what people have fed me. Can we agree that thats the right direction to go? -- Trent Jarvi tjarvi at qbang.org From brian at mbari.org Mon Feb 6 14:57:50 2006 From: brian at mbari.org (Brian Schlining) Date: Mon, 6 Feb 2006 13:57:50 -0800 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> > The other thing we have not completed discussing is the directory > structure. There is interest in making rxtx more IDE friendly. I > get more mail about that off the list than how to install rxtx. > > And I see we have Ken Thompson in da house :) He is our trusted > CVS maintainer and the guy that purchased the rxtx.org domain. Old > community. We will need Ken for changing the directory structure of > source. > > I would like to open up discussion about both of these as it is > more than time. The problem is I have little experience with Ant > and even less with IDEs. It would be nice if we could work with > Eclipse and NetBeans. > > http://www.netbeans.org/ (sun and some community) > http://www.eclipes.org (ibm,rhat,... perhaps more community) > http://maven.apache.org/what-is-maven.html (apache. It is community) > borland should sortof be here too but I think thats covered in > eclipse. > >> From what I understand so far, we should morph rxtx to support >> those three > maybe trusting apaches lead with maven. But I use vi. I have > little to no clues beyond what people have fed me. > Maven likes the directory structure below for Java code. (From http:// maven.apache.org/guides/getting-started/index.html) This structure works fine with ant, netbeans, and eclipse. rxtx_root_directory `-- src |-- main | `-- java | `-- gnu | `-- io `-- test `-- java `-- gnu `-- io Brian Schlining Software Engineer http://www.mbari.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/d9451eba/attachment-0011.html From tjarvi at qbang.org Mon Feb 6 15:11:45 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 15:11:45 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: > rxtx_root_directory > `-- src > |-- main > | `-- java > | `-- gnu > | `-- io > `-- test > `-- java > `-- gnu > `-- io > >From what I understand this will just be good. For me it makes no difference. So lets do the rxtx thing. Let if fester for two weeks and if nobody objects, we will do it. I'm not doing this because I care. I'm doing this to eliminate much of my inbox. But test... man is rxtx lacking there in the community aspect. It is covered but not right. _maybe_ I can change that this year. -- Trent Jarvi tjarvi at qbang.org (cat hurding since 1997) From lux at diesel-research.com Mon Feb 6 21:38:49 2006 From: lux at diesel-research.com (Kim Lux) Date: Mon, 06 Feb 2006 21:38:49 -0700 Subject: [Rxtx] How can I use Lock Files with rxtx (in FC4) ? Message-ID: <1139287129.17031.3.camel@zd7280> I am now running an rxtx application on FC4. I am getting: ========================================================= check_group_uucp(): error testing lock file creation Error details: Permission denied check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL ========================================================= $ ls -al /var/lock total 32 drwxrwxr-x 4 root lock 4096 Feb 6 16:04 . drwxr-xr-x 24 root root 4096 Nov 14 01:19 .. drwx------ 2 root root 4096 Apr 27 2005 lvm drwxr-xr-x 2 root root 4096 Feb 6 16:04 subsys How do I fix this for regulator users ? -- Kim Lux, Diesel Research Inc. From dmarkman at mac.com Mon Feb 6 22:24:44 2006 From: dmarkman at mac.com (Dmitry Markman) Date: Tue, 7 Feb 2006 00:24:44 -0500 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: if I understands the issue right in order to be able to use ant for c/c++ compilation you have to install ant's cc task http://ant-contrib.sourceforge.net/cc.html it looks like it should work on mac os x (authors claim, that it's platform independent) but I never tested so all you have to do it's providing right command line for the gcc compiler On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: >> rxtx_root_directory >> `-- src >> |-- main >> | `-- java >> | `-- gnu >> | `-- io >> `-- test >> `-- java >> `-- gnu >> `-- io >> > > >> From what I understand this will just be good. > > For me it makes no difference. So lets do the rxtx thing. Let if > fester for two weeks and if nobody objects, we will do it. > > I'm not doing this because I care. I'm doing this to eliminate > much of my inbox. > > But test... man is rxtx lacking there in the community aspect. It > is covered but not right. _maybe_ I can change that this year. > > -- > Trent Jarvi > tjarvi at qbang.org > (cat hurding since 1997) > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx Dmitry Markman From lux at diesel-research.com Mon Feb 6 23:20:15 2006 From: lux at diesel-research.com (Kim Lux) Date: Mon, 06 Feb 2006 23:20:15 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? Message-ID: <1139293215.3689.4.camel@zd7280> I'm running the code below. portlist.hasMoreElements() is false. /dev has ports in it as listed below. What am I doing wrong ? ========================================================== // Step through the list of ports until we find one that matches // the one we are looking for. portList = CommPortIdentifier.getPortIdentifiers(); while(portList.hasMoreElements()) { portID = (CommPortIdentifier) portList.nextElement(); // if (portID.getName().equals("/dev/ttyUSB0")) { myTA.append("Serial port ttyUSB0 has been found\n"); break; }// if portID equals... }// End of while... ========================================================== ls -al /dev/tty* crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 ... crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 -- Kim Lux, Diesel Research Inc. From david.garnier at trusted-logic.com Tue Feb 7 00:46:30 2006 From: david.garnier at trusted-logic.com (David Garnier) Date: Tue, 07 Feb 2006 08:46:30 +0100 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: <43E85056.2090608@trusted-logic.com> Hello, I think that the make-based build process is fine as it is, apart from the location of the Java source files. It is true that putting the Java source in a directory structure that map 1-to-1 to the Java package structure is the norm and should make it easier for everyone to modify the Java source, with or without an IDE. Ant is a good tool, but in the RXTX case I fail to see the advantage of using it compared to the current make-based process. As Trent said, they are more pressing issues, like testing. Regards, David Dmitry Markman wrote: > if I understands the issue right > in order to be able to use ant for c/c++ compilation > you have to install ant's cc task > http://ant-contrib.sourceforge.net/cc.html > > it looks like it should work on mac os x > (authors claim, that it's platform independent) > but I never tested > > so all you have to do it's providing right command line > for the gcc compiler > > > > > On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: > >>> rxtx_root_directory >>> `-- src >>> |-- main >>> | `-- java >>> | `-- gnu >>> | `-- io >>> `-- test >>> `-- java >>> `-- gnu >>> `-- io >>> >> >> >>> From what I understand this will just be good. >> >> For me it makes no difference. So lets do the rxtx thing. Let if >> fester for two weeks and if nobody objects, we will do it. >> >> I'm not doing this because I care. I'm doing this to eliminate much >> of my inbox. >> >> But test... man is rxtx lacking there in the community aspect. It is >> covered but not right. _maybe_ I can change that this year. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> (cat hurding since 1997) From tjarvi at qbang.org Tue Feb 7 01:11:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 01:11:31 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <43E85056.2090608@trusted-logic.com> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: On Tue, 7 Feb 2006, David Garnier wrote: > Hello, > > I think that the make-based build process is fine as it is, apart from the location of the Java > source files. It is true that putting the Java source in a directory structure that map 1-to-1 to > the Java package structure is the norm and should make it easier for everyone to modify the Java > source, with or without an IDE. > > Ant is a good tool, but in the RXTX case I fail to see the advantage of using it compared to the > current make-based process. As Trent said, they are more pressing issues, like testing. > Hi David I have more experience with testing rxtx than I can talk about. But let it be known, rxtx has gone trough 100's of hours of testing. We are hobby folks interested in toys but there is more. rxtx has had some of the best guidance in the industry there. This is not an easy thing. I may be able to come back in a month from the other side of the corperate fence and help. I suspect the tests could just be made public but they are in a very unusual environment that just wont work in a wider sense. This is something I'll be trying to change. At one point it was agreed we could just make the results public so this isnt just noise.. There is interest and I think its safe to mention that much. The big problem with testing in the past is most of it is done with a loopback connection. So we *still* have major questions regarding things like flow control. rxtx talks to itself over a loopback and it works. regardless of right or wrong. This requires more thought to be done right. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Feb 7 02:46:34 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 02:46:34 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: > The big problem with testing in the past is most of it is done with a > loopback connection. So we *still* have major questions regarding things > like flow control. rxtx talks to itself over a loopback and it works. > regardless of right or wrong. With serial communication there are gold standards. ckermit is probably a definitive 'standard.' Maybe its possible to do ping/pong tests with ckermit? Is it scriptable? There are known issues in rxtx. Probably the worst is some threading issues regarding some JREs with multiple JNI threads setting java variables. Man did I get schooled there. Just switch the c functions to returning variables and things go away. Sometimes they work fine, sometimes they blow up. Without understanding everything, somehow rhat got it right and debian (and especially gentoo) grabbed kernel patches causing all sort of harm. Its not hard to fix once you understand whats going on but nearly impossible to track with a debugger. So I have a good idea what 2.1-8 will have outside of the IDE modifications. rxtx 2.1-7 is a release for everyone to sync with. Its not even as stable as -pre17 as far as I know - I ran no test suites. I'll be chasing it too. We just had so many contributions that it was time. It seriously broke internal scheduals but thats a great thing :) The other thing I want to do in 2.1-8 is automagic baud rates. It turns out lots of shops are doing really funky baud rates for things like automobile test equipment. It is possible but it requires a fair amount of change in the native code. Is anyone looking at this? -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Feb 7 02:57:21 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 07 Feb 2006 04:57:21 -0500 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <43E85056.2090608@trusted-logic.com> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: Hi All, I agree, testing is very important. The problem I have been trying to address is related to cross-platform testing and the robust nature of the installs. Typically, I visit 3 platforms to deploy my product, windows, linux and mac. A build is performed on each platform. The idea that you can build for many platforms from one copy the source code seems attractive. This should enable synchronized deployments of identical code. The question of how to achieve this goal remains open. As Trent mentioned, this is hard. Perhaps Ant will help here (but perhaps not). Ant does seem to help with running unit tests. However, it does not help with multi-platform tests. For that you need many machines and different operating environments. Toward that end, I have created a multi-platform test that can be run from web start, located at: http://show.docjava.com:8086/book/cgij/code/jnlp/serialPort.PortTest.jnlp This is interesting because many people in the community can run the test and we can improve the test, as time permits. No, it is not a perfect solution, however, the idea does help with multi-platform tests using many machines and different operating environments. If the group has a good test for a general serial port set-ups, i would be happy to deploy it, for general evaluation using web start. And as for ANT, it is just an idea. Not all my ideas are good ones! - Doug >Hello, > >I think that the make-based build process is fine as it is, apart >from the location of the Java >source files. It is true that putting the Java source in a directory >structure that map 1-to-1 to >the Java package structure is the norm and should make it easier for >everyone to modify the Java >source, with or without an IDE. > >Ant is a good tool, but in the RXTX case I fail to see the advantage >of using it compared to the >current make-based process. As Trent said, they are more pressing >issues, like testing. > >Regards, >David > >Dmitry Markman wrote: >> if I understands the issue right >> in order to be able to use ant for c/c++ compilation >> you have to install ant's cc task >> http://ant-contrib.sourceforge.net/cc.html >> >> it looks like it should work on mac os x >> (authors claim, that it's platform independent) >> but I never tested >> >> so all you have to do it's providing right command line >> for the gcc compiler >> >> >> >> >> On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: >> >>>> rxtx_root_directory >>>> `-- src >>>> |-- main >>>> | `-- java >>>> | `-- gnu >>>> | `-- io >>>> `-- test >>>> `-- java >>>> `-- gnu >>>> `-- io >>>> >>> >>> >>>> From what I understand this will just be good. >>> >>> For me it makes no difference. So lets do the rxtx thing. Let if >>> fester for two weeks and if nobody objects, we will do it. >>> >>> I'm not doing this because I care. I'm doing this to eliminate much >>> of my inbox. >>> >>> But test... man is rxtx lacking there in the community aspect. It is >>> covered but not right. _maybe_ I can change that this year. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> (cat hurding since 1997) > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From matt.higgins at gmail.com Tue Feb 7 08:28:34 2006 From: matt.higgins at gmail.com (Matt Higgins) Date: Tue, 7 Feb 2006 10:28:34 -0500 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final Message-ID: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? import java.io.*; import java.util.*; import gnu.io.*; public class MySimpleRead implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; public static void main(String[] args) { boolean portFound = false; String defaultPort = "COM1"; if (args.length > 0) { defaultPort = args[0]; } portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; MySimpleRead reader = new MySimpleRead(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } } public MySimpleRead() { try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) { e.printStackTrace(); } try { inputStream = serialPort.getInputStream(); } catch (IOException e) { e.printStackTrace(); } try { serialPort.addEventListener(this); } catch (TooManyListenersException e) { e.printStackTrace(); } try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { e.printStackTrace(); } System.out.println("Baud is " + serialPort.getBaudRate()); System.out.println("Bits is " + serialPort.getDataBits()); System.out.println("Stop is " + serialPort.getStopBits()); System.out.println("Par is " + serialPort.getParity()); serialPort.notifyOnDataAvailable(true); readThread = new Thread(this); readThread.start(); } public void run() { // Thread.sleep(20000); //} catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { System.out.println("An event occurred " + event.getEventType()); switch (event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: byte[] readBuffer = new byte[20]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } System.out.print(new String(readBuffer)); } catch (IOException e) {} break; } } } --------------- Result on windows ------------------------------ Stable Library ============================================================== Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port:: COM1 Baud is 9600 Bits is 8 Stop is 1 Par is 0 ----------------- End Results ----------------------------------------- ------------------ Result on Linux ----------------------------------- Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 Found port: /dev/ttyS0 Baud is 9600 Bits is 8 Stop is 1 Par is 0 An event occurred 1 043100066224 ------------------ End Results --------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/a1431630/attachment-0011.html From brian at mbari.org Tue Feb 7 09:48:37 2006 From: brian at mbari.org (Brian Schlining) Date: Tue, 7 Feb 2006 08:48:37 -0800 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> Message-ID: <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> Hi Matt > The following code works fine on Linux but I never see any data > when run on Windows. This is a cut and paste from the SimpleRead > example. > I am attempting to read data from a bar code scanner. I can fire > up HyperTermianl on windows and see that the device is working > properly as I see the barcodes are scanned and echoed back to the > terminal. However when I run the app I don't see any data. It is > however associating with the com port as the informational bits > print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. Cheers Brian Schlining Software Engineer http://www.mbari.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/16d07f37/attachment-0011.html From lux at diesel-research.com Tue Feb 7 11:59:58 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 11:59:58 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139293215.3689.4.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> Message-ID: <1139338798.8145.4.camel@zd7280> Any ideas on this ? Any reason why portList.hasMoreElements() should be false even though there are devices in /dev ? On Mon, 2006-02-06 at 23:20 -0700, Kim Lux wrote: > I'm running the code below. > > portlist.hasMoreElements() is false. > > /dev has ports in it as listed below. > > What am I doing wrong ? > > > ========================================================== > // Step through the list of ports until we find one that matches > // the one we are looking for. > > portList = CommPortIdentifier.getPortIdentifiers(); > > while(portList.hasMoreElements()) > { > portID = (CommPortIdentifier) portList.nextElement(); // > if (portID.getName().equals("/dev/ttyUSB0")) > { > myTA.append("Serial port ttyUSB0 has been found\n"); > break; > }// if portID equals... > }// End of while... > ========================================================== > > ls -al /dev/tty* > crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty > crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 > crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 > crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 > crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 > ... > crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 > crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 > crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 > > > -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 12:20:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 12:20:25 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139338798.8145.4.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> Message-ID: On Tue, 7 Feb 2006, Kim Lux wrote: > > Any ideas on this ? Any reason why portList.hasMoreElements() should be > false even though there are devices in /dev ? > > > On Mon, 2006-02-06 at 23:20 -0700, Kim Lux wrote: >> I'm running the code below. >> >> portlist.hasMoreElements() is false. >> >> /dev has ports in it as listed below. >> >> What am I doing wrong ? >> >> >> ========================================================== >> // Step through the list of ports until we find one that matches >> // the one we are looking for. >> >> portList = CommPortIdentifier.getPortIdentifiers(); >> >> while(portList.hasMoreElements()) >> { >> portID = (CommPortIdentifier) portList.nextElement(); // >> if (portID.getName().equals("/dev/ttyUSB0")) >> { >> myTA.append("Serial port ttyUSB0 has been found\n"); >> break; >> }// if portID equals... >> }// End of while... >> ========================================================== >> >> ls -al /dev/tty* >> crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty >> crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 >> crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 >> crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 >> crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 >> ... >> crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 >> crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 >> crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 >> >> >> > Hi Kim What rxtx does is try to open the port and do a timed out read. If the kernel/... do not complain it's enumarted. I suspect you could do a crude test by doing something like cat /dev/ttyS0 > /dev/null If that barfs then rxtx wont enumerate the port. hmm looking at your question again, I suspect it's a lockfile problem. This is documented in INSTALL with the source. Its easy enough to test this too.. touch /var/lock/testingrxtxlockfiles && rm -f /var/lock/testingrxtxlockfiles If you are not in the right group it will bail. Root will work regardless. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 12:37:56 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 12:37:56 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> Message-ID: <1139341076.8145.11.camel@zd7280> Exactly which ports does rxtx attempt to put into the list ? /dev/* or /dev/tty* or /dev/tty[0-9[0-9] ? or /dev/ttyS* ? For the record, only /dev/ttyUSB0 is a valid port on the machine I am presently on. Will this be a problem ? On Tue, 2006-02-07 at 12:20 -0700, Trent Jarvi wrote: > This is documented in INSTALL with the source. > I was wondering where that file was. I will download source and dig it up. Thanks. -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 12:51:09 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 12:51:09 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139341076.8145.11.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: On Tue, 7 Feb 2006, Kim Lux wrote: > > Exactly which ports does rxtx attempt to put into the list ? /dev/* > or /dev/tty* or /dev/tty[0-9[0-9] ? or /dev/ttyS* ? > > For the record, only /dev/ttyUSB0 is a valid port on the machine I am > presently on. Will this be a problem ? > > > On Tue, 2006-02-07 at 12:20 -0700, Trent Jarvi wrote: >> This is documented in INSTALL with the source. >> > I was wondering where that file was. I will download source and dig it > up. > > Thanks. > Hmm I'm looking at pre17 so this may have changed. (its just what I have on this machine) if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA" // for the IPAQs }; CandidatePortPrefixes=Temp; } So you may need to add "ttyUSB" to that list. RXTX used to enumerate _everything_ see if(osName.equals("Linux-all-ports") But it became less than practical. This is all in RXTXCommDriver.java hmm I just did a cvs update. if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have to get your fingers into the code. We aim for sane defaults. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 13:06:45 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 13:06:45 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139342805.8145.22.camel@zd7280> On Tue, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > Hmm I'm looking at pre17 so this may have changed. (its just what I have > on this machine) > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA" // for the IPAQs > }; > CandidatePortPrefixes=Temp; > } > > > So you may need to add "ttyUSB" to that list. RXTX used to enumerate > _everything_ see if(osName.equals("Linux-all-ports") But it became less > than practical. > > This is all in RXTXCommDriver.java > > hmm I just did a cvs update. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have > to get your fingers into the code. We aim for sane defaults. Excellent. Thanks for taking the time. -- Kim Lux, Diesel Research Inc. From ideiglenes1 at freemail.hu Tue Feb 7 13:53:39 2006 From: ideiglenes1 at freemail.hu (--) Date: Tue, 07 Feb 2006 21:53:39 +0100 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139345619.22534.2.camel@localhost> Hi! I use this code to get all the extra Linux devices. :) if ("Linux".equals(System.getProperty("os.name"))) { System.setProperty("os.name","Linux-all-ports"); } driver = new RXTXCommDriver(); On k, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > On Tue, 7 Feb 2006, Kim Lux wrote: > > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have > to get your fingers into the code. We aim for sane defaults. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From matt.higgins at gmail.com Tue Feb 7 13:45:54 2006 From: matt.higgins at gmail.com (Matt Higgins) Date: Tue, 7 Feb 2006 15:45:54 -0500 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> Message-ID: <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> Sweet this is exactly what I needed. I was searching the archives through marc.theamisgroup they only have archives back to 1/3/05. Should have hit the mailman archive! Thanks a lot! On 2/7/06, Brian Schlining wrote: > > Hi Matt > > The following code works fine on Linux but I never see any data when run > on Windows. This is a cut and paste from the SimpleRead example. > I am attempting to read data from a bar code scanner. I can fire up > HyperTermianl on windows and see that the device is working properly as I > see the barcodes are scanned and echoed back to the terminal. However when I > run the app I don't see any data. It is however associating with the com > port as the informational bits print fine? > > > You're not the only one whose had this problem, I don't know if Trent has > addressed this is the latest release of RXTX but there is a workaround. > Here's the recent thread from the RXTX mailing list regarding this issues: > > Thanasis Delenikas tdelenik at gmail.com > Wed Jan 18 13:56:23 MST 2006 > > * Previous message: [Rxtx] Re: More close() performance fixes > * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] > > Hi all. > (I've subscribed again from my other email account). > > Trent, > > You are right. Linux *always* works, no matter what flow control you set. > Windows *works only* with hardware flow control (I haven't tested what > happens with software XON/XOFF flow control). > > I assume (but I am not certain) that even with no flow control at all, all > platforms should work. Without flow control, you have the risk of bumping > into overflow or framing errors, but that's your (the end programmer, I > mean) problem. > > >From my side, I shouldn't be working without flow control. That was a bug > too... It was some code forgotten from the old times, when I used to work > with phone emulation drivers which didn't support flow control. The > correct > way is to have some flow control enabled and that's why I suppose this is > a > low-severity bug for RxTx. > > I have no idea which platform shows the correct behaviour, since > my knowledge about Linux and the inner workings of these low-level i/o > operations is limited. > > Regards, > Thanasis Delenikas. > > > > > Message: 2 > > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > > From: Trent Jarvi > > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > > To: RXTX Developers and Users > > Message-ID: > > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > > > Hi all, > > > > > > Trent, I have found something. > > > I read your comment about flow control, so I experimented a bit. > > > > > > If you remember, in my sample program I've used no flow control at all > ( > > i.e. > > > Java constant FLOWCONTROL_NONE). > > > > > > Now, during testing, I've switch to hardware inbound flow control (i.e > . > > Java > > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > > beautifully! > > > > > > I think I will switch to H/W flow control and test things for a while, > > but > > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > > > > > Hi Thanasis, > > > > I'm fairly sure you have identified a bug. I would not worry too much > > about what Sun CommAPI w32 defaults are. I think they did more or less > > whatever the port opened with. Just a guess. Linux tries to stomp on > > ports so they are all the same. > > > > So this started out with Linux worked, Windows XP/.. did not as I > recall. > > Something is wrong in rxtx. Do I understand this right? > > > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > > > Perhaps there is something Wayne or I did not understand when we wrote > > that code. I wasnt programming back in the BBS days so modems are not > my > > thing. I have a few questions. > > > > Is the above matrix confirmed by observation? > > Linux just always worked? > > Which one _should_ work? I'm guessing modems work with hardware flow > > control. I'll have to dig around. > > > > The windows flow control changes a couple things with hardware flow > > control. Following the w32 API documentation is confusing sometimes. > > But it looks like Linux could have a bug too. > > Cheers > > Brian Schlining > Software Engineer > http://www.mbari.org > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/9c989144/attachment-0011.html From tjarvi at qbang.org Tue Feb 7 14:06:14 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 14:06:14 -0700 (MST) Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> Message-ID: >> >> You're not the only one whose had this problem, I don't know if Trent has >> addressed this is the latest release of RXTX but there is a workaround. >> Here's the recent thread from the RXTX mailing list regarding this issues: >> I have not. I expect to have access to some test equipment next month and I'll go through all of this. I really don't know whats going on and I need a gold standard. I thought maybe linux was autodetecting the flow control. Your observations would certainly be welcome. I need to talk to Russell King and see what he is doing. Until then I'd just be toying around over a loopback as usual. This is very high on the list though. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 17:25:05 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 17:25:05 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139358305.17994.2.camel@zd7280> My application now works. I installed the libraries and jar from 2.1-7 (Final). portlist.hasMoreElements is no longer false. The application finds the port for /dev/ttyUSB0. Thanks for your help, Trent (et al) Sorry I bothered you with this. Next time I will look in the source first. I didn't think it was an rxtx issue, I thought it was a Linux setup issue . On Tue, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > Hmm I'm looking at pre17 so this may have changed. (its just what I > have > on this machine) > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux > Serial Ports > "ttySA" // for the > IPAQs > }; > > CandidatePortPrefixes=Temp; > } > > > So you may need to add "ttyUSB" to that list. RXTX used to enumerate > _everything_ see if(osName.equals("Linux-all-ports") But it became > less > than practical. > > This is all in RXTXCommDriver.java > > hmm I just did a cvs update. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux > Serial Ports > "ttySA", // for the > IPAQs > "ttyUSB" // for USB > frobs > }; > > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you > have > to get your fingers into the code. We aim for sane defaults. -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 19:21:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 19:21:54 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139358305.17994.2.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> <1139358305.17994.2.camel@zd7280> Message-ID: >Sorry I bothered you with this. Next time I will look in the source >first. I didn't think it was an rxtx issue, I thought it was a Linux >setup issue . Why would you be sorry? I would have done the same. I'm glad it's working :) -- Trent Jarvi tjarvi at qbang.org From tma at mail.island.net Wed Feb 8 13:39:35 2006 From: tma at mail.island.net (Tom Alldread) Date: Wed, 08 Feb 2006 12:39:35 -0800 Subject: [Rxtx] Win32/Linux Serial Port Data Dropouts In-Reply-To: <200602060702.k167255O007882@www.qbang.org> References: <200602060702.k167255O007882@www.qbang.org> Message-ID: <43EA5707.4020200@mail.island.net> Greetings Folks at RXTX: During the last couple of months I have been alternately testing with javax.comm 2 and RXTX 2.1 under Windows XP and CommApi 3 and RXTX 2.1 under Suse 10.0 Linux. In the process I have learned a little about java multi-threading under NetBeans 5 with Profiler. My java (jdk 1.5_06) application is used for data acquisition and provides a graphical display of A-D conversion data received from a 56KBaud serial port. The actual data throughput is about 10KBaud thus it is well below the speed of the port. I use hardware RTS/CTS flow control which can stall the data acquisition sample rate if necessary. This ensures the display computer has the ability to slow the data acquisition rate should it become too busy to accept the regular data flow. Both the serial port buffer and the java read buffer are set at 16KB. Usually the data transfers into the java read buffer are less than 100 bytes unless the data acquisition is recovering from a stall. The data flow normally hesitates after each 5 KB block as a continue command is needed from the display computer to start the drawing of a new graphics display line. Separate threads have been provided for the serial port event monitoring and data processing. The serial port event thread has been given the maximum priority and data processing thread the minimum priority provided by java. Thread yield statements have been placed within all data processing while/for loops as an effort to ensure quick access to CPU cycles for the serial port event thread. I have found that short data transmissions are essentially error free but occasional dropouts occur with continuous data flow especially under Windows XP. ....................................................................................................................................................................................... Linux results: I am happy to report that RXTX 2.1 appears to work very well under Linux although I did notice some errors when the screen savers were running with my dual monitors. I believe this is a local problem associated with my dual graphics which needs further attention. The recent CommApi 3 Linux release from Sun did not work at all with my program. It seemed to send commands out OK but did not receive any data. Although the serial port event triggered the ISR, the input stream appeared filled with nulls and thus did not contain any data. As my understanding is that CommApi 3 was tested with a Red Hat distribution of Linux I wonder if this problem is distro dependent? Although somewhat off topic here I wonder if anyone reading this has had similar experience? .................................................................................................................................................................................. Windows XP results: There are problems with occasional data dropouts which become more frequent as the sampling rate is increased or if the computer becomes busy with other duties. The dropouts typically consist of a half dozen byte block of lost data. It appears the lost bytes never get added to the java input stream. There has not been any indication of garbled data, overruns or framing errors which suggests the UART communications remains solid. Using javax.comm 2 I found that the setting of SerialPort 'enableReceiveThreshold' to 40 and 'enableReceiveTimeout' of 100mS reduced the dropouts error rate significantly. I found that I could not get RXTX 2.1 to function with the aforementioned threshold and timeout settings. The javax.comm 2 interface is consequently performing better for me under Windows than RXTX 2.1. I wonder if anyone here has any suggestions as to what I might try to improve RXTX 2.1? Although my settings are the same as under Suse 10.0, RXTX 2.1 performs much better for me under Linux than any of the alternatives that I have tried under Windows XP . ............................................................................................................................................................................... I would like to establish, based on the experience of others, if I have reached the normally expected performance limit of java serial port communications? Should I expect to achieve virtually error free serial port data input from a continuous stream under Windows XP java software? I am considering changing my protocol to packets with error checking if necessary but would like to know if the dropout problems I am experiencing are typical or not before I take this rather work intensive plunge. Many thanks in advance for any help! Best Regards, Tom Alldread -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.375 / Virus Database: 267.15.2/253 - Release Date: 2006-02-07 From jlaxson at mac.com Wed Feb 8 23:56:48 2006 From: jlaxson at mac.com (John Laxson) Date: Thu, 9 Feb 2006 00:56:48 -0600 Subject: [Rxtx] PortInUseException: Unknown Application on OSX Message-ID: Hi, I've been trying to get RXTX 2.1.7 going on Mac OS X for a while here, and am running up into a wall here. I've tried with pre- compiled and the source version and get the same problem, a gnu.io.PortInUseException: Unknown Application. I have run the fixperms script included with the source distribution, and id shows me as a member of the uucp group, and permissions on /var/spool/uucp are 775 root:uucp. Running a test program (included at the bottom for clarity) lets me enumerate all the serial ports correctly, but trying to open any of them gives the PortInUseException. If it helps, when I try to open a port that's set to make an outgoing bluetooth connection, there is no delay and no connection attempt at all. Thanks, John Laxson PS: The documentation wiki on qbang.org shows 404, and has for a few days now. My test code: public static void main(String[] args) { SerialPort serialPort; try { Enumeration e = CommPortIdentifier.getPortIdentifiers(); CommPortIdentifier ident; while (e.hasMoreElements()) { ident = (CommPortIdentifier)e.nextElement(); System.out.println(ident.getName()); } ident = CommPortIdentifier.getPortIdentifier("/dev/cu.modem"); serialPort = (SerialPort) ident.open("Me", 5000); } catch (Exception e) { e.printStackTrace(); } } From rajesh.invincible at gmail.com Thu Feb 9 03:39:38 2006 From: rajesh.invincible at gmail.com (Rajesh N) Date: Thu, 9 Feb 2006 16:09:38 +0530 Subject: [Rxtx] Re: Move .java Files in gnu.io filesystem hierarchy - Maven (2) In-Reply-To: <43DF21D2.7090200@ngi.it> References: <43DF21D2.7090200@ngi.it> Message-ID: <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Can anybody tell me how to overcome these EXCEPTIONS I AM WORKING ON SERIAL COMMN IN JAVA ON LINUX. 1. " NOT ALL PARAMETERS SUPPORTED BY THE KERNEL" This i came across the following statement inmy prog. SerialP is A SerialPort object SerialP.setSerialPortParams(9600(BAUDRATE),DATABITS_8,STOPBITS_1,PARITY_NONE) 2. NullPointer Exception at Event Dispatch Now i have checked all my object references for a null reference but i found none i have put up my entire code in try catch blocks but still I AM UNABLE TO CATCH THIS EXCEPTION AND HENCE MY APPLICATION CLOSES HOW DOES THESE GO? PLEASE HELP ME IT IS URGENTTTTTTTTTTTTTTTT yours sincerely RAJESH On 1/31/06, Fabio Frumento wrote: > Hi Xavier, > > I don't know maven at all but the directory hierarchy listed buy Trent > is fine for me... > > I'll take a look to maven, it seems an interesting project > > Regards > > Fabio Frumento > > Trent Jarvi wrote: > > On Tue, 31 Jan 2006, Xavier Frisaye wrote: > > > >> Hi all, > >> > >> If you are going to rearrange the src folder, i will propose to use > >> maven 2 and follow its directory structure > >> > (http://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html). > >> > >> Maven 2 simplify java project and give a standard way to make projects > >> (http://maven.apache.org/). > >> We are using it for internal projects and we are very satisfied. > >> > >> Is anybody interested? > >> > >> I'm not an expert in maven 2 (yet) but i'm agree to help using it if > >> you choose to make so. > >> > > > > so this would be: > > > > rxtx-devel/src/main/java/gnu.io > > rxtx-devel/src/test/java/ManIwish.java > > > > I don't use IDEs very much so I'll let others comment. But I don't see > > a problem with that. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Thu Feb 9 09:50:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 9 Feb 2006 09:50:31 -0700 (MST) Subject: [Rxtx] Re: Move .java Files in gnu.io filesystem hierarchy - Maven (2) In-Reply-To: <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Message-ID: On Thu, 9 Feb 2006, Rajesh N wrote: > Can anybody tell me how to overcome these EXCEPTIONS > I AM WORKING ON SERIAL COMMN IN JAVA ON LINUX. > > 1. " NOT ALL PARAMETERS SUPPORTED BY THE KERNEL" > > This i came across the following statement inmy prog. > SerialP is A SerialPort object > SerialP.setSerialPortParams(9600(BAUDRATE),DATABITS_8,STOPBITS_1,PARITY_NONE) > Strange. The parameters you use are the same the port should open with by default. Could you paste the actual exception you are getting? I don't see that in the rxtx source. Also it would help to know the rxtx version. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Fri Feb 10 15:29:05 2006 From: lux at diesel-research.com (Kim Lux) Date: Fri, 10 Feb 2006 15:29:05 -0700 Subject: [Rxtx] One serial port object for both sending and receiving ? Message-ID: <1139610545.18177.4.camel@zd7280> Is it OK to use one SerialPort ojbect (ex Serial Port serialPort;) and use it for both sending and receiving ? For example: ======================================================================== static SerialPort serialPort = null; static OutputStream serialOut = null; static InputStream serialIn = null; // assign it to an outputStream for use try{ serialOut = serialPort.getOutputStream(); System.out.println("Serial output stream has been assigned."); }//try catch(IOException e) { System.out.println("Error: Couldn't assign output stream to serial port."); }//catch //assign it to an inputStream for use try{ serialIn = serialPort.getInputStream(); System.out.println("Serial input stream has been assigned."); }//try catch(IOException e) { System.out.println("Error: Couldn't assign input stream to serial port."); }//catch ======================================================================== -- Kim Lux, Diesel Research Inc. From lux at diesel-research.com Fri Feb 10 21:23:00 2006 From: lux at diesel-research.com (Kim Lux) Date: Fri, 10 Feb 2006 21:23:00 -0700 Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Message-ID: <1139631780.23882.10.camel@zd7280> I've got a problem receiving chars with my version of serialRead, written in an SWT GUI. I had a Java pro have a good look at my code and he can't see anything wrong with it. I can send chars fine. When I receive a char the cpu usage for the app goes to 100% and the code in the serial event handler doesn't get executed. The instructions on the Java Comm Serial API How-To for Linux page state that I must install javacomm. Is that true ? Everything builds without it and I can send chars on rxtx just fine, but I can't receive them. Could this be the problem ? I downloaded and installed javacomm. I was not able to add "Driver=gnuio.RXTXCommDriver to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 installed in /usr/java/jre1.5.0_05. I added comm.jar to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext to the library paths. Is this OK ? Does it matter that I am receiving on /dev/ttyUSB0 ? Thanks. -- Kim Lux, Diesel Research Inc. From lunareclipse03 at web.de Sat Feb 11 09:44:46 2006 From: lunareclipse03 at web.de (lunareclipse03@web.de) Date: Sat, 11 Feb 2006 17:44:46 +0100 Subject: [Rxtx] Question about Serial I/O under Win32 Message-ID: <662084330@web.de> Hello everybody, I have a strange problem with a piece of code I made for myself. No, this is not really concerning rxtx, but nevertheless I post this to the list, hoping that some of you can help me. I've written two libraries, one for linux and one for win32. The linux port works quite well, I can send / receive faxes and / or replay voice messages over the telephone line using a voice modem. But the win32 port of the library causes some trouble. If, for example, I send out a fax with a certain modem under linux, it works well. The fax is complete when it comes out of the fax machine. If I then use the same modem to send out a fax under win32, the fax coming out of the fax machine gets "stuck" halfways, but the sending modem thinks that transmission was ok and drops the connection. The answering fax machine then gives me "error while receiving." The "upper layer" java code MUST be right, because if I do the same thing under linux (using the linux library), everything is alright. Now I have to ask: Can somebody please help me out with this??!? Could it be the case that some kind of flow control or COMMTIMEOUTS setting causes this behaviour? I set flow control to RTS/CTS before sending out a fax. How can I DISABLE flow control? Or what do you think? Can something else cause this problems? Thank you all for your time and PLEASE write back soon. Regards, --Sven Ahlemann Am Waldrand 31 45721 Haltern am See Germany ______________________________________________________________ Verschicken Sie romantische, coole und witzige Bilder per SMS! Jetzt bei WEB.DE FreeMail: http://f.web.de/?mc=021193 From lux at diesel-research.com Sat Feb 11 10:06:52 2006 From: lux at diesel-research.com (Kim Lux) Date: Sat, 11 Feb 2006 10:06:52 -0700 Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: <1139631780.23882.10.camel@zd7280> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> <1139631780.23882.10.camel@zd7280> Message-ID: <1139677612.3431.5.camel@zd7280> More on this problem. I copied and pasted simpleRead into a console based Eclipse project and I've got the same result, except that cpu usage doesn't go to 100%. I'm beginning to think there is an issue in rxtx. My imports for simpleRead are: ============================ import gnu.io.*; import java.util.*; //import javax.comm.*; import java.io.*; =========================== Any ideas ? I am trying to read from /dev/ttyUSB0 using a serial to USB adapter which has worked well with minicom and gtkterm. Thanks. On Fri, 2006-02-10 at 21:23 -0700, Kim Lux wrote: > I've got a problem receiving chars with my version of serialRead, > written in an SWT GUI. > > I had a Java pro have a good look at my code and he can't see anything > wrong with it. > > I can send chars fine. When I receive a char the cpu usage for the app > goes to 100% and the code in the serial event handler doesn't get > executed. > > The instructions on the Java Comm Serial API How-To for Linux page state > that I must install javacomm. Is that true ? Everything builds without > it and I can send chars on rxtx just fine, but I can't receive them. > Could this be the problem ? > > I downloaded and installed javacomm. I was not able to add > "Driver=gnuio.RXTXCommDriver > to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not > have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 > installed in /usr/java/jre1.5.0_05. I added comm.jar > to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext > to the library paths. Is this OK ? > > Does it matter that I am receiving on /dev/ttyUSB0 ? > > Thanks. > -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Sun Feb 12 21:01:33 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:01:33 -0700 (MST) Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: <1139677612.3431.5.camel@zd7280> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> <1139631780.23882.10.camel@zd7280> <1139677612.3431.5.camel@zd7280> Message-ID: I suspect what is happening is the select() is breaking out in the native code but the driver does not have support for notifying there are X bytes available. On some traditional Unix based systems, the only way you know data is available is the fd status changes and do an FIORDCHK ioctl. Or perhaps the only thing you can know is the fd status changed. It would take reading through the kernel driver code to know for sure. So on USB, depending upon the driver, the same may need to be done or the driver improved a bit if possible to support. Polling reads will also work but don't use the event driven model of CommAPI which isnt acceptable in the long run. The 100% cpu usage can then be explained because select no longer blocks until the data is read; the eventLoop spins loose. You can put a well placed sleep but rxtx only expects those are needed when it knows data is available. This may not be a super simple thing to understand and fix. I do have ideas to get you started. I'm going to be short on time the next couple weeks. I expect to put some good time in and answer some other questions I saw around the 25th. For now, I'd look at the following and go from there with the hints I've given. JNIEXPORT jint JNICALL RXTXPort(nativeavailable)( JNIEnv *env, jobject jobj ) { int fd = get_java_var( env, jobj,"fd","I" ); int result; /* char message[80]; ENTER( "RXTXPort:nativeavailable" ); On SCO OpenServer FIONREAD always fails for serial devices, so try ioctl FIORDCHK instead; will only tell us whether bytes are available, not how many, but better than nothing. This turns out to be true on Solaris also. taj. */ #ifdef FIORDCHK /* __unixware__ __sun__ probably others */ result = ioctl(fd, FIORDCHK, 0); #else if( ioctl( fd, FIONREAD, &result ) < 0 ) { goto fail; } #endif /* FIORDCHK */ On Sat, 11 Feb 2006, Kim Lux wrote: > > More on this problem. I copied and pasted simpleRead into a console > based Eclipse project and I've got the same result, except that cpu > usage doesn't go to 100%. I'm beginning to think there is an issue in > rxtx. > > My imports for simpleRead are: > > ============================ > import gnu.io.*; > import java.util.*; > //import javax.comm.*; > import java.io.*; > =========================== > > Any ideas ? I am trying to read from /dev/ttyUSB0 using a serial to > USB adapter which has worked well with minicom and gtkterm. > > Thanks. > > > > On Fri, 2006-02-10 at 21:23 -0700, Kim Lux wrote: >> I've got a problem receiving chars with my version of serialRead, >> written in an SWT GUI. >> >> I had a Java pro have a good look at my code and he can't see anything >> wrong with it. >> >> I can send chars fine. When I receive a char the cpu usage for the app >> goes to 100% and the code in the serial event handler doesn't get >> executed. >> >> The instructions on the Java Comm Serial API How-To for Linux page state >> that I must install javacomm. Is that true ? Everything builds without >> it and I can send chars on rxtx just fine, but I can't receive them. >> Could this be the problem ? >> >> I downloaded and installed javacomm. I was not able to add >> "Driver=gnuio.RXTXCommDriver >> to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not >> have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 >> installed in /usr/java/jre1.5.0_05. I added comm.jar >> to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext >> to the library paths. Is this OK ? >> >> Does it matter that I am receiving on /dev/ttyUSB0 ? >> >> Thanks. >> > From tjarvi at qbang.org Sun Feb 12 21:03:30 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:03:30 -0700 (MST) Subject: [Rxtx] One serial port object for both sending and receiving ? In-Reply-To: <1139610545.18177.4.camel@zd7280> References: <1139610545.18177.4.camel@zd7280> Message-ID: On Fri, 10 Feb 2006, Kim Lux wrote: > > Is it OK to use one SerialPort ojbect (ex Serial Port serialPort;) and > use it for both sending and receiving ? > > For example: > > ======================================================================== > static SerialPort serialPort = null; > static OutputStream serialOut = null; > static InputStream serialIn = null; > > > > > // assign it to an outputStream for use > try{ > serialOut = serialPort.getOutputStream(); > System.out.println("Serial output stream has been assigned."); > }//try > catch(IOException e) > { > System.out.println("Error: Couldn't assign output stream to serial > port."); > }//catch > > > //assign it to an inputStream for use > try{ > serialIn = serialPort.getInputStream(); > System.out.println("Serial input stream has been assigned."); > }//try > catch(IOException e) > { > System.out.println("Error: Couldn't assign input stream to serial > port."); > }//catch This should be fine. In fact trying to do it another way will probably not work as you will run into lockfile issues. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun Feb 12 21:13:13 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:13:13 -0700 (MST) Subject: [Rxtx] Question about Serial I/O under Win32 In-Reply-To: <662084330@web.de> References: <662084330@web.de> Message-ID: On Sat, 11 Feb 2006 lunareclipse03 at web.de wrote: > Hello everybody, > > I have a strange problem with a piece of code I made for myself. No, > this is not really concerning rxtx, but nevertheless I post this to the > list, hoping that some of you can help me. I've written two libraries, > one for linux and one for win32. The linux port works quite well, I can > send / receive faxes and / or replay voice messages over the telephone > line using a voice modem. But the win32 port of the library causes some > trouble. If, for example, I send out a fax with a certain modem under > linux, it works well. The fax is complete when it comes out of the fax > machine. If I then use the same modem to send out a fax under win32, the > fax coming out of the fax machine gets "stuck" halfways, but the sending > modem thinks that transmission was ok and drops the connection. The > answering fax machine then gives me "error while receiving." The "upper > layer" java code MUST be right, because if I do the same thing under > linux (using the linux library), everything is alright. Now I have to > ask: Can somebody please help me out with this??!? Could it be the case > that some kind of flow control or COMMTIMEOUTS setting causes this > behaviour? I set flow control to RTS/CTS before sending out a fax. How > can I DISABLE flow control? Or what do you think? Can something else > cause this problems? Thank you all for your time and PLEASE write back > soon. > Hi Sven I'm not too willing to talk about flow control at the low level until I confirm some things with test equipment later. It is not clear if you are using rxtx or writing your own native code. So I'm not sure how to answer much of this :) If you are wondering how to change the flow control using rxtx from java, The BlackBox example from Sun flips this back and forth. SerialPort.java in rxtx 2.1 uses the following: SerialPort.java: public static final int FLOWCONTROL_NONE =0; SerialPort.java: public static final int FLOWCONTROL_RTSCTS_IN =1; SerialPort.java: public static final int FLOWCONTROL_RTSCTS_OUT =2; SerialPort.java: public static final int FLOWCONTROL_XONXOFF_IN =4; SerialPort.java: public static final int FLOWCONTROL_XONXOFF_OUT=8; So if you set flowcontrol to RTSCTS, you can set it to NONE to turn it off. If you are looking for how to do it in native code, the rxtx Source is SerialImp.c (unix/linux/mac os x/w32) and termios.c (w32 only with SerialImp.c) You can track the code: SerialImp.c:JNIEXPORT void JNICALL RXTXPort(setflowcontrol)( JNIEnv *env, jobject jobj, jint flowmode ) termios.c:int tcgetattr( int fd, struct termios *s_termios ) termios.c:int tcsetattr( int fd, int when, struct termios *s_termios ) There may be a problem in the rxtx flow control code though. Rather than guess, I want to test this with a gold standard. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Feb 6 00:00:16 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 00:00:16 -0700 (MST) Subject: [Rxtx] wiki delay until tomorrow night. In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: On Sun, 5 Feb 2006, Trent Jarvi wrote: > On Sun, 5 Feb 2006, Kim Lux wrote: > >> usb ? Tell me more... I need that too. > > usb is a very proper design. Thats all it is. > Maybe rxtx could help usb. But it would start with helping bring back the community that was already there. It's not something I'd love to do but maybe its the right thing to do. It would probably take 2 years to do right. But maybe thats better than what we have now. I honestly don't know what IBM is doing which could just run over everything. Just some thoughts after some fine german wine. -- Trent Jarvi tjarvi at qbang.org From gadelavega at yahoo.com.ar Mon Feb 6 02:17:05 2006 From: gadelavega at yahoo.com.ar (Gonzalo A. de la Vega) Date: Mon, 06 Feb 2006 10:17:05 +0100 Subject: [Rxtx] Serial port ownership question In-Reply-To: References: <20060205113618.30274.qmail@web53501.mail.yahoo.com> <1139157422.4553.9.camel@zd7280> <1139158698.4936.9.camel@zd7280> Message-ID: <43E71411.4050402@yahoo.com.ar> On my Fedora Core 4: ls -l /dev/ttyS* crw-rw---- 1 root uucp 4, 64 Feb 6 2006 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Feb 6 2006 /dev/ttyS1 ... and: grep "ttyUSB" /etc/udev/rules.d/50-udev.rules KERNEL=="ttyUSB*", GROUP="uucp", MODE="0660" So anyone in the "uucp" group can use serial ports. On Gentoo the group is "tty". Trent Jarvi escribi?: > > > On Sun, 5 Feb 2006, Dr. Douglas Lyon wrote: > >> I can confirm that this is the case (only root ownership of >> serial ports, under fedora 4). >> Wow, what were they thinking?! >> - DL >> >>> I've found that the newer kernels have the serial ports owned by root. >>> For example, >>> >>> $ls -al /dev/tty* >>> crw-rw-rw- 1 root root 5, 0 Feb 5 02:06 /dev/tty >>> crw-rw---- 1 root root 4, 0 Feb 5 02:06 /dev/tty0 >>> crw------- 1 root root 4, 1 Feb 5 09:07 /dev/tty1 >>> crw-rw---- 1 root tty 4, 10 Feb 5 02:06 /dev/tty10 >>> crw-rw---- 1 root tty 4, 11 Feb 5 02:06 /dev/tty11 >>> ... > > > This is just not a problem jcp or such are going to solve. Its a > platform spitwad fight. But do look at pam. In fact thats what Sun > is doing too. Maybe Linux followed their lead.. I'm not a pam guy. > I've spent 16 hours trying to understand it but your users wont :) > > Solution? I have no clue. Its two tangent mentalities from my > perspective. > > -- > Trent Jarvi > tjarvi at qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mtnvega at yahoo.com.br Mon Feb 6 05:35:43 2006 From: mtnvega at yahoo.com.br (Luiz Jr) Date: Mon, 6 Feb 2006 12:35:43 +0000 (GMT) Subject: [Rxtx] Documentation Wiki In-Reply-To: <1139157422.4553.9.camel@zd7280> Message-ID: <20060206123543.57256.qmail@web53515.mail.yahoo.com> Hello, Thank you for you answer, but so the usage of the API is pretty much like the Java Communications Api? If yes, what version of the Java Comm Api? Thank you, Luiz A. Brandao Jr Kim Lux escreveu: On Sun, 2006-02-05 at 08:36 -0300, Luiz Jr wrote: > Hello, > > I want to start using the RXTX libraries, but I would to know how, > since I can not access the documentation wiki page I just started using them yesterday. Below is how I installed the libraries, if that helps. I used snippets of code from the SimpleWrite application here to get me going. http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html Instead of "import javax.comm.*;", use "import gnu.io.*;" which is gotten from RXTXcomm.jar, which you will need to include in your project references. I am working in Eclipse. BTW: there is no way to open a port without going through the port list and finding it. Maybe sometime in the future someone (me ?) will write a method called openSerialPort that allows the user to give a port identifier, such as "/dev/tty1" and return a port ready to use. It wouldn't take much to write that and it would save users a lot of code. Hope this helps. ======================================================================= 1) Figure out which java you are running, incase there is more than one installed. $ java -version java version "1.5.0_05" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_05-b05) Java HotSpot(TM) Client VM (build 1.5.0_05-b05, mixed mode, sharing) 2) Find all the jre directories and the one from which you are currently running. kfind (jre) 3) cd to that directory plus /lib/i386 cd /usr/java/jre1.5.0_05/lib/i386 4) Copy the library files (*.so) to that directory. cp /home/krlux/Desktop/'Java Controls'/rxtx-linux/bin/* . 5) Check that the copy was successful ls librxtx* librxtxI2C.so librxtxRaw.so librxtxSerial.so librxtxParallel.so librxtxRS485.so 6) cd to the /lib/ext directory for your java. cd /usr/java/jre1.5.0_05/lib/ext 7) Copy the Jar files there cp /home/krlux/Desktop/'Java Controls'/rxtx-linux/lib/ext/* . 8) Check that it was successful ls RXTX* RXTXcomm.jar Rxtx is now installed on your machine ready to use. =================================================================== -- Kim Lux, Diesel Research Inc. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx --------------------------------- Yahoo! Acesso Gr?tis - Internet r?pida e gr?tis. Instale o discador agora! -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/544aa403/attachment-0012.html From lyon at docjava.com Mon Feb 6 05:49:34 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 06 Feb 2006 07:49:34 -0500 Subject: [Rxtx] wiki delay until tomorrow night. In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: Hi All, I have often thought about USB drivers being needed. For example, the ironman watch will not interface to a mac (windows only). It is USB. My dymo label writer has no Java driver (native only). Etc. Most cheap web cameras are USB (and Java drivers go through JAI, if it supports the camera at all). The JAI code shows how sun did the USB drivers. You have to be a member of the jai project to download the source code. https://jai.dev.java.net has the jai distro. And then you are not allowed to redistribute it. However, we can all learn from it (if so inclined). Basically: cvs -d :pserver:lyon at cvs.dev.java.net:/cvs login cvs -d :pserver:lyon at cvs.dev.java.net:/cvs checkout jai-core You will need to user your own uid and pw to get in. The ant build has over 100 warnings from sun deprecations of its own code. You might say that they were hoisted on their own Picard ;) One interesting thing is that they support several platforms: linux-amd64 64-bit Linux-AMD64 linux-i586 32-bit Linux-x86 solaris-amd64 64-bit Solaris-AMD64 solaris-i586 32-bit Solaris-x86 solaris-sparc 32-bit Solaris-SPARC solaris-sparcv9 64-bit Solaris-SPARC windows-i586 32-bit Windows-x86 Thus, ant is used to provide a multi-platform native method distro. Neat. How do they do it? check this out: And: The core download does not contain any C source code (it was all pre-built). Basically, they are just copying .so and .dll files into build directories. I would love to see the C code for this...but Sun does not post it on the https://jai.dev.java.net site. I don't know why...Perhaps I missed it. - Doug >On Sun, 5 Feb 2006, Trent Jarvi wrote: > >>On Sun, 5 Feb 2006, Kim Lux wrote: >> >>>usb ? Tell me more... I need that too. >> >>usb is a very proper design. Thats all it is. >> > >Maybe rxtx could help usb. But it would start with helping bring >back the community that was already there. > >It's not something I'd love to do but maybe its the right thing to do. > >It would probably take 2 years to do right. But maybe thats better >than what we have now. > >I honestly don't know what IBM is doing which could just run over everything. > >Just some thoughts after some fine german wine. > >-- >Trent Jarvi >tjarvi at qbang.org > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tdelenik at gmail.com Mon Feb 6 05:56:32 2006 From: tdelenik at gmail.com (Thanasis Delenikas) Date: Mon, 6 Feb 2006 14:56:32 +0200 Subject: Fwd: [Rxtx] Documentation Wiki In-Reply-To: <1139157422.4553.9.camel@zd7280> References: <20060205113618.30274.qmail@web53501.mail.yahoo.com> <1139157422.4553.9.camel@zd7280> Message-ID: <310a1a930602060456t129f1dc6p5f2b908f13ab5a0b@mail.gmail.com> Hello all, Kim, this is a snippet from the code I use. The closest to directly opening a specific port without enumeration. << ... portId = CommPortIdentifier.getPortIdentifier(getPort()); serialPort = (SerialPort) portId.open("jSMSEngine", 1971); ... >> where getPort() return the string identifier of the port, i.e. "/dev/ttyS0" or "COM1" or whatever. Thanasis. ---------- Forwarded message ---------- From: Kim Lux Date: Feb 5, 2006 6:37 PM Subject: Re: [Rxtx] Documentation Wiki To: RXTX Developers and Users BTW: there is no way to open a port without going through the port list and finding it. Maybe sometime in the future someone (me ?) will write a method called openSerialPort that allows the user to give a port identifier, such as "/dev/tty1" and return a port ready to use. It wouldn't take much to write that and it would save users a lot of code. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/182ab5b8/attachment-0012.html From tjarvi at qbang.org Mon Feb 6 11:53:57 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 11:53:57 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: On Mon, 6 Feb 2006, Dr. Douglas Lyon wrote: > Hi All, > I have often thought about USB drivers being needed. > For example, the ironman watch will not interface > to a mac (windows only). It is USB. > My dymo label writer has no Java driver (native only). > Etc. > Most cheap web cameras are USB (and Java drivers go > through JAI, if it supports the camera at all). > The JAI code shows how sun did the USB drivers. > You have to be a member of the jai project to download > the source code. > https://jai.dev.java.net has the jai distro. > And then you are not allowed to redistribute it. However, > we can all learn from it (if so inclined). Basically: > cvs -d :pserver:lyon at cvs.dev.java.net:/cvs login > cvs -d :pserver:lyon at cvs.dev.java.net:/cvs checkout jai-core > You will need to user your own uid and pw to get in. > The ant build has over 100 warnings from sun deprecations > of its own code. > > You might say that they were hoisted on their own Picard ;) > > One interesting thing is that they support several platforms: > linux-amd64 64-bit Linux-AMD64 > linux-i586 32-bit Linux-x86 > solaris-amd64 64-bit Solaris-AMD64 > solaris-i586 32-bit Solaris-x86 > solaris-sparc 32-bit Solaris-SPARC > solaris-sparcv9 64-bit Solaris-SPARC > windows-i586 32-bit Windows-x86 > Thus, ant is used to provide a multi-platform native method distro. > Neat. > How do they do it? > check this out: > > > > > > > > > > > > > And: > > > > > > > > > > The core download does not contain any C source code (it was all pre-built). > Basically, they are just copying .so and .dll files into build directories. > > I would love to see the C code for this...but Sun does not post it on the > https://jai.dev.java.net site. > > I don't know why...Perhaps I missed it. > > - Doug > > I've looked at moving rxtx to Ant builds. I think that would help IDEs a great deal. I requested a evalutation desk copy the O'Reilly Ant book for some j2ee material I was teaching. http://www.oreilly.com/catalog/anttdg/ It has a one sentence mention of JNI. So there was not luck there. I saw that there is another Ant book that does mention JNI more. I can't find it now. Ant must be able to support it with extensions. http://ant.apache.org/manual/OptionalTasks/javah.html What the auto(break :) tools do in the rxtx build is 4 things really. 1) gcc compile flags 2) ld compile flags 3) config.h 4) compile flags for customizing rxtx (lockfiles, ...) See 1 All of this information except 4 can be static once obtained. So I'm not attached to the auto tools. If I could find an example of Ant being used for JNI code, I'd be one of the first to start moving that direction. Maybe someone saw an example someplace. The other thing we have not completed discussing is the directory structure. There is interest in making rxtx more IDE friendly. I get more mail about that off the list than how to install rxtx. And I see we have Ken Thompson in da house :) He is our trusted CVS maintainer and the guy that purchased the rxtx.org domain. Old community. We will need Ken for changing the directory structure of source. I would like to open up discussion about both of these as it is more than time. The problem is I have little experience with Ant and even less with IDEs. It would be nice if we could work with Eclipse and NetBeans. http://www.netbeans.org/ (sun and some community) http://www.eclipes.org (ibm,rhat,... perhaps more community) http://maven.apache.org/what-is-maven.html (apache. It is community) borland should sortof be here too but I think thats covered in eclipse. >From what I understand so far, we should morph rxtx to support those three maybe trusting apaches lead with maven. But I use vi. I have little to no clues beyond what people have fed me. Can we agree that thats the right direction to go? -- Trent Jarvi tjarvi at qbang.org From brian at mbari.org Mon Feb 6 14:57:50 2006 From: brian at mbari.org (Brian Schlining) Date: Mon, 6 Feb 2006 13:57:50 -0800 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> > The other thing we have not completed discussing is the directory > structure. There is interest in making rxtx more IDE friendly. I > get more mail about that off the list than how to install rxtx. > > And I see we have Ken Thompson in da house :) He is our trusted > CVS maintainer and the guy that purchased the rxtx.org domain. Old > community. We will need Ken for changing the directory structure of > source. > > I would like to open up discussion about both of these as it is > more than time. The problem is I have little experience with Ant > and even less with IDEs. It would be nice if we could work with > Eclipse and NetBeans. > > http://www.netbeans.org/ (sun and some community) > http://www.eclipes.org (ibm,rhat,... perhaps more community) > http://maven.apache.org/what-is-maven.html (apache. It is community) > borland should sortof be here too but I think thats covered in > eclipse. > >> From what I understand so far, we should morph rxtx to support >> those three > maybe trusting apaches lead with maven. But I use vi. I have > little to no clues beyond what people have fed me. > Maven likes the directory structure below for Java code. (From http:// maven.apache.org/guides/getting-started/index.html) This structure works fine with ant, netbeans, and eclipse. rxtx_root_directory `-- src |-- main | `-- java | `-- gnu | `-- io `-- test `-- java `-- gnu `-- io Brian Schlining Software Engineer http://www.mbari.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/d9451eba/attachment-0012.html From tjarvi at qbang.org Mon Feb 6 15:11:45 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 15:11:45 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: > rxtx_root_directory > `-- src > |-- main > | `-- java > | `-- gnu > | `-- io > `-- test > `-- java > `-- gnu > `-- io > >From what I understand this will just be good. For me it makes no difference. So lets do the rxtx thing. Let if fester for two weeks and if nobody objects, we will do it. I'm not doing this because I care. I'm doing this to eliminate much of my inbox. But test... man is rxtx lacking there in the community aspect. It is covered but not right. _maybe_ I can change that this year. -- Trent Jarvi tjarvi at qbang.org (cat hurding since 1997) From lux at diesel-research.com Mon Feb 6 21:38:49 2006 From: lux at diesel-research.com (Kim Lux) Date: Mon, 06 Feb 2006 21:38:49 -0700 Subject: [Rxtx] How can I use Lock Files with rxtx (in FC4) ? Message-ID: <1139287129.17031.3.camel@zd7280> I am now running an rxtx application on FC4. I am getting: ========================================================= check_group_uucp(): error testing lock file creation Error details: Permission denied check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL ========================================================= $ ls -al /var/lock total 32 drwxrwxr-x 4 root lock 4096 Feb 6 16:04 . drwxr-xr-x 24 root root 4096 Nov 14 01:19 .. drwx------ 2 root root 4096 Apr 27 2005 lvm drwxr-xr-x 2 root root 4096 Feb 6 16:04 subsys How do I fix this for regulator users ? -- Kim Lux, Diesel Research Inc. From dmarkman at mac.com Mon Feb 6 22:24:44 2006 From: dmarkman at mac.com (Dmitry Markman) Date: Tue, 7 Feb 2006 00:24:44 -0500 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: if I understands the issue right in order to be able to use ant for c/c++ compilation you have to install ant's cc task http://ant-contrib.sourceforge.net/cc.html it looks like it should work on mac os x (authors claim, that it's platform independent) but I never tested so all you have to do it's providing right command line for the gcc compiler On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: >> rxtx_root_directory >> `-- src >> |-- main >> | `-- java >> | `-- gnu >> | `-- io >> `-- test >> `-- java >> `-- gnu >> `-- io >> > > >> From what I understand this will just be good. > > For me it makes no difference. So lets do the rxtx thing. Let if > fester for two weeks and if nobody objects, we will do it. > > I'm not doing this because I care. I'm doing this to eliminate > much of my inbox. > > But test... man is rxtx lacking there in the community aspect. It > is covered but not right. _maybe_ I can change that this year. > > -- > Trent Jarvi > tjarvi at qbang.org > (cat hurding since 1997) > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx Dmitry Markman From lux at diesel-research.com Mon Feb 6 23:20:15 2006 From: lux at diesel-research.com (Kim Lux) Date: Mon, 06 Feb 2006 23:20:15 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? Message-ID: <1139293215.3689.4.camel@zd7280> I'm running the code below. portlist.hasMoreElements() is false. /dev has ports in it as listed below. What am I doing wrong ? ========================================================== // Step through the list of ports until we find one that matches // the one we are looking for. portList = CommPortIdentifier.getPortIdentifiers(); while(portList.hasMoreElements()) { portID = (CommPortIdentifier) portList.nextElement(); // if (portID.getName().equals("/dev/ttyUSB0")) { myTA.append("Serial port ttyUSB0 has been found\n"); break; }// if portID equals... }// End of while... ========================================================== ls -al /dev/tty* crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 ... crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 -- Kim Lux, Diesel Research Inc. From david.garnier at trusted-logic.com Tue Feb 7 00:46:30 2006 From: david.garnier at trusted-logic.com (David Garnier) Date: Tue, 07 Feb 2006 08:46:30 +0100 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: <43E85056.2090608@trusted-logic.com> Hello, I think that the make-based build process is fine as it is, apart from the location of the Java source files. It is true that putting the Java source in a directory structure that map 1-to-1 to the Java package structure is the norm and should make it easier for everyone to modify the Java source, with or without an IDE. Ant is a good tool, but in the RXTX case I fail to see the advantage of using it compared to the current make-based process. As Trent said, they are more pressing issues, like testing. Regards, David Dmitry Markman wrote: > if I understands the issue right > in order to be able to use ant for c/c++ compilation > you have to install ant's cc task > http://ant-contrib.sourceforge.net/cc.html > > it looks like it should work on mac os x > (authors claim, that it's platform independent) > but I never tested > > so all you have to do it's providing right command line > for the gcc compiler > > > > > On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: > >>> rxtx_root_directory >>> `-- src >>> |-- main >>> | `-- java >>> | `-- gnu >>> | `-- io >>> `-- test >>> `-- java >>> `-- gnu >>> `-- io >>> >> >> >>> From what I understand this will just be good. >> >> For me it makes no difference. So lets do the rxtx thing. Let if >> fester for two weeks and if nobody objects, we will do it. >> >> I'm not doing this because I care. I'm doing this to eliminate much >> of my inbox. >> >> But test... man is rxtx lacking there in the community aspect. It is >> covered but not right. _maybe_ I can change that this year. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> (cat hurding since 1997) From tjarvi at qbang.org Tue Feb 7 01:11:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 01:11:31 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <43E85056.2090608@trusted-logic.com> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: On Tue, 7 Feb 2006, David Garnier wrote: > Hello, > > I think that the make-based build process is fine as it is, apart from the location of the Java > source files. It is true that putting the Java source in a directory structure that map 1-to-1 to > the Java package structure is the norm and should make it easier for everyone to modify the Java > source, with or without an IDE. > > Ant is a good tool, but in the RXTX case I fail to see the advantage of using it compared to the > current make-based process. As Trent said, they are more pressing issues, like testing. > Hi David I have more experience with testing rxtx than I can talk about. But let it be known, rxtx has gone trough 100's of hours of testing. We are hobby folks interested in toys but there is more. rxtx has had some of the best guidance in the industry there. This is not an easy thing. I may be able to come back in a month from the other side of the corperate fence and help. I suspect the tests could just be made public but they are in a very unusual environment that just wont work in a wider sense. This is something I'll be trying to change. At one point it was agreed we could just make the results public so this isnt just noise.. There is interest and I think its safe to mention that much. The big problem with testing in the past is most of it is done with a loopback connection. So we *still* have major questions regarding things like flow control. rxtx talks to itself over a loopback and it works. regardless of right or wrong. This requires more thought to be done right. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Feb 7 02:46:34 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 02:46:34 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: > The big problem with testing in the past is most of it is done with a > loopback connection. So we *still* have major questions regarding things > like flow control. rxtx talks to itself over a loopback and it works. > regardless of right or wrong. With serial communication there are gold standards. ckermit is probably a definitive 'standard.' Maybe its possible to do ping/pong tests with ckermit? Is it scriptable? There are known issues in rxtx. Probably the worst is some threading issues regarding some JREs with multiple JNI threads setting java variables. Man did I get schooled there. Just switch the c functions to returning variables and things go away. Sometimes they work fine, sometimes they blow up. Without understanding everything, somehow rhat got it right and debian (and especially gentoo) grabbed kernel patches causing all sort of harm. Its not hard to fix once you understand whats going on but nearly impossible to track with a debugger. So I have a good idea what 2.1-8 will have outside of the IDE modifications. rxtx 2.1-7 is a release for everyone to sync with. Its not even as stable as -pre17 as far as I know - I ran no test suites. I'll be chasing it too. We just had so many contributions that it was time. It seriously broke internal scheduals but thats a great thing :) The other thing I want to do in 2.1-8 is automagic baud rates. It turns out lots of shops are doing really funky baud rates for things like automobile test equipment. It is possible but it requires a fair amount of change in the native code. Is anyone looking at this? -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Feb 7 02:57:21 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 07 Feb 2006 04:57:21 -0500 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <43E85056.2090608@trusted-logic.com> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: Hi All, I agree, testing is very important. The problem I have been trying to address is related to cross-platform testing and the robust nature of the installs. Typically, I visit 3 platforms to deploy my product, windows, linux and mac. A build is performed on each platform. The idea that you can build for many platforms from one copy the source code seems attractive. This should enable synchronized deployments of identical code. The question of how to achieve this goal remains open. As Trent mentioned, this is hard. Perhaps Ant will help here (but perhaps not). Ant does seem to help with running unit tests. However, it does not help with multi-platform tests. For that you need many machines and different operating environments. Toward that end, I have created a multi-platform test that can be run from web start, located at: http://show.docjava.com:8086/book/cgij/code/jnlp/serialPort.PortTest.jnlp This is interesting because many people in the community can run the test and we can improve the test, as time permits. No, it is not a perfect solution, however, the idea does help with multi-platform tests using many machines and different operating environments. If the group has a good test for a general serial port set-ups, i would be happy to deploy it, for general evaluation using web start. And as for ANT, it is just an idea. Not all my ideas are good ones! - Doug >Hello, > >I think that the make-based build process is fine as it is, apart >from the location of the Java >source files. It is true that putting the Java source in a directory >structure that map 1-to-1 to >the Java package structure is the norm and should make it easier for >everyone to modify the Java >source, with or without an IDE. > >Ant is a good tool, but in the RXTX case I fail to see the advantage >of using it compared to the >current make-based process. As Trent said, they are more pressing >issues, like testing. > >Regards, >David > >Dmitry Markman wrote: >> if I understands the issue right >> in order to be able to use ant for c/c++ compilation >> you have to install ant's cc task >> http://ant-contrib.sourceforge.net/cc.html >> >> it looks like it should work on mac os x >> (authors claim, that it's platform independent) >> but I never tested >> >> so all you have to do it's providing right command line >> for the gcc compiler >> >> >> >> >> On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: >> >>>> rxtx_root_directory >>>> `-- src >>>> |-- main >>>> | `-- java >>>> | `-- gnu >>>> | `-- io >>>> `-- test >>>> `-- java >>>> `-- gnu >>>> `-- io >>>> >>> >>> >>>> From what I understand this will just be good. >>> >>> For me it makes no difference. So lets do the rxtx thing. Let if >>> fester for two weeks and if nobody objects, we will do it. >>> >>> I'm not doing this because I care. I'm doing this to eliminate much >>> of my inbox. >>> >>> But test... man is rxtx lacking there in the community aspect. It is >>> covered but not right. _maybe_ I can change that this year. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> (cat hurding since 1997) > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From matt.higgins at gmail.com Tue Feb 7 08:28:34 2006 From: matt.higgins at gmail.com (Matt Higgins) Date: Tue, 7 Feb 2006 10:28:34 -0500 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final Message-ID: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? import java.io.*; import java.util.*; import gnu.io.*; public class MySimpleRead implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; public static void main(String[] args) { boolean portFound = false; String defaultPort = "COM1"; if (args.length > 0) { defaultPort = args[0]; } portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; MySimpleRead reader = new MySimpleRead(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } } public MySimpleRead() { try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) { e.printStackTrace(); } try { inputStream = serialPort.getInputStream(); } catch (IOException e) { e.printStackTrace(); } try { serialPort.addEventListener(this); } catch (TooManyListenersException e) { e.printStackTrace(); } try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { e.printStackTrace(); } System.out.println("Baud is " + serialPort.getBaudRate()); System.out.println("Bits is " + serialPort.getDataBits()); System.out.println("Stop is " + serialPort.getStopBits()); System.out.println("Par is " + serialPort.getParity()); serialPort.notifyOnDataAvailable(true); readThread = new Thread(this); readThread.start(); } public void run() { // Thread.sleep(20000); //} catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { System.out.println("An event occurred " + event.getEventType()); switch (event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: byte[] readBuffer = new byte[20]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } System.out.print(new String(readBuffer)); } catch (IOException e) {} break; } } } --------------- Result on windows ------------------------------ Stable Library ============================================================== Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port:: COM1 Baud is 9600 Bits is 8 Stop is 1 Par is 0 ----------------- End Results ----------------------------------------- ------------------ Result on Linux ----------------------------------- Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 Found port: /dev/ttyS0 Baud is 9600 Bits is 8 Stop is 1 Par is 0 An event occurred 1 043100066224 ------------------ End Results --------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/a1431630/attachment-0012.html From brian at mbari.org Tue Feb 7 09:48:37 2006 From: brian at mbari.org (Brian Schlining) Date: Tue, 7 Feb 2006 08:48:37 -0800 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> Message-ID: <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> Hi Matt > The following code works fine on Linux but I never see any data > when run on Windows. This is a cut and paste from the SimpleRead > example. > I am attempting to read data from a bar code scanner. I can fire > up HyperTermianl on windows and see that the device is working > properly as I see the barcodes are scanned and echoed back to the > terminal. However when I run the app I don't see any data. It is > however associating with the com port as the informational bits > print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. Cheers Brian Schlining Software Engineer http://www.mbari.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/16d07f37/attachment-0012.html From lux at diesel-research.com Tue Feb 7 11:59:58 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 11:59:58 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139293215.3689.4.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> Message-ID: <1139338798.8145.4.camel@zd7280> Any ideas on this ? Any reason why portList.hasMoreElements() should be false even though there are devices in /dev ? On Mon, 2006-02-06 at 23:20 -0700, Kim Lux wrote: > I'm running the code below. > > portlist.hasMoreElements() is false. > > /dev has ports in it as listed below. > > What am I doing wrong ? > > > ========================================================== > // Step through the list of ports until we find one that matches > // the one we are looking for. > > portList = CommPortIdentifier.getPortIdentifiers(); > > while(portList.hasMoreElements()) > { > portID = (CommPortIdentifier) portList.nextElement(); // > if (portID.getName().equals("/dev/ttyUSB0")) > { > myTA.append("Serial port ttyUSB0 has been found\n"); > break; > }// if portID equals... > }// End of while... > ========================================================== > > ls -al /dev/tty* > crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty > crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 > crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 > crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 > crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 > ... > crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 > crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 > crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 > > > -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 12:20:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 12:20:25 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139338798.8145.4.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> Message-ID: On Tue, 7 Feb 2006, Kim Lux wrote: > > Any ideas on this ? Any reason why portList.hasMoreElements() should be > false even though there are devices in /dev ? > > > On Mon, 2006-02-06 at 23:20 -0700, Kim Lux wrote: >> I'm running the code below. >> >> portlist.hasMoreElements() is false. >> >> /dev has ports in it as listed below. >> >> What am I doing wrong ? >> >> >> ========================================================== >> // Step through the list of ports until we find one that matches >> // the one we are looking for. >> >> portList = CommPortIdentifier.getPortIdentifiers(); >> >> while(portList.hasMoreElements()) >> { >> portID = (CommPortIdentifier) portList.nextElement(); // >> if (portID.getName().equals("/dev/ttyUSB0")) >> { >> myTA.append("Serial port ttyUSB0 has been found\n"); >> break; >> }// if portID equals... >> }// End of while... >> ========================================================== >> >> ls -al /dev/tty* >> crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty >> crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 >> crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 >> crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 >> crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 >> ... >> crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 >> crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 >> crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 >> >> >> > Hi Kim What rxtx does is try to open the port and do a timed out read. If the kernel/... do not complain it's enumarted. I suspect you could do a crude test by doing something like cat /dev/ttyS0 > /dev/null If that barfs then rxtx wont enumerate the port. hmm looking at your question again, I suspect it's a lockfile problem. This is documented in INSTALL with the source. Its easy enough to test this too.. touch /var/lock/testingrxtxlockfiles && rm -f /var/lock/testingrxtxlockfiles If you are not in the right group it will bail. Root will work regardless. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 12:37:56 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 12:37:56 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> Message-ID: <1139341076.8145.11.camel@zd7280> Exactly which ports does rxtx attempt to put into the list ? /dev/* or /dev/tty* or /dev/tty[0-9[0-9] ? or /dev/ttyS* ? For the record, only /dev/ttyUSB0 is a valid port on the machine I am presently on. Will this be a problem ? On Tue, 2006-02-07 at 12:20 -0700, Trent Jarvi wrote: > This is documented in INSTALL with the source. > I was wondering where that file was. I will download source and dig it up. Thanks. -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 12:51:09 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 12:51:09 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139341076.8145.11.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: On Tue, 7 Feb 2006, Kim Lux wrote: > > Exactly which ports does rxtx attempt to put into the list ? /dev/* > or /dev/tty* or /dev/tty[0-9[0-9] ? or /dev/ttyS* ? > > For the record, only /dev/ttyUSB0 is a valid port on the machine I am > presently on. Will this be a problem ? > > > On Tue, 2006-02-07 at 12:20 -0700, Trent Jarvi wrote: >> This is documented in INSTALL with the source. >> > I was wondering where that file was. I will download source and dig it > up. > > Thanks. > Hmm I'm looking at pre17 so this may have changed. (its just what I have on this machine) if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA" // for the IPAQs }; CandidatePortPrefixes=Temp; } So you may need to add "ttyUSB" to that list. RXTX used to enumerate _everything_ see if(osName.equals("Linux-all-ports") But it became less than practical. This is all in RXTXCommDriver.java hmm I just did a cvs update. if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have to get your fingers into the code. We aim for sane defaults. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 13:06:45 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 13:06:45 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139342805.8145.22.camel@zd7280> On Tue, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > Hmm I'm looking at pre17 so this may have changed. (its just what I have > on this machine) > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA" // for the IPAQs > }; > CandidatePortPrefixes=Temp; > } > > > So you may need to add "ttyUSB" to that list. RXTX used to enumerate > _everything_ see if(osName.equals("Linux-all-ports") But it became less > than practical. > > This is all in RXTXCommDriver.java > > hmm I just did a cvs update. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have > to get your fingers into the code. We aim for sane defaults. Excellent. Thanks for taking the time. -- Kim Lux, Diesel Research Inc. From ideiglenes1 at freemail.hu Tue Feb 7 13:53:39 2006 From: ideiglenes1 at freemail.hu (--) Date: Tue, 07 Feb 2006 21:53:39 +0100 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139345619.22534.2.camel@localhost> Hi! I use this code to get all the extra Linux devices. :) if ("Linux".equals(System.getProperty("os.name"))) { System.setProperty("os.name","Linux-all-ports"); } driver = new RXTXCommDriver(); On k, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > On Tue, 7 Feb 2006, Kim Lux wrote: > > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have > to get your fingers into the code. We aim for sane defaults. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From matt.higgins at gmail.com Tue Feb 7 13:45:54 2006 From: matt.higgins at gmail.com (Matt Higgins) Date: Tue, 7 Feb 2006 15:45:54 -0500 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> Message-ID: <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> Sweet this is exactly what I needed. I was searching the archives through marc.theamisgroup they only have archives back to 1/3/05. Should have hit the mailman archive! Thanks a lot! On 2/7/06, Brian Schlining wrote: > > Hi Matt > > The following code works fine on Linux but I never see any data when run > on Windows. This is a cut and paste from the SimpleRead example. > I am attempting to read data from a bar code scanner. I can fire up > HyperTermianl on windows and see that the device is working properly as I > see the barcodes are scanned and echoed back to the terminal. However when I > run the app I don't see any data. It is however associating with the com > port as the informational bits print fine? > > > You're not the only one whose had this problem, I don't know if Trent has > addressed this is the latest release of RXTX but there is a workaround. > Here's the recent thread from the RXTX mailing list regarding this issues: > > Thanasis Delenikas tdelenik at gmail.com > Wed Jan 18 13:56:23 MST 2006 > > * Previous message: [Rxtx] Re: More close() performance fixes > * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] > > Hi all. > (I've subscribed again from my other email account). > > Trent, > > You are right. Linux *always* works, no matter what flow control you set. > Windows *works only* with hardware flow control (I haven't tested what > happens with software XON/XOFF flow control). > > I assume (but I am not certain) that even with no flow control at all, all > platforms should work. Without flow control, you have the risk of bumping > into overflow or framing errors, but that's your (the end programmer, I > mean) problem. > > >From my side, I shouldn't be working without flow control. That was a bug > too... It was some code forgotten from the old times, when I used to work > with phone emulation drivers which didn't support flow control. The > correct > way is to have some flow control enabled and that's why I suppose this is > a > low-severity bug for RxTx. > > I have no idea which platform shows the correct behaviour, since > my knowledge about Linux and the inner workings of these low-level i/o > operations is limited. > > Regards, > Thanasis Delenikas. > > > > > Message: 2 > > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > > From: Trent Jarvi > > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > > To: RXTX Developers and Users > > Message-ID: > > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > > > Hi all, > > > > > > Trent, I have found something. > > > I read your comment about flow control, so I experimented a bit. > > > > > > If you remember, in my sample program I've used no flow control at all > ( > > i.e. > > > Java constant FLOWCONTROL_NONE). > > > > > > Now, during testing, I've switch to hardware inbound flow control (i.e > . > > Java > > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > > beautifully! > > > > > > I think I will switch to H/W flow control and test things for a while, > > but > > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > > > > > Hi Thanasis, > > > > I'm fairly sure you have identified a bug. I would not worry too much > > about what Sun CommAPI w32 defaults are. I think they did more or less > > whatever the port opened with. Just a guess. Linux tries to stomp on > > ports so they are all the same. > > > > So this started out with Linux worked, Windows XP/.. did not as I > recall. > > Something is wrong in rxtx. Do I understand this right? > > > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > > > Perhaps there is something Wayne or I did not understand when we wrote > > that code. I wasnt programming back in the BBS days so modems are not > my > > thing. I have a few questions. > > > > Is the above matrix confirmed by observation? > > Linux just always worked? > > Which one _should_ work? I'm guessing modems work with hardware flow > > control. I'll have to dig around. > > > > The windows flow control changes a couple things with hardware flow > > control. Following the w32 API documentation is confusing sometimes. > > But it looks like Linux could have a bug too. > > Cheers > > Brian Schlining > Software Engineer > http://www.mbari.org > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/9c989144/attachment-0012.html From tjarvi at qbang.org Tue Feb 7 14:06:14 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 14:06:14 -0700 (MST) Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> Message-ID: >> >> You're not the only one whose had this problem, I don't know if Trent has >> addressed this is the latest release of RXTX but there is a workaround. >> Here's the recent thread from the RXTX mailing list regarding this issues: >> I have not. I expect to have access to some test equipment next month and I'll go through all of this. I really don't know whats going on and I need a gold standard. I thought maybe linux was autodetecting the flow control. Your observations would certainly be welcome. I need to talk to Russell King and see what he is doing. Until then I'd just be toying around over a loopback as usual. This is very high on the list though. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 17:25:05 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 17:25:05 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139358305.17994.2.camel@zd7280> My application now works. I installed the libraries and jar from 2.1-7 (Final). portlist.hasMoreElements is no longer false. The application finds the port for /dev/ttyUSB0. Thanks for your help, Trent (et al) Sorry I bothered you with this. Next time I will look in the source first. I didn't think it was an rxtx issue, I thought it was a Linux setup issue . On Tue, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > Hmm I'm looking at pre17 so this may have changed. (its just what I > have > on this machine) > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux > Serial Ports > "ttySA" // for the > IPAQs > }; > > CandidatePortPrefixes=Temp; > } > > > So you may need to add "ttyUSB" to that list. RXTX used to enumerate > _everything_ see if(osName.equals("Linux-all-ports") But it became > less > than practical. > > This is all in RXTXCommDriver.java > > hmm I just did a cvs update. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux > Serial Ports > "ttySA", // for the > IPAQs > "ttyUSB" // for USB > frobs > }; > > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you > have > to get your fingers into the code. We aim for sane defaults. -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 19:21:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 19:21:54 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139358305.17994.2.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> <1139358305.17994.2.camel@zd7280> Message-ID: >Sorry I bothered you with this. Next time I will look in the source >first. I didn't think it was an rxtx issue, I thought it was a Linux >setup issue . Why would you be sorry? I would have done the same. I'm glad it's working :) -- Trent Jarvi tjarvi at qbang.org From tma at mail.island.net Wed Feb 8 13:39:35 2006 From: tma at mail.island.net (Tom Alldread) Date: Wed, 08 Feb 2006 12:39:35 -0800 Subject: [Rxtx] Win32/Linux Serial Port Data Dropouts In-Reply-To: <200602060702.k167255O007882@www.qbang.org> References: <200602060702.k167255O007882@www.qbang.org> Message-ID: <43EA5707.4020200@mail.island.net> Greetings Folks at RXTX: During the last couple of months I have been alternately testing with javax.comm 2 and RXTX 2.1 under Windows XP and CommApi 3 and RXTX 2.1 under Suse 10.0 Linux. In the process I have learned a little about java multi-threading under NetBeans 5 with Profiler. My java (jdk 1.5_06) application is used for data acquisition and provides a graphical display of A-D conversion data received from a 56KBaud serial port. The actual data throughput is about 10KBaud thus it is well below the speed of the port. I use hardware RTS/CTS flow control which can stall the data acquisition sample rate if necessary. This ensures the display computer has the ability to slow the data acquisition rate should it become too busy to accept the regular data flow. Both the serial port buffer and the java read buffer are set at 16KB. Usually the data transfers into the java read buffer are less than 100 bytes unless the data acquisition is recovering from a stall. The data flow normally hesitates after each 5 KB block as a continue command is needed from the display computer to start the drawing of a new graphics display line. Separate threads have been provided for the serial port event monitoring and data processing. The serial port event thread has been given the maximum priority and data processing thread the minimum priority provided by java. Thread yield statements have been placed within all data processing while/for loops as an effort to ensure quick access to CPU cycles for the serial port event thread. I have found that short data transmissions are essentially error free but occasional dropouts occur with continuous data flow especially under Windows XP. ....................................................................................................................................................................................... Linux results: I am happy to report that RXTX 2.1 appears to work very well under Linux although I did notice some errors when the screen savers were running with my dual monitors. I believe this is a local problem associated with my dual graphics which needs further attention. The recent CommApi 3 Linux release from Sun did not work at all with my program. It seemed to send commands out OK but did not receive any data. Although the serial port event triggered the ISR, the input stream appeared filled with nulls and thus did not contain any data. As my understanding is that CommApi 3 was tested with a Red Hat distribution of Linux I wonder if this problem is distro dependent? Although somewhat off topic here I wonder if anyone reading this has had similar experience? .................................................................................................................................................................................. Windows XP results: There are problems with occasional data dropouts which become more frequent as the sampling rate is increased or if the computer becomes busy with other duties. The dropouts typically consist of a half dozen byte block of lost data. It appears the lost bytes never get added to the java input stream. There has not been any indication of garbled data, overruns or framing errors which suggests the UART communications remains solid. Using javax.comm 2 I found that the setting of SerialPort 'enableReceiveThreshold' to 40 and 'enableReceiveTimeout' of 100mS reduced the dropouts error rate significantly. I found that I could not get RXTX 2.1 to function with the aforementioned threshold and timeout settings. The javax.comm 2 interface is consequently performing better for me under Windows than RXTX 2.1. I wonder if anyone here has any suggestions as to what I might try to improve RXTX 2.1? Although my settings are the same as under Suse 10.0, RXTX 2.1 performs much better for me under Linux than any of the alternatives that I have tried under Windows XP . ............................................................................................................................................................................... I would like to establish, based on the experience of others, if I have reached the normally expected performance limit of java serial port communications? Should I expect to achieve virtually error free serial port data input from a continuous stream under Windows XP java software? I am considering changing my protocol to packets with error checking if necessary but would like to know if the dropout problems I am experiencing are typical or not before I take this rather work intensive plunge. Many thanks in advance for any help! Best Regards, Tom Alldread -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.375 / Virus Database: 267.15.2/253 - Release Date: 2006-02-07 From jlaxson at mac.com Wed Feb 8 23:56:48 2006 From: jlaxson at mac.com (John Laxson) Date: Thu, 9 Feb 2006 00:56:48 -0600 Subject: [Rxtx] PortInUseException: Unknown Application on OSX Message-ID: Hi, I've been trying to get RXTX 2.1.7 going on Mac OS X for a while here, and am running up into a wall here. I've tried with pre- compiled and the source version and get the same problem, a gnu.io.PortInUseException: Unknown Application. I have run the fixperms script included with the source distribution, and id shows me as a member of the uucp group, and permissions on /var/spool/uucp are 775 root:uucp. Running a test program (included at the bottom for clarity) lets me enumerate all the serial ports correctly, but trying to open any of them gives the PortInUseException. If it helps, when I try to open a port that's set to make an outgoing bluetooth connection, there is no delay and no connection attempt at all. Thanks, John Laxson PS: The documentation wiki on qbang.org shows 404, and has for a few days now. My test code: public static void main(String[] args) { SerialPort serialPort; try { Enumeration e = CommPortIdentifier.getPortIdentifiers(); CommPortIdentifier ident; while (e.hasMoreElements()) { ident = (CommPortIdentifier)e.nextElement(); System.out.println(ident.getName()); } ident = CommPortIdentifier.getPortIdentifier("/dev/cu.modem"); serialPort = (SerialPort) ident.open("Me", 5000); } catch (Exception e) { e.printStackTrace(); } } From rajesh.invincible at gmail.com Thu Feb 9 03:39:38 2006 From: rajesh.invincible at gmail.com (Rajesh N) Date: Thu, 9 Feb 2006 16:09:38 +0530 Subject: [Rxtx] Re: Move .java Files in gnu.io filesystem hierarchy - Maven (2) In-Reply-To: <43DF21D2.7090200@ngi.it> References: <43DF21D2.7090200@ngi.it> Message-ID: <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Can anybody tell me how to overcome these EXCEPTIONS I AM WORKING ON SERIAL COMMN IN JAVA ON LINUX. 1. " NOT ALL PARAMETERS SUPPORTED BY THE KERNEL" This i came across the following statement inmy prog. SerialP is A SerialPort object SerialP.setSerialPortParams(9600(BAUDRATE),DATABITS_8,STOPBITS_1,PARITY_NONE) 2. NullPointer Exception at Event Dispatch Now i have checked all my object references for a null reference but i found none i have put up my entire code in try catch blocks but still I AM UNABLE TO CATCH THIS EXCEPTION AND HENCE MY APPLICATION CLOSES HOW DOES THESE GO? PLEASE HELP ME IT IS URGENTTTTTTTTTTTTTTTT yours sincerely RAJESH On 1/31/06, Fabio Frumento wrote: > Hi Xavier, > > I don't know maven at all but the directory hierarchy listed buy Trent > is fine for me... > > I'll take a look to maven, it seems an interesting project > > Regards > > Fabio Frumento > > Trent Jarvi wrote: > > On Tue, 31 Jan 2006, Xavier Frisaye wrote: > > > >> Hi all, > >> > >> If you are going to rearrange the src folder, i will propose to use > >> maven 2 and follow its directory structure > >> > (http://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html). > >> > >> Maven 2 simplify java project and give a standard way to make projects > >> (http://maven.apache.org/). > >> We are using it for internal projects and we are very satisfied. > >> > >> Is anybody interested? > >> > >> I'm not an expert in maven 2 (yet) but i'm agree to help using it if > >> you choose to make so. > >> > > > > so this would be: > > > > rxtx-devel/src/main/java/gnu.io > > rxtx-devel/src/test/java/ManIwish.java > > > > I don't use IDEs very much so I'll let others comment. But I don't see > > a problem with that. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Thu Feb 9 09:50:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 9 Feb 2006 09:50:31 -0700 (MST) Subject: [Rxtx] Re: Move .java Files in gnu.io filesystem hierarchy - Maven (2) In-Reply-To: <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Message-ID: On Thu, 9 Feb 2006, Rajesh N wrote: > Can anybody tell me how to overcome these EXCEPTIONS > I AM WORKING ON SERIAL COMMN IN JAVA ON LINUX. > > 1. " NOT ALL PARAMETERS SUPPORTED BY THE KERNEL" > > This i came across the following statement inmy prog. > SerialP is A SerialPort object > SerialP.setSerialPortParams(9600(BAUDRATE),DATABITS_8,STOPBITS_1,PARITY_NONE) > Strange. The parameters you use are the same the port should open with by default. Could you paste the actual exception you are getting? I don't see that in the rxtx source. Also it would help to know the rxtx version. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Fri Feb 10 15:29:05 2006 From: lux at diesel-research.com (Kim Lux) Date: Fri, 10 Feb 2006 15:29:05 -0700 Subject: [Rxtx] One serial port object for both sending and receiving ? Message-ID: <1139610545.18177.4.camel@zd7280> Is it OK to use one SerialPort ojbect (ex Serial Port serialPort;) and use it for both sending and receiving ? For example: ======================================================================== static SerialPort serialPort = null; static OutputStream serialOut = null; static InputStream serialIn = null; // assign it to an outputStream for use try{ serialOut = serialPort.getOutputStream(); System.out.println("Serial output stream has been assigned."); }//try catch(IOException e) { System.out.println("Error: Couldn't assign output stream to serial port."); }//catch //assign it to an inputStream for use try{ serialIn = serialPort.getInputStream(); System.out.println("Serial input stream has been assigned."); }//try catch(IOException e) { System.out.println("Error: Couldn't assign input stream to serial port."); }//catch ======================================================================== -- Kim Lux, Diesel Research Inc. From lux at diesel-research.com Fri Feb 10 21:23:00 2006 From: lux at diesel-research.com (Kim Lux) Date: Fri, 10 Feb 2006 21:23:00 -0700 Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Message-ID: <1139631780.23882.10.camel@zd7280> I've got a problem receiving chars with my version of serialRead, written in an SWT GUI. I had a Java pro have a good look at my code and he can't see anything wrong with it. I can send chars fine. When I receive a char the cpu usage for the app goes to 100% and the code in the serial event handler doesn't get executed. The instructions on the Java Comm Serial API How-To for Linux page state that I must install javacomm. Is that true ? Everything builds without it and I can send chars on rxtx just fine, but I can't receive them. Could this be the problem ? I downloaded and installed javacomm. I was not able to add "Driver=gnuio.RXTXCommDriver to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 installed in /usr/java/jre1.5.0_05. I added comm.jar to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext to the library paths. Is this OK ? Does it matter that I am receiving on /dev/ttyUSB0 ? Thanks. -- Kim Lux, Diesel Research Inc. From lunareclipse03 at web.de Sat Feb 11 09:44:46 2006 From: lunareclipse03 at web.de (lunareclipse03@web.de) Date: Sat, 11 Feb 2006 17:44:46 +0100 Subject: [Rxtx] Question about Serial I/O under Win32 Message-ID: <662084330@web.de> Hello everybody, I have a strange problem with a piece of code I made for myself. No, this is not really concerning rxtx, but nevertheless I post this to the list, hoping that some of you can help me. I've written two libraries, one for linux and one for win32. The linux port works quite well, I can send / receive faxes and / or replay voice messages over the telephone line using a voice modem. But the win32 port of the library causes some trouble. If, for example, I send out a fax with a certain modem under linux, it works well. The fax is complete when it comes out of the fax machine. If I then use the same modem to send out a fax under win32, the fax coming out of the fax machine gets "stuck" halfways, but the sending modem thinks that transmission was ok and drops the connection. The answering fax machine then gives me "error while receiving." The "upper layer" java code MUST be right, because if I do the same thing under linux (using the linux library), everything is alright. Now I have to ask: Can somebody please help me out with this??!? Could it be the case that some kind of flow control or COMMTIMEOUTS setting causes this behaviour? I set flow control to RTS/CTS before sending out a fax. How can I DISABLE flow control? Or what do you think? Can something else cause this problems? Thank you all for your time and PLEASE write back soon. Regards, --Sven Ahlemann Am Waldrand 31 45721 Haltern am See Germany ______________________________________________________________ Verschicken Sie romantische, coole und witzige Bilder per SMS! Jetzt bei WEB.DE FreeMail: http://f.web.de/?mc=021193 From lux at diesel-research.com Sat Feb 11 10:06:52 2006 From: lux at diesel-research.com (Kim Lux) Date: Sat, 11 Feb 2006 10:06:52 -0700 Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: <1139631780.23882.10.camel@zd7280> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> <1139631780.23882.10.camel@zd7280> Message-ID: <1139677612.3431.5.camel@zd7280> More on this problem. I copied and pasted simpleRead into a console based Eclipse project and I've got the same result, except that cpu usage doesn't go to 100%. I'm beginning to think there is an issue in rxtx. My imports for simpleRead are: ============================ import gnu.io.*; import java.util.*; //import javax.comm.*; import java.io.*; =========================== Any ideas ? I am trying to read from /dev/ttyUSB0 using a serial to USB adapter which has worked well with minicom and gtkterm. Thanks. On Fri, 2006-02-10 at 21:23 -0700, Kim Lux wrote: > I've got a problem receiving chars with my version of serialRead, > written in an SWT GUI. > > I had a Java pro have a good look at my code and he can't see anything > wrong with it. > > I can send chars fine. When I receive a char the cpu usage for the app > goes to 100% and the code in the serial event handler doesn't get > executed. > > The instructions on the Java Comm Serial API How-To for Linux page state > that I must install javacomm. Is that true ? Everything builds without > it and I can send chars on rxtx just fine, but I can't receive them. > Could this be the problem ? > > I downloaded and installed javacomm. I was not able to add > "Driver=gnuio.RXTXCommDriver > to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not > have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 > installed in /usr/java/jre1.5.0_05. I added comm.jar > to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext > to the library paths. Is this OK ? > > Does it matter that I am receiving on /dev/ttyUSB0 ? > > Thanks. > -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Sun Feb 12 21:01:33 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:01:33 -0700 (MST) Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: <1139677612.3431.5.camel@zd7280> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> <1139631780.23882.10.camel@zd7280> <1139677612.3431.5.camel@zd7280> Message-ID: I suspect what is happening is the select() is breaking out in the native code but the driver does not have support for notifying there are X bytes available. On some traditional Unix based systems, the only way you know data is available is the fd status changes and do an FIORDCHK ioctl. Or perhaps the only thing you can know is the fd status changed. It would take reading through the kernel driver code to know for sure. So on USB, depending upon the driver, the same may need to be done or the driver improved a bit if possible to support. Polling reads will also work but don't use the event driven model of CommAPI which isnt acceptable in the long run. The 100% cpu usage can then be explained because select no longer blocks until the data is read; the eventLoop spins loose. You can put a well placed sleep but rxtx only expects those are needed when it knows data is available. This may not be a super simple thing to understand and fix. I do have ideas to get you started. I'm going to be short on time the next couple weeks. I expect to put some good time in and answer some other questions I saw around the 25th. For now, I'd look at the following and go from there with the hints I've given. JNIEXPORT jint JNICALL RXTXPort(nativeavailable)( JNIEnv *env, jobject jobj ) { int fd = get_java_var( env, jobj,"fd","I" ); int result; /* char message[80]; ENTER( "RXTXPort:nativeavailable" ); On SCO OpenServer FIONREAD always fails for serial devices, so try ioctl FIORDCHK instead; will only tell us whether bytes are available, not how many, but better than nothing. This turns out to be true on Solaris also. taj. */ #ifdef FIORDCHK /* __unixware__ __sun__ probably others */ result = ioctl(fd, FIORDCHK, 0); #else if( ioctl( fd, FIONREAD, &result ) < 0 ) { goto fail; } #endif /* FIORDCHK */ On Sat, 11 Feb 2006, Kim Lux wrote: > > More on this problem. I copied and pasted simpleRead into a console > based Eclipse project and I've got the same result, except that cpu > usage doesn't go to 100%. I'm beginning to think there is an issue in > rxtx. > > My imports for simpleRead are: > > ============================ > import gnu.io.*; > import java.util.*; > //import javax.comm.*; > import java.io.*; > =========================== > > Any ideas ? I am trying to read from /dev/ttyUSB0 using a serial to > USB adapter which has worked well with minicom and gtkterm. > > Thanks. > > > > On Fri, 2006-02-10 at 21:23 -0700, Kim Lux wrote: >> I've got a problem receiving chars with my version of serialRead, >> written in an SWT GUI. >> >> I had a Java pro have a good look at my code and he can't see anything >> wrong with it. >> >> I can send chars fine. When I receive a char the cpu usage for the app >> goes to 100% and the code in the serial event handler doesn't get >> executed. >> >> The instructions on the Java Comm Serial API How-To for Linux page state >> that I must install javacomm. Is that true ? Everything builds without >> it and I can send chars on rxtx just fine, but I can't receive them. >> Could this be the problem ? >> >> I downloaded and installed javacomm. I was not able to add >> "Driver=gnuio.RXTXCommDriver >> to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not >> have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 >> installed in /usr/java/jre1.5.0_05. I added comm.jar >> to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext >> to the library paths. Is this OK ? >> >> Does it matter that I am receiving on /dev/ttyUSB0 ? >> >> Thanks. >> > From tjarvi at qbang.org Sun Feb 12 21:03:30 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:03:30 -0700 (MST) Subject: [Rxtx] One serial port object for both sending and receiving ? In-Reply-To: <1139610545.18177.4.camel@zd7280> References: <1139610545.18177.4.camel@zd7280> Message-ID: On Fri, 10 Feb 2006, Kim Lux wrote: > > Is it OK to use one SerialPort ojbect (ex Serial Port serialPort;) and > use it for both sending and receiving ? > > For example: > > ======================================================================== > static SerialPort serialPort = null; > static OutputStream serialOut = null; > static InputStream serialIn = null; > > > > > // assign it to an outputStream for use > try{ > serialOut = serialPort.getOutputStream(); > System.out.println("Serial output stream has been assigned."); > }//try > catch(IOException e) > { > System.out.println("Error: Couldn't assign output stream to serial > port."); > }//catch > > > //assign it to an inputStream for use > try{ > serialIn = serialPort.getInputStream(); > System.out.println("Serial input stream has been assigned."); > }//try > catch(IOException e) > { > System.out.println("Error: Couldn't assign input stream to serial > port."); > }//catch This should be fine. In fact trying to do it another way will probably not work as you will run into lockfile issues. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun Feb 12 21:13:13 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:13:13 -0700 (MST) Subject: [Rxtx] Question about Serial I/O under Win32 In-Reply-To: <662084330@web.de> References: <662084330@web.de> Message-ID: On Sat, 11 Feb 2006 lunareclipse03 at web.de wrote: > Hello everybody, > > I have a strange problem with a piece of code I made for myself. No, > this is not really concerning rxtx, but nevertheless I post this to the > list, hoping that some of you can help me. I've written two libraries, > one for linux and one for win32. The linux port works quite well, I can > send / receive faxes and / or replay voice messages over the telephone > line using a voice modem. But the win32 port of the library causes some > trouble. If, for example, I send out a fax with a certain modem under > linux, it works well. The fax is complete when it comes out of the fax > machine. If I then use the same modem to send out a fax under win32, the > fax coming out of the fax machine gets "stuck" halfways, but the sending > modem thinks that transmission was ok and drops the connection. The > answering fax machine then gives me "error while receiving." The "upper > layer" java code MUST be right, because if I do the same thing under > linux (using the linux library), everything is alright. Now I have to > ask: Can somebody please help me out with this??!? Could it be the case > that some kind of flow control or COMMTIMEOUTS setting causes this > behaviour? I set flow control to RTS/CTS before sending out a fax. How > can I DISABLE flow control? Or what do you think? Can something else > cause this problems? Thank you all for your time and PLEASE write back > soon. > Hi Sven I'm not too willing to talk about flow control at the low level until I confirm some things with test equipment later. It is not clear if you are using rxtx or writing your own native code. So I'm not sure how to answer much of this :) If you are wondering how to change the flow control using rxtx from java, The BlackBox example from Sun flips this back and forth. SerialPort.java in rxtx 2.1 uses the following: SerialPort.java: public static final int FLOWCONTROL_NONE =0; SerialPort.java: public static final int FLOWCONTROL_RTSCTS_IN =1; SerialPort.java: public static final int FLOWCONTROL_RTSCTS_OUT =2; SerialPort.java: public static final int FLOWCONTROL_XONXOFF_IN =4; SerialPort.java: public static final int FLOWCONTROL_XONXOFF_OUT=8; So if you set flowcontrol to RTSCTS, you can set it to NONE to turn it off. If you are looking for how to do it in native code, the rxtx Source is SerialImp.c (unix/linux/mac os x/w32) and termios.c (w32 only with SerialImp.c) You can track the code: SerialImp.c:JNIEXPORT void JNICALL RXTXPort(setflowcontrol)( JNIEnv *env, jobject jobj, jint flowmode ) termios.c:int tcgetattr( int fd, struct termios *s_termios ) termios.c:int tcsetattr( int fd, int when, struct termios *s_termios ) There may be a problem in the rxtx flow control code though. Rather than guess, I want to test this with a gold standard. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Feb 6 00:00:16 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 00:00:16 -0700 (MST) Subject: [Rxtx] wiki delay until tomorrow night. In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: On Sun, 5 Feb 2006, Trent Jarvi wrote: > On Sun, 5 Feb 2006, Kim Lux wrote: > >> usb ? Tell me more... I need that too. > > usb is a very proper design. Thats all it is. > Maybe rxtx could help usb. But it would start with helping bring back the community that was already there. It's not something I'd love to do but maybe its the right thing to do. It would probably take 2 years to do right. But maybe thats better than what we have now. I honestly don't know what IBM is doing which could just run over everything. Just some thoughts after some fine german wine. -- Trent Jarvi tjarvi at qbang.org From gadelavega at yahoo.com.ar Mon Feb 6 02:17:05 2006 From: gadelavega at yahoo.com.ar (Gonzalo A. de la Vega) Date: Mon, 06 Feb 2006 10:17:05 +0100 Subject: [Rxtx] Serial port ownership question In-Reply-To: References: <20060205113618.30274.qmail@web53501.mail.yahoo.com> <1139157422.4553.9.camel@zd7280> <1139158698.4936.9.camel@zd7280> Message-ID: <43E71411.4050402@yahoo.com.ar> On my Fedora Core 4: ls -l /dev/ttyS* crw-rw---- 1 root uucp 4, 64 Feb 6 2006 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Feb 6 2006 /dev/ttyS1 ... and: grep "ttyUSB" /etc/udev/rules.d/50-udev.rules KERNEL=="ttyUSB*", GROUP="uucp", MODE="0660" So anyone in the "uucp" group can use serial ports. On Gentoo the group is "tty". Trent Jarvi escribi?: > > > On Sun, 5 Feb 2006, Dr. Douglas Lyon wrote: > >> I can confirm that this is the case (only root ownership of >> serial ports, under fedora 4). >> Wow, what were they thinking?! >> - DL >> >>> I've found that the newer kernels have the serial ports owned by root. >>> For example, >>> >>> $ls -al /dev/tty* >>> crw-rw-rw- 1 root root 5, 0 Feb 5 02:06 /dev/tty >>> crw-rw---- 1 root root 4, 0 Feb 5 02:06 /dev/tty0 >>> crw------- 1 root root 4, 1 Feb 5 09:07 /dev/tty1 >>> crw-rw---- 1 root tty 4, 10 Feb 5 02:06 /dev/tty10 >>> crw-rw---- 1 root tty 4, 11 Feb 5 02:06 /dev/tty11 >>> ... > > > This is just not a problem jcp or such are going to solve. Its a > platform spitwad fight. But do look at pam. In fact thats what Sun > is doing too. Maybe Linux followed their lead.. I'm not a pam guy. > I've spent 16 hours trying to understand it but your users wont :) > > Solution? I have no clue. Its two tangent mentalities from my > perspective. > > -- > Trent Jarvi > tjarvi at qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mtnvega at yahoo.com.br Mon Feb 6 05:35:43 2006 From: mtnvega at yahoo.com.br (Luiz Jr) Date: Mon, 6 Feb 2006 12:35:43 +0000 (GMT) Subject: [Rxtx] Documentation Wiki In-Reply-To: <1139157422.4553.9.camel@zd7280> Message-ID: <20060206123543.57256.qmail@web53515.mail.yahoo.com> Hello, Thank you for you answer, but so the usage of the API is pretty much like the Java Communications Api? If yes, what version of the Java Comm Api? Thank you, Luiz A. Brandao Jr Kim Lux escreveu: On Sun, 2006-02-05 at 08:36 -0300, Luiz Jr wrote: > Hello, > > I want to start using the RXTX libraries, but I would to know how, > since I can not access the documentation wiki page I just started using them yesterday. Below is how I installed the libraries, if that helps. I used snippets of code from the SimpleWrite application here to get me going. http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html Instead of "import javax.comm.*;", use "import gnu.io.*;" which is gotten from RXTXcomm.jar, which you will need to include in your project references. I am working in Eclipse. BTW: there is no way to open a port without going through the port list and finding it. Maybe sometime in the future someone (me ?) will write a method called openSerialPort that allows the user to give a port identifier, such as "/dev/tty1" and return a port ready to use. It wouldn't take much to write that and it would save users a lot of code. Hope this helps. ======================================================================= 1) Figure out which java you are running, incase there is more than one installed. $ java -version java version "1.5.0_05" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_05-b05) Java HotSpot(TM) Client VM (build 1.5.0_05-b05, mixed mode, sharing) 2) Find all the jre directories and the one from which you are currently running. kfind (jre) 3) cd to that directory plus /lib/i386 cd /usr/java/jre1.5.0_05/lib/i386 4) Copy the library files (*.so) to that directory. cp /home/krlux/Desktop/'Java Controls'/rxtx-linux/bin/* . 5) Check that the copy was successful ls librxtx* librxtxI2C.so librxtxRaw.so librxtxSerial.so librxtxParallel.so librxtxRS485.so 6) cd to the /lib/ext directory for your java. cd /usr/java/jre1.5.0_05/lib/ext 7) Copy the Jar files there cp /home/krlux/Desktop/'Java Controls'/rxtx-linux/lib/ext/* . 8) Check that it was successful ls RXTX* RXTXcomm.jar Rxtx is now installed on your machine ready to use. =================================================================== -- Kim Lux, Diesel Research Inc. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx --------------------------------- Yahoo! Acesso Gr?tis - Internet r?pida e gr?tis. Instale o discador agora! -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/544aa403/attachment-0013.html From lyon at docjava.com Mon Feb 6 05:49:34 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 06 Feb 2006 07:49:34 -0500 Subject: [Rxtx] wiki delay until tomorrow night. In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: Hi All, I have often thought about USB drivers being needed. For example, the ironman watch will not interface to a mac (windows only). It is USB. My dymo label writer has no Java driver (native only). Etc. Most cheap web cameras are USB (and Java drivers go through JAI, if it supports the camera at all). The JAI code shows how sun did the USB drivers. You have to be a member of the jai project to download the source code. https://jai.dev.java.net has the jai distro. And then you are not allowed to redistribute it. However, we can all learn from it (if so inclined). Basically: cvs -d :pserver:lyon at cvs.dev.java.net:/cvs login cvs -d :pserver:lyon at cvs.dev.java.net:/cvs checkout jai-core You will need to user your own uid and pw to get in. The ant build has over 100 warnings from sun deprecations of its own code. You might say that they were hoisted on their own Picard ;) One interesting thing is that they support several platforms: linux-amd64 64-bit Linux-AMD64 linux-i586 32-bit Linux-x86 solaris-amd64 64-bit Solaris-AMD64 solaris-i586 32-bit Solaris-x86 solaris-sparc 32-bit Solaris-SPARC solaris-sparcv9 64-bit Solaris-SPARC windows-i586 32-bit Windows-x86 Thus, ant is used to provide a multi-platform native method distro. Neat. How do they do it? check this out: And: The core download does not contain any C source code (it was all pre-built). Basically, they are just copying .so and .dll files into build directories. I would love to see the C code for this...but Sun does not post it on the https://jai.dev.java.net site. I don't know why...Perhaps I missed it. - Doug >On Sun, 5 Feb 2006, Trent Jarvi wrote: > >>On Sun, 5 Feb 2006, Kim Lux wrote: >> >>>usb ? Tell me more... I need that too. >> >>usb is a very proper design. Thats all it is. >> > >Maybe rxtx could help usb. But it would start with helping bring >back the community that was already there. > >It's not something I'd love to do but maybe its the right thing to do. > >It would probably take 2 years to do right. But maybe thats better >than what we have now. > >I honestly don't know what IBM is doing which could just run over everything. > >Just some thoughts after some fine german wine. > >-- >Trent Jarvi >tjarvi at qbang.org > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tdelenik at gmail.com Mon Feb 6 05:56:32 2006 From: tdelenik at gmail.com (Thanasis Delenikas) Date: Mon, 6 Feb 2006 14:56:32 +0200 Subject: Fwd: [Rxtx] Documentation Wiki In-Reply-To: <1139157422.4553.9.camel@zd7280> References: <20060205113618.30274.qmail@web53501.mail.yahoo.com> <1139157422.4553.9.camel@zd7280> Message-ID: <310a1a930602060456t129f1dc6p5f2b908f13ab5a0b@mail.gmail.com> Hello all, Kim, this is a snippet from the code I use. The closest to directly opening a specific port without enumeration. << ... portId = CommPortIdentifier.getPortIdentifier(getPort()); serialPort = (SerialPort) portId.open("jSMSEngine", 1971); ... >> where getPort() return the string identifier of the port, i.e. "/dev/ttyS0" or "COM1" or whatever. Thanasis. ---------- Forwarded message ---------- From: Kim Lux Date: Feb 5, 2006 6:37 PM Subject: Re: [Rxtx] Documentation Wiki To: RXTX Developers and Users BTW: there is no way to open a port without going through the port list and finding it. Maybe sometime in the future someone (me ?) will write a method called openSerialPort that allows the user to give a port identifier, such as "/dev/tty1" and return a port ready to use. It wouldn't take much to write that and it would save users a lot of code. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/182ab5b8/attachment-0013.html From tjarvi at qbang.org Mon Feb 6 11:53:57 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 11:53:57 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: On Mon, 6 Feb 2006, Dr. Douglas Lyon wrote: > Hi All, > I have often thought about USB drivers being needed. > For example, the ironman watch will not interface > to a mac (windows only). It is USB. > My dymo label writer has no Java driver (native only). > Etc. > Most cheap web cameras are USB (and Java drivers go > through JAI, if it supports the camera at all). > The JAI code shows how sun did the USB drivers. > You have to be a member of the jai project to download > the source code. > https://jai.dev.java.net has the jai distro. > And then you are not allowed to redistribute it. However, > we can all learn from it (if so inclined). Basically: > cvs -d :pserver:lyon at cvs.dev.java.net:/cvs login > cvs -d :pserver:lyon at cvs.dev.java.net:/cvs checkout jai-core > You will need to user your own uid and pw to get in. > The ant build has over 100 warnings from sun deprecations > of its own code. > > You might say that they were hoisted on their own Picard ;) > > One interesting thing is that they support several platforms: > linux-amd64 64-bit Linux-AMD64 > linux-i586 32-bit Linux-x86 > solaris-amd64 64-bit Solaris-AMD64 > solaris-i586 32-bit Solaris-x86 > solaris-sparc 32-bit Solaris-SPARC > solaris-sparcv9 64-bit Solaris-SPARC > windows-i586 32-bit Windows-x86 > Thus, ant is used to provide a multi-platform native method distro. > Neat. > How do they do it? > check this out: > > > > > > > > > > > > > And: > > > > > > > > > > The core download does not contain any C source code (it was all pre-built). > Basically, they are just copying .so and .dll files into build directories. > > I would love to see the C code for this...but Sun does not post it on the > https://jai.dev.java.net site. > > I don't know why...Perhaps I missed it. > > - Doug > > I've looked at moving rxtx to Ant builds. I think that would help IDEs a great deal. I requested a evalutation desk copy the O'Reilly Ant book for some j2ee material I was teaching. http://www.oreilly.com/catalog/anttdg/ It has a one sentence mention of JNI. So there was not luck there. I saw that there is another Ant book that does mention JNI more. I can't find it now. Ant must be able to support it with extensions. http://ant.apache.org/manual/OptionalTasks/javah.html What the auto(break :) tools do in the rxtx build is 4 things really. 1) gcc compile flags 2) ld compile flags 3) config.h 4) compile flags for customizing rxtx (lockfiles, ...) See 1 All of this information except 4 can be static once obtained. So I'm not attached to the auto tools. If I could find an example of Ant being used for JNI code, I'd be one of the first to start moving that direction. Maybe someone saw an example someplace. The other thing we have not completed discussing is the directory structure. There is interest in making rxtx more IDE friendly. I get more mail about that off the list than how to install rxtx. And I see we have Ken Thompson in da house :) He is our trusted CVS maintainer and the guy that purchased the rxtx.org domain. Old community. We will need Ken for changing the directory structure of source. I would like to open up discussion about both of these as it is more than time. The problem is I have little experience with Ant and even less with IDEs. It would be nice if we could work with Eclipse and NetBeans. http://www.netbeans.org/ (sun and some community) http://www.eclipes.org (ibm,rhat,... perhaps more community) http://maven.apache.org/what-is-maven.html (apache. It is community) borland should sortof be here too but I think thats covered in eclipse. >From what I understand so far, we should morph rxtx to support those three maybe trusting apaches lead with maven. But I use vi. I have little to no clues beyond what people have fed me. Can we agree that thats the right direction to go? -- Trent Jarvi tjarvi at qbang.org From brian at mbari.org Mon Feb 6 14:57:50 2006 From: brian at mbari.org (Brian Schlining) Date: Mon, 6 Feb 2006 13:57:50 -0800 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> > The other thing we have not completed discussing is the directory > structure. There is interest in making rxtx more IDE friendly. I > get more mail about that off the list than how to install rxtx. > > And I see we have Ken Thompson in da house :) He is our trusted > CVS maintainer and the guy that purchased the rxtx.org domain. Old > community. We will need Ken for changing the directory structure of > source. > > I would like to open up discussion about both of these as it is > more than time. The problem is I have little experience with Ant > and even less with IDEs. It would be nice if we could work with > Eclipse and NetBeans. > > http://www.netbeans.org/ (sun and some community) > http://www.eclipes.org (ibm,rhat,... perhaps more community) > http://maven.apache.org/what-is-maven.html (apache. It is community) > borland should sortof be here too but I think thats covered in > eclipse. > >> From what I understand so far, we should morph rxtx to support >> those three > maybe trusting apaches lead with maven. But I use vi. I have > little to no clues beyond what people have fed me. > Maven likes the directory structure below for Java code. (From http:// maven.apache.org/guides/getting-started/index.html) This structure works fine with ant, netbeans, and eclipse. rxtx_root_directory `-- src |-- main | `-- java | `-- gnu | `-- io `-- test `-- java `-- gnu `-- io Brian Schlining Software Engineer http://www.mbari.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/d9451eba/attachment-0013.html From tjarvi at qbang.org Mon Feb 6 15:11:45 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 15:11:45 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: > rxtx_root_directory > `-- src > |-- main > | `-- java > | `-- gnu > | `-- io > `-- test > `-- java > `-- gnu > `-- io > >From what I understand this will just be good. For me it makes no difference. So lets do the rxtx thing. Let if fester for two weeks and if nobody objects, we will do it. I'm not doing this because I care. I'm doing this to eliminate much of my inbox. But test... man is rxtx lacking there in the community aspect. It is covered but not right. _maybe_ I can change that this year. -- Trent Jarvi tjarvi at qbang.org (cat hurding since 1997) From lux at diesel-research.com Mon Feb 6 21:38:49 2006 From: lux at diesel-research.com (Kim Lux) Date: Mon, 06 Feb 2006 21:38:49 -0700 Subject: [Rxtx] How can I use Lock Files with rxtx (in FC4) ? Message-ID: <1139287129.17031.3.camel@zd7280> I am now running an rxtx application on FC4. I am getting: ========================================================= check_group_uucp(): error testing lock file creation Error details: Permission denied check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL ========================================================= $ ls -al /var/lock total 32 drwxrwxr-x 4 root lock 4096 Feb 6 16:04 . drwxr-xr-x 24 root root 4096 Nov 14 01:19 .. drwx------ 2 root root 4096 Apr 27 2005 lvm drwxr-xr-x 2 root root 4096 Feb 6 16:04 subsys How do I fix this for regulator users ? -- Kim Lux, Diesel Research Inc. From dmarkman at mac.com Mon Feb 6 22:24:44 2006 From: dmarkman at mac.com (Dmitry Markman) Date: Tue, 7 Feb 2006 00:24:44 -0500 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: if I understands the issue right in order to be able to use ant for c/c++ compilation you have to install ant's cc task http://ant-contrib.sourceforge.net/cc.html it looks like it should work on mac os x (authors claim, that it's platform independent) but I never tested so all you have to do it's providing right command line for the gcc compiler On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: >> rxtx_root_directory >> `-- src >> |-- main >> | `-- java >> | `-- gnu >> | `-- io >> `-- test >> `-- java >> `-- gnu >> `-- io >> > > >> From what I understand this will just be good. > > For me it makes no difference. So lets do the rxtx thing. Let if > fester for two weeks and if nobody objects, we will do it. > > I'm not doing this because I care. I'm doing this to eliminate > much of my inbox. > > But test... man is rxtx lacking there in the community aspect. It > is covered but not right. _maybe_ I can change that this year. > > -- > Trent Jarvi > tjarvi at qbang.org > (cat hurding since 1997) > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx Dmitry Markman From lux at diesel-research.com Mon Feb 6 23:20:15 2006 From: lux at diesel-research.com (Kim Lux) Date: Mon, 06 Feb 2006 23:20:15 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? Message-ID: <1139293215.3689.4.camel@zd7280> I'm running the code below. portlist.hasMoreElements() is false. /dev has ports in it as listed below. What am I doing wrong ? ========================================================== // Step through the list of ports until we find one that matches // the one we are looking for. portList = CommPortIdentifier.getPortIdentifiers(); while(portList.hasMoreElements()) { portID = (CommPortIdentifier) portList.nextElement(); // if (portID.getName().equals("/dev/ttyUSB0")) { myTA.append("Serial port ttyUSB0 has been found\n"); break; }// if portID equals... }// End of while... ========================================================== ls -al /dev/tty* crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 ... crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 -- Kim Lux, Diesel Research Inc. From david.garnier at trusted-logic.com Tue Feb 7 00:46:30 2006 From: david.garnier at trusted-logic.com (David Garnier) Date: Tue, 07 Feb 2006 08:46:30 +0100 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: <43E85056.2090608@trusted-logic.com> Hello, I think that the make-based build process is fine as it is, apart from the location of the Java source files. It is true that putting the Java source in a directory structure that map 1-to-1 to the Java package structure is the norm and should make it easier for everyone to modify the Java source, with or without an IDE. Ant is a good tool, but in the RXTX case I fail to see the advantage of using it compared to the current make-based process. As Trent said, they are more pressing issues, like testing. Regards, David Dmitry Markman wrote: > if I understands the issue right > in order to be able to use ant for c/c++ compilation > you have to install ant's cc task > http://ant-contrib.sourceforge.net/cc.html > > it looks like it should work on mac os x > (authors claim, that it's platform independent) > but I never tested > > so all you have to do it's providing right command line > for the gcc compiler > > > > > On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: > >>> rxtx_root_directory >>> `-- src >>> |-- main >>> | `-- java >>> | `-- gnu >>> | `-- io >>> `-- test >>> `-- java >>> `-- gnu >>> `-- io >>> >> >> >>> From what I understand this will just be good. >> >> For me it makes no difference. So lets do the rxtx thing. Let if >> fester for two weeks and if nobody objects, we will do it. >> >> I'm not doing this because I care. I'm doing this to eliminate much >> of my inbox. >> >> But test... man is rxtx lacking there in the community aspect. It is >> covered but not right. _maybe_ I can change that this year. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> (cat hurding since 1997) From tjarvi at qbang.org Tue Feb 7 01:11:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 01:11:31 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <43E85056.2090608@trusted-logic.com> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: On Tue, 7 Feb 2006, David Garnier wrote: > Hello, > > I think that the make-based build process is fine as it is, apart from the location of the Java > source files. It is true that putting the Java source in a directory structure that map 1-to-1 to > the Java package structure is the norm and should make it easier for everyone to modify the Java > source, with or without an IDE. > > Ant is a good tool, but in the RXTX case I fail to see the advantage of using it compared to the > current make-based process. As Trent said, they are more pressing issues, like testing. > Hi David I have more experience with testing rxtx than I can talk about. But let it be known, rxtx has gone trough 100's of hours of testing. We are hobby folks interested in toys but there is more. rxtx has had some of the best guidance in the industry there. This is not an easy thing. I may be able to come back in a month from the other side of the corperate fence and help. I suspect the tests could just be made public but they are in a very unusual environment that just wont work in a wider sense. This is something I'll be trying to change. At one point it was agreed we could just make the results public so this isnt just noise.. There is interest and I think its safe to mention that much. The big problem with testing in the past is most of it is done with a loopback connection. So we *still* have major questions regarding things like flow control. rxtx talks to itself over a loopback and it works. regardless of right or wrong. This requires more thought to be done right. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Feb 7 02:46:34 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 02:46:34 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: > The big problem with testing in the past is most of it is done with a > loopback connection. So we *still* have major questions regarding things > like flow control. rxtx talks to itself over a loopback and it works. > regardless of right or wrong. With serial communication there are gold standards. ckermit is probably a definitive 'standard.' Maybe its possible to do ping/pong tests with ckermit? Is it scriptable? There are known issues in rxtx. Probably the worst is some threading issues regarding some JREs with multiple JNI threads setting java variables. Man did I get schooled there. Just switch the c functions to returning variables and things go away. Sometimes they work fine, sometimes they blow up. Without understanding everything, somehow rhat got it right and debian (and especially gentoo) grabbed kernel patches causing all sort of harm. Its not hard to fix once you understand whats going on but nearly impossible to track with a debugger. So I have a good idea what 2.1-8 will have outside of the IDE modifications. rxtx 2.1-7 is a release for everyone to sync with. Its not even as stable as -pre17 as far as I know - I ran no test suites. I'll be chasing it too. We just had so many contributions that it was time. It seriously broke internal scheduals but thats a great thing :) The other thing I want to do in 2.1-8 is automagic baud rates. It turns out lots of shops are doing really funky baud rates for things like automobile test equipment. It is possible but it requires a fair amount of change in the native code. Is anyone looking at this? -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Feb 7 02:57:21 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 07 Feb 2006 04:57:21 -0500 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <43E85056.2090608@trusted-logic.com> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: Hi All, I agree, testing is very important. The problem I have been trying to address is related to cross-platform testing and the robust nature of the installs. Typically, I visit 3 platforms to deploy my product, windows, linux and mac. A build is performed on each platform. The idea that you can build for many platforms from one copy the source code seems attractive. This should enable synchronized deployments of identical code. The question of how to achieve this goal remains open. As Trent mentioned, this is hard. Perhaps Ant will help here (but perhaps not). Ant does seem to help with running unit tests. However, it does not help with multi-platform tests. For that you need many machines and different operating environments. Toward that end, I have created a multi-platform test that can be run from web start, located at: http://show.docjava.com:8086/book/cgij/code/jnlp/serialPort.PortTest.jnlp This is interesting because many people in the community can run the test and we can improve the test, as time permits. No, it is not a perfect solution, however, the idea does help with multi-platform tests using many machines and different operating environments. If the group has a good test for a general serial port set-ups, i would be happy to deploy it, for general evaluation using web start. And as for ANT, it is just an idea. Not all my ideas are good ones! - Doug >Hello, > >I think that the make-based build process is fine as it is, apart >from the location of the Java >source files. It is true that putting the Java source in a directory >structure that map 1-to-1 to >the Java package structure is the norm and should make it easier for >everyone to modify the Java >source, with or without an IDE. > >Ant is a good tool, but in the RXTX case I fail to see the advantage >of using it compared to the >current make-based process. As Trent said, they are more pressing >issues, like testing. > >Regards, >David > >Dmitry Markman wrote: >> if I understands the issue right >> in order to be able to use ant for c/c++ compilation >> you have to install ant's cc task >> http://ant-contrib.sourceforge.net/cc.html >> >> it looks like it should work on mac os x >> (authors claim, that it's platform independent) >> but I never tested >> >> so all you have to do it's providing right command line >> for the gcc compiler >> >> >> >> >> On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: >> >>>> rxtx_root_directory >>>> `-- src >>>> |-- main >>>> | `-- java >>>> | `-- gnu >>>> | `-- io >>>> `-- test >>>> `-- java >>>> `-- gnu >>>> `-- io >>>> >>> >>> >>>> From what I understand this will just be good. >>> >>> For me it makes no difference. So lets do the rxtx thing. Let if >>> fester for two weeks and if nobody objects, we will do it. >>> >>> I'm not doing this because I care. I'm doing this to eliminate much >>> of my inbox. >>> >>> But test... man is rxtx lacking there in the community aspect. It is >>> covered but not right. _maybe_ I can change that this year. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> (cat hurding since 1997) > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From matt.higgins at gmail.com Tue Feb 7 08:28:34 2006 From: matt.higgins at gmail.com (Matt Higgins) Date: Tue, 7 Feb 2006 10:28:34 -0500 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final Message-ID: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? import java.io.*; import java.util.*; import gnu.io.*; public class MySimpleRead implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; public static void main(String[] args) { boolean portFound = false; String defaultPort = "COM1"; if (args.length > 0) { defaultPort = args[0]; } portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; MySimpleRead reader = new MySimpleRead(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } } public MySimpleRead() { try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) { e.printStackTrace(); } try { inputStream = serialPort.getInputStream(); } catch (IOException e) { e.printStackTrace(); } try { serialPort.addEventListener(this); } catch (TooManyListenersException e) { e.printStackTrace(); } try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { e.printStackTrace(); } System.out.println("Baud is " + serialPort.getBaudRate()); System.out.println("Bits is " + serialPort.getDataBits()); System.out.println("Stop is " + serialPort.getStopBits()); System.out.println("Par is " + serialPort.getParity()); serialPort.notifyOnDataAvailable(true); readThread = new Thread(this); readThread.start(); } public void run() { // Thread.sleep(20000); //} catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { System.out.println("An event occurred " + event.getEventType()); switch (event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: byte[] readBuffer = new byte[20]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } System.out.print(new String(readBuffer)); } catch (IOException e) {} break; } } } --------------- Result on windows ------------------------------ Stable Library ============================================================== Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port:: COM1 Baud is 9600 Bits is 8 Stop is 1 Par is 0 ----------------- End Results ----------------------------------------- ------------------ Result on Linux ----------------------------------- Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 Found port: /dev/ttyS0 Baud is 9600 Bits is 8 Stop is 1 Par is 0 An event occurred 1 043100066224 ------------------ End Results --------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/a1431630/attachment-0013.html From brian at mbari.org Tue Feb 7 09:48:37 2006 From: brian at mbari.org (Brian Schlining) Date: Tue, 7 Feb 2006 08:48:37 -0800 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> Message-ID: <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> Hi Matt > The following code works fine on Linux but I never see any data > when run on Windows. This is a cut and paste from the SimpleRead > example. > I am attempting to read data from a bar code scanner. I can fire > up HyperTermianl on windows and see that the device is working > properly as I see the barcodes are scanned and echoed back to the > terminal. However when I run the app I don't see any data. It is > however associating with the com port as the informational bits > print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. Cheers Brian Schlining Software Engineer http://www.mbari.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/16d07f37/attachment-0013.html From lux at diesel-research.com Tue Feb 7 11:59:58 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 11:59:58 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139293215.3689.4.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> Message-ID: <1139338798.8145.4.camel@zd7280> Any ideas on this ? Any reason why portList.hasMoreElements() should be false even though there are devices in /dev ? On Mon, 2006-02-06 at 23:20 -0700, Kim Lux wrote: > I'm running the code below. > > portlist.hasMoreElements() is false. > > /dev has ports in it as listed below. > > What am I doing wrong ? > > > ========================================================== > // Step through the list of ports until we find one that matches > // the one we are looking for. > > portList = CommPortIdentifier.getPortIdentifiers(); > > while(portList.hasMoreElements()) > { > portID = (CommPortIdentifier) portList.nextElement(); // > if (portID.getName().equals("/dev/ttyUSB0")) > { > myTA.append("Serial port ttyUSB0 has been found\n"); > break; > }// if portID equals... > }// End of while... > ========================================================== > > ls -al /dev/tty* > crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty > crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 > crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 > crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 > crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 > ... > crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 > crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 > crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 > > > -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 12:20:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 12:20:25 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139338798.8145.4.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> Message-ID: On Tue, 7 Feb 2006, Kim Lux wrote: > > Any ideas on this ? Any reason why portList.hasMoreElements() should be > false even though there are devices in /dev ? > > > On Mon, 2006-02-06 at 23:20 -0700, Kim Lux wrote: >> I'm running the code below. >> >> portlist.hasMoreElements() is false. >> >> /dev has ports in it as listed below. >> >> What am I doing wrong ? >> >> >> ========================================================== >> // Step through the list of ports until we find one that matches >> // the one we are looking for. >> >> portList = CommPortIdentifier.getPortIdentifiers(); >> >> while(portList.hasMoreElements()) >> { >> portID = (CommPortIdentifier) portList.nextElement(); // >> if (portID.getName().equals("/dev/ttyUSB0")) >> { >> myTA.append("Serial port ttyUSB0 has been found\n"); >> break; >> }// if portID equals... >> }// End of while... >> ========================================================== >> >> ls -al /dev/tty* >> crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty >> crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 >> crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 >> crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 >> crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 >> ... >> crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 >> crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 >> crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 >> >> >> > Hi Kim What rxtx does is try to open the port and do a timed out read. If the kernel/... do not complain it's enumarted. I suspect you could do a crude test by doing something like cat /dev/ttyS0 > /dev/null If that barfs then rxtx wont enumerate the port. hmm looking at your question again, I suspect it's a lockfile problem. This is documented in INSTALL with the source. Its easy enough to test this too.. touch /var/lock/testingrxtxlockfiles && rm -f /var/lock/testingrxtxlockfiles If you are not in the right group it will bail. Root will work regardless. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 12:37:56 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 12:37:56 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> Message-ID: <1139341076.8145.11.camel@zd7280> Exactly which ports does rxtx attempt to put into the list ? /dev/* or /dev/tty* or /dev/tty[0-9[0-9] ? or /dev/ttyS* ? For the record, only /dev/ttyUSB0 is a valid port on the machine I am presently on. Will this be a problem ? On Tue, 2006-02-07 at 12:20 -0700, Trent Jarvi wrote: > This is documented in INSTALL with the source. > I was wondering where that file was. I will download source and dig it up. Thanks. -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 12:51:09 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 12:51:09 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139341076.8145.11.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: On Tue, 7 Feb 2006, Kim Lux wrote: > > Exactly which ports does rxtx attempt to put into the list ? /dev/* > or /dev/tty* or /dev/tty[0-9[0-9] ? or /dev/ttyS* ? > > For the record, only /dev/ttyUSB0 is a valid port on the machine I am > presently on. Will this be a problem ? > > > On Tue, 2006-02-07 at 12:20 -0700, Trent Jarvi wrote: >> This is documented in INSTALL with the source. >> > I was wondering where that file was. I will download source and dig it > up. > > Thanks. > Hmm I'm looking at pre17 so this may have changed. (its just what I have on this machine) if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA" // for the IPAQs }; CandidatePortPrefixes=Temp; } So you may need to add "ttyUSB" to that list. RXTX used to enumerate _everything_ see if(osName.equals("Linux-all-ports") But it became less than practical. This is all in RXTXCommDriver.java hmm I just did a cvs update. if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have to get your fingers into the code. We aim for sane defaults. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 13:06:45 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 13:06:45 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139342805.8145.22.camel@zd7280> On Tue, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > Hmm I'm looking at pre17 so this may have changed. (its just what I have > on this machine) > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA" // for the IPAQs > }; > CandidatePortPrefixes=Temp; > } > > > So you may need to add "ttyUSB" to that list. RXTX used to enumerate > _everything_ see if(osName.equals("Linux-all-ports") But it became less > than practical. > > This is all in RXTXCommDriver.java > > hmm I just did a cvs update. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have > to get your fingers into the code. We aim for sane defaults. Excellent. Thanks for taking the time. -- Kim Lux, Diesel Research Inc. From ideiglenes1 at freemail.hu Tue Feb 7 13:53:39 2006 From: ideiglenes1 at freemail.hu (--) Date: Tue, 07 Feb 2006 21:53:39 +0100 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139345619.22534.2.camel@localhost> Hi! I use this code to get all the extra Linux devices. :) if ("Linux".equals(System.getProperty("os.name"))) { System.setProperty("os.name","Linux-all-ports"); } driver = new RXTXCommDriver(); On k, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > On Tue, 7 Feb 2006, Kim Lux wrote: > > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have > to get your fingers into the code. We aim for sane defaults. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From matt.higgins at gmail.com Tue Feb 7 13:45:54 2006 From: matt.higgins at gmail.com (Matt Higgins) Date: Tue, 7 Feb 2006 15:45:54 -0500 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> Message-ID: <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> Sweet this is exactly what I needed. I was searching the archives through marc.theamisgroup they only have archives back to 1/3/05. Should have hit the mailman archive! Thanks a lot! On 2/7/06, Brian Schlining wrote: > > Hi Matt > > The following code works fine on Linux but I never see any data when run > on Windows. This is a cut and paste from the SimpleRead example. > I am attempting to read data from a bar code scanner. I can fire up > HyperTermianl on windows and see that the device is working properly as I > see the barcodes are scanned and echoed back to the terminal. However when I > run the app I don't see any data. It is however associating with the com > port as the informational bits print fine? > > > You're not the only one whose had this problem, I don't know if Trent has > addressed this is the latest release of RXTX but there is a workaround. > Here's the recent thread from the RXTX mailing list regarding this issues: > > Thanasis Delenikas tdelenik at gmail.com > Wed Jan 18 13:56:23 MST 2006 > > * Previous message: [Rxtx] Re: More close() performance fixes > * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] > > Hi all. > (I've subscribed again from my other email account). > > Trent, > > You are right. Linux *always* works, no matter what flow control you set. > Windows *works only* with hardware flow control (I haven't tested what > happens with software XON/XOFF flow control). > > I assume (but I am not certain) that even with no flow control at all, all > platforms should work. Without flow control, you have the risk of bumping > into overflow or framing errors, but that's your (the end programmer, I > mean) problem. > > >From my side, I shouldn't be working without flow control. That was a bug > too... It was some code forgotten from the old times, when I used to work > with phone emulation drivers which didn't support flow control. The > correct > way is to have some flow control enabled and that's why I suppose this is > a > low-severity bug for RxTx. > > I have no idea which platform shows the correct behaviour, since > my knowledge about Linux and the inner workings of these low-level i/o > operations is limited. > > Regards, > Thanasis Delenikas. > > > > > Message: 2 > > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > > From: Trent Jarvi > > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > > To: RXTX Developers and Users > > Message-ID: > > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > > > Hi all, > > > > > > Trent, I have found something. > > > I read your comment about flow control, so I experimented a bit. > > > > > > If you remember, in my sample program I've used no flow control at all > ( > > i.e. > > > Java constant FLOWCONTROL_NONE). > > > > > > Now, during testing, I've switch to hardware inbound flow control (i.e > . > > Java > > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > > beautifully! > > > > > > I think I will switch to H/W flow control and test things for a while, > > but > > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > > > > > Hi Thanasis, > > > > I'm fairly sure you have identified a bug. I would not worry too much > > about what Sun CommAPI w32 defaults are. I think they did more or less > > whatever the port opened with. Just a guess. Linux tries to stomp on > > ports so they are all the same. > > > > So this started out with Linux worked, Windows XP/.. did not as I > recall. > > Something is wrong in rxtx. Do I understand this right? > > > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > > > Perhaps there is something Wayne or I did not understand when we wrote > > that code. I wasnt programming back in the BBS days so modems are not > my > > thing. I have a few questions. > > > > Is the above matrix confirmed by observation? > > Linux just always worked? > > Which one _should_ work? I'm guessing modems work with hardware flow > > control. I'll have to dig around. > > > > The windows flow control changes a couple things with hardware flow > > control. Following the w32 API documentation is confusing sometimes. > > But it looks like Linux could have a bug too. > > Cheers > > Brian Schlining > Software Engineer > http://www.mbari.org > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/9c989144/attachment-0013.html From tjarvi at qbang.org Tue Feb 7 14:06:14 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 14:06:14 -0700 (MST) Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> Message-ID: >> >> You're not the only one whose had this problem, I don't know if Trent has >> addressed this is the latest release of RXTX but there is a workaround. >> Here's the recent thread from the RXTX mailing list regarding this issues: >> I have not. I expect to have access to some test equipment next month and I'll go through all of this. I really don't know whats going on and I need a gold standard. I thought maybe linux was autodetecting the flow control. Your observations would certainly be welcome. I need to talk to Russell King and see what he is doing. Until then I'd just be toying around over a loopback as usual. This is very high on the list though. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 17:25:05 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 17:25:05 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139358305.17994.2.camel@zd7280> My application now works. I installed the libraries and jar from 2.1-7 (Final). portlist.hasMoreElements is no longer false. The application finds the port for /dev/ttyUSB0. Thanks for your help, Trent (et al) Sorry I bothered you with this. Next time I will look in the source first. I didn't think it was an rxtx issue, I thought it was a Linux setup issue . On Tue, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > Hmm I'm looking at pre17 so this may have changed. (its just what I > have > on this machine) > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux > Serial Ports > "ttySA" // for the > IPAQs > }; > > CandidatePortPrefixes=Temp; > } > > > So you may need to add "ttyUSB" to that list. RXTX used to enumerate > _everything_ see if(osName.equals("Linux-all-ports") But it became > less > than practical. > > This is all in RXTXCommDriver.java > > hmm I just did a cvs update. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux > Serial Ports > "ttySA", // for the > IPAQs > "ttyUSB" // for USB > frobs > }; > > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you > have > to get your fingers into the code. We aim for sane defaults. -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 19:21:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 19:21:54 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139358305.17994.2.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> <1139358305.17994.2.camel@zd7280> Message-ID: >Sorry I bothered you with this. Next time I will look in the source >first. I didn't think it was an rxtx issue, I thought it was a Linux >setup issue . Why would you be sorry? I would have done the same. I'm glad it's working :) -- Trent Jarvi tjarvi at qbang.org From tma at mail.island.net Wed Feb 8 13:39:35 2006 From: tma at mail.island.net (Tom Alldread) Date: Wed, 08 Feb 2006 12:39:35 -0800 Subject: [Rxtx] Win32/Linux Serial Port Data Dropouts In-Reply-To: <200602060702.k167255O007882@www.qbang.org> References: <200602060702.k167255O007882@www.qbang.org> Message-ID: <43EA5707.4020200@mail.island.net> Greetings Folks at RXTX: During the last couple of months I have been alternately testing with javax.comm 2 and RXTX 2.1 under Windows XP and CommApi 3 and RXTX 2.1 under Suse 10.0 Linux. In the process I have learned a little about java multi-threading under NetBeans 5 with Profiler. My java (jdk 1.5_06) application is used for data acquisition and provides a graphical display of A-D conversion data received from a 56KBaud serial port. The actual data throughput is about 10KBaud thus it is well below the speed of the port. I use hardware RTS/CTS flow control which can stall the data acquisition sample rate if necessary. This ensures the display computer has the ability to slow the data acquisition rate should it become too busy to accept the regular data flow. Both the serial port buffer and the java read buffer are set at 16KB. Usually the data transfers into the java read buffer are less than 100 bytes unless the data acquisition is recovering from a stall. The data flow normally hesitates after each 5 KB block as a continue command is needed from the display computer to start the drawing of a new graphics display line. Separate threads have been provided for the serial port event monitoring and data processing. The serial port event thread has been given the maximum priority and data processing thread the minimum priority provided by java. Thread yield statements have been placed within all data processing while/for loops as an effort to ensure quick access to CPU cycles for the serial port event thread. I have found that short data transmissions are essentially error free but occasional dropouts occur with continuous data flow especially under Windows XP. ....................................................................................................................................................................................... Linux results: I am happy to report that RXTX 2.1 appears to work very well under Linux although I did notice some errors when the screen savers were running with my dual monitors. I believe this is a local problem associated with my dual graphics which needs further attention. The recent CommApi 3 Linux release from Sun did not work at all with my program. It seemed to send commands out OK but did not receive any data. Although the serial port event triggered the ISR, the input stream appeared filled with nulls and thus did not contain any data. As my understanding is that CommApi 3 was tested with a Red Hat distribution of Linux I wonder if this problem is distro dependent? Although somewhat off topic here I wonder if anyone reading this has had similar experience? .................................................................................................................................................................................. Windows XP results: There are problems with occasional data dropouts which become more frequent as the sampling rate is increased or if the computer becomes busy with other duties. The dropouts typically consist of a half dozen byte block of lost data. It appears the lost bytes never get added to the java input stream. There has not been any indication of garbled data, overruns or framing errors which suggests the UART communications remains solid. Using javax.comm 2 I found that the setting of SerialPort 'enableReceiveThreshold' to 40 and 'enableReceiveTimeout' of 100mS reduced the dropouts error rate significantly. I found that I could not get RXTX 2.1 to function with the aforementioned threshold and timeout settings. The javax.comm 2 interface is consequently performing better for me under Windows than RXTX 2.1. I wonder if anyone here has any suggestions as to what I might try to improve RXTX 2.1? Although my settings are the same as under Suse 10.0, RXTX 2.1 performs much better for me under Linux than any of the alternatives that I have tried under Windows XP . ............................................................................................................................................................................... I would like to establish, based on the experience of others, if I have reached the normally expected performance limit of java serial port communications? Should I expect to achieve virtually error free serial port data input from a continuous stream under Windows XP java software? I am considering changing my protocol to packets with error checking if necessary but would like to know if the dropout problems I am experiencing are typical or not before I take this rather work intensive plunge. Many thanks in advance for any help! Best Regards, Tom Alldread -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.375 / Virus Database: 267.15.2/253 - Release Date: 2006-02-07 From jlaxson at mac.com Wed Feb 8 23:56:48 2006 From: jlaxson at mac.com (John Laxson) Date: Thu, 9 Feb 2006 00:56:48 -0600 Subject: [Rxtx] PortInUseException: Unknown Application on OSX Message-ID: Hi, I've been trying to get RXTX 2.1.7 going on Mac OS X for a while here, and am running up into a wall here. I've tried with pre- compiled and the source version and get the same problem, a gnu.io.PortInUseException: Unknown Application. I have run the fixperms script included with the source distribution, and id shows me as a member of the uucp group, and permissions on /var/spool/uucp are 775 root:uucp. Running a test program (included at the bottom for clarity) lets me enumerate all the serial ports correctly, but trying to open any of them gives the PortInUseException. If it helps, when I try to open a port that's set to make an outgoing bluetooth connection, there is no delay and no connection attempt at all. Thanks, John Laxson PS: The documentation wiki on qbang.org shows 404, and has for a few days now. My test code: public static void main(String[] args) { SerialPort serialPort; try { Enumeration e = CommPortIdentifier.getPortIdentifiers(); CommPortIdentifier ident; while (e.hasMoreElements()) { ident = (CommPortIdentifier)e.nextElement(); System.out.println(ident.getName()); } ident = CommPortIdentifier.getPortIdentifier("/dev/cu.modem"); serialPort = (SerialPort) ident.open("Me", 5000); } catch (Exception e) { e.printStackTrace(); } } From rajesh.invincible at gmail.com Thu Feb 9 03:39:38 2006 From: rajesh.invincible at gmail.com (Rajesh N) Date: Thu, 9 Feb 2006 16:09:38 +0530 Subject: [Rxtx] Re: Move .java Files in gnu.io filesystem hierarchy - Maven (2) In-Reply-To: <43DF21D2.7090200@ngi.it> References: <43DF21D2.7090200@ngi.it> Message-ID: <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Can anybody tell me how to overcome these EXCEPTIONS I AM WORKING ON SERIAL COMMN IN JAVA ON LINUX. 1. " NOT ALL PARAMETERS SUPPORTED BY THE KERNEL" This i came across the following statement inmy prog. SerialP is A SerialPort object SerialP.setSerialPortParams(9600(BAUDRATE),DATABITS_8,STOPBITS_1,PARITY_NONE) 2. NullPointer Exception at Event Dispatch Now i have checked all my object references for a null reference but i found none i have put up my entire code in try catch blocks but still I AM UNABLE TO CATCH THIS EXCEPTION AND HENCE MY APPLICATION CLOSES HOW DOES THESE GO? PLEASE HELP ME IT IS URGENTTTTTTTTTTTTTTTT yours sincerely RAJESH On 1/31/06, Fabio Frumento wrote: > Hi Xavier, > > I don't know maven at all but the directory hierarchy listed buy Trent > is fine for me... > > I'll take a look to maven, it seems an interesting project > > Regards > > Fabio Frumento > > Trent Jarvi wrote: > > On Tue, 31 Jan 2006, Xavier Frisaye wrote: > > > >> Hi all, > >> > >> If you are going to rearrange the src folder, i will propose to use > >> maven 2 and follow its directory structure > >> > (http://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html). > >> > >> Maven 2 simplify java project and give a standard way to make projects > >> (http://maven.apache.org/). > >> We are using it for internal projects and we are very satisfied. > >> > >> Is anybody interested? > >> > >> I'm not an expert in maven 2 (yet) but i'm agree to help using it if > >> you choose to make so. > >> > > > > so this would be: > > > > rxtx-devel/src/main/java/gnu.io > > rxtx-devel/src/test/java/ManIwish.java > > > > I don't use IDEs very much so I'll let others comment. But I don't see > > a problem with that. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Thu Feb 9 09:50:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 9 Feb 2006 09:50:31 -0700 (MST) Subject: [Rxtx] Re: Move .java Files in gnu.io filesystem hierarchy - Maven (2) In-Reply-To: <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Message-ID: On Thu, 9 Feb 2006, Rajesh N wrote: > Can anybody tell me how to overcome these EXCEPTIONS > I AM WORKING ON SERIAL COMMN IN JAVA ON LINUX. > > 1. " NOT ALL PARAMETERS SUPPORTED BY THE KERNEL" > > This i came across the following statement inmy prog. > SerialP is A SerialPort object > SerialP.setSerialPortParams(9600(BAUDRATE),DATABITS_8,STOPBITS_1,PARITY_NONE) > Strange. The parameters you use are the same the port should open with by default. Could you paste the actual exception you are getting? I don't see that in the rxtx source. Also it would help to know the rxtx version. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Fri Feb 10 15:29:05 2006 From: lux at diesel-research.com (Kim Lux) Date: Fri, 10 Feb 2006 15:29:05 -0700 Subject: [Rxtx] One serial port object for both sending and receiving ? Message-ID: <1139610545.18177.4.camel@zd7280> Is it OK to use one SerialPort ojbect (ex Serial Port serialPort;) and use it for both sending and receiving ? For example: ======================================================================== static SerialPort serialPort = null; static OutputStream serialOut = null; static InputStream serialIn = null; // assign it to an outputStream for use try{ serialOut = serialPort.getOutputStream(); System.out.println("Serial output stream has been assigned."); }//try catch(IOException e) { System.out.println("Error: Couldn't assign output stream to serial port."); }//catch //assign it to an inputStream for use try{ serialIn = serialPort.getInputStream(); System.out.println("Serial input stream has been assigned."); }//try catch(IOException e) { System.out.println("Error: Couldn't assign input stream to serial port."); }//catch ======================================================================== -- Kim Lux, Diesel Research Inc. From lux at diesel-research.com Fri Feb 10 21:23:00 2006 From: lux at diesel-research.com (Kim Lux) Date: Fri, 10 Feb 2006 21:23:00 -0700 Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Message-ID: <1139631780.23882.10.camel@zd7280> I've got a problem receiving chars with my version of serialRead, written in an SWT GUI. I had a Java pro have a good look at my code and he can't see anything wrong with it. I can send chars fine. When I receive a char the cpu usage for the app goes to 100% and the code in the serial event handler doesn't get executed. The instructions on the Java Comm Serial API How-To for Linux page state that I must install javacomm. Is that true ? Everything builds without it and I can send chars on rxtx just fine, but I can't receive them. Could this be the problem ? I downloaded and installed javacomm. I was not able to add "Driver=gnuio.RXTXCommDriver to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 installed in /usr/java/jre1.5.0_05. I added comm.jar to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext to the library paths. Is this OK ? Does it matter that I am receiving on /dev/ttyUSB0 ? Thanks. -- Kim Lux, Diesel Research Inc. From lunareclipse03 at web.de Sat Feb 11 09:44:46 2006 From: lunareclipse03 at web.de (lunareclipse03@web.de) Date: Sat, 11 Feb 2006 17:44:46 +0100 Subject: [Rxtx] Question about Serial I/O under Win32 Message-ID: <662084330@web.de> Hello everybody, I have a strange problem with a piece of code I made for myself. No, this is not really concerning rxtx, but nevertheless I post this to the list, hoping that some of you can help me. I've written two libraries, one for linux and one for win32. The linux port works quite well, I can send / receive faxes and / or replay voice messages over the telephone line using a voice modem. But the win32 port of the library causes some trouble. If, for example, I send out a fax with a certain modem under linux, it works well. The fax is complete when it comes out of the fax machine. If I then use the same modem to send out a fax under win32, the fax coming out of the fax machine gets "stuck" halfways, but the sending modem thinks that transmission was ok and drops the connection. The answering fax machine then gives me "error while receiving." The "upper layer" java code MUST be right, because if I do the same thing under linux (using the linux library), everything is alright. Now I have to ask: Can somebody please help me out with this??!? Could it be the case that some kind of flow control or COMMTIMEOUTS setting causes this behaviour? I set flow control to RTS/CTS before sending out a fax. How can I DISABLE flow control? Or what do you think? Can something else cause this problems? Thank you all for your time and PLEASE write back soon. Regards, --Sven Ahlemann Am Waldrand 31 45721 Haltern am See Germany ______________________________________________________________ Verschicken Sie romantische, coole und witzige Bilder per SMS! Jetzt bei WEB.DE FreeMail: http://f.web.de/?mc=021193 From lux at diesel-research.com Sat Feb 11 10:06:52 2006 From: lux at diesel-research.com (Kim Lux) Date: Sat, 11 Feb 2006 10:06:52 -0700 Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: <1139631780.23882.10.camel@zd7280> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> <1139631780.23882.10.camel@zd7280> Message-ID: <1139677612.3431.5.camel@zd7280> More on this problem. I copied and pasted simpleRead into a console based Eclipse project and I've got the same result, except that cpu usage doesn't go to 100%. I'm beginning to think there is an issue in rxtx. My imports for simpleRead are: ============================ import gnu.io.*; import java.util.*; //import javax.comm.*; import java.io.*; =========================== Any ideas ? I am trying to read from /dev/ttyUSB0 using a serial to USB adapter which has worked well with minicom and gtkterm. Thanks. On Fri, 2006-02-10 at 21:23 -0700, Kim Lux wrote: > I've got a problem receiving chars with my version of serialRead, > written in an SWT GUI. > > I had a Java pro have a good look at my code and he can't see anything > wrong with it. > > I can send chars fine. When I receive a char the cpu usage for the app > goes to 100% and the code in the serial event handler doesn't get > executed. > > The instructions on the Java Comm Serial API How-To for Linux page state > that I must install javacomm. Is that true ? Everything builds without > it and I can send chars on rxtx just fine, but I can't receive them. > Could this be the problem ? > > I downloaded and installed javacomm. I was not able to add > "Driver=gnuio.RXTXCommDriver > to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not > have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 > installed in /usr/java/jre1.5.0_05. I added comm.jar > to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext > to the library paths. Is this OK ? > > Does it matter that I am receiving on /dev/ttyUSB0 ? > > Thanks. > -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Sun Feb 12 21:01:33 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:01:33 -0700 (MST) Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: <1139677612.3431.5.camel@zd7280> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> <1139631780.23882.10.camel@zd7280> <1139677612.3431.5.camel@zd7280> Message-ID: I suspect what is happening is the select() is breaking out in the native code but the driver does not have support for notifying there are X bytes available. On some traditional Unix based systems, the only way you know data is available is the fd status changes and do an FIORDCHK ioctl. Or perhaps the only thing you can know is the fd status changed. It would take reading through the kernel driver code to know for sure. So on USB, depending upon the driver, the same may need to be done or the driver improved a bit if possible to support. Polling reads will also work but don't use the event driven model of CommAPI which isnt acceptable in the long run. The 100% cpu usage can then be explained because select no longer blocks until the data is read; the eventLoop spins loose. You can put a well placed sleep but rxtx only expects those are needed when it knows data is available. This may not be a super simple thing to understand and fix. I do have ideas to get you started. I'm going to be short on time the next couple weeks. I expect to put some good time in and answer some other questions I saw around the 25th. For now, I'd look at the following and go from there with the hints I've given. JNIEXPORT jint JNICALL RXTXPort(nativeavailable)( JNIEnv *env, jobject jobj ) { int fd = get_java_var( env, jobj,"fd","I" ); int result; /* char message[80]; ENTER( "RXTXPort:nativeavailable" ); On SCO OpenServer FIONREAD always fails for serial devices, so try ioctl FIORDCHK instead; will only tell us whether bytes are available, not how many, but better than nothing. This turns out to be true on Solaris also. taj. */ #ifdef FIORDCHK /* __unixware__ __sun__ probably others */ result = ioctl(fd, FIORDCHK, 0); #else if( ioctl( fd, FIONREAD, &result ) < 0 ) { goto fail; } #endif /* FIORDCHK */ On Sat, 11 Feb 2006, Kim Lux wrote: > > More on this problem. I copied and pasted simpleRead into a console > based Eclipse project and I've got the same result, except that cpu > usage doesn't go to 100%. I'm beginning to think there is an issue in > rxtx. > > My imports for simpleRead are: > > ============================ > import gnu.io.*; > import java.util.*; > //import javax.comm.*; > import java.io.*; > =========================== > > Any ideas ? I am trying to read from /dev/ttyUSB0 using a serial to > USB adapter which has worked well with minicom and gtkterm. > > Thanks. > > > > On Fri, 2006-02-10 at 21:23 -0700, Kim Lux wrote: >> I've got a problem receiving chars with my version of serialRead, >> written in an SWT GUI. >> >> I had a Java pro have a good look at my code and he can't see anything >> wrong with it. >> >> I can send chars fine. When I receive a char the cpu usage for the app >> goes to 100% and the code in the serial event handler doesn't get >> executed. >> >> The instructions on the Java Comm Serial API How-To for Linux page state >> that I must install javacomm. Is that true ? Everything builds without >> it and I can send chars on rxtx just fine, but I can't receive them. >> Could this be the problem ? >> >> I downloaded and installed javacomm. I was not able to add >> "Driver=gnuio.RXTXCommDriver >> to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not >> have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 >> installed in /usr/java/jre1.5.0_05. I added comm.jar >> to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext >> to the library paths. Is this OK ? >> >> Does it matter that I am receiving on /dev/ttyUSB0 ? >> >> Thanks. >> > From tjarvi at qbang.org Sun Feb 12 21:03:30 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:03:30 -0700 (MST) Subject: [Rxtx] One serial port object for both sending and receiving ? In-Reply-To: <1139610545.18177.4.camel@zd7280> References: <1139610545.18177.4.camel@zd7280> Message-ID: On Fri, 10 Feb 2006, Kim Lux wrote: > > Is it OK to use one SerialPort ojbect (ex Serial Port serialPort;) and > use it for both sending and receiving ? > > For example: > > ======================================================================== > static SerialPort serialPort = null; > static OutputStream serialOut = null; > static InputStream serialIn = null; > > > > > // assign it to an outputStream for use > try{ > serialOut = serialPort.getOutputStream(); > System.out.println("Serial output stream has been assigned."); > }//try > catch(IOException e) > { > System.out.println("Error: Couldn't assign output stream to serial > port."); > }//catch > > > //assign it to an inputStream for use > try{ > serialIn = serialPort.getInputStream(); > System.out.println("Serial input stream has been assigned."); > }//try > catch(IOException e) > { > System.out.println("Error: Couldn't assign input stream to serial > port."); > }//catch This should be fine. In fact trying to do it another way will probably not work as you will run into lockfile issues. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun Feb 12 21:13:13 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:13:13 -0700 (MST) Subject: [Rxtx] Question about Serial I/O under Win32 In-Reply-To: <662084330@web.de> References: <662084330@web.de> Message-ID: On Sat, 11 Feb 2006 lunareclipse03 at web.de wrote: > Hello everybody, > > I have a strange problem with a piece of code I made for myself. No, > this is not really concerning rxtx, but nevertheless I post this to the > list, hoping that some of you can help me. I've written two libraries, > one for linux and one for win32. The linux port works quite well, I can > send / receive faxes and / or replay voice messages over the telephone > line using a voice modem. But the win32 port of the library causes some > trouble. If, for example, I send out a fax with a certain modem under > linux, it works well. The fax is complete when it comes out of the fax > machine. If I then use the same modem to send out a fax under win32, the > fax coming out of the fax machine gets "stuck" halfways, but the sending > modem thinks that transmission was ok and drops the connection. The > answering fax machine then gives me "error while receiving." The "upper > layer" java code MUST be right, because if I do the same thing under > linux (using the linux library), everything is alright. Now I have to > ask: Can somebody please help me out with this??!? Could it be the case > that some kind of flow control or COMMTIMEOUTS setting causes this > behaviour? I set flow control to RTS/CTS before sending out a fax. How > can I DISABLE flow control? Or what do you think? Can something else > cause this problems? Thank you all for your time and PLEASE write back > soon. > Hi Sven I'm not too willing to talk about flow control at the low level until I confirm some things with test equipment later. It is not clear if you are using rxtx or writing your own native code. So I'm not sure how to answer much of this :) If you are wondering how to change the flow control using rxtx from java, The BlackBox example from Sun flips this back and forth. SerialPort.java in rxtx 2.1 uses the following: SerialPort.java: public static final int FLOWCONTROL_NONE =0; SerialPort.java: public static final int FLOWCONTROL_RTSCTS_IN =1; SerialPort.java: public static final int FLOWCONTROL_RTSCTS_OUT =2; SerialPort.java: public static final int FLOWCONTROL_XONXOFF_IN =4; SerialPort.java: public static final int FLOWCONTROL_XONXOFF_OUT=8; So if you set flowcontrol to RTSCTS, you can set it to NONE to turn it off. If you are looking for how to do it in native code, the rxtx Source is SerialImp.c (unix/linux/mac os x/w32) and termios.c (w32 only with SerialImp.c) You can track the code: SerialImp.c:JNIEXPORT void JNICALL RXTXPort(setflowcontrol)( JNIEnv *env, jobject jobj, jint flowmode ) termios.c:int tcgetattr( int fd, struct termios *s_termios ) termios.c:int tcsetattr( int fd, int when, struct termios *s_termios ) There may be a problem in the rxtx flow control code though. Rather than guess, I want to test this with a gold standard. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Feb 6 00:00:16 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 00:00:16 -0700 (MST) Subject: [Rxtx] wiki delay until tomorrow night. In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: On Sun, 5 Feb 2006, Trent Jarvi wrote: > On Sun, 5 Feb 2006, Kim Lux wrote: > >> usb ? Tell me more... I need that too. > > usb is a very proper design. Thats all it is. > Maybe rxtx could help usb. But it would start with helping bring back the community that was already there. It's not something I'd love to do but maybe its the right thing to do. It would probably take 2 years to do right. But maybe thats better than what we have now. I honestly don't know what IBM is doing which could just run over everything. Just some thoughts after some fine german wine. -- Trent Jarvi tjarvi at qbang.org From gadelavega at yahoo.com.ar Mon Feb 6 02:17:05 2006 From: gadelavega at yahoo.com.ar (Gonzalo A. de la Vega) Date: Mon, 06 Feb 2006 10:17:05 +0100 Subject: [Rxtx] Serial port ownership question In-Reply-To: References: <20060205113618.30274.qmail@web53501.mail.yahoo.com> <1139157422.4553.9.camel@zd7280> <1139158698.4936.9.camel@zd7280> Message-ID: <43E71411.4050402@yahoo.com.ar> On my Fedora Core 4: ls -l /dev/ttyS* crw-rw---- 1 root uucp 4, 64 Feb 6 2006 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Feb 6 2006 /dev/ttyS1 ... and: grep "ttyUSB" /etc/udev/rules.d/50-udev.rules KERNEL=="ttyUSB*", GROUP="uucp", MODE="0660" So anyone in the "uucp" group can use serial ports. On Gentoo the group is "tty". Trent Jarvi escribi?: > > > On Sun, 5 Feb 2006, Dr. Douglas Lyon wrote: > >> I can confirm that this is the case (only root ownership of >> serial ports, under fedora 4). >> Wow, what were they thinking?! >> - DL >> >>> I've found that the newer kernels have the serial ports owned by root. >>> For example, >>> >>> $ls -al /dev/tty* >>> crw-rw-rw- 1 root root 5, 0 Feb 5 02:06 /dev/tty >>> crw-rw---- 1 root root 4, 0 Feb 5 02:06 /dev/tty0 >>> crw------- 1 root root 4, 1 Feb 5 09:07 /dev/tty1 >>> crw-rw---- 1 root tty 4, 10 Feb 5 02:06 /dev/tty10 >>> crw-rw---- 1 root tty 4, 11 Feb 5 02:06 /dev/tty11 >>> ... > > > This is just not a problem jcp or such are going to solve. Its a > platform spitwad fight. But do look at pam. In fact thats what Sun > is doing too. Maybe Linux followed their lead.. I'm not a pam guy. > I've spent 16 hours trying to understand it but your users wont :) > > Solution? I have no clue. Its two tangent mentalities from my > perspective. > > -- > Trent Jarvi > tjarvi at qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mtnvega at yahoo.com.br Mon Feb 6 05:35:43 2006 From: mtnvega at yahoo.com.br (Luiz Jr) Date: Mon, 6 Feb 2006 12:35:43 +0000 (GMT) Subject: [Rxtx] Documentation Wiki In-Reply-To: <1139157422.4553.9.camel@zd7280> Message-ID: <20060206123543.57256.qmail@web53515.mail.yahoo.com> Hello, Thank you for you answer, but so the usage of the API is pretty much like the Java Communications Api? If yes, what version of the Java Comm Api? Thank you, Luiz A. Brandao Jr Kim Lux escreveu: On Sun, 2006-02-05 at 08:36 -0300, Luiz Jr wrote: > Hello, > > I want to start using the RXTX libraries, but I would to know how, > since I can not access the documentation wiki page I just started using them yesterday. Below is how I installed the libraries, if that helps. I used snippets of code from the SimpleWrite application here to get me going. http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html Instead of "import javax.comm.*;", use "import gnu.io.*;" which is gotten from RXTXcomm.jar, which you will need to include in your project references. I am working in Eclipse. BTW: there is no way to open a port without going through the port list and finding it. Maybe sometime in the future someone (me ?) will write a method called openSerialPort that allows the user to give a port identifier, such as "/dev/tty1" and return a port ready to use. It wouldn't take much to write that and it would save users a lot of code. Hope this helps. ======================================================================= 1) Figure out which java you are running, incase there is more than one installed. $ java -version java version "1.5.0_05" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_05-b05) Java HotSpot(TM) Client VM (build 1.5.0_05-b05, mixed mode, sharing) 2) Find all the jre directories and the one from which you are currently running. kfind (jre) 3) cd to that directory plus /lib/i386 cd /usr/java/jre1.5.0_05/lib/i386 4) Copy the library files (*.so) to that directory. cp /home/krlux/Desktop/'Java Controls'/rxtx-linux/bin/* . 5) Check that the copy was successful ls librxtx* librxtxI2C.so librxtxRaw.so librxtxSerial.so librxtxParallel.so librxtxRS485.so 6) cd to the /lib/ext directory for your java. cd /usr/java/jre1.5.0_05/lib/ext 7) Copy the Jar files there cp /home/krlux/Desktop/'Java Controls'/rxtx-linux/lib/ext/* . 8) Check that it was successful ls RXTX* RXTXcomm.jar Rxtx is now installed on your machine ready to use. =================================================================== -- Kim Lux, Diesel Research Inc. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx --------------------------------- Yahoo! Acesso Gr?tis - Internet r?pida e gr?tis. Instale o discador agora! -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/544aa403/attachment-0014.html From lyon at docjava.com Mon Feb 6 05:49:34 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 06 Feb 2006 07:49:34 -0500 Subject: [Rxtx] wiki delay until tomorrow night. In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: Hi All, I have often thought about USB drivers being needed. For example, the ironman watch will not interface to a mac (windows only). It is USB. My dymo label writer has no Java driver (native only). Etc. Most cheap web cameras are USB (and Java drivers go through JAI, if it supports the camera at all). The JAI code shows how sun did the USB drivers. You have to be a member of the jai project to download the source code. https://jai.dev.java.net has the jai distro. And then you are not allowed to redistribute it. However, we can all learn from it (if so inclined). Basically: cvs -d :pserver:lyon at cvs.dev.java.net:/cvs login cvs -d :pserver:lyon at cvs.dev.java.net:/cvs checkout jai-core You will need to user your own uid and pw to get in. The ant build has over 100 warnings from sun deprecations of its own code. You might say that they were hoisted on their own Picard ;) One interesting thing is that they support several platforms: linux-amd64 64-bit Linux-AMD64 linux-i586 32-bit Linux-x86 solaris-amd64 64-bit Solaris-AMD64 solaris-i586 32-bit Solaris-x86 solaris-sparc 32-bit Solaris-SPARC solaris-sparcv9 64-bit Solaris-SPARC windows-i586 32-bit Windows-x86 Thus, ant is used to provide a multi-platform native method distro. Neat. How do they do it? check this out: And: The core download does not contain any C source code (it was all pre-built). Basically, they are just copying .so and .dll files into build directories. I would love to see the C code for this...but Sun does not post it on the https://jai.dev.java.net site. I don't know why...Perhaps I missed it. - Doug >On Sun, 5 Feb 2006, Trent Jarvi wrote: > >>On Sun, 5 Feb 2006, Kim Lux wrote: >> >>>usb ? Tell me more... I need that too. >> >>usb is a very proper design. Thats all it is. >> > >Maybe rxtx could help usb. But it would start with helping bring >back the community that was already there. > >It's not something I'd love to do but maybe its the right thing to do. > >It would probably take 2 years to do right. But maybe thats better >than what we have now. > >I honestly don't know what IBM is doing which could just run over everything. > >Just some thoughts after some fine german wine. > >-- >Trent Jarvi >tjarvi at qbang.org > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tdelenik at gmail.com Mon Feb 6 05:56:32 2006 From: tdelenik at gmail.com (Thanasis Delenikas) Date: Mon, 6 Feb 2006 14:56:32 +0200 Subject: Fwd: [Rxtx] Documentation Wiki In-Reply-To: <1139157422.4553.9.camel@zd7280> References: <20060205113618.30274.qmail@web53501.mail.yahoo.com> <1139157422.4553.9.camel@zd7280> Message-ID: <310a1a930602060456t129f1dc6p5f2b908f13ab5a0b@mail.gmail.com> Hello all, Kim, this is a snippet from the code I use. The closest to directly opening a specific port without enumeration. << ... portId = CommPortIdentifier.getPortIdentifier(getPort()); serialPort = (SerialPort) portId.open("jSMSEngine", 1971); ... >> where getPort() return the string identifier of the port, i.e. "/dev/ttyS0" or "COM1" or whatever. Thanasis. ---------- Forwarded message ---------- From: Kim Lux Date: Feb 5, 2006 6:37 PM Subject: Re: [Rxtx] Documentation Wiki To: RXTX Developers and Users BTW: there is no way to open a port without going through the port list and finding it. Maybe sometime in the future someone (me ?) will write a method called openSerialPort that allows the user to give a port identifier, such as "/dev/tty1" and return a port ready to use. It wouldn't take much to write that and it would save users a lot of code. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/182ab5b8/attachment-0014.html From tjarvi at qbang.org Mon Feb 6 11:53:57 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 11:53:57 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: On Mon, 6 Feb 2006, Dr. Douglas Lyon wrote: > Hi All, > I have often thought about USB drivers being needed. > For example, the ironman watch will not interface > to a mac (windows only). It is USB. > My dymo label writer has no Java driver (native only). > Etc. > Most cheap web cameras are USB (and Java drivers go > through JAI, if it supports the camera at all). > The JAI code shows how sun did the USB drivers. > You have to be a member of the jai project to download > the source code. > https://jai.dev.java.net has the jai distro. > And then you are not allowed to redistribute it. However, > we can all learn from it (if so inclined). Basically: > cvs -d :pserver:lyon at cvs.dev.java.net:/cvs login > cvs -d :pserver:lyon at cvs.dev.java.net:/cvs checkout jai-core > You will need to user your own uid and pw to get in. > The ant build has over 100 warnings from sun deprecations > of its own code. > > You might say that they were hoisted on their own Picard ;) > > One interesting thing is that they support several platforms: > linux-amd64 64-bit Linux-AMD64 > linux-i586 32-bit Linux-x86 > solaris-amd64 64-bit Solaris-AMD64 > solaris-i586 32-bit Solaris-x86 > solaris-sparc 32-bit Solaris-SPARC > solaris-sparcv9 64-bit Solaris-SPARC > windows-i586 32-bit Windows-x86 > Thus, ant is used to provide a multi-platform native method distro. > Neat. > How do they do it? > check this out: > > > > > > > > > > > > > And: > > > > > > > > > > The core download does not contain any C source code (it was all pre-built). > Basically, they are just copying .so and .dll files into build directories. > > I would love to see the C code for this...but Sun does not post it on the > https://jai.dev.java.net site. > > I don't know why...Perhaps I missed it. > > - Doug > > I've looked at moving rxtx to Ant builds. I think that would help IDEs a great deal. I requested a evalutation desk copy the O'Reilly Ant book for some j2ee material I was teaching. http://www.oreilly.com/catalog/anttdg/ It has a one sentence mention of JNI. So there was not luck there. I saw that there is another Ant book that does mention JNI more. I can't find it now. Ant must be able to support it with extensions. http://ant.apache.org/manual/OptionalTasks/javah.html What the auto(break :) tools do in the rxtx build is 4 things really. 1) gcc compile flags 2) ld compile flags 3) config.h 4) compile flags for customizing rxtx (lockfiles, ...) See 1 All of this information except 4 can be static once obtained. So I'm not attached to the auto tools. If I could find an example of Ant being used for JNI code, I'd be one of the first to start moving that direction. Maybe someone saw an example someplace. The other thing we have not completed discussing is the directory structure. There is interest in making rxtx more IDE friendly. I get more mail about that off the list than how to install rxtx. And I see we have Ken Thompson in da house :) He is our trusted CVS maintainer and the guy that purchased the rxtx.org domain. Old community. We will need Ken for changing the directory structure of source. I would like to open up discussion about both of these as it is more than time. The problem is I have little experience with Ant and even less with IDEs. It would be nice if we could work with Eclipse and NetBeans. http://www.netbeans.org/ (sun and some community) http://www.eclipes.org (ibm,rhat,... perhaps more community) http://maven.apache.org/what-is-maven.html (apache. It is community) borland should sortof be here too but I think thats covered in eclipse. >From what I understand so far, we should morph rxtx to support those three maybe trusting apaches lead with maven. But I use vi. I have little to no clues beyond what people have fed me. Can we agree that thats the right direction to go? -- Trent Jarvi tjarvi at qbang.org From brian at mbari.org Mon Feb 6 14:57:50 2006 From: brian at mbari.org (Brian Schlining) Date: Mon, 6 Feb 2006 13:57:50 -0800 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> > The other thing we have not completed discussing is the directory > structure. There is interest in making rxtx more IDE friendly. I > get more mail about that off the list than how to install rxtx. > > And I see we have Ken Thompson in da house :) He is our trusted > CVS maintainer and the guy that purchased the rxtx.org domain. Old > community. We will need Ken for changing the directory structure of > source. > > I would like to open up discussion about both of these as it is > more than time. The problem is I have little experience with Ant > and even less with IDEs. It would be nice if we could work with > Eclipse and NetBeans. > > http://www.netbeans.org/ (sun and some community) > http://www.eclipes.org (ibm,rhat,... perhaps more community) > http://maven.apache.org/what-is-maven.html (apache. It is community) > borland should sortof be here too but I think thats covered in > eclipse. > >> From what I understand so far, we should morph rxtx to support >> those three > maybe trusting apaches lead with maven. But I use vi. I have > little to no clues beyond what people have fed me. > Maven likes the directory structure below for Java code. (From http:// maven.apache.org/guides/getting-started/index.html) This structure works fine with ant, netbeans, and eclipse. rxtx_root_directory `-- src |-- main | `-- java | `-- gnu | `-- io `-- test `-- java `-- gnu `-- io Brian Schlining Software Engineer http://www.mbari.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/d9451eba/attachment-0014.html From tjarvi at qbang.org Mon Feb 6 15:11:45 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 15:11:45 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: > rxtx_root_directory > `-- src > |-- main > | `-- java > | `-- gnu > | `-- io > `-- test > `-- java > `-- gnu > `-- io > >From what I understand this will just be good. For me it makes no difference. So lets do the rxtx thing. Let if fester for two weeks and if nobody objects, we will do it. I'm not doing this because I care. I'm doing this to eliminate much of my inbox. But test... man is rxtx lacking there in the community aspect. It is covered but not right. _maybe_ I can change that this year. -- Trent Jarvi tjarvi at qbang.org (cat hurding since 1997) From lux at diesel-research.com Mon Feb 6 21:38:49 2006 From: lux at diesel-research.com (Kim Lux) Date: Mon, 06 Feb 2006 21:38:49 -0700 Subject: [Rxtx] How can I use Lock Files with rxtx (in FC4) ? Message-ID: <1139287129.17031.3.camel@zd7280> I am now running an rxtx application on FC4. I am getting: ========================================================= check_group_uucp(): error testing lock file creation Error details: Permission denied check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL ========================================================= $ ls -al /var/lock total 32 drwxrwxr-x 4 root lock 4096 Feb 6 16:04 . drwxr-xr-x 24 root root 4096 Nov 14 01:19 .. drwx------ 2 root root 4096 Apr 27 2005 lvm drwxr-xr-x 2 root root 4096 Feb 6 16:04 subsys How do I fix this for regulator users ? -- Kim Lux, Diesel Research Inc. From dmarkman at mac.com Mon Feb 6 22:24:44 2006 From: dmarkman at mac.com (Dmitry Markman) Date: Tue, 7 Feb 2006 00:24:44 -0500 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: if I understands the issue right in order to be able to use ant for c/c++ compilation you have to install ant's cc task http://ant-contrib.sourceforge.net/cc.html it looks like it should work on mac os x (authors claim, that it's platform independent) but I never tested so all you have to do it's providing right command line for the gcc compiler On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: >> rxtx_root_directory >> `-- src >> |-- main >> | `-- java >> | `-- gnu >> | `-- io >> `-- test >> `-- java >> `-- gnu >> `-- io >> > > >> From what I understand this will just be good. > > For me it makes no difference. So lets do the rxtx thing. Let if > fester for two weeks and if nobody objects, we will do it. > > I'm not doing this because I care. I'm doing this to eliminate > much of my inbox. > > But test... man is rxtx lacking there in the community aspect. It > is covered but not right. _maybe_ I can change that this year. > > -- > Trent Jarvi > tjarvi at qbang.org > (cat hurding since 1997) > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx Dmitry Markman From lux at diesel-research.com Mon Feb 6 23:20:15 2006 From: lux at diesel-research.com (Kim Lux) Date: Mon, 06 Feb 2006 23:20:15 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? Message-ID: <1139293215.3689.4.camel@zd7280> I'm running the code below. portlist.hasMoreElements() is false. /dev has ports in it as listed below. What am I doing wrong ? ========================================================== // Step through the list of ports until we find one that matches // the one we are looking for. portList = CommPortIdentifier.getPortIdentifiers(); while(portList.hasMoreElements()) { portID = (CommPortIdentifier) portList.nextElement(); // if (portID.getName().equals("/dev/ttyUSB0")) { myTA.append("Serial port ttyUSB0 has been found\n"); break; }// if portID equals... }// End of while... ========================================================== ls -al /dev/tty* crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 ... crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 -- Kim Lux, Diesel Research Inc. From david.garnier at trusted-logic.com Tue Feb 7 00:46:30 2006 From: david.garnier at trusted-logic.com (David Garnier) Date: Tue, 07 Feb 2006 08:46:30 +0100 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: <43E85056.2090608@trusted-logic.com> Hello, I think that the make-based build process is fine as it is, apart from the location of the Java source files. It is true that putting the Java source in a directory structure that map 1-to-1 to the Java package structure is the norm and should make it easier for everyone to modify the Java source, with or without an IDE. Ant is a good tool, but in the RXTX case I fail to see the advantage of using it compared to the current make-based process. As Trent said, they are more pressing issues, like testing. Regards, David Dmitry Markman wrote: > if I understands the issue right > in order to be able to use ant for c/c++ compilation > you have to install ant's cc task > http://ant-contrib.sourceforge.net/cc.html > > it looks like it should work on mac os x > (authors claim, that it's platform independent) > but I never tested > > so all you have to do it's providing right command line > for the gcc compiler > > > > > On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: > >>> rxtx_root_directory >>> `-- src >>> |-- main >>> | `-- java >>> | `-- gnu >>> | `-- io >>> `-- test >>> `-- java >>> `-- gnu >>> `-- io >>> >> >> >>> From what I understand this will just be good. >> >> For me it makes no difference. So lets do the rxtx thing. Let if >> fester for two weeks and if nobody objects, we will do it. >> >> I'm not doing this because I care. I'm doing this to eliminate much >> of my inbox. >> >> But test... man is rxtx lacking there in the community aspect. It is >> covered but not right. _maybe_ I can change that this year. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> (cat hurding since 1997) From tjarvi at qbang.org Tue Feb 7 01:11:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 01:11:31 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <43E85056.2090608@trusted-logic.com> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: On Tue, 7 Feb 2006, David Garnier wrote: > Hello, > > I think that the make-based build process is fine as it is, apart from the location of the Java > source files. It is true that putting the Java source in a directory structure that map 1-to-1 to > the Java package structure is the norm and should make it easier for everyone to modify the Java > source, with or without an IDE. > > Ant is a good tool, but in the RXTX case I fail to see the advantage of using it compared to the > current make-based process. As Trent said, they are more pressing issues, like testing. > Hi David I have more experience with testing rxtx than I can talk about. But let it be known, rxtx has gone trough 100's of hours of testing. We are hobby folks interested in toys but there is more. rxtx has had some of the best guidance in the industry there. This is not an easy thing. I may be able to come back in a month from the other side of the corperate fence and help. I suspect the tests could just be made public but they are in a very unusual environment that just wont work in a wider sense. This is something I'll be trying to change. At one point it was agreed we could just make the results public so this isnt just noise.. There is interest and I think its safe to mention that much. The big problem with testing in the past is most of it is done with a loopback connection. So we *still* have major questions regarding things like flow control. rxtx talks to itself over a loopback and it works. regardless of right or wrong. This requires more thought to be done right. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Feb 7 02:46:34 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 02:46:34 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: > The big problem with testing in the past is most of it is done with a > loopback connection. So we *still* have major questions regarding things > like flow control. rxtx talks to itself over a loopback and it works. > regardless of right or wrong. With serial communication there are gold standards. ckermit is probably a definitive 'standard.' Maybe its possible to do ping/pong tests with ckermit? Is it scriptable? There are known issues in rxtx. Probably the worst is some threading issues regarding some JREs with multiple JNI threads setting java variables. Man did I get schooled there. Just switch the c functions to returning variables and things go away. Sometimes they work fine, sometimes they blow up. Without understanding everything, somehow rhat got it right and debian (and especially gentoo) grabbed kernel patches causing all sort of harm. Its not hard to fix once you understand whats going on but nearly impossible to track with a debugger. So I have a good idea what 2.1-8 will have outside of the IDE modifications. rxtx 2.1-7 is a release for everyone to sync with. Its not even as stable as -pre17 as far as I know - I ran no test suites. I'll be chasing it too. We just had so many contributions that it was time. It seriously broke internal scheduals but thats a great thing :) The other thing I want to do in 2.1-8 is automagic baud rates. It turns out lots of shops are doing really funky baud rates for things like automobile test equipment. It is possible but it requires a fair amount of change in the native code. Is anyone looking at this? -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Feb 7 02:57:21 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 07 Feb 2006 04:57:21 -0500 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <43E85056.2090608@trusted-logic.com> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: Hi All, I agree, testing is very important. The problem I have been trying to address is related to cross-platform testing and the robust nature of the installs. Typically, I visit 3 platforms to deploy my product, windows, linux and mac. A build is performed on each platform. The idea that you can build for many platforms from one copy the source code seems attractive. This should enable synchronized deployments of identical code. The question of how to achieve this goal remains open. As Trent mentioned, this is hard. Perhaps Ant will help here (but perhaps not). Ant does seem to help with running unit tests. However, it does not help with multi-platform tests. For that you need many machines and different operating environments. Toward that end, I have created a multi-platform test that can be run from web start, located at: http://show.docjava.com:8086/book/cgij/code/jnlp/serialPort.PortTest.jnlp This is interesting because many people in the community can run the test and we can improve the test, as time permits. No, it is not a perfect solution, however, the idea does help with multi-platform tests using many machines and different operating environments. If the group has a good test for a general serial port set-ups, i would be happy to deploy it, for general evaluation using web start. And as for ANT, it is just an idea. Not all my ideas are good ones! - Doug >Hello, > >I think that the make-based build process is fine as it is, apart >from the location of the Java >source files. It is true that putting the Java source in a directory >structure that map 1-to-1 to >the Java package structure is the norm and should make it easier for >everyone to modify the Java >source, with or without an IDE. > >Ant is a good tool, but in the RXTX case I fail to see the advantage >of using it compared to the >current make-based process. As Trent said, they are more pressing >issues, like testing. > >Regards, >David > >Dmitry Markman wrote: >> if I understands the issue right >> in order to be able to use ant for c/c++ compilation >> you have to install ant's cc task >> http://ant-contrib.sourceforge.net/cc.html >> >> it looks like it should work on mac os x >> (authors claim, that it's platform independent) >> but I never tested >> >> so all you have to do it's providing right command line >> for the gcc compiler >> >> >> >> >> On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: >> >>>> rxtx_root_directory >>>> `-- src >>>> |-- main >>>> | `-- java >>>> | `-- gnu >>>> | `-- io >>>> `-- test >>>> `-- java >>>> `-- gnu >>>> `-- io >>>> >>> >>> >>>> From what I understand this will just be good. >>> >>> For me it makes no difference. So lets do the rxtx thing. Let if >>> fester for two weeks and if nobody objects, we will do it. >>> >>> I'm not doing this because I care. I'm doing this to eliminate much >>> of my inbox. >>> >>> But test... man is rxtx lacking there in the community aspect. It is >>> covered but not right. _maybe_ I can change that this year. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> (cat hurding since 1997) > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From matt.higgins at gmail.com Tue Feb 7 08:28:34 2006 From: matt.higgins at gmail.com (Matt Higgins) Date: Tue, 7 Feb 2006 10:28:34 -0500 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final Message-ID: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? import java.io.*; import java.util.*; import gnu.io.*; public class MySimpleRead implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; public static void main(String[] args) { boolean portFound = false; String defaultPort = "COM1"; if (args.length > 0) { defaultPort = args[0]; } portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; MySimpleRead reader = new MySimpleRead(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } } public MySimpleRead() { try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) { e.printStackTrace(); } try { inputStream = serialPort.getInputStream(); } catch (IOException e) { e.printStackTrace(); } try { serialPort.addEventListener(this); } catch (TooManyListenersException e) { e.printStackTrace(); } try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { e.printStackTrace(); } System.out.println("Baud is " + serialPort.getBaudRate()); System.out.println("Bits is " + serialPort.getDataBits()); System.out.println("Stop is " + serialPort.getStopBits()); System.out.println("Par is " + serialPort.getParity()); serialPort.notifyOnDataAvailable(true); readThread = new Thread(this); readThread.start(); } public void run() { // Thread.sleep(20000); //} catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { System.out.println("An event occurred " + event.getEventType()); switch (event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: byte[] readBuffer = new byte[20]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } System.out.print(new String(readBuffer)); } catch (IOException e) {} break; } } } --------------- Result on windows ------------------------------ Stable Library ============================================================== Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port:: COM1 Baud is 9600 Bits is 8 Stop is 1 Par is 0 ----------------- End Results ----------------------------------------- ------------------ Result on Linux ----------------------------------- Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 Found port: /dev/ttyS0 Baud is 9600 Bits is 8 Stop is 1 Par is 0 An event occurred 1 043100066224 ------------------ End Results --------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/a1431630/attachment-0014.html From brian at mbari.org Tue Feb 7 09:48:37 2006 From: brian at mbari.org (Brian Schlining) Date: Tue, 7 Feb 2006 08:48:37 -0800 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> Message-ID: <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> Hi Matt > The following code works fine on Linux but I never see any data > when run on Windows. This is a cut and paste from the SimpleRead > example. > I am attempting to read data from a bar code scanner. I can fire > up HyperTermianl on windows and see that the device is working > properly as I see the barcodes are scanned and echoed back to the > terminal. However when I run the app I don't see any data. It is > however associating with the com port as the informational bits > print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. Cheers Brian Schlining Software Engineer http://www.mbari.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/16d07f37/attachment-0014.html From lux at diesel-research.com Tue Feb 7 11:59:58 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 11:59:58 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139293215.3689.4.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> Message-ID: <1139338798.8145.4.camel@zd7280> Any ideas on this ? Any reason why portList.hasMoreElements() should be false even though there are devices in /dev ? On Mon, 2006-02-06 at 23:20 -0700, Kim Lux wrote: > I'm running the code below. > > portlist.hasMoreElements() is false. > > /dev has ports in it as listed below. > > What am I doing wrong ? > > > ========================================================== > // Step through the list of ports until we find one that matches > // the one we are looking for. > > portList = CommPortIdentifier.getPortIdentifiers(); > > while(portList.hasMoreElements()) > { > portID = (CommPortIdentifier) portList.nextElement(); // > if (portID.getName().equals("/dev/ttyUSB0")) > { > myTA.append("Serial port ttyUSB0 has been found\n"); > break; > }// if portID equals... > }// End of while... > ========================================================== > > ls -al /dev/tty* > crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty > crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 > crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 > crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 > crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 > ... > crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 > crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 > crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 > > > -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 12:20:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 12:20:25 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139338798.8145.4.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> Message-ID: On Tue, 7 Feb 2006, Kim Lux wrote: > > Any ideas on this ? Any reason why portList.hasMoreElements() should be > false even though there are devices in /dev ? > > > On Mon, 2006-02-06 at 23:20 -0700, Kim Lux wrote: >> I'm running the code below. >> >> portlist.hasMoreElements() is false. >> >> /dev has ports in it as listed below. >> >> What am I doing wrong ? >> >> >> ========================================================== >> // Step through the list of ports until we find one that matches >> // the one we are looking for. >> >> portList = CommPortIdentifier.getPortIdentifiers(); >> >> while(portList.hasMoreElements()) >> { >> portID = (CommPortIdentifier) portList.nextElement(); // >> if (portID.getName().equals("/dev/ttyUSB0")) >> { >> myTA.append("Serial port ttyUSB0 has been found\n"); >> break; >> }// if portID equals... >> }// End of while... >> ========================================================== >> >> ls -al /dev/tty* >> crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty >> crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 >> crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 >> crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 >> crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 >> ... >> crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 >> crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 >> crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 >> >> >> > Hi Kim What rxtx does is try to open the port and do a timed out read. If the kernel/... do not complain it's enumarted. I suspect you could do a crude test by doing something like cat /dev/ttyS0 > /dev/null If that barfs then rxtx wont enumerate the port. hmm looking at your question again, I suspect it's a lockfile problem. This is documented in INSTALL with the source. Its easy enough to test this too.. touch /var/lock/testingrxtxlockfiles && rm -f /var/lock/testingrxtxlockfiles If you are not in the right group it will bail. Root will work regardless. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 12:37:56 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 12:37:56 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> Message-ID: <1139341076.8145.11.camel@zd7280> Exactly which ports does rxtx attempt to put into the list ? /dev/* or /dev/tty* or /dev/tty[0-9[0-9] ? or /dev/ttyS* ? For the record, only /dev/ttyUSB0 is a valid port on the machine I am presently on. Will this be a problem ? On Tue, 2006-02-07 at 12:20 -0700, Trent Jarvi wrote: > This is documented in INSTALL with the source. > I was wondering where that file was. I will download source and dig it up. Thanks. -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 12:51:09 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 12:51:09 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139341076.8145.11.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: On Tue, 7 Feb 2006, Kim Lux wrote: > > Exactly which ports does rxtx attempt to put into the list ? /dev/* > or /dev/tty* or /dev/tty[0-9[0-9] ? or /dev/ttyS* ? > > For the record, only /dev/ttyUSB0 is a valid port on the machine I am > presently on. Will this be a problem ? > > > On Tue, 2006-02-07 at 12:20 -0700, Trent Jarvi wrote: >> This is documented in INSTALL with the source. >> > I was wondering where that file was. I will download source and dig it > up. > > Thanks. > Hmm I'm looking at pre17 so this may have changed. (its just what I have on this machine) if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA" // for the IPAQs }; CandidatePortPrefixes=Temp; } So you may need to add "ttyUSB" to that list. RXTX used to enumerate _everything_ see if(osName.equals("Linux-all-ports") But it became less than practical. This is all in RXTXCommDriver.java hmm I just did a cvs update. if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have to get your fingers into the code. We aim for sane defaults. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 13:06:45 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 13:06:45 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139342805.8145.22.camel@zd7280> On Tue, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > Hmm I'm looking at pre17 so this may have changed. (its just what I have > on this machine) > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA" // for the IPAQs > }; > CandidatePortPrefixes=Temp; > } > > > So you may need to add "ttyUSB" to that list. RXTX used to enumerate > _everything_ see if(osName.equals("Linux-all-ports") But it became less > than practical. > > This is all in RXTXCommDriver.java > > hmm I just did a cvs update. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have > to get your fingers into the code. We aim for sane defaults. Excellent. Thanks for taking the time. -- Kim Lux, Diesel Research Inc. From ideiglenes1 at freemail.hu Tue Feb 7 13:53:39 2006 From: ideiglenes1 at freemail.hu (--) Date: Tue, 07 Feb 2006 21:53:39 +0100 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139345619.22534.2.camel@localhost> Hi! I use this code to get all the extra Linux devices. :) if ("Linux".equals(System.getProperty("os.name"))) { System.setProperty("os.name","Linux-all-ports"); } driver = new RXTXCommDriver(); On k, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > On Tue, 7 Feb 2006, Kim Lux wrote: > > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have > to get your fingers into the code. We aim for sane defaults. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From matt.higgins at gmail.com Tue Feb 7 13:45:54 2006 From: matt.higgins at gmail.com (Matt Higgins) Date: Tue, 7 Feb 2006 15:45:54 -0500 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> Message-ID: <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> Sweet this is exactly what I needed. I was searching the archives through marc.theamisgroup they only have archives back to 1/3/05. Should have hit the mailman archive! Thanks a lot! On 2/7/06, Brian Schlining wrote: > > Hi Matt > > The following code works fine on Linux but I never see any data when run > on Windows. This is a cut and paste from the SimpleRead example. > I am attempting to read data from a bar code scanner. I can fire up > HyperTermianl on windows and see that the device is working properly as I > see the barcodes are scanned and echoed back to the terminal. However when I > run the app I don't see any data. It is however associating with the com > port as the informational bits print fine? > > > You're not the only one whose had this problem, I don't know if Trent has > addressed this is the latest release of RXTX but there is a workaround. > Here's the recent thread from the RXTX mailing list regarding this issues: > > Thanasis Delenikas tdelenik at gmail.com > Wed Jan 18 13:56:23 MST 2006 > > * Previous message: [Rxtx] Re: More close() performance fixes > * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] > > Hi all. > (I've subscribed again from my other email account). > > Trent, > > You are right. Linux *always* works, no matter what flow control you set. > Windows *works only* with hardware flow control (I haven't tested what > happens with software XON/XOFF flow control). > > I assume (but I am not certain) that even with no flow control at all, all > platforms should work. Without flow control, you have the risk of bumping > into overflow or framing errors, but that's your (the end programmer, I > mean) problem. > > >From my side, I shouldn't be working without flow control. That was a bug > too... It was some code forgotten from the old times, when I used to work > with phone emulation drivers which didn't support flow control. The > correct > way is to have some flow control enabled and that's why I suppose this is > a > low-severity bug for RxTx. > > I have no idea which platform shows the correct behaviour, since > my knowledge about Linux and the inner workings of these low-level i/o > operations is limited. > > Regards, > Thanasis Delenikas. > > > > > Message: 2 > > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > > From: Trent Jarvi > > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > > To: RXTX Developers and Users > > Message-ID: > > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > > > Hi all, > > > > > > Trent, I have found something. > > > I read your comment about flow control, so I experimented a bit. > > > > > > If you remember, in my sample program I've used no flow control at all > ( > > i.e. > > > Java constant FLOWCONTROL_NONE). > > > > > > Now, during testing, I've switch to hardware inbound flow control (i.e > . > > Java > > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > > beautifully! > > > > > > I think I will switch to H/W flow control and test things for a while, > > but > > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > > > > > Hi Thanasis, > > > > I'm fairly sure you have identified a bug. I would not worry too much > > about what Sun CommAPI w32 defaults are. I think they did more or less > > whatever the port opened with. Just a guess. Linux tries to stomp on > > ports so they are all the same. > > > > So this started out with Linux worked, Windows XP/.. did not as I > recall. > > Something is wrong in rxtx. Do I understand this right? > > > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > > > Perhaps there is something Wayne or I did not understand when we wrote > > that code. I wasnt programming back in the BBS days so modems are not > my > > thing. I have a few questions. > > > > Is the above matrix confirmed by observation? > > Linux just always worked? > > Which one _should_ work? I'm guessing modems work with hardware flow > > control. I'll have to dig around. > > > > The windows flow control changes a couple things with hardware flow > > control. Following the w32 API documentation is confusing sometimes. > > But it looks like Linux could have a bug too. > > Cheers > > Brian Schlining > Software Engineer > http://www.mbari.org > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/9c989144/attachment-0014.html From tjarvi at qbang.org Tue Feb 7 14:06:14 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 14:06:14 -0700 (MST) Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> Message-ID: >> >> You're not the only one whose had this problem, I don't know if Trent has >> addressed this is the latest release of RXTX but there is a workaround. >> Here's the recent thread from the RXTX mailing list regarding this issues: >> I have not. I expect to have access to some test equipment next month and I'll go through all of this. I really don't know whats going on and I need a gold standard. I thought maybe linux was autodetecting the flow control. Your observations would certainly be welcome. I need to talk to Russell King and see what he is doing. Until then I'd just be toying around over a loopback as usual. This is very high on the list though. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 17:25:05 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 17:25:05 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139358305.17994.2.camel@zd7280> My application now works. I installed the libraries and jar from 2.1-7 (Final). portlist.hasMoreElements is no longer false. The application finds the port for /dev/ttyUSB0. Thanks for your help, Trent (et al) Sorry I bothered you with this. Next time I will look in the source first. I didn't think it was an rxtx issue, I thought it was a Linux setup issue . On Tue, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > Hmm I'm looking at pre17 so this may have changed. (its just what I > have > on this machine) > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux > Serial Ports > "ttySA" // for the > IPAQs > }; > > CandidatePortPrefixes=Temp; > } > > > So you may need to add "ttyUSB" to that list. RXTX used to enumerate > _everything_ see if(osName.equals("Linux-all-ports") But it became > less > than practical. > > This is all in RXTXCommDriver.java > > hmm I just did a cvs update. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux > Serial Ports > "ttySA", // for the > IPAQs > "ttyUSB" // for USB > frobs > }; > > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you > have > to get your fingers into the code. We aim for sane defaults. -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 19:21:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 19:21:54 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139358305.17994.2.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> <1139358305.17994.2.camel@zd7280> Message-ID: >Sorry I bothered you with this. Next time I will look in the source >first. I didn't think it was an rxtx issue, I thought it was a Linux >setup issue . Why would you be sorry? I would have done the same. I'm glad it's working :) -- Trent Jarvi tjarvi at qbang.org From tma at mail.island.net Wed Feb 8 13:39:35 2006 From: tma at mail.island.net (Tom Alldread) Date: Wed, 08 Feb 2006 12:39:35 -0800 Subject: [Rxtx] Win32/Linux Serial Port Data Dropouts In-Reply-To: <200602060702.k167255O007882@www.qbang.org> References: <200602060702.k167255O007882@www.qbang.org> Message-ID: <43EA5707.4020200@mail.island.net> Greetings Folks at RXTX: During the last couple of months I have been alternately testing with javax.comm 2 and RXTX 2.1 under Windows XP and CommApi 3 and RXTX 2.1 under Suse 10.0 Linux. In the process I have learned a little about java multi-threading under NetBeans 5 with Profiler. My java (jdk 1.5_06) application is used for data acquisition and provides a graphical display of A-D conversion data received from a 56KBaud serial port. The actual data throughput is about 10KBaud thus it is well below the speed of the port. I use hardware RTS/CTS flow control which can stall the data acquisition sample rate if necessary. This ensures the display computer has the ability to slow the data acquisition rate should it become too busy to accept the regular data flow. Both the serial port buffer and the java read buffer are set at 16KB. Usually the data transfers into the java read buffer are less than 100 bytes unless the data acquisition is recovering from a stall. The data flow normally hesitates after each 5 KB block as a continue command is needed from the display computer to start the drawing of a new graphics display line. Separate threads have been provided for the serial port event monitoring and data processing. The serial port event thread has been given the maximum priority and data processing thread the minimum priority provided by java. Thread yield statements have been placed within all data processing while/for loops as an effort to ensure quick access to CPU cycles for the serial port event thread. I have found that short data transmissions are essentially error free but occasional dropouts occur with continuous data flow especially under Windows XP. ....................................................................................................................................................................................... Linux results: I am happy to report that RXTX 2.1 appears to work very well under Linux although I did notice some errors when the screen savers were running with my dual monitors. I believe this is a local problem associated with my dual graphics which needs further attention. The recent CommApi 3 Linux release from Sun did not work at all with my program. It seemed to send commands out OK but did not receive any data. Although the serial port event triggered the ISR, the input stream appeared filled with nulls and thus did not contain any data. As my understanding is that CommApi 3 was tested with a Red Hat distribution of Linux I wonder if this problem is distro dependent? Although somewhat off topic here I wonder if anyone reading this has had similar experience? .................................................................................................................................................................................. Windows XP results: There are problems with occasional data dropouts which become more frequent as the sampling rate is increased or if the computer becomes busy with other duties. The dropouts typically consist of a half dozen byte block of lost data. It appears the lost bytes never get added to the java input stream. There has not been any indication of garbled data, overruns or framing errors which suggests the UART communications remains solid. Using javax.comm 2 I found that the setting of SerialPort 'enableReceiveThreshold' to 40 and 'enableReceiveTimeout' of 100mS reduced the dropouts error rate significantly. I found that I could not get RXTX 2.1 to function with the aforementioned threshold and timeout settings. The javax.comm 2 interface is consequently performing better for me under Windows than RXTX 2.1. I wonder if anyone here has any suggestions as to what I might try to improve RXTX 2.1? Although my settings are the same as under Suse 10.0, RXTX 2.1 performs much better for me under Linux than any of the alternatives that I have tried under Windows XP . ............................................................................................................................................................................... I would like to establish, based on the experience of others, if I have reached the normally expected performance limit of java serial port communications? Should I expect to achieve virtually error free serial port data input from a continuous stream under Windows XP java software? I am considering changing my protocol to packets with error checking if necessary but would like to know if the dropout problems I am experiencing are typical or not before I take this rather work intensive plunge. Many thanks in advance for any help! Best Regards, Tom Alldread -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.375 / Virus Database: 267.15.2/253 - Release Date: 2006-02-07 From jlaxson at mac.com Wed Feb 8 23:56:48 2006 From: jlaxson at mac.com (John Laxson) Date: Thu, 9 Feb 2006 00:56:48 -0600 Subject: [Rxtx] PortInUseException: Unknown Application on OSX Message-ID: Hi, I've been trying to get RXTX 2.1.7 going on Mac OS X for a while here, and am running up into a wall here. I've tried with pre- compiled and the source version and get the same problem, a gnu.io.PortInUseException: Unknown Application. I have run the fixperms script included with the source distribution, and id shows me as a member of the uucp group, and permissions on /var/spool/uucp are 775 root:uucp. Running a test program (included at the bottom for clarity) lets me enumerate all the serial ports correctly, but trying to open any of them gives the PortInUseException. If it helps, when I try to open a port that's set to make an outgoing bluetooth connection, there is no delay and no connection attempt at all. Thanks, John Laxson PS: The documentation wiki on qbang.org shows 404, and has for a few days now. My test code: public static void main(String[] args) { SerialPort serialPort; try { Enumeration e = CommPortIdentifier.getPortIdentifiers(); CommPortIdentifier ident; while (e.hasMoreElements()) { ident = (CommPortIdentifier)e.nextElement(); System.out.println(ident.getName()); } ident = CommPortIdentifier.getPortIdentifier("/dev/cu.modem"); serialPort = (SerialPort) ident.open("Me", 5000); } catch (Exception e) { e.printStackTrace(); } } From rajesh.invincible at gmail.com Thu Feb 9 03:39:38 2006 From: rajesh.invincible at gmail.com (Rajesh N) Date: Thu, 9 Feb 2006 16:09:38 +0530 Subject: [Rxtx] Re: Move .java Files in gnu.io filesystem hierarchy - Maven (2) In-Reply-To: <43DF21D2.7090200@ngi.it> References: <43DF21D2.7090200@ngi.it> Message-ID: <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Can anybody tell me how to overcome these EXCEPTIONS I AM WORKING ON SERIAL COMMN IN JAVA ON LINUX. 1. " NOT ALL PARAMETERS SUPPORTED BY THE KERNEL" This i came across the following statement inmy prog. SerialP is A SerialPort object SerialP.setSerialPortParams(9600(BAUDRATE),DATABITS_8,STOPBITS_1,PARITY_NONE) 2. NullPointer Exception at Event Dispatch Now i have checked all my object references for a null reference but i found none i have put up my entire code in try catch blocks but still I AM UNABLE TO CATCH THIS EXCEPTION AND HENCE MY APPLICATION CLOSES HOW DOES THESE GO? PLEASE HELP ME IT IS URGENTTTTTTTTTTTTTTTT yours sincerely RAJESH On 1/31/06, Fabio Frumento wrote: > Hi Xavier, > > I don't know maven at all but the directory hierarchy listed buy Trent > is fine for me... > > I'll take a look to maven, it seems an interesting project > > Regards > > Fabio Frumento > > Trent Jarvi wrote: > > On Tue, 31 Jan 2006, Xavier Frisaye wrote: > > > >> Hi all, > >> > >> If you are going to rearrange the src folder, i will propose to use > >> maven 2 and follow its directory structure > >> > (http://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html). > >> > >> Maven 2 simplify java project and give a standard way to make projects > >> (http://maven.apache.org/). > >> We are using it for internal projects and we are very satisfied. > >> > >> Is anybody interested? > >> > >> I'm not an expert in maven 2 (yet) but i'm agree to help using it if > >> you choose to make so. > >> > > > > so this would be: > > > > rxtx-devel/src/main/java/gnu.io > > rxtx-devel/src/test/java/ManIwish.java > > > > I don't use IDEs very much so I'll let others comment. But I don't see > > a problem with that. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Thu Feb 9 09:50:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 9 Feb 2006 09:50:31 -0700 (MST) Subject: [Rxtx] Re: Move .java Files in gnu.io filesystem hierarchy - Maven (2) In-Reply-To: <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Message-ID: On Thu, 9 Feb 2006, Rajesh N wrote: > Can anybody tell me how to overcome these EXCEPTIONS > I AM WORKING ON SERIAL COMMN IN JAVA ON LINUX. > > 1. " NOT ALL PARAMETERS SUPPORTED BY THE KERNEL" > > This i came across the following statement inmy prog. > SerialP is A SerialPort object > SerialP.setSerialPortParams(9600(BAUDRATE),DATABITS_8,STOPBITS_1,PARITY_NONE) > Strange. The parameters you use are the same the port should open with by default. Could you paste the actual exception you are getting? I don't see that in the rxtx source. Also it would help to know the rxtx version. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Fri Feb 10 15:29:05 2006 From: lux at diesel-research.com (Kim Lux) Date: Fri, 10 Feb 2006 15:29:05 -0700 Subject: [Rxtx] One serial port object for both sending and receiving ? Message-ID: <1139610545.18177.4.camel@zd7280> Is it OK to use one SerialPort ojbect (ex Serial Port serialPort;) and use it for both sending and receiving ? For example: ======================================================================== static SerialPort serialPort = null; static OutputStream serialOut = null; static InputStream serialIn = null; // assign it to an outputStream for use try{ serialOut = serialPort.getOutputStream(); System.out.println("Serial output stream has been assigned."); }//try catch(IOException e) { System.out.println("Error: Couldn't assign output stream to serial port."); }//catch //assign it to an inputStream for use try{ serialIn = serialPort.getInputStream(); System.out.println("Serial input stream has been assigned."); }//try catch(IOException e) { System.out.println("Error: Couldn't assign input stream to serial port."); }//catch ======================================================================== -- Kim Lux, Diesel Research Inc. From lux at diesel-research.com Fri Feb 10 21:23:00 2006 From: lux at diesel-research.com (Kim Lux) Date: Fri, 10 Feb 2006 21:23:00 -0700 Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Message-ID: <1139631780.23882.10.camel@zd7280> I've got a problem receiving chars with my version of serialRead, written in an SWT GUI. I had a Java pro have a good look at my code and he can't see anything wrong with it. I can send chars fine. When I receive a char the cpu usage for the app goes to 100% and the code in the serial event handler doesn't get executed. The instructions on the Java Comm Serial API How-To for Linux page state that I must install javacomm. Is that true ? Everything builds without it and I can send chars on rxtx just fine, but I can't receive them. Could this be the problem ? I downloaded and installed javacomm. I was not able to add "Driver=gnuio.RXTXCommDriver to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 installed in /usr/java/jre1.5.0_05. I added comm.jar to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext to the library paths. Is this OK ? Does it matter that I am receiving on /dev/ttyUSB0 ? Thanks. -- Kim Lux, Diesel Research Inc. From lunareclipse03 at web.de Sat Feb 11 09:44:46 2006 From: lunareclipse03 at web.de (lunareclipse03@web.de) Date: Sat, 11 Feb 2006 17:44:46 +0100 Subject: [Rxtx] Question about Serial I/O under Win32 Message-ID: <662084330@web.de> Hello everybody, I have a strange problem with a piece of code I made for myself. No, this is not really concerning rxtx, but nevertheless I post this to the list, hoping that some of you can help me. I've written two libraries, one for linux and one for win32. The linux port works quite well, I can send / receive faxes and / or replay voice messages over the telephone line using a voice modem. But the win32 port of the library causes some trouble. If, for example, I send out a fax with a certain modem under linux, it works well. The fax is complete when it comes out of the fax machine. If I then use the same modem to send out a fax under win32, the fax coming out of the fax machine gets "stuck" halfways, but the sending modem thinks that transmission was ok and drops the connection. The answering fax machine then gives me "error while receiving." The "upper layer" java code MUST be right, because if I do the same thing under linux (using the linux library), everything is alright. Now I have to ask: Can somebody please help me out with this??!? Could it be the case that some kind of flow control or COMMTIMEOUTS setting causes this behaviour? I set flow control to RTS/CTS before sending out a fax. How can I DISABLE flow control? Or what do you think? Can something else cause this problems? Thank you all for your time and PLEASE write back soon. Regards, --Sven Ahlemann Am Waldrand 31 45721 Haltern am See Germany ______________________________________________________________ Verschicken Sie romantische, coole und witzige Bilder per SMS! Jetzt bei WEB.DE FreeMail: http://f.web.de/?mc=021193 From lux at diesel-research.com Sat Feb 11 10:06:52 2006 From: lux at diesel-research.com (Kim Lux) Date: Sat, 11 Feb 2006 10:06:52 -0700 Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: <1139631780.23882.10.camel@zd7280> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> <1139631780.23882.10.camel@zd7280> Message-ID: <1139677612.3431.5.camel@zd7280> More on this problem. I copied and pasted simpleRead into a console based Eclipse project and I've got the same result, except that cpu usage doesn't go to 100%. I'm beginning to think there is an issue in rxtx. My imports for simpleRead are: ============================ import gnu.io.*; import java.util.*; //import javax.comm.*; import java.io.*; =========================== Any ideas ? I am trying to read from /dev/ttyUSB0 using a serial to USB adapter which has worked well with minicom and gtkterm. Thanks. On Fri, 2006-02-10 at 21:23 -0700, Kim Lux wrote: > I've got a problem receiving chars with my version of serialRead, > written in an SWT GUI. > > I had a Java pro have a good look at my code and he can't see anything > wrong with it. > > I can send chars fine. When I receive a char the cpu usage for the app > goes to 100% and the code in the serial event handler doesn't get > executed. > > The instructions on the Java Comm Serial API How-To for Linux page state > that I must install javacomm. Is that true ? Everything builds without > it and I can send chars on rxtx just fine, but I can't receive them. > Could this be the problem ? > > I downloaded and installed javacomm. I was not able to add > "Driver=gnuio.RXTXCommDriver > to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not > have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 > installed in /usr/java/jre1.5.0_05. I added comm.jar > to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext > to the library paths. Is this OK ? > > Does it matter that I am receiving on /dev/ttyUSB0 ? > > Thanks. > -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Sun Feb 12 21:01:33 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:01:33 -0700 (MST) Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: <1139677612.3431.5.camel@zd7280> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> <1139631780.23882.10.camel@zd7280> <1139677612.3431.5.camel@zd7280> Message-ID: I suspect what is happening is the select() is breaking out in the native code but the driver does not have support for notifying there are X bytes available. On some traditional Unix based systems, the only way you know data is available is the fd status changes and do an FIORDCHK ioctl. Or perhaps the only thing you can know is the fd status changed. It would take reading through the kernel driver code to know for sure. So on USB, depending upon the driver, the same may need to be done or the driver improved a bit if possible to support. Polling reads will also work but don't use the event driven model of CommAPI which isnt acceptable in the long run. The 100% cpu usage can then be explained because select no longer blocks until the data is read; the eventLoop spins loose. You can put a well placed sleep but rxtx only expects those are needed when it knows data is available. This may not be a super simple thing to understand and fix. I do have ideas to get you started. I'm going to be short on time the next couple weeks. I expect to put some good time in and answer some other questions I saw around the 25th. For now, I'd look at the following and go from there with the hints I've given. JNIEXPORT jint JNICALL RXTXPort(nativeavailable)( JNIEnv *env, jobject jobj ) { int fd = get_java_var( env, jobj,"fd","I" ); int result; /* char message[80]; ENTER( "RXTXPort:nativeavailable" ); On SCO OpenServer FIONREAD always fails for serial devices, so try ioctl FIORDCHK instead; will only tell us whether bytes are available, not how many, but better than nothing. This turns out to be true on Solaris also. taj. */ #ifdef FIORDCHK /* __unixware__ __sun__ probably others */ result = ioctl(fd, FIORDCHK, 0); #else if( ioctl( fd, FIONREAD, &result ) < 0 ) { goto fail; } #endif /* FIORDCHK */ On Sat, 11 Feb 2006, Kim Lux wrote: > > More on this problem. I copied and pasted simpleRead into a console > based Eclipse project and I've got the same result, except that cpu > usage doesn't go to 100%. I'm beginning to think there is an issue in > rxtx. > > My imports for simpleRead are: > > ============================ > import gnu.io.*; > import java.util.*; > //import javax.comm.*; > import java.io.*; > =========================== > > Any ideas ? I am trying to read from /dev/ttyUSB0 using a serial to > USB adapter which has worked well with minicom and gtkterm. > > Thanks. > > > > On Fri, 2006-02-10 at 21:23 -0700, Kim Lux wrote: >> I've got a problem receiving chars with my version of serialRead, >> written in an SWT GUI. >> >> I had a Java pro have a good look at my code and he can't see anything >> wrong with it. >> >> I can send chars fine. When I receive a char the cpu usage for the app >> goes to 100% and the code in the serial event handler doesn't get >> executed. >> >> The instructions on the Java Comm Serial API How-To for Linux page state >> that I must install javacomm. Is that true ? Everything builds without >> it and I can send chars on rxtx just fine, but I can't receive them. >> Could this be the problem ? >> >> I downloaded and installed javacomm. I was not able to add >> "Driver=gnuio.RXTXCommDriver >> to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not >> have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 >> installed in /usr/java/jre1.5.0_05. I added comm.jar >> to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext >> to the library paths. Is this OK ? >> >> Does it matter that I am receiving on /dev/ttyUSB0 ? >> >> Thanks. >> > From tjarvi at qbang.org Sun Feb 12 21:03:30 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:03:30 -0700 (MST) Subject: [Rxtx] One serial port object for both sending and receiving ? In-Reply-To: <1139610545.18177.4.camel@zd7280> References: <1139610545.18177.4.camel@zd7280> Message-ID: On Fri, 10 Feb 2006, Kim Lux wrote: > > Is it OK to use one SerialPort ojbect (ex Serial Port serialPort;) and > use it for both sending and receiving ? > > For example: > > ======================================================================== > static SerialPort serialPort = null; > static OutputStream serialOut = null; > static InputStream serialIn = null; > > > > > // assign it to an outputStream for use > try{ > serialOut = serialPort.getOutputStream(); > System.out.println("Serial output stream has been assigned."); > }//try > catch(IOException e) > { > System.out.println("Error: Couldn't assign output stream to serial > port."); > }//catch > > > //assign it to an inputStream for use > try{ > serialIn = serialPort.getInputStream(); > System.out.println("Serial input stream has been assigned."); > }//try > catch(IOException e) > { > System.out.println("Error: Couldn't assign input stream to serial > port."); > }//catch This should be fine. In fact trying to do it another way will probably not work as you will run into lockfile issues. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun Feb 12 21:13:13 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:13:13 -0700 (MST) Subject: [Rxtx] Question about Serial I/O under Win32 In-Reply-To: <662084330@web.de> References: <662084330@web.de> Message-ID: On Sat, 11 Feb 2006 lunareclipse03 at web.de wrote: > Hello everybody, > > I have a strange problem with a piece of code I made for myself. No, > this is not really concerning rxtx, but nevertheless I post this to the > list, hoping that some of you can help me. I've written two libraries, > one for linux and one for win32. The linux port works quite well, I can > send / receive faxes and / or replay voice messages over the telephone > line using a voice modem. But the win32 port of the library causes some > trouble. If, for example, I send out a fax with a certain modem under > linux, it works well. The fax is complete when it comes out of the fax > machine. If I then use the same modem to send out a fax under win32, the > fax coming out of the fax machine gets "stuck" halfways, but the sending > modem thinks that transmission was ok and drops the connection. The > answering fax machine then gives me "error while receiving." The "upper > layer" java code MUST be right, because if I do the same thing under > linux (using the linux library), everything is alright. Now I have to > ask: Can somebody please help me out with this??!? Could it be the case > that some kind of flow control or COMMTIMEOUTS setting causes this > behaviour? I set flow control to RTS/CTS before sending out a fax. How > can I DISABLE flow control? Or what do you think? Can something else > cause this problems? Thank you all for your time and PLEASE write back > soon. > Hi Sven I'm not too willing to talk about flow control at the low level until I confirm some things with test equipment later. It is not clear if you are using rxtx or writing your own native code. So I'm not sure how to answer much of this :) If you are wondering how to change the flow control using rxtx from java, The BlackBox example from Sun flips this back and forth. SerialPort.java in rxtx 2.1 uses the following: SerialPort.java: public static final int FLOWCONTROL_NONE =0; SerialPort.java: public static final int FLOWCONTROL_RTSCTS_IN =1; SerialPort.java: public static final int FLOWCONTROL_RTSCTS_OUT =2; SerialPort.java: public static final int FLOWCONTROL_XONXOFF_IN =4; SerialPort.java: public static final int FLOWCONTROL_XONXOFF_OUT=8; So if you set flowcontrol to RTSCTS, you can set it to NONE to turn it off. If you are looking for how to do it in native code, the rxtx Source is SerialImp.c (unix/linux/mac os x/w32) and termios.c (w32 only with SerialImp.c) You can track the code: SerialImp.c:JNIEXPORT void JNICALL RXTXPort(setflowcontrol)( JNIEnv *env, jobject jobj, jint flowmode ) termios.c:int tcgetattr( int fd, struct termios *s_termios ) termios.c:int tcsetattr( int fd, int when, struct termios *s_termios ) There may be a problem in the rxtx flow control code though. Rather than guess, I want to test this with a gold standard. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Feb 6 00:00:16 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 00:00:16 -0700 (MST) Subject: [Rxtx] wiki delay until tomorrow night. In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: On Sun, 5 Feb 2006, Trent Jarvi wrote: > On Sun, 5 Feb 2006, Kim Lux wrote: > >> usb ? Tell me more... I need that too. > > usb is a very proper design. Thats all it is. > Maybe rxtx could help usb. But it would start with helping bring back the community that was already there. It's not something I'd love to do but maybe its the right thing to do. It would probably take 2 years to do right. But maybe thats better than what we have now. I honestly don't know what IBM is doing which could just run over everything. Just some thoughts after some fine german wine. -- Trent Jarvi tjarvi at qbang.org From gadelavega at yahoo.com.ar Mon Feb 6 02:17:05 2006 From: gadelavega at yahoo.com.ar (Gonzalo A. de la Vega) Date: Mon, 06 Feb 2006 10:17:05 +0100 Subject: [Rxtx] Serial port ownership question In-Reply-To: References: <20060205113618.30274.qmail@web53501.mail.yahoo.com> <1139157422.4553.9.camel@zd7280> <1139158698.4936.9.camel@zd7280> Message-ID: <43E71411.4050402@yahoo.com.ar> On my Fedora Core 4: ls -l /dev/ttyS* crw-rw---- 1 root uucp 4, 64 Feb 6 2006 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Feb 6 2006 /dev/ttyS1 ... and: grep "ttyUSB" /etc/udev/rules.d/50-udev.rules KERNEL=="ttyUSB*", GROUP="uucp", MODE="0660" So anyone in the "uucp" group can use serial ports. On Gentoo the group is "tty". Trent Jarvi escribi?: > > > On Sun, 5 Feb 2006, Dr. Douglas Lyon wrote: > >> I can confirm that this is the case (only root ownership of >> serial ports, under fedora 4). >> Wow, what were they thinking?! >> - DL >> >>> I've found that the newer kernels have the serial ports owned by root. >>> For example, >>> >>> $ls -al /dev/tty* >>> crw-rw-rw- 1 root root 5, 0 Feb 5 02:06 /dev/tty >>> crw-rw---- 1 root root 4, 0 Feb 5 02:06 /dev/tty0 >>> crw------- 1 root root 4, 1 Feb 5 09:07 /dev/tty1 >>> crw-rw---- 1 root tty 4, 10 Feb 5 02:06 /dev/tty10 >>> crw-rw---- 1 root tty 4, 11 Feb 5 02:06 /dev/tty11 >>> ... > > > This is just not a problem jcp or such are going to solve. Its a > platform spitwad fight. But do look at pam. In fact thats what Sun > is doing too. Maybe Linux followed their lead.. I'm not a pam guy. > I've spent 16 hours trying to understand it but your users wont :) > > Solution? I have no clue. Its two tangent mentalities from my > perspective. > > -- > Trent Jarvi > tjarvi at qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mtnvega at yahoo.com.br Mon Feb 6 05:35:43 2006 From: mtnvega at yahoo.com.br (Luiz Jr) Date: Mon, 6 Feb 2006 12:35:43 +0000 (GMT) Subject: [Rxtx] Documentation Wiki In-Reply-To: <1139157422.4553.9.camel@zd7280> Message-ID: <20060206123543.57256.qmail@web53515.mail.yahoo.com> Hello, Thank you for you answer, but so the usage of the API is pretty much like the Java Communications Api? If yes, what version of the Java Comm Api? Thank you, Luiz A. Brandao Jr Kim Lux escreveu: On Sun, 2006-02-05 at 08:36 -0300, Luiz Jr wrote: > Hello, > > I want to start using the RXTX libraries, but I would to know how, > since I can not access the documentation wiki page I just started using them yesterday. Below is how I installed the libraries, if that helps. I used snippets of code from the SimpleWrite application here to get me going. http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html Instead of "import javax.comm.*;", use "import gnu.io.*;" which is gotten from RXTXcomm.jar, which you will need to include in your project references. I am working in Eclipse. BTW: there is no way to open a port without going through the port list and finding it. Maybe sometime in the future someone (me ?) will write a method called openSerialPort that allows the user to give a port identifier, such as "/dev/tty1" and return a port ready to use. It wouldn't take much to write that and it would save users a lot of code. Hope this helps. ======================================================================= 1) Figure out which java you are running, incase there is more than one installed. $ java -version java version "1.5.0_05" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_05-b05) Java HotSpot(TM) Client VM (build 1.5.0_05-b05, mixed mode, sharing) 2) Find all the jre directories and the one from which you are currently running. kfind (jre) 3) cd to that directory plus /lib/i386 cd /usr/java/jre1.5.0_05/lib/i386 4) Copy the library files (*.so) to that directory. cp /home/krlux/Desktop/'Java Controls'/rxtx-linux/bin/* . 5) Check that the copy was successful ls librxtx* librxtxI2C.so librxtxRaw.so librxtxSerial.so librxtxParallel.so librxtxRS485.so 6) cd to the /lib/ext directory for your java. cd /usr/java/jre1.5.0_05/lib/ext 7) Copy the Jar files there cp /home/krlux/Desktop/'Java Controls'/rxtx-linux/lib/ext/* . 8) Check that it was successful ls RXTX* RXTXcomm.jar Rxtx is now installed on your machine ready to use. =================================================================== -- Kim Lux, Diesel Research Inc. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx --------------------------------- Yahoo! Acesso Gr?tis - Internet r?pida e gr?tis. Instale o discador agora! -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/544aa403/attachment-0015.html From lyon at docjava.com Mon Feb 6 05:49:34 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 06 Feb 2006 07:49:34 -0500 Subject: [Rxtx] wiki delay until tomorrow night. In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: Hi All, I have often thought about USB drivers being needed. For example, the ironman watch will not interface to a mac (windows only). It is USB. My dymo label writer has no Java driver (native only). Etc. Most cheap web cameras are USB (and Java drivers go through JAI, if it supports the camera at all). The JAI code shows how sun did the USB drivers. You have to be a member of the jai project to download the source code. https://jai.dev.java.net has the jai distro. And then you are not allowed to redistribute it. However, we can all learn from it (if so inclined). Basically: cvs -d :pserver:lyon at cvs.dev.java.net:/cvs login cvs -d :pserver:lyon at cvs.dev.java.net:/cvs checkout jai-core You will need to user your own uid and pw to get in. The ant build has over 100 warnings from sun deprecations of its own code. You might say that they were hoisted on their own Picard ;) One interesting thing is that they support several platforms: linux-amd64 64-bit Linux-AMD64 linux-i586 32-bit Linux-x86 solaris-amd64 64-bit Solaris-AMD64 solaris-i586 32-bit Solaris-x86 solaris-sparc 32-bit Solaris-SPARC solaris-sparcv9 64-bit Solaris-SPARC windows-i586 32-bit Windows-x86 Thus, ant is used to provide a multi-platform native method distro. Neat. How do they do it? check this out: And: The core download does not contain any C source code (it was all pre-built). Basically, they are just copying .so and .dll files into build directories. I would love to see the C code for this...but Sun does not post it on the https://jai.dev.java.net site. I don't know why...Perhaps I missed it. - Doug >On Sun, 5 Feb 2006, Trent Jarvi wrote: > >>On Sun, 5 Feb 2006, Kim Lux wrote: >> >>>usb ? Tell me more... I need that too. >> >>usb is a very proper design. Thats all it is. >> > >Maybe rxtx could help usb. But it would start with helping bring >back the community that was already there. > >It's not something I'd love to do but maybe its the right thing to do. > >It would probably take 2 years to do right. But maybe thats better >than what we have now. > >I honestly don't know what IBM is doing which could just run over everything. > >Just some thoughts after some fine german wine. > >-- >Trent Jarvi >tjarvi at qbang.org > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tdelenik at gmail.com Mon Feb 6 05:56:32 2006 From: tdelenik at gmail.com (Thanasis Delenikas) Date: Mon, 6 Feb 2006 14:56:32 +0200 Subject: Fwd: [Rxtx] Documentation Wiki In-Reply-To: <1139157422.4553.9.camel@zd7280> References: <20060205113618.30274.qmail@web53501.mail.yahoo.com> <1139157422.4553.9.camel@zd7280> Message-ID: <310a1a930602060456t129f1dc6p5f2b908f13ab5a0b@mail.gmail.com> Hello all, Kim, this is a snippet from the code I use. The closest to directly opening a specific port without enumeration. << ... portId = CommPortIdentifier.getPortIdentifier(getPort()); serialPort = (SerialPort) portId.open("jSMSEngine", 1971); ... >> where getPort() return the string identifier of the port, i.e. "/dev/ttyS0" or "COM1" or whatever. Thanasis. ---------- Forwarded message ---------- From: Kim Lux Date: Feb 5, 2006 6:37 PM Subject: Re: [Rxtx] Documentation Wiki To: RXTX Developers and Users BTW: there is no way to open a port without going through the port list and finding it. Maybe sometime in the future someone (me ?) will write a method called openSerialPort that allows the user to give a port identifier, such as "/dev/tty1" and return a port ready to use. It wouldn't take much to write that and it would save users a lot of code. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/182ab5b8/attachment-0015.html From tjarvi at qbang.org Mon Feb 6 11:53:57 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 11:53:57 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: On Mon, 6 Feb 2006, Dr. Douglas Lyon wrote: > Hi All, > I have often thought about USB drivers being needed. > For example, the ironman watch will not interface > to a mac (windows only). It is USB. > My dymo label writer has no Java driver (native only). > Etc. > Most cheap web cameras are USB (and Java drivers go > through JAI, if it supports the camera at all). > The JAI code shows how sun did the USB drivers. > You have to be a member of the jai project to download > the source code. > https://jai.dev.java.net has the jai distro. > And then you are not allowed to redistribute it. However, > we can all learn from it (if so inclined). Basically: > cvs -d :pserver:lyon at cvs.dev.java.net:/cvs login > cvs -d :pserver:lyon at cvs.dev.java.net:/cvs checkout jai-core > You will need to user your own uid and pw to get in. > The ant build has over 100 warnings from sun deprecations > of its own code. > > You might say that they were hoisted on their own Picard ;) > > One interesting thing is that they support several platforms: > linux-amd64 64-bit Linux-AMD64 > linux-i586 32-bit Linux-x86 > solaris-amd64 64-bit Solaris-AMD64 > solaris-i586 32-bit Solaris-x86 > solaris-sparc 32-bit Solaris-SPARC > solaris-sparcv9 64-bit Solaris-SPARC > windows-i586 32-bit Windows-x86 > Thus, ant is used to provide a multi-platform native method distro. > Neat. > How do they do it? > check this out: > > > > > > > > > > > > > And: > > > > > > > > > > The core download does not contain any C source code (it was all pre-built). > Basically, they are just copying .so and .dll files into build directories. > > I would love to see the C code for this...but Sun does not post it on the > https://jai.dev.java.net site. > > I don't know why...Perhaps I missed it. > > - Doug > > I've looked at moving rxtx to Ant builds. I think that would help IDEs a great deal. I requested a evalutation desk copy the O'Reilly Ant book for some j2ee material I was teaching. http://www.oreilly.com/catalog/anttdg/ It has a one sentence mention of JNI. So there was not luck there. I saw that there is another Ant book that does mention JNI more. I can't find it now. Ant must be able to support it with extensions. http://ant.apache.org/manual/OptionalTasks/javah.html What the auto(break :) tools do in the rxtx build is 4 things really. 1) gcc compile flags 2) ld compile flags 3) config.h 4) compile flags for customizing rxtx (lockfiles, ...) See 1 All of this information except 4 can be static once obtained. So I'm not attached to the auto tools. If I could find an example of Ant being used for JNI code, I'd be one of the first to start moving that direction. Maybe someone saw an example someplace. The other thing we have not completed discussing is the directory structure. There is interest in making rxtx more IDE friendly. I get more mail about that off the list than how to install rxtx. And I see we have Ken Thompson in da house :) He is our trusted CVS maintainer and the guy that purchased the rxtx.org domain. Old community. We will need Ken for changing the directory structure of source. I would like to open up discussion about both of these as it is more than time. The problem is I have little experience with Ant and even less with IDEs. It would be nice if we could work with Eclipse and NetBeans. http://www.netbeans.org/ (sun and some community) http://www.eclipes.org (ibm,rhat,... perhaps more community) http://maven.apache.org/what-is-maven.html (apache. It is community) borland should sortof be here too but I think thats covered in eclipse. >From what I understand so far, we should morph rxtx to support those three maybe trusting apaches lead with maven. But I use vi. I have little to no clues beyond what people have fed me. Can we agree that thats the right direction to go? -- Trent Jarvi tjarvi at qbang.org From brian at mbari.org Mon Feb 6 14:57:50 2006 From: brian at mbari.org (Brian Schlining) Date: Mon, 6 Feb 2006 13:57:50 -0800 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> > The other thing we have not completed discussing is the directory > structure. There is interest in making rxtx more IDE friendly. I > get more mail about that off the list than how to install rxtx. > > And I see we have Ken Thompson in da house :) He is our trusted > CVS maintainer and the guy that purchased the rxtx.org domain. Old > community. We will need Ken for changing the directory structure of > source. > > I would like to open up discussion about both of these as it is > more than time. The problem is I have little experience with Ant > and even less with IDEs. It would be nice if we could work with > Eclipse and NetBeans. > > http://www.netbeans.org/ (sun and some community) > http://www.eclipes.org (ibm,rhat,... perhaps more community) > http://maven.apache.org/what-is-maven.html (apache. It is community) > borland should sortof be here too but I think thats covered in > eclipse. > >> From what I understand so far, we should morph rxtx to support >> those three > maybe trusting apaches lead with maven. But I use vi. I have > little to no clues beyond what people have fed me. > Maven likes the directory structure below for Java code. (From http:// maven.apache.org/guides/getting-started/index.html) This structure works fine with ant, netbeans, and eclipse. rxtx_root_directory `-- src |-- main | `-- java | `-- gnu | `-- io `-- test `-- java `-- gnu `-- io Brian Schlining Software Engineer http://www.mbari.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/d9451eba/attachment-0015.html From tjarvi at qbang.org Mon Feb 6 15:11:45 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 15:11:45 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: > rxtx_root_directory > `-- src > |-- main > | `-- java > | `-- gnu > | `-- io > `-- test > `-- java > `-- gnu > `-- io > >From what I understand this will just be good. For me it makes no difference. So lets do the rxtx thing. Let if fester for two weeks and if nobody objects, we will do it. I'm not doing this because I care. I'm doing this to eliminate much of my inbox. But test... man is rxtx lacking there in the community aspect. It is covered but not right. _maybe_ I can change that this year. -- Trent Jarvi tjarvi at qbang.org (cat hurding since 1997) From lux at diesel-research.com Mon Feb 6 21:38:49 2006 From: lux at diesel-research.com (Kim Lux) Date: Mon, 06 Feb 2006 21:38:49 -0700 Subject: [Rxtx] How can I use Lock Files with rxtx (in FC4) ? Message-ID: <1139287129.17031.3.camel@zd7280> I am now running an rxtx application on FC4. I am getting: ========================================================= check_group_uucp(): error testing lock file creation Error details: Permission denied check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL ========================================================= $ ls -al /var/lock total 32 drwxrwxr-x 4 root lock 4096 Feb 6 16:04 . drwxr-xr-x 24 root root 4096 Nov 14 01:19 .. drwx------ 2 root root 4096 Apr 27 2005 lvm drwxr-xr-x 2 root root 4096 Feb 6 16:04 subsys How do I fix this for regulator users ? -- Kim Lux, Diesel Research Inc. From dmarkman at mac.com Mon Feb 6 22:24:44 2006 From: dmarkman at mac.com (Dmitry Markman) Date: Tue, 7 Feb 2006 00:24:44 -0500 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: if I understands the issue right in order to be able to use ant for c/c++ compilation you have to install ant's cc task http://ant-contrib.sourceforge.net/cc.html it looks like it should work on mac os x (authors claim, that it's platform independent) but I never tested so all you have to do it's providing right command line for the gcc compiler On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: >> rxtx_root_directory >> `-- src >> |-- main >> | `-- java >> | `-- gnu >> | `-- io >> `-- test >> `-- java >> `-- gnu >> `-- io >> > > >> From what I understand this will just be good. > > For me it makes no difference. So lets do the rxtx thing. Let if > fester for two weeks and if nobody objects, we will do it. > > I'm not doing this because I care. I'm doing this to eliminate > much of my inbox. > > But test... man is rxtx lacking there in the community aspect. It > is covered but not right. _maybe_ I can change that this year. > > -- > Trent Jarvi > tjarvi at qbang.org > (cat hurding since 1997) > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx Dmitry Markman From lux at diesel-research.com Mon Feb 6 23:20:15 2006 From: lux at diesel-research.com (Kim Lux) Date: Mon, 06 Feb 2006 23:20:15 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? Message-ID: <1139293215.3689.4.camel@zd7280> I'm running the code below. portlist.hasMoreElements() is false. /dev has ports in it as listed below. What am I doing wrong ? ========================================================== // Step through the list of ports until we find one that matches // the one we are looking for. portList = CommPortIdentifier.getPortIdentifiers(); while(portList.hasMoreElements()) { portID = (CommPortIdentifier) portList.nextElement(); // if (portID.getName().equals("/dev/ttyUSB0")) { myTA.append("Serial port ttyUSB0 has been found\n"); break; }// if portID equals... }// End of while... ========================================================== ls -al /dev/tty* crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 ... crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 -- Kim Lux, Diesel Research Inc. From david.garnier at trusted-logic.com Tue Feb 7 00:46:30 2006 From: david.garnier at trusted-logic.com (David Garnier) Date: Tue, 07 Feb 2006 08:46:30 +0100 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: <43E85056.2090608@trusted-logic.com> Hello, I think that the make-based build process is fine as it is, apart from the location of the Java source files. It is true that putting the Java source in a directory structure that map 1-to-1 to the Java package structure is the norm and should make it easier for everyone to modify the Java source, with or without an IDE. Ant is a good tool, but in the RXTX case I fail to see the advantage of using it compared to the current make-based process. As Trent said, they are more pressing issues, like testing. Regards, David Dmitry Markman wrote: > if I understands the issue right > in order to be able to use ant for c/c++ compilation > you have to install ant's cc task > http://ant-contrib.sourceforge.net/cc.html > > it looks like it should work on mac os x > (authors claim, that it's platform independent) > but I never tested > > so all you have to do it's providing right command line > for the gcc compiler > > > > > On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: > >>> rxtx_root_directory >>> `-- src >>> |-- main >>> | `-- java >>> | `-- gnu >>> | `-- io >>> `-- test >>> `-- java >>> `-- gnu >>> `-- io >>> >> >> >>> From what I understand this will just be good. >> >> For me it makes no difference. So lets do the rxtx thing. Let if >> fester for two weeks and if nobody objects, we will do it. >> >> I'm not doing this because I care. I'm doing this to eliminate much >> of my inbox. >> >> But test... man is rxtx lacking there in the community aspect. It is >> covered but not right. _maybe_ I can change that this year. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> (cat hurding since 1997) From tjarvi at qbang.org Tue Feb 7 01:11:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 01:11:31 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <43E85056.2090608@trusted-logic.com> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: On Tue, 7 Feb 2006, David Garnier wrote: > Hello, > > I think that the make-based build process is fine as it is, apart from the location of the Java > source files. It is true that putting the Java source in a directory structure that map 1-to-1 to > the Java package structure is the norm and should make it easier for everyone to modify the Java > source, with or without an IDE. > > Ant is a good tool, but in the RXTX case I fail to see the advantage of using it compared to the > current make-based process. As Trent said, they are more pressing issues, like testing. > Hi David I have more experience with testing rxtx than I can talk about. But let it be known, rxtx has gone trough 100's of hours of testing. We are hobby folks interested in toys but there is more. rxtx has had some of the best guidance in the industry there. This is not an easy thing. I may be able to come back in a month from the other side of the corperate fence and help. I suspect the tests could just be made public but they are in a very unusual environment that just wont work in a wider sense. This is something I'll be trying to change. At one point it was agreed we could just make the results public so this isnt just noise.. There is interest and I think its safe to mention that much. The big problem with testing in the past is most of it is done with a loopback connection. So we *still* have major questions regarding things like flow control. rxtx talks to itself over a loopback and it works. regardless of right or wrong. This requires more thought to be done right. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Feb 7 02:46:34 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 02:46:34 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: > The big problem with testing in the past is most of it is done with a > loopback connection. So we *still* have major questions regarding things > like flow control. rxtx talks to itself over a loopback and it works. > regardless of right or wrong. With serial communication there are gold standards. ckermit is probably a definitive 'standard.' Maybe its possible to do ping/pong tests with ckermit? Is it scriptable? There are known issues in rxtx. Probably the worst is some threading issues regarding some JREs with multiple JNI threads setting java variables. Man did I get schooled there. Just switch the c functions to returning variables and things go away. Sometimes they work fine, sometimes they blow up. Without understanding everything, somehow rhat got it right and debian (and especially gentoo) grabbed kernel patches causing all sort of harm. Its not hard to fix once you understand whats going on but nearly impossible to track with a debugger. So I have a good idea what 2.1-8 will have outside of the IDE modifications. rxtx 2.1-7 is a release for everyone to sync with. Its not even as stable as -pre17 as far as I know - I ran no test suites. I'll be chasing it too. We just had so many contributions that it was time. It seriously broke internal scheduals but thats a great thing :) The other thing I want to do in 2.1-8 is automagic baud rates. It turns out lots of shops are doing really funky baud rates for things like automobile test equipment. It is possible but it requires a fair amount of change in the native code. Is anyone looking at this? -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Feb 7 02:57:21 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 07 Feb 2006 04:57:21 -0500 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <43E85056.2090608@trusted-logic.com> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: Hi All, I agree, testing is very important. The problem I have been trying to address is related to cross-platform testing and the robust nature of the installs. Typically, I visit 3 platforms to deploy my product, windows, linux and mac. A build is performed on each platform. The idea that you can build for many platforms from one copy the source code seems attractive. This should enable synchronized deployments of identical code. The question of how to achieve this goal remains open. As Trent mentioned, this is hard. Perhaps Ant will help here (but perhaps not). Ant does seem to help with running unit tests. However, it does not help with multi-platform tests. For that you need many machines and different operating environments. Toward that end, I have created a multi-platform test that can be run from web start, located at: http://show.docjava.com:8086/book/cgij/code/jnlp/serialPort.PortTest.jnlp This is interesting because many people in the community can run the test and we can improve the test, as time permits. No, it is not a perfect solution, however, the idea does help with multi-platform tests using many machines and different operating environments. If the group has a good test for a general serial port set-ups, i would be happy to deploy it, for general evaluation using web start. And as for ANT, it is just an idea. Not all my ideas are good ones! - Doug >Hello, > >I think that the make-based build process is fine as it is, apart >from the location of the Java >source files. It is true that putting the Java source in a directory >structure that map 1-to-1 to >the Java package structure is the norm and should make it easier for >everyone to modify the Java >source, with or without an IDE. > >Ant is a good tool, but in the RXTX case I fail to see the advantage >of using it compared to the >current make-based process. As Trent said, they are more pressing >issues, like testing. > >Regards, >David > >Dmitry Markman wrote: >> if I understands the issue right >> in order to be able to use ant for c/c++ compilation >> you have to install ant's cc task >> http://ant-contrib.sourceforge.net/cc.html >> >> it looks like it should work on mac os x >> (authors claim, that it's platform independent) >> but I never tested >> >> so all you have to do it's providing right command line >> for the gcc compiler >> >> >> >> >> On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: >> >>>> rxtx_root_directory >>>> `-- src >>>> |-- main >>>> | `-- java >>>> | `-- gnu >>>> | `-- io >>>> `-- test >>>> `-- java >>>> `-- gnu >>>> `-- io >>>> >>> >>> >>>> From what I understand this will just be good. >>> >>> For me it makes no difference. So lets do the rxtx thing. Let if >>> fester for two weeks and if nobody objects, we will do it. >>> >>> I'm not doing this because I care. I'm doing this to eliminate much >>> of my inbox. >>> >>> But test... man is rxtx lacking there in the community aspect. It is >>> covered but not right. _maybe_ I can change that this year. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> (cat hurding since 1997) > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From matt.higgins at gmail.com Tue Feb 7 08:28:34 2006 From: matt.higgins at gmail.com (Matt Higgins) Date: Tue, 7 Feb 2006 10:28:34 -0500 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final Message-ID: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? import java.io.*; import java.util.*; import gnu.io.*; public class MySimpleRead implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; public static void main(String[] args) { boolean portFound = false; String defaultPort = "COM1"; if (args.length > 0) { defaultPort = args[0]; } portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; MySimpleRead reader = new MySimpleRead(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } } public MySimpleRead() { try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) { e.printStackTrace(); } try { inputStream = serialPort.getInputStream(); } catch (IOException e) { e.printStackTrace(); } try { serialPort.addEventListener(this); } catch (TooManyListenersException e) { e.printStackTrace(); } try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { e.printStackTrace(); } System.out.println("Baud is " + serialPort.getBaudRate()); System.out.println("Bits is " + serialPort.getDataBits()); System.out.println("Stop is " + serialPort.getStopBits()); System.out.println("Par is " + serialPort.getParity()); serialPort.notifyOnDataAvailable(true); readThread = new Thread(this); readThread.start(); } public void run() { // Thread.sleep(20000); //} catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { System.out.println("An event occurred " + event.getEventType()); switch (event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: byte[] readBuffer = new byte[20]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } System.out.print(new String(readBuffer)); } catch (IOException e) {} break; } } } --------------- Result on windows ------------------------------ Stable Library ============================================================== Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port:: COM1 Baud is 9600 Bits is 8 Stop is 1 Par is 0 ----------------- End Results ----------------------------------------- ------------------ Result on Linux ----------------------------------- Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 Found port: /dev/ttyS0 Baud is 9600 Bits is 8 Stop is 1 Par is 0 An event occurred 1 043100066224 ------------------ End Results --------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/a1431630/attachment-0015.html From brian at mbari.org Tue Feb 7 09:48:37 2006 From: brian at mbari.org (Brian Schlining) Date: Tue, 7 Feb 2006 08:48:37 -0800 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> Message-ID: <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> Hi Matt > The following code works fine on Linux but I never see any data > when run on Windows. This is a cut and paste from the SimpleRead > example. > I am attempting to read data from a bar code scanner. I can fire > up HyperTermianl on windows and see that the device is working > properly as I see the barcodes are scanned and echoed back to the > terminal. However when I run the app I don't see any data. It is > however associating with the com port as the informational bits > print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. Cheers Brian Schlining Software Engineer http://www.mbari.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/16d07f37/attachment-0015.html From lux at diesel-research.com Tue Feb 7 11:59:58 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 11:59:58 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139293215.3689.4.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> Message-ID: <1139338798.8145.4.camel@zd7280> Any ideas on this ? Any reason why portList.hasMoreElements() should be false even though there are devices in /dev ? On Mon, 2006-02-06 at 23:20 -0700, Kim Lux wrote: > I'm running the code below. > > portlist.hasMoreElements() is false. > > /dev has ports in it as listed below. > > What am I doing wrong ? > > > ========================================================== > // Step through the list of ports until we find one that matches > // the one we are looking for. > > portList = CommPortIdentifier.getPortIdentifiers(); > > while(portList.hasMoreElements()) > { > portID = (CommPortIdentifier) portList.nextElement(); // > if (portID.getName().equals("/dev/ttyUSB0")) > { > myTA.append("Serial port ttyUSB0 has been found\n"); > break; > }// if portID equals... > }// End of while... > ========================================================== > > ls -al /dev/tty* > crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty > crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 > crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 > crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 > crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 > ... > crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 > crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 > crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 > > > -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 12:20:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 12:20:25 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139338798.8145.4.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> Message-ID: On Tue, 7 Feb 2006, Kim Lux wrote: > > Any ideas on this ? Any reason why portList.hasMoreElements() should be > false even though there are devices in /dev ? > > > On Mon, 2006-02-06 at 23:20 -0700, Kim Lux wrote: >> I'm running the code below. >> >> portlist.hasMoreElements() is false. >> >> /dev has ports in it as listed below. >> >> What am I doing wrong ? >> >> >> ========================================================== >> // Step through the list of ports until we find one that matches >> // the one we are looking for. >> >> portList = CommPortIdentifier.getPortIdentifiers(); >> >> while(portList.hasMoreElements()) >> { >> portID = (CommPortIdentifier) portList.nextElement(); // >> if (portID.getName().equals("/dev/ttyUSB0")) >> { >> myTA.append("Serial port ttyUSB0 has been found\n"); >> break; >> }// if portID equals... >> }// End of while... >> ========================================================== >> >> ls -al /dev/tty* >> crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty >> crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 >> crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 >> crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 >> crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 >> ... >> crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 >> crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 >> crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 >> >> >> > Hi Kim What rxtx does is try to open the port and do a timed out read. If the kernel/... do not complain it's enumarted. I suspect you could do a crude test by doing something like cat /dev/ttyS0 > /dev/null If that barfs then rxtx wont enumerate the port. hmm looking at your question again, I suspect it's a lockfile problem. This is documented in INSTALL with the source. Its easy enough to test this too.. touch /var/lock/testingrxtxlockfiles && rm -f /var/lock/testingrxtxlockfiles If you are not in the right group it will bail. Root will work regardless. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 12:37:56 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 12:37:56 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> Message-ID: <1139341076.8145.11.camel@zd7280> Exactly which ports does rxtx attempt to put into the list ? /dev/* or /dev/tty* or /dev/tty[0-9[0-9] ? or /dev/ttyS* ? For the record, only /dev/ttyUSB0 is a valid port on the machine I am presently on. Will this be a problem ? On Tue, 2006-02-07 at 12:20 -0700, Trent Jarvi wrote: > This is documented in INSTALL with the source. > I was wondering where that file was. I will download source and dig it up. Thanks. -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 12:51:09 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 12:51:09 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139341076.8145.11.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: On Tue, 7 Feb 2006, Kim Lux wrote: > > Exactly which ports does rxtx attempt to put into the list ? /dev/* > or /dev/tty* or /dev/tty[0-9[0-9] ? or /dev/ttyS* ? > > For the record, only /dev/ttyUSB0 is a valid port on the machine I am > presently on. Will this be a problem ? > > > On Tue, 2006-02-07 at 12:20 -0700, Trent Jarvi wrote: >> This is documented in INSTALL with the source. >> > I was wondering where that file was. I will download source and dig it > up. > > Thanks. > Hmm I'm looking at pre17 so this may have changed. (its just what I have on this machine) if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA" // for the IPAQs }; CandidatePortPrefixes=Temp; } So you may need to add "ttyUSB" to that list. RXTX used to enumerate _everything_ see if(osName.equals("Linux-all-ports") But it became less than practical. This is all in RXTXCommDriver.java hmm I just did a cvs update. if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have to get your fingers into the code. We aim for sane defaults. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 13:06:45 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 13:06:45 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139342805.8145.22.camel@zd7280> On Tue, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > Hmm I'm looking at pre17 so this may have changed. (its just what I have > on this machine) > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA" // for the IPAQs > }; > CandidatePortPrefixes=Temp; > } > > > So you may need to add "ttyUSB" to that list. RXTX used to enumerate > _everything_ see if(osName.equals("Linux-all-ports") But it became less > than practical. > > This is all in RXTXCommDriver.java > > hmm I just did a cvs update. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have > to get your fingers into the code. We aim for sane defaults. Excellent. Thanks for taking the time. -- Kim Lux, Diesel Research Inc. From ideiglenes1 at freemail.hu Tue Feb 7 13:53:39 2006 From: ideiglenes1 at freemail.hu (--) Date: Tue, 07 Feb 2006 21:53:39 +0100 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139345619.22534.2.camel@localhost> Hi! I use this code to get all the extra Linux devices. :) if ("Linux".equals(System.getProperty("os.name"))) { System.setProperty("os.name","Linux-all-ports"); } driver = new RXTXCommDriver(); On k, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > On Tue, 7 Feb 2006, Kim Lux wrote: > > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have > to get your fingers into the code. We aim for sane defaults. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From matt.higgins at gmail.com Tue Feb 7 13:45:54 2006 From: matt.higgins at gmail.com (Matt Higgins) Date: Tue, 7 Feb 2006 15:45:54 -0500 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> Message-ID: <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> Sweet this is exactly what I needed. I was searching the archives through marc.theamisgroup they only have archives back to 1/3/05. Should have hit the mailman archive! Thanks a lot! On 2/7/06, Brian Schlining wrote: > > Hi Matt > > The following code works fine on Linux but I never see any data when run > on Windows. This is a cut and paste from the SimpleRead example. > I am attempting to read data from a bar code scanner. I can fire up > HyperTermianl on windows and see that the device is working properly as I > see the barcodes are scanned and echoed back to the terminal. However when I > run the app I don't see any data. It is however associating with the com > port as the informational bits print fine? > > > You're not the only one whose had this problem, I don't know if Trent has > addressed this is the latest release of RXTX but there is a workaround. > Here's the recent thread from the RXTX mailing list regarding this issues: > > Thanasis Delenikas tdelenik at gmail.com > Wed Jan 18 13:56:23 MST 2006 > > * Previous message: [Rxtx] Re: More close() performance fixes > * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] > > Hi all. > (I've subscribed again from my other email account). > > Trent, > > You are right. Linux *always* works, no matter what flow control you set. > Windows *works only* with hardware flow control (I haven't tested what > happens with software XON/XOFF flow control). > > I assume (but I am not certain) that even with no flow control at all, all > platforms should work. Without flow control, you have the risk of bumping > into overflow or framing errors, but that's your (the end programmer, I > mean) problem. > > >From my side, I shouldn't be working without flow control. That was a bug > too... It was some code forgotten from the old times, when I used to work > with phone emulation drivers which didn't support flow control. The > correct > way is to have some flow control enabled and that's why I suppose this is > a > low-severity bug for RxTx. > > I have no idea which platform shows the correct behaviour, since > my knowledge about Linux and the inner workings of these low-level i/o > operations is limited. > > Regards, > Thanasis Delenikas. > > > > > Message: 2 > > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > > From: Trent Jarvi > > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > > To: RXTX Developers and Users > > Message-ID: > > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > > > Hi all, > > > > > > Trent, I have found something. > > > I read your comment about flow control, so I experimented a bit. > > > > > > If you remember, in my sample program I've used no flow control at all > ( > > i.e. > > > Java constant FLOWCONTROL_NONE). > > > > > > Now, during testing, I've switch to hardware inbound flow control (i.e > . > > Java > > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > > beautifully! > > > > > > I think I will switch to H/W flow control and test things for a while, > > but > > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > > > > > Hi Thanasis, > > > > I'm fairly sure you have identified a bug. I would not worry too much > > about what Sun CommAPI w32 defaults are. I think they did more or less > > whatever the port opened with. Just a guess. Linux tries to stomp on > > ports so they are all the same. > > > > So this started out with Linux worked, Windows XP/.. did not as I > recall. > > Something is wrong in rxtx. Do I understand this right? > > > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > > > Perhaps there is something Wayne or I did not understand when we wrote > > that code. I wasnt programming back in the BBS days so modems are not > my > > thing. I have a few questions. > > > > Is the above matrix confirmed by observation? > > Linux just always worked? > > Which one _should_ work? I'm guessing modems work with hardware flow > > control. I'll have to dig around. > > > > The windows flow control changes a couple things with hardware flow > > control. Following the w32 API documentation is confusing sometimes. > > But it looks like Linux could have a bug too. > > Cheers > > Brian Schlining > Software Engineer > http://www.mbari.org > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/9c989144/attachment-0015.html From tjarvi at qbang.org Tue Feb 7 14:06:14 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 14:06:14 -0700 (MST) Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> Message-ID: >> >> You're not the only one whose had this problem, I don't know if Trent has >> addressed this is the latest release of RXTX but there is a workaround. >> Here's the recent thread from the RXTX mailing list regarding this issues: >> I have not. I expect to have access to some test equipment next month and I'll go through all of this. I really don't know whats going on and I need a gold standard. I thought maybe linux was autodetecting the flow control. Your observations would certainly be welcome. I need to talk to Russell King and see what he is doing. Until then I'd just be toying around over a loopback as usual. This is very high on the list though. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 17:25:05 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 17:25:05 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139358305.17994.2.camel@zd7280> My application now works. I installed the libraries and jar from 2.1-7 (Final). portlist.hasMoreElements is no longer false. The application finds the port for /dev/ttyUSB0. Thanks for your help, Trent (et al) Sorry I bothered you with this. Next time I will look in the source first. I didn't think it was an rxtx issue, I thought it was a Linux setup issue . On Tue, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > Hmm I'm looking at pre17 so this may have changed. (its just what I > have > on this machine) > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux > Serial Ports > "ttySA" // for the > IPAQs > }; > > CandidatePortPrefixes=Temp; > } > > > So you may need to add "ttyUSB" to that list. RXTX used to enumerate > _everything_ see if(osName.equals("Linux-all-ports") But it became > less > than practical. > > This is all in RXTXCommDriver.java > > hmm I just did a cvs update. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux > Serial Ports > "ttySA", // for the > IPAQs > "ttyUSB" // for USB > frobs > }; > > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you > have > to get your fingers into the code. We aim for sane defaults. -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 19:21:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 19:21:54 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139358305.17994.2.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> <1139358305.17994.2.camel@zd7280> Message-ID: >Sorry I bothered you with this. Next time I will look in the source >first. I didn't think it was an rxtx issue, I thought it was a Linux >setup issue . Why would you be sorry? I would have done the same. I'm glad it's working :) -- Trent Jarvi tjarvi at qbang.org From tma at mail.island.net Wed Feb 8 13:39:35 2006 From: tma at mail.island.net (Tom Alldread) Date: Wed, 08 Feb 2006 12:39:35 -0800 Subject: [Rxtx] Win32/Linux Serial Port Data Dropouts In-Reply-To: <200602060702.k167255O007882@www.qbang.org> References: <200602060702.k167255O007882@www.qbang.org> Message-ID: <43EA5707.4020200@mail.island.net> Greetings Folks at RXTX: During the last couple of months I have been alternately testing with javax.comm 2 and RXTX 2.1 under Windows XP and CommApi 3 and RXTX 2.1 under Suse 10.0 Linux. In the process I have learned a little about java multi-threading under NetBeans 5 with Profiler. My java (jdk 1.5_06) application is used for data acquisition and provides a graphical display of A-D conversion data received from a 56KBaud serial port. The actual data throughput is about 10KBaud thus it is well below the speed of the port. I use hardware RTS/CTS flow control which can stall the data acquisition sample rate if necessary. This ensures the display computer has the ability to slow the data acquisition rate should it become too busy to accept the regular data flow. Both the serial port buffer and the java read buffer are set at 16KB. Usually the data transfers into the java read buffer are less than 100 bytes unless the data acquisition is recovering from a stall. The data flow normally hesitates after each 5 KB block as a continue command is needed from the display computer to start the drawing of a new graphics display line. Separate threads have been provided for the serial port event monitoring and data processing. The serial port event thread has been given the maximum priority and data processing thread the minimum priority provided by java. Thread yield statements have been placed within all data processing while/for loops as an effort to ensure quick access to CPU cycles for the serial port event thread. I have found that short data transmissions are essentially error free but occasional dropouts occur with continuous data flow especially under Windows XP. ....................................................................................................................................................................................... Linux results: I am happy to report that RXTX 2.1 appears to work very well under Linux although I did notice some errors when the screen savers were running with my dual monitors. I believe this is a local problem associated with my dual graphics which needs further attention. The recent CommApi 3 Linux release from Sun did not work at all with my program. It seemed to send commands out OK but did not receive any data. Although the serial port event triggered the ISR, the input stream appeared filled with nulls and thus did not contain any data. As my understanding is that CommApi 3 was tested with a Red Hat distribution of Linux I wonder if this problem is distro dependent? Although somewhat off topic here I wonder if anyone reading this has had similar experience? .................................................................................................................................................................................. Windows XP results: There are problems with occasional data dropouts which become more frequent as the sampling rate is increased or if the computer becomes busy with other duties. The dropouts typically consist of a half dozen byte block of lost data. It appears the lost bytes never get added to the java input stream. There has not been any indication of garbled data, overruns or framing errors which suggests the UART communications remains solid. Using javax.comm 2 I found that the setting of SerialPort 'enableReceiveThreshold' to 40 and 'enableReceiveTimeout' of 100mS reduced the dropouts error rate significantly. I found that I could not get RXTX 2.1 to function with the aforementioned threshold and timeout settings. The javax.comm 2 interface is consequently performing better for me under Windows than RXTX 2.1. I wonder if anyone here has any suggestions as to what I might try to improve RXTX 2.1? Although my settings are the same as under Suse 10.0, RXTX 2.1 performs much better for me under Linux than any of the alternatives that I have tried under Windows XP . ............................................................................................................................................................................... I would like to establish, based on the experience of others, if I have reached the normally expected performance limit of java serial port communications? Should I expect to achieve virtually error free serial port data input from a continuous stream under Windows XP java software? I am considering changing my protocol to packets with error checking if necessary but would like to know if the dropout problems I am experiencing are typical or not before I take this rather work intensive plunge. Many thanks in advance for any help! Best Regards, Tom Alldread -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.375 / Virus Database: 267.15.2/253 - Release Date: 2006-02-07 From jlaxson at mac.com Wed Feb 8 23:56:48 2006 From: jlaxson at mac.com (John Laxson) Date: Thu, 9 Feb 2006 00:56:48 -0600 Subject: [Rxtx] PortInUseException: Unknown Application on OSX Message-ID: Hi, I've been trying to get RXTX 2.1.7 going on Mac OS X for a while here, and am running up into a wall here. I've tried with pre- compiled and the source version and get the same problem, a gnu.io.PortInUseException: Unknown Application. I have run the fixperms script included with the source distribution, and id shows me as a member of the uucp group, and permissions on /var/spool/uucp are 775 root:uucp. Running a test program (included at the bottom for clarity) lets me enumerate all the serial ports correctly, but trying to open any of them gives the PortInUseException. If it helps, when I try to open a port that's set to make an outgoing bluetooth connection, there is no delay and no connection attempt at all. Thanks, John Laxson PS: The documentation wiki on qbang.org shows 404, and has for a few days now. My test code: public static void main(String[] args) { SerialPort serialPort; try { Enumeration e = CommPortIdentifier.getPortIdentifiers(); CommPortIdentifier ident; while (e.hasMoreElements()) { ident = (CommPortIdentifier)e.nextElement(); System.out.println(ident.getName()); } ident = CommPortIdentifier.getPortIdentifier("/dev/cu.modem"); serialPort = (SerialPort) ident.open("Me", 5000); } catch (Exception e) { e.printStackTrace(); } } From rajesh.invincible at gmail.com Thu Feb 9 03:39:38 2006 From: rajesh.invincible at gmail.com (Rajesh N) Date: Thu, 9 Feb 2006 16:09:38 +0530 Subject: [Rxtx] Re: Move .java Files in gnu.io filesystem hierarchy - Maven (2) In-Reply-To: <43DF21D2.7090200@ngi.it> References: <43DF21D2.7090200@ngi.it> Message-ID: <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Can anybody tell me how to overcome these EXCEPTIONS I AM WORKING ON SERIAL COMMN IN JAVA ON LINUX. 1. " NOT ALL PARAMETERS SUPPORTED BY THE KERNEL" This i came across the following statement inmy prog. SerialP is A SerialPort object SerialP.setSerialPortParams(9600(BAUDRATE),DATABITS_8,STOPBITS_1,PARITY_NONE) 2. NullPointer Exception at Event Dispatch Now i have checked all my object references for a null reference but i found none i have put up my entire code in try catch blocks but still I AM UNABLE TO CATCH THIS EXCEPTION AND HENCE MY APPLICATION CLOSES HOW DOES THESE GO? PLEASE HELP ME IT IS URGENTTTTTTTTTTTTTTTT yours sincerely RAJESH On 1/31/06, Fabio Frumento wrote: > Hi Xavier, > > I don't know maven at all but the directory hierarchy listed buy Trent > is fine for me... > > I'll take a look to maven, it seems an interesting project > > Regards > > Fabio Frumento > > Trent Jarvi wrote: > > On Tue, 31 Jan 2006, Xavier Frisaye wrote: > > > >> Hi all, > >> > >> If you are going to rearrange the src folder, i will propose to use > >> maven 2 and follow its directory structure > >> > (http://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html). > >> > >> Maven 2 simplify java project and give a standard way to make projects > >> (http://maven.apache.org/). > >> We are using it for internal projects and we are very satisfied. > >> > >> Is anybody interested? > >> > >> I'm not an expert in maven 2 (yet) but i'm agree to help using it if > >> you choose to make so. > >> > > > > so this would be: > > > > rxtx-devel/src/main/java/gnu.io > > rxtx-devel/src/test/java/ManIwish.java > > > > I don't use IDEs very much so I'll let others comment. But I don't see > > a problem with that. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Thu Feb 9 09:50:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 9 Feb 2006 09:50:31 -0700 (MST) Subject: [Rxtx] Re: Move .java Files in gnu.io filesystem hierarchy - Maven (2) In-Reply-To: <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Message-ID: On Thu, 9 Feb 2006, Rajesh N wrote: > Can anybody tell me how to overcome these EXCEPTIONS > I AM WORKING ON SERIAL COMMN IN JAVA ON LINUX. > > 1. " NOT ALL PARAMETERS SUPPORTED BY THE KERNEL" > > This i came across the following statement inmy prog. > SerialP is A SerialPort object > SerialP.setSerialPortParams(9600(BAUDRATE),DATABITS_8,STOPBITS_1,PARITY_NONE) > Strange. The parameters you use are the same the port should open with by default. Could you paste the actual exception you are getting? I don't see that in the rxtx source. Also it would help to know the rxtx version. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Fri Feb 10 15:29:05 2006 From: lux at diesel-research.com (Kim Lux) Date: Fri, 10 Feb 2006 15:29:05 -0700 Subject: [Rxtx] One serial port object for both sending and receiving ? Message-ID: <1139610545.18177.4.camel@zd7280> Is it OK to use one SerialPort ojbect (ex Serial Port serialPort;) and use it for both sending and receiving ? For example: ======================================================================== static SerialPort serialPort = null; static OutputStream serialOut = null; static InputStream serialIn = null; // assign it to an outputStream for use try{ serialOut = serialPort.getOutputStream(); System.out.println("Serial output stream has been assigned."); }//try catch(IOException e) { System.out.println("Error: Couldn't assign output stream to serial port."); }//catch //assign it to an inputStream for use try{ serialIn = serialPort.getInputStream(); System.out.println("Serial input stream has been assigned."); }//try catch(IOException e) { System.out.println("Error: Couldn't assign input stream to serial port."); }//catch ======================================================================== -- Kim Lux, Diesel Research Inc. From lux at diesel-research.com Fri Feb 10 21:23:00 2006 From: lux at diesel-research.com (Kim Lux) Date: Fri, 10 Feb 2006 21:23:00 -0700 Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Message-ID: <1139631780.23882.10.camel@zd7280> I've got a problem receiving chars with my version of serialRead, written in an SWT GUI. I had a Java pro have a good look at my code and he can't see anything wrong with it. I can send chars fine. When I receive a char the cpu usage for the app goes to 100% and the code in the serial event handler doesn't get executed. The instructions on the Java Comm Serial API How-To for Linux page state that I must install javacomm. Is that true ? Everything builds without it and I can send chars on rxtx just fine, but I can't receive them. Could this be the problem ? I downloaded and installed javacomm. I was not able to add "Driver=gnuio.RXTXCommDriver to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 installed in /usr/java/jre1.5.0_05. I added comm.jar to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext to the library paths. Is this OK ? Does it matter that I am receiving on /dev/ttyUSB0 ? Thanks. -- Kim Lux, Diesel Research Inc. From lunareclipse03 at web.de Sat Feb 11 09:44:46 2006 From: lunareclipse03 at web.de (lunareclipse03@web.de) Date: Sat, 11 Feb 2006 17:44:46 +0100 Subject: [Rxtx] Question about Serial I/O under Win32 Message-ID: <662084330@web.de> Hello everybody, I have a strange problem with a piece of code I made for myself. No, this is not really concerning rxtx, but nevertheless I post this to the list, hoping that some of you can help me. I've written two libraries, one for linux and one for win32. The linux port works quite well, I can send / receive faxes and / or replay voice messages over the telephone line using a voice modem. But the win32 port of the library causes some trouble. If, for example, I send out a fax with a certain modem under linux, it works well. The fax is complete when it comes out of the fax machine. If I then use the same modem to send out a fax under win32, the fax coming out of the fax machine gets "stuck" halfways, but the sending modem thinks that transmission was ok and drops the connection. The answering fax machine then gives me "error while receiving." The "upper layer" java code MUST be right, because if I do the same thing under linux (using the linux library), everything is alright. Now I have to ask: Can somebody please help me out with this??!? Could it be the case that some kind of flow control or COMMTIMEOUTS setting causes this behaviour? I set flow control to RTS/CTS before sending out a fax. How can I DISABLE flow control? Or what do you think? Can something else cause this problems? Thank you all for your time and PLEASE write back soon. Regards, --Sven Ahlemann Am Waldrand 31 45721 Haltern am See Germany ______________________________________________________________ Verschicken Sie romantische, coole und witzige Bilder per SMS! Jetzt bei WEB.DE FreeMail: http://f.web.de/?mc=021193 From lux at diesel-research.com Sat Feb 11 10:06:52 2006 From: lux at diesel-research.com (Kim Lux) Date: Sat, 11 Feb 2006 10:06:52 -0700 Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: <1139631780.23882.10.camel@zd7280> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> <1139631780.23882.10.camel@zd7280> Message-ID: <1139677612.3431.5.camel@zd7280> More on this problem. I copied and pasted simpleRead into a console based Eclipse project and I've got the same result, except that cpu usage doesn't go to 100%. I'm beginning to think there is an issue in rxtx. My imports for simpleRead are: ============================ import gnu.io.*; import java.util.*; //import javax.comm.*; import java.io.*; =========================== Any ideas ? I am trying to read from /dev/ttyUSB0 using a serial to USB adapter which has worked well with minicom and gtkterm. Thanks. On Fri, 2006-02-10 at 21:23 -0700, Kim Lux wrote: > I've got a problem receiving chars with my version of serialRead, > written in an SWT GUI. > > I had a Java pro have a good look at my code and he can't see anything > wrong with it. > > I can send chars fine. When I receive a char the cpu usage for the app > goes to 100% and the code in the serial event handler doesn't get > executed. > > The instructions on the Java Comm Serial API How-To for Linux page state > that I must install javacomm. Is that true ? Everything builds without > it and I can send chars on rxtx just fine, but I can't receive them. > Could this be the problem ? > > I downloaded and installed javacomm. I was not able to add > "Driver=gnuio.RXTXCommDriver > to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not > have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 > installed in /usr/java/jre1.5.0_05. I added comm.jar > to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext > to the library paths. Is this OK ? > > Does it matter that I am receiving on /dev/ttyUSB0 ? > > Thanks. > -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Sun Feb 12 21:01:33 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:01:33 -0700 (MST) Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: <1139677612.3431.5.camel@zd7280> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> <1139631780.23882.10.camel@zd7280> <1139677612.3431.5.camel@zd7280> Message-ID: I suspect what is happening is the select() is breaking out in the native code but the driver does not have support for notifying there are X bytes available. On some traditional Unix based systems, the only way you know data is available is the fd status changes and do an FIORDCHK ioctl. Or perhaps the only thing you can know is the fd status changed. It would take reading through the kernel driver code to know for sure. So on USB, depending upon the driver, the same may need to be done or the driver improved a bit if possible to support. Polling reads will also work but don't use the event driven model of CommAPI which isnt acceptable in the long run. The 100% cpu usage can then be explained because select no longer blocks until the data is read; the eventLoop spins loose. You can put a well placed sleep but rxtx only expects those are needed when it knows data is available. This may not be a super simple thing to understand and fix. I do have ideas to get you started. I'm going to be short on time the next couple weeks. I expect to put some good time in and answer some other questions I saw around the 25th. For now, I'd look at the following and go from there with the hints I've given. JNIEXPORT jint JNICALL RXTXPort(nativeavailable)( JNIEnv *env, jobject jobj ) { int fd = get_java_var( env, jobj,"fd","I" ); int result; /* char message[80]; ENTER( "RXTXPort:nativeavailable" ); On SCO OpenServer FIONREAD always fails for serial devices, so try ioctl FIORDCHK instead; will only tell us whether bytes are available, not how many, but better than nothing. This turns out to be true on Solaris also. taj. */ #ifdef FIORDCHK /* __unixware__ __sun__ probably others */ result = ioctl(fd, FIORDCHK, 0); #else if( ioctl( fd, FIONREAD, &result ) < 0 ) { goto fail; } #endif /* FIORDCHK */ On Sat, 11 Feb 2006, Kim Lux wrote: > > More on this problem. I copied and pasted simpleRead into a console > based Eclipse project and I've got the same result, except that cpu > usage doesn't go to 100%. I'm beginning to think there is an issue in > rxtx. > > My imports for simpleRead are: > > ============================ > import gnu.io.*; > import java.util.*; > //import javax.comm.*; > import java.io.*; > =========================== > > Any ideas ? I am trying to read from /dev/ttyUSB0 using a serial to > USB adapter which has worked well with minicom and gtkterm. > > Thanks. > > > > On Fri, 2006-02-10 at 21:23 -0700, Kim Lux wrote: >> I've got a problem receiving chars with my version of serialRead, >> written in an SWT GUI. >> >> I had a Java pro have a good look at my code and he can't see anything >> wrong with it. >> >> I can send chars fine. When I receive a char the cpu usage for the app >> goes to 100% and the code in the serial event handler doesn't get >> executed. >> >> The instructions on the Java Comm Serial API How-To for Linux page state >> that I must install javacomm. Is that true ? Everything builds without >> it and I can send chars on rxtx just fine, but I can't receive them. >> Could this be the problem ? >> >> I downloaded and installed javacomm. I was not able to add >> "Driver=gnuio.RXTXCommDriver >> to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not >> have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 >> installed in /usr/java/jre1.5.0_05. I added comm.jar >> to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext >> to the library paths. Is this OK ? >> >> Does it matter that I am receiving on /dev/ttyUSB0 ? >> >> Thanks. >> > From tjarvi at qbang.org Sun Feb 12 21:03:30 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:03:30 -0700 (MST) Subject: [Rxtx] One serial port object for both sending and receiving ? In-Reply-To: <1139610545.18177.4.camel@zd7280> References: <1139610545.18177.4.camel@zd7280> Message-ID: On Fri, 10 Feb 2006, Kim Lux wrote: > > Is it OK to use one SerialPort ojbect (ex Serial Port serialPort;) and > use it for both sending and receiving ? > > For example: > > ======================================================================== > static SerialPort serialPort = null; > static OutputStream serialOut = null; > static InputStream serialIn = null; > > > > > // assign it to an outputStream for use > try{ > serialOut = serialPort.getOutputStream(); > System.out.println("Serial output stream has been assigned."); > }//try > catch(IOException e) > { > System.out.println("Error: Couldn't assign output stream to serial > port."); > }//catch > > > //assign it to an inputStream for use > try{ > serialIn = serialPort.getInputStream(); > System.out.println("Serial input stream has been assigned."); > }//try > catch(IOException e) > { > System.out.println("Error: Couldn't assign input stream to serial > port."); > }//catch This should be fine. In fact trying to do it another way will probably not work as you will run into lockfile issues. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun Feb 12 21:13:13 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:13:13 -0700 (MST) Subject: [Rxtx] Question about Serial I/O under Win32 In-Reply-To: <662084330@web.de> References: <662084330@web.de> Message-ID: On Sat, 11 Feb 2006 lunareclipse03 at web.de wrote: > Hello everybody, > > I have a strange problem with a piece of code I made for myself. No, > this is not really concerning rxtx, but nevertheless I post this to the > list, hoping that some of you can help me. I've written two libraries, > one for linux and one for win32. The linux port works quite well, I can > send / receive faxes and / or replay voice messages over the telephone > line using a voice modem. But the win32 port of the library causes some > trouble. If, for example, I send out a fax with a certain modem under > linux, it works well. The fax is complete when it comes out of the fax > machine. If I then use the same modem to send out a fax under win32, the > fax coming out of the fax machine gets "stuck" halfways, but the sending > modem thinks that transmission was ok and drops the connection. The > answering fax machine then gives me "error while receiving." The "upper > layer" java code MUST be right, because if I do the same thing under > linux (using the linux library), everything is alright. Now I have to > ask: Can somebody please help me out with this??!? Could it be the case > that some kind of flow control or COMMTIMEOUTS setting causes this > behaviour? I set flow control to RTS/CTS before sending out a fax. How > can I DISABLE flow control? Or what do you think? Can something else > cause this problems? Thank you all for your time and PLEASE write back > soon. > Hi Sven I'm not too willing to talk about flow control at the low level until I confirm some things with test equipment later. It is not clear if you are using rxtx or writing your own native code. So I'm not sure how to answer much of this :) If you are wondering how to change the flow control using rxtx from java, The BlackBox example from Sun flips this back and forth. SerialPort.java in rxtx 2.1 uses the following: SerialPort.java: public static final int FLOWCONTROL_NONE =0; SerialPort.java: public static final int FLOWCONTROL_RTSCTS_IN =1; SerialPort.java: public static final int FLOWCONTROL_RTSCTS_OUT =2; SerialPort.java: public static final int FLOWCONTROL_XONXOFF_IN =4; SerialPort.java: public static final int FLOWCONTROL_XONXOFF_OUT=8; So if you set flowcontrol to RTSCTS, you can set it to NONE to turn it off. If you are looking for how to do it in native code, the rxtx Source is SerialImp.c (unix/linux/mac os x/w32) and termios.c (w32 only with SerialImp.c) You can track the code: SerialImp.c:JNIEXPORT void JNICALL RXTXPort(setflowcontrol)( JNIEnv *env, jobject jobj, jint flowmode ) termios.c:int tcgetattr( int fd, struct termios *s_termios ) termios.c:int tcsetattr( int fd, int when, struct termios *s_termios ) There may be a problem in the rxtx flow control code though. Rather than guess, I want to test this with a gold standard. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Feb 6 00:00:16 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 00:00:16 -0700 (MST) Subject: [Rxtx] wiki delay until tomorrow night. In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: On Sun, 5 Feb 2006, Trent Jarvi wrote: > On Sun, 5 Feb 2006, Kim Lux wrote: > >> usb ? Tell me more... I need that too. > > usb is a very proper design. Thats all it is. > Maybe rxtx could help usb. But it would start with helping bring back the community that was already there. It's not something I'd love to do but maybe its the right thing to do. It would probably take 2 years to do right. But maybe thats better than what we have now. I honestly don't know what IBM is doing which could just run over everything. Just some thoughts after some fine german wine. -- Trent Jarvi tjarvi at qbang.org From gadelavega at yahoo.com.ar Mon Feb 6 02:17:05 2006 From: gadelavega at yahoo.com.ar (Gonzalo A. de la Vega) Date: Mon, 06 Feb 2006 10:17:05 +0100 Subject: [Rxtx] Serial port ownership question In-Reply-To: References: <20060205113618.30274.qmail@web53501.mail.yahoo.com> <1139157422.4553.9.camel@zd7280> <1139158698.4936.9.camel@zd7280> Message-ID: <43E71411.4050402@yahoo.com.ar> On my Fedora Core 4: ls -l /dev/ttyS* crw-rw---- 1 root uucp 4, 64 Feb 6 2006 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Feb 6 2006 /dev/ttyS1 ... and: grep "ttyUSB" /etc/udev/rules.d/50-udev.rules KERNEL=="ttyUSB*", GROUP="uucp", MODE="0660" So anyone in the "uucp" group can use serial ports. On Gentoo the group is "tty". Trent Jarvi escribi?: > > > On Sun, 5 Feb 2006, Dr. Douglas Lyon wrote: > >> I can confirm that this is the case (only root ownership of >> serial ports, under fedora 4). >> Wow, what were they thinking?! >> - DL >> >>> I've found that the newer kernels have the serial ports owned by root. >>> For example, >>> >>> $ls -al /dev/tty* >>> crw-rw-rw- 1 root root 5, 0 Feb 5 02:06 /dev/tty >>> crw-rw---- 1 root root 4, 0 Feb 5 02:06 /dev/tty0 >>> crw------- 1 root root 4, 1 Feb 5 09:07 /dev/tty1 >>> crw-rw---- 1 root tty 4, 10 Feb 5 02:06 /dev/tty10 >>> crw-rw---- 1 root tty 4, 11 Feb 5 02:06 /dev/tty11 >>> ... > > > This is just not a problem jcp or such are going to solve. Its a > platform spitwad fight. But do look at pam. In fact thats what Sun > is doing too. Maybe Linux followed their lead.. I'm not a pam guy. > I've spent 16 hours trying to understand it but your users wont :) > > Solution? I have no clue. Its two tangent mentalities from my > perspective. > > -- > Trent Jarvi > tjarvi at qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mtnvega at yahoo.com.br Mon Feb 6 05:35:43 2006 From: mtnvega at yahoo.com.br (Luiz Jr) Date: Mon, 6 Feb 2006 12:35:43 +0000 (GMT) Subject: [Rxtx] Documentation Wiki In-Reply-To: <1139157422.4553.9.camel@zd7280> Message-ID: <20060206123543.57256.qmail@web53515.mail.yahoo.com> Hello, Thank you for you answer, but so the usage of the API is pretty much like the Java Communications Api? If yes, what version of the Java Comm Api? Thank you, Luiz A. Brandao Jr Kim Lux escreveu: On Sun, 2006-02-05 at 08:36 -0300, Luiz Jr wrote: > Hello, > > I want to start using the RXTX libraries, but I would to know how, > since I can not access the documentation wiki page I just started using them yesterday. Below is how I installed the libraries, if that helps. I used snippets of code from the SimpleWrite application here to get me going. http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html Instead of "import javax.comm.*;", use "import gnu.io.*;" which is gotten from RXTXcomm.jar, which you will need to include in your project references. I am working in Eclipse. BTW: there is no way to open a port without going through the port list and finding it. Maybe sometime in the future someone (me ?) will write a method called openSerialPort that allows the user to give a port identifier, such as "/dev/tty1" and return a port ready to use. It wouldn't take much to write that and it would save users a lot of code. Hope this helps. ======================================================================= 1) Figure out which java you are running, incase there is more than one installed. $ java -version java version "1.5.0_05" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_05-b05) Java HotSpot(TM) Client VM (build 1.5.0_05-b05, mixed mode, sharing) 2) Find all the jre directories and the one from which you are currently running. kfind (jre) 3) cd to that directory plus /lib/i386 cd /usr/java/jre1.5.0_05/lib/i386 4) Copy the library files (*.so) to that directory. cp /home/krlux/Desktop/'Java Controls'/rxtx-linux/bin/* . 5) Check that the copy was successful ls librxtx* librxtxI2C.so librxtxRaw.so librxtxSerial.so librxtxParallel.so librxtxRS485.so 6) cd to the /lib/ext directory for your java. cd /usr/java/jre1.5.0_05/lib/ext 7) Copy the Jar files there cp /home/krlux/Desktop/'Java Controls'/rxtx-linux/lib/ext/* . 8) Check that it was successful ls RXTX* RXTXcomm.jar Rxtx is now installed on your machine ready to use. =================================================================== -- Kim Lux, Diesel Research Inc. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx --------------------------------- Yahoo! Acesso Gr?tis - Internet r?pida e gr?tis. Instale o discador agora! -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/544aa403/attachment-0016.html From lyon at docjava.com Mon Feb 6 05:49:34 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 06 Feb 2006 07:49:34 -0500 Subject: [Rxtx] wiki delay until tomorrow night. In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: Hi All, I have often thought about USB drivers being needed. For example, the ironman watch will not interface to a mac (windows only). It is USB. My dymo label writer has no Java driver (native only). Etc. Most cheap web cameras are USB (and Java drivers go through JAI, if it supports the camera at all). The JAI code shows how sun did the USB drivers. You have to be a member of the jai project to download the source code. https://jai.dev.java.net has the jai distro. And then you are not allowed to redistribute it. However, we can all learn from it (if so inclined). Basically: cvs -d :pserver:lyon at cvs.dev.java.net:/cvs login cvs -d :pserver:lyon at cvs.dev.java.net:/cvs checkout jai-core You will need to user your own uid and pw to get in. The ant build has over 100 warnings from sun deprecations of its own code. You might say that they were hoisted on their own Picard ;) One interesting thing is that they support several platforms: linux-amd64 64-bit Linux-AMD64 linux-i586 32-bit Linux-x86 solaris-amd64 64-bit Solaris-AMD64 solaris-i586 32-bit Solaris-x86 solaris-sparc 32-bit Solaris-SPARC solaris-sparcv9 64-bit Solaris-SPARC windows-i586 32-bit Windows-x86 Thus, ant is used to provide a multi-platform native method distro. Neat. How do they do it? check this out: And: The core download does not contain any C source code (it was all pre-built). Basically, they are just copying .so and .dll files into build directories. I would love to see the C code for this...but Sun does not post it on the https://jai.dev.java.net site. I don't know why...Perhaps I missed it. - Doug >On Sun, 5 Feb 2006, Trent Jarvi wrote: > >>On Sun, 5 Feb 2006, Kim Lux wrote: >> >>>usb ? Tell me more... I need that too. >> >>usb is a very proper design. Thats all it is. >> > >Maybe rxtx could help usb. But it would start with helping bring >back the community that was already there. > >It's not something I'd love to do but maybe its the right thing to do. > >It would probably take 2 years to do right. But maybe thats better >than what we have now. > >I honestly don't know what IBM is doing which could just run over everything. > >Just some thoughts after some fine german wine. > >-- >Trent Jarvi >tjarvi at qbang.org > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tdelenik at gmail.com Mon Feb 6 05:56:32 2006 From: tdelenik at gmail.com (Thanasis Delenikas) Date: Mon, 6 Feb 2006 14:56:32 +0200 Subject: Fwd: [Rxtx] Documentation Wiki In-Reply-To: <1139157422.4553.9.camel@zd7280> References: <20060205113618.30274.qmail@web53501.mail.yahoo.com> <1139157422.4553.9.camel@zd7280> Message-ID: <310a1a930602060456t129f1dc6p5f2b908f13ab5a0b@mail.gmail.com> Hello all, Kim, this is a snippet from the code I use. The closest to directly opening a specific port without enumeration. << ... portId = CommPortIdentifier.getPortIdentifier(getPort()); serialPort = (SerialPort) portId.open("jSMSEngine", 1971); ... >> where getPort() return the string identifier of the port, i.e. "/dev/ttyS0" or "COM1" or whatever. Thanasis. ---------- Forwarded message ---------- From: Kim Lux Date: Feb 5, 2006 6:37 PM Subject: Re: [Rxtx] Documentation Wiki To: RXTX Developers and Users BTW: there is no way to open a port without going through the port list and finding it. Maybe sometime in the future someone (me ?) will write a method called openSerialPort that allows the user to give a port identifier, such as "/dev/tty1" and return a port ready to use. It wouldn't take much to write that and it would save users a lot of code. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/182ab5b8/attachment-0016.html From tjarvi at qbang.org Mon Feb 6 11:53:57 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 11:53:57 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: On Mon, 6 Feb 2006, Dr. Douglas Lyon wrote: > Hi All, > I have often thought about USB drivers being needed. > For example, the ironman watch will not interface > to a mac (windows only). It is USB. > My dymo label writer has no Java driver (native only). > Etc. > Most cheap web cameras are USB (and Java drivers go > through JAI, if it supports the camera at all). > The JAI code shows how sun did the USB drivers. > You have to be a member of the jai project to download > the source code. > https://jai.dev.java.net has the jai distro. > And then you are not allowed to redistribute it. However, > we can all learn from it (if so inclined). Basically: > cvs -d :pserver:lyon at cvs.dev.java.net:/cvs login > cvs -d :pserver:lyon at cvs.dev.java.net:/cvs checkout jai-core > You will need to user your own uid and pw to get in. > The ant build has over 100 warnings from sun deprecations > of its own code. > > You might say that they were hoisted on their own Picard ;) > > One interesting thing is that they support several platforms: > linux-amd64 64-bit Linux-AMD64 > linux-i586 32-bit Linux-x86 > solaris-amd64 64-bit Solaris-AMD64 > solaris-i586 32-bit Solaris-x86 > solaris-sparc 32-bit Solaris-SPARC > solaris-sparcv9 64-bit Solaris-SPARC > windows-i586 32-bit Windows-x86 > Thus, ant is used to provide a multi-platform native method distro. > Neat. > How do they do it? > check this out: > > > > > > > > > > > > > And: > > > > > > > > > > The core download does not contain any C source code (it was all pre-built). > Basically, they are just copying .so and .dll files into build directories. > > I would love to see the C code for this...but Sun does not post it on the > https://jai.dev.java.net site. > > I don't know why...Perhaps I missed it. > > - Doug > > I've looked at moving rxtx to Ant builds. I think that would help IDEs a great deal. I requested a evalutation desk copy the O'Reilly Ant book for some j2ee material I was teaching. http://www.oreilly.com/catalog/anttdg/ It has a one sentence mention of JNI. So there was not luck there. I saw that there is another Ant book that does mention JNI more. I can't find it now. Ant must be able to support it with extensions. http://ant.apache.org/manual/OptionalTasks/javah.html What the auto(break :) tools do in the rxtx build is 4 things really. 1) gcc compile flags 2) ld compile flags 3) config.h 4) compile flags for customizing rxtx (lockfiles, ...) See 1 All of this information except 4 can be static once obtained. So I'm not attached to the auto tools. If I could find an example of Ant being used for JNI code, I'd be one of the first to start moving that direction. Maybe someone saw an example someplace. The other thing we have not completed discussing is the directory structure. There is interest in making rxtx more IDE friendly. I get more mail about that off the list than how to install rxtx. And I see we have Ken Thompson in da house :) He is our trusted CVS maintainer and the guy that purchased the rxtx.org domain. Old community. We will need Ken for changing the directory structure of source. I would like to open up discussion about both of these as it is more than time. The problem is I have little experience with Ant and even less with IDEs. It would be nice if we could work with Eclipse and NetBeans. http://www.netbeans.org/ (sun and some community) http://www.eclipes.org (ibm,rhat,... perhaps more community) http://maven.apache.org/what-is-maven.html (apache. It is community) borland should sortof be here too but I think thats covered in eclipse. >From what I understand so far, we should morph rxtx to support those three maybe trusting apaches lead with maven. But I use vi. I have little to no clues beyond what people have fed me. Can we agree that thats the right direction to go? -- Trent Jarvi tjarvi at qbang.org From brian at mbari.org Mon Feb 6 14:57:50 2006 From: brian at mbari.org (Brian Schlining) Date: Mon, 6 Feb 2006 13:57:50 -0800 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> > The other thing we have not completed discussing is the directory > structure. There is interest in making rxtx more IDE friendly. I > get more mail about that off the list than how to install rxtx. > > And I see we have Ken Thompson in da house :) He is our trusted > CVS maintainer and the guy that purchased the rxtx.org domain. Old > community. We will need Ken for changing the directory structure of > source. > > I would like to open up discussion about both of these as it is > more than time. The problem is I have little experience with Ant > and even less with IDEs. It would be nice if we could work with > Eclipse and NetBeans. > > http://www.netbeans.org/ (sun and some community) > http://www.eclipes.org (ibm,rhat,... perhaps more community) > http://maven.apache.org/what-is-maven.html (apache. It is community) > borland should sortof be here too but I think thats covered in > eclipse. > >> From what I understand so far, we should morph rxtx to support >> those three > maybe trusting apaches lead with maven. But I use vi. I have > little to no clues beyond what people have fed me. > Maven likes the directory structure below for Java code. (From http:// maven.apache.org/guides/getting-started/index.html) This structure works fine with ant, netbeans, and eclipse. rxtx_root_directory `-- src |-- main | `-- java | `-- gnu | `-- io `-- test `-- java `-- gnu `-- io Brian Schlining Software Engineer http://www.mbari.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/d9451eba/attachment-0016.html From tjarvi at qbang.org Mon Feb 6 15:11:45 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 15:11:45 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: > rxtx_root_directory > `-- src > |-- main > | `-- java > | `-- gnu > | `-- io > `-- test > `-- java > `-- gnu > `-- io > >From what I understand this will just be good. For me it makes no difference. So lets do the rxtx thing. Let if fester for two weeks and if nobody objects, we will do it. I'm not doing this because I care. I'm doing this to eliminate much of my inbox. But test... man is rxtx lacking there in the community aspect. It is covered but not right. _maybe_ I can change that this year. -- Trent Jarvi tjarvi at qbang.org (cat hurding since 1997) From lux at diesel-research.com Mon Feb 6 21:38:49 2006 From: lux at diesel-research.com (Kim Lux) Date: Mon, 06 Feb 2006 21:38:49 -0700 Subject: [Rxtx] How can I use Lock Files with rxtx (in FC4) ? Message-ID: <1139287129.17031.3.camel@zd7280> I am now running an rxtx application on FC4. I am getting: ========================================================= check_group_uucp(): error testing lock file creation Error details: Permission denied check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL ========================================================= $ ls -al /var/lock total 32 drwxrwxr-x 4 root lock 4096 Feb 6 16:04 . drwxr-xr-x 24 root root 4096 Nov 14 01:19 .. drwx------ 2 root root 4096 Apr 27 2005 lvm drwxr-xr-x 2 root root 4096 Feb 6 16:04 subsys How do I fix this for regulator users ? -- Kim Lux, Diesel Research Inc. From dmarkman at mac.com Mon Feb 6 22:24:44 2006 From: dmarkman at mac.com (Dmitry Markman) Date: Tue, 7 Feb 2006 00:24:44 -0500 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: if I understands the issue right in order to be able to use ant for c/c++ compilation you have to install ant's cc task http://ant-contrib.sourceforge.net/cc.html it looks like it should work on mac os x (authors claim, that it's platform independent) but I never tested so all you have to do it's providing right command line for the gcc compiler On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: >> rxtx_root_directory >> `-- src >> |-- main >> | `-- java >> | `-- gnu >> | `-- io >> `-- test >> `-- java >> `-- gnu >> `-- io >> > > >> From what I understand this will just be good. > > For me it makes no difference. So lets do the rxtx thing. Let if > fester for two weeks and if nobody objects, we will do it. > > I'm not doing this because I care. I'm doing this to eliminate > much of my inbox. > > But test... man is rxtx lacking there in the community aspect. It > is covered but not right. _maybe_ I can change that this year. > > -- > Trent Jarvi > tjarvi at qbang.org > (cat hurding since 1997) > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx Dmitry Markman From lux at diesel-research.com Mon Feb 6 23:20:15 2006 From: lux at diesel-research.com (Kim Lux) Date: Mon, 06 Feb 2006 23:20:15 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? Message-ID: <1139293215.3689.4.camel@zd7280> I'm running the code below. portlist.hasMoreElements() is false. /dev has ports in it as listed below. What am I doing wrong ? ========================================================== // Step through the list of ports until we find one that matches // the one we are looking for. portList = CommPortIdentifier.getPortIdentifiers(); while(portList.hasMoreElements()) { portID = (CommPortIdentifier) portList.nextElement(); // if (portID.getName().equals("/dev/ttyUSB0")) { myTA.append("Serial port ttyUSB0 has been found\n"); break; }// if portID equals... }// End of while... ========================================================== ls -al /dev/tty* crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 ... crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 -- Kim Lux, Diesel Research Inc. From david.garnier at trusted-logic.com Tue Feb 7 00:46:30 2006 From: david.garnier at trusted-logic.com (David Garnier) Date: Tue, 07 Feb 2006 08:46:30 +0100 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: <43E85056.2090608@trusted-logic.com> Hello, I think that the make-based build process is fine as it is, apart from the location of the Java source files. It is true that putting the Java source in a directory structure that map 1-to-1 to the Java package structure is the norm and should make it easier for everyone to modify the Java source, with or without an IDE. Ant is a good tool, but in the RXTX case I fail to see the advantage of using it compared to the current make-based process. As Trent said, they are more pressing issues, like testing. Regards, David Dmitry Markman wrote: > if I understands the issue right > in order to be able to use ant for c/c++ compilation > you have to install ant's cc task > http://ant-contrib.sourceforge.net/cc.html > > it looks like it should work on mac os x > (authors claim, that it's platform independent) > but I never tested > > so all you have to do it's providing right command line > for the gcc compiler > > > > > On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: > >>> rxtx_root_directory >>> `-- src >>> |-- main >>> | `-- java >>> | `-- gnu >>> | `-- io >>> `-- test >>> `-- java >>> `-- gnu >>> `-- io >>> >> >> >>> From what I understand this will just be good. >> >> For me it makes no difference. So lets do the rxtx thing. Let if >> fester for two weeks and if nobody objects, we will do it. >> >> I'm not doing this because I care. I'm doing this to eliminate much >> of my inbox. >> >> But test... man is rxtx lacking there in the community aspect. It is >> covered but not right. _maybe_ I can change that this year. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> (cat hurding since 1997) From tjarvi at qbang.org Tue Feb 7 01:11:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 01:11:31 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <43E85056.2090608@trusted-logic.com> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: On Tue, 7 Feb 2006, David Garnier wrote: > Hello, > > I think that the make-based build process is fine as it is, apart from the location of the Java > source files. It is true that putting the Java source in a directory structure that map 1-to-1 to > the Java package structure is the norm and should make it easier for everyone to modify the Java > source, with or without an IDE. > > Ant is a good tool, but in the RXTX case I fail to see the advantage of using it compared to the > current make-based process. As Trent said, they are more pressing issues, like testing. > Hi David I have more experience with testing rxtx than I can talk about. But let it be known, rxtx has gone trough 100's of hours of testing. We are hobby folks interested in toys but there is more. rxtx has had some of the best guidance in the industry there. This is not an easy thing. I may be able to come back in a month from the other side of the corperate fence and help. I suspect the tests could just be made public but they are in a very unusual environment that just wont work in a wider sense. This is something I'll be trying to change. At one point it was agreed we could just make the results public so this isnt just noise.. There is interest and I think its safe to mention that much. The big problem with testing in the past is most of it is done with a loopback connection. So we *still* have major questions regarding things like flow control. rxtx talks to itself over a loopback and it works. regardless of right or wrong. This requires more thought to be done right. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Feb 7 02:46:34 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 02:46:34 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: > The big problem with testing in the past is most of it is done with a > loopback connection. So we *still* have major questions regarding things > like flow control. rxtx talks to itself over a loopback and it works. > regardless of right or wrong. With serial communication there are gold standards. ckermit is probably a definitive 'standard.' Maybe its possible to do ping/pong tests with ckermit? Is it scriptable? There are known issues in rxtx. Probably the worst is some threading issues regarding some JREs with multiple JNI threads setting java variables. Man did I get schooled there. Just switch the c functions to returning variables and things go away. Sometimes they work fine, sometimes they blow up. Without understanding everything, somehow rhat got it right and debian (and especially gentoo) grabbed kernel patches causing all sort of harm. Its not hard to fix once you understand whats going on but nearly impossible to track with a debugger. So I have a good idea what 2.1-8 will have outside of the IDE modifications. rxtx 2.1-7 is a release for everyone to sync with. Its not even as stable as -pre17 as far as I know - I ran no test suites. I'll be chasing it too. We just had so many contributions that it was time. It seriously broke internal scheduals but thats a great thing :) The other thing I want to do in 2.1-8 is automagic baud rates. It turns out lots of shops are doing really funky baud rates for things like automobile test equipment. It is possible but it requires a fair amount of change in the native code. Is anyone looking at this? -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Feb 7 02:57:21 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 07 Feb 2006 04:57:21 -0500 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <43E85056.2090608@trusted-logic.com> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: Hi All, I agree, testing is very important. The problem I have been trying to address is related to cross-platform testing and the robust nature of the installs. Typically, I visit 3 platforms to deploy my product, windows, linux and mac. A build is performed on each platform. The idea that you can build for many platforms from one copy the source code seems attractive. This should enable synchronized deployments of identical code. The question of how to achieve this goal remains open. As Trent mentioned, this is hard. Perhaps Ant will help here (but perhaps not). Ant does seem to help with running unit tests. However, it does not help with multi-platform tests. For that you need many machines and different operating environments. Toward that end, I have created a multi-platform test that can be run from web start, located at: http://show.docjava.com:8086/book/cgij/code/jnlp/serialPort.PortTest.jnlp This is interesting because many people in the community can run the test and we can improve the test, as time permits. No, it is not a perfect solution, however, the idea does help with multi-platform tests using many machines and different operating environments. If the group has a good test for a general serial port set-ups, i would be happy to deploy it, for general evaluation using web start. And as for ANT, it is just an idea. Not all my ideas are good ones! - Doug >Hello, > >I think that the make-based build process is fine as it is, apart >from the location of the Java >source files. It is true that putting the Java source in a directory >structure that map 1-to-1 to >the Java package structure is the norm and should make it easier for >everyone to modify the Java >source, with or without an IDE. > >Ant is a good tool, but in the RXTX case I fail to see the advantage >of using it compared to the >current make-based process. As Trent said, they are more pressing >issues, like testing. > >Regards, >David > >Dmitry Markman wrote: >> if I understands the issue right >> in order to be able to use ant for c/c++ compilation >> you have to install ant's cc task >> http://ant-contrib.sourceforge.net/cc.html >> >> it looks like it should work on mac os x >> (authors claim, that it's platform independent) >> but I never tested >> >> so all you have to do it's providing right command line >> for the gcc compiler >> >> >> >> >> On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: >> >>>> rxtx_root_directory >>>> `-- src >>>> |-- main >>>> | `-- java >>>> | `-- gnu >>>> | `-- io >>>> `-- test >>>> `-- java >>>> `-- gnu >>>> `-- io >>>> >>> >>> >>>> From what I understand this will just be good. >>> >>> For me it makes no difference. So lets do the rxtx thing. Let if >>> fester for two weeks and if nobody objects, we will do it. >>> >>> I'm not doing this because I care. I'm doing this to eliminate much >>> of my inbox. >>> >>> But test... man is rxtx lacking there in the community aspect. It is >>> covered but not right. _maybe_ I can change that this year. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> (cat hurding since 1997) > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From matt.higgins at gmail.com Tue Feb 7 08:28:34 2006 From: matt.higgins at gmail.com (Matt Higgins) Date: Tue, 7 Feb 2006 10:28:34 -0500 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final Message-ID: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? import java.io.*; import java.util.*; import gnu.io.*; public class MySimpleRead implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; public static void main(String[] args) { boolean portFound = false; String defaultPort = "COM1"; if (args.length > 0) { defaultPort = args[0]; } portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; MySimpleRead reader = new MySimpleRead(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } } public MySimpleRead() { try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) { e.printStackTrace(); } try { inputStream = serialPort.getInputStream(); } catch (IOException e) { e.printStackTrace(); } try { serialPort.addEventListener(this); } catch (TooManyListenersException e) { e.printStackTrace(); } try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { e.printStackTrace(); } System.out.println("Baud is " + serialPort.getBaudRate()); System.out.println("Bits is " + serialPort.getDataBits()); System.out.println("Stop is " + serialPort.getStopBits()); System.out.println("Par is " + serialPort.getParity()); serialPort.notifyOnDataAvailable(true); readThread = new Thread(this); readThread.start(); } public void run() { // Thread.sleep(20000); //} catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { System.out.println("An event occurred " + event.getEventType()); switch (event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: byte[] readBuffer = new byte[20]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } System.out.print(new String(readBuffer)); } catch (IOException e) {} break; } } } --------------- Result on windows ------------------------------ Stable Library ============================================================== Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port:: COM1 Baud is 9600 Bits is 8 Stop is 1 Par is 0 ----------------- End Results ----------------------------------------- ------------------ Result on Linux ----------------------------------- Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 Found port: /dev/ttyS0 Baud is 9600 Bits is 8 Stop is 1 Par is 0 An event occurred 1 043100066224 ------------------ End Results --------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/a1431630/attachment-0016.html From brian at mbari.org Tue Feb 7 09:48:37 2006 From: brian at mbari.org (Brian Schlining) Date: Tue, 7 Feb 2006 08:48:37 -0800 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> Message-ID: <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> Hi Matt > The following code works fine on Linux but I never see any data > when run on Windows. This is a cut and paste from the SimpleRead > example. > I am attempting to read data from a bar code scanner. I can fire > up HyperTermianl on windows and see that the device is working > properly as I see the barcodes are scanned and echoed back to the > terminal. However when I run the app I don't see any data. It is > however associating with the com port as the informational bits > print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. Cheers Brian Schlining Software Engineer http://www.mbari.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/16d07f37/attachment-0016.html From lux at diesel-research.com Tue Feb 7 11:59:58 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 11:59:58 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139293215.3689.4.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> Message-ID: <1139338798.8145.4.camel@zd7280> Any ideas on this ? Any reason why portList.hasMoreElements() should be false even though there are devices in /dev ? On Mon, 2006-02-06 at 23:20 -0700, Kim Lux wrote: > I'm running the code below. > > portlist.hasMoreElements() is false. > > /dev has ports in it as listed below. > > What am I doing wrong ? > > > ========================================================== > // Step through the list of ports until we find one that matches > // the one we are looking for. > > portList = CommPortIdentifier.getPortIdentifiers(); > > while(portList.hasMoreElements()) > { > portID = (CommPortIdentifier) portList.nextElement(); // > if (portID.getName().equals("/dev/ttyUSB0")) > { > myTA.append("Serial port ttyUSB0 has been found\n"); > break; > }// if portID equals... > }// End of while... > ========================================================== > > ls -al /dev/tty* > crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty > crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 > crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 > crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 > crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 > ... > crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 > crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 > crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 > > > -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 12:20:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 12:20:25 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139338798.8145.4.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> Message-ID: On Tue, 7 Feb 2006, Kim Lux wrote: > > Any ideas on this ? Any reason why portList.hasMoreElements() should be > false even though there are devices in /dev ? > > > On Mon, 2006-02-06 at 23:20 -0700, Kim Lux wrote: >> I'm running the code below. >> >> portlist.hasMoreElements() is false. >> >> /dev has ports in it as listed below. >> >> What am I doing wrong ? >> >> >> ========================================================== >> // Step through the list of ports until we find one that matches >> // the one we are looking for. >> >> portList = CommPortIdentifier.getPortIdentifiers(); >> >> while(portList.hasMoreElements()) >> { >> portID = (CommPortIdentifier) portList.nextElement(); // >> if (portID.getName().equals("/dev/ttyUSB0")) >> { >> myTA.append("Serial port ttyUSB0 has been found\n"); >> break; >> }// if portID equals... >> }// End of while... >> ========================================================== >> >> ls -al /dev/tty* >> crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty >> crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 >> crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 >> crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 >> crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 >> ... >> crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 >> crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 >> crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 >> >> >> > Hi Kim What rxtx does is try to open the port and do a timed out read. If the kernel/... do not complain it's enumarted. I suspect you could do a crude test by doing something like cat /dev/ttyS0 > /dev/null If that barfs then rxtx wont enumerate the port. hmm looking at your question again, I suspect it's a lockfile problem. This is documented in INSTALL with the source. Its easy enough to test this too.. touch /var/lock/testingrxtxlockfiles && rm -f /var/lock/testingrxtxlockfiles If you are not in the right group it will bail. Root will work regardless. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 12:37:56 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 12:37:56 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> Message-ID: <1139341076.8145.11.camel@zd7280> Exactly which ports does rxtx attempt to put into the list ? /dev/* or /dev/tty* or /dev/tty[0-9[0-9] ? or /dev/ttyS* ? For the record, only /dev/ttyUSB0 is a valid port on the machine I am presently on. Will this be a problem ? On Tue, 2006-02-07 at 12:20 -0700, Trent Jarvi wrote: > This is documented in INSTALL with the source. > I was wondering where that file was. I will download source and dig it up. Thanks. -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 12:51:09 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 12:51:09 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139341076.8145.11.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: On Tue, 7 Feb 2006, Kim Lux wrote: > > Exactly which ports does rxtx attempt to put into the list ? /dev/* > or /dev/tty* or /dev/tty[0-9[0-9] ? or /dev/ttyS* ? > > For the record, only /dev/ttyUSB0 is a valid port on the machine I am > presently on. Will this be a problem ? > > > On Tue, 2006-02-07 at 12:20 -0700, Trent Jarvi wrote: >> This is documented in INSTALL with the source. >> > I was wondering where that file was. I will download source and dig it > up. > > Thanks. > Hmm I'm looking at pre17 so this may have changed. (its just what I have on this machine) if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA" // for the IPAQs }; CandidatePortPrefixes=Temp; } So you may need to add "ttyUSB" to that list. RXTX used to enumerate _everything_ see if(osName.equals("Linux-all-ports") But it became less than practical. This is all in RXTXCommDriver.java hmm I just did a cvs update. if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have to get your fingers into the code. We aim for sane defaults. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 13:06:45 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 13:06:45 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139342805.8145.22.camel@zd7280> On Tue, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > Hmm I'm looking at pre17 so this may have changed. (its just what I have > on this machine) > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA" // for the IPAQs > }; > CandidatePortPrefixes=Temp; > } > > > So you may need to add "ttyUSB" to that list. RXTX used to enumerate > _everything_ see if(osName.equals("Linux-all-ports") But it became less > than practical. > > This is all in RXTXCommDriver.java > > hmm I just did a cvs update. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have > to get your fingers into the code. We aim for sane defaults. Excellent. Thanks for taking the time. -- Kim Lux, Diesel Research Inc. From ideiglenes1 at freemail.hu Tue Feb 7 13:53:39 2006 From: ideiglenes1 at freemail.hu (--) Date: Tue, 07 Feb 2006 21:53:39 +0100 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139345619.22534.2.camel@localhost> Hi! I use this code to get all the extra Linux devices. :) if ("Linux".equals(System.getProperty("os.name"))) { System.setProperty("os.name","Linux-all-ports"); } driver = new RXTXCommDriver(); On k, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > On Tue, 7 Feb 2006, Kim Lux wrote: > > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have > to get your fingers into the code. We aim for sane defaults. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From matt.higgins at gmail.com Tue Feb 7 13:45:54 2006 From: matt.higgins at gmail.com (Matt Higgins) Date: Tue, 7 Feb 2006 15:45:54 -0500 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> Message-ID: <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> Sweet this is exactly what I needed. I was searching the archives through marc.theamisgroup they only have archives back to 1/3/05. Should have hit the mailman archive! Thanks a lot! On 2/7/06, Brian Schlining wrote: > > Hi Matt > > The following code works fine on Linux but I never see any data when run > on Windows. This is a cut and paste from the SimpleRead example. > I am attempting to read data from a bar code scanner. I can fire up > HyperTermianl on windows and see that the device is working properly as I > see the barcodes are scanned and echoed back to the terminal. However when I > run the app I don't see any data. It is however associating with the com > port as the informational bits print fine? > > > You're not the only one whose had this problem, I don't know if Trent has > addressed this is the latest release of RXTX but there is a workaround. > Here's the recent thread from the RXTX mailing list regarding this issues: > > Thanasis Delenikas tdelenik at gmail.com > Wed Jan 18 13:56:23 MST 2006 > > * Previous message: [Rxtx] Re: More close() performance fixes > * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] > > Hi all. > (I've subscribed again from my other email account). > > Trent, > > You are right. Linux *always* works, no matter what flow control you set. > Windows *works only* with hardware flow control (I haven't tested what > happens with software XON/XOFF flow control). > > I assume (but I am not certain) that even with no flow control at all, all > platforms should work. Without flow control, you have the risk of bumping > into overflow or framing errors, but that's your (the end programmer, I > mean) problem. > > >From my side, I shouldn't be working without flow control. That was a bug > too... It was some code forgotten from the old times, when I used to work > with phone emulation drivers which didn't support flow control. The > correct > way is to have some flow control enabled and that's why I suppose this is > a > low-severity bug for RxTx. > > I have no idea which platform shows the correct behaviour, since > my knowledge about Linux and the inner workings of these low-level i/o > operations is limited. > > Regards, > Thanasis Delenikas. > > > > > Message: 2 > > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > > From: Trent Jarvi > > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > > To: RXTX Developers and Users > > Message-ID: > > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > > > Hi all, > > > > > > Trent, I have found something. > > > I read your comment about flow control, so I experimented a bit. > > > > > > If you remember, in my sample program I've used no flow control at all > ( > > i.e. > > > Java constant FLOWCONTROL_NONE). > > > > > > Now, during testing, I've switch to hardware inbound flow control (i.e > . > > Java > > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > > beautifully! > > > > > > I think I will switch to H/W flow control and test things for a while, > > but > > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > > > > > Hi Thanasis, > > > > I'm fairly sure you have identified a bug. I would not worry too much > > about what Sun CommAPI w32 defaults are. I think they did more or less > > whatever the port opened with. Just a guess. Linux tries to stomp on > > ports so they are all the same. > > > > So this started out with Linux worked, Windows XP/.. did not as I > recall. > > Something is wrong in rxtx. Do I understand this right? > > > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > > > Perhaps there is something Wayne or I did not understand when we wrote > > that code. I wasnt programming back in the BBS days so modems are not > my > > thing. I have a few questions. > > > > Is the above matrix confirmed by observation? > > Linux just always worked? > > Which one _should_ work? I'm guessing modems work with hardware flow > > control. I'll have to dig around. > > > > The windows flow control changes a couple things with hardware flow > > control. Following the w32 API documentation is confusing sometimes. > > But it looks like Linux could have a bug too. > > Cheers > > Brian Schlining > Software Engineer > http://www.mbari.org > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/9c989144/attachment-0016.html From tjarvi at qbang.org Tue Feb 7 14:06:14 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 14:06:14 -0700 (MST) Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> Message-ID: >> >> You're not the only one whose had this problem, I don't know if Trent has >> addressed this is the latest release of RXTX but there is a workaround. >> Here's the recent thread from the RXTX mailing list regarding this issues: >> I have not. I expect to have access to some test equipment next month and I'll go through all of this. I really don't know whats going on and I need a gold standard. I thought maybe linux was autodetecting the flow control. Your observations would certainly be welcome. I need to talk to Russell King and see what he is doing. Until then I'd just be toying around over a loopback as usual. This is very high on the list though. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 17:25:05 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 17:25:05 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139358305.17994.2.camel@zd7280> My application now works. I installed the libraries and jar from 2.1-7 (Final). portlist.hasMoreElements is no longer false. The application finds the port for /dev/ttyUSB0. Thanks for your help, Trent (et al) Sorry I bothered you with this. Next time I will look in the source first. I didn't think it was an rxtx issue, I thought it was a Linux setup issue . On Tue, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > Hmm I'm looking at pre17 so this may have changed. (its just what I > have > on this machine) > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux > Serial Ports > "ttySA" // for the > IPAQs > }; > > CandidatePortPrefixes=Temp; > } > > > So you may need to add "ttyUSB" to that list. RXTX used to enumerate > _everything_ see if(osName.equals("Linux-all-ports") But it became > less > than practical. > > This is all in RXTXCommDriver.java > > hmm I just did a cvs update. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux > Serial Ports > "ttySA", // for the > IPAQs > "ttyUSB" // for USB > frobs > }; > > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you > have > to get your fingers into the code. We aim for sane defaults. -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 19:21:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 19:21:54 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139358305.17994.2.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> <1139358305.17994.2.camel@zd7280> Message-ID: >Sorry I bothered you with this. Next time I will look in the source >first. I didn't think it was an rxtx issue, I thought it was a Linux >setup issue . Why would you be sorry? I would have done the same. I'm glad it's working :) -- Trent Jarvi tjarvi at qbang.org From tma at mail.island.net Wed Feb 8 13:39:35 2006 From: tma at mail.island.net (Tom Alldread) Date: Wed, 08 Feb 2006 12:39:35 -0800 Subject: [Rxtx] Win32/Linux Serial Port Data Dropouts In-Reply-To: <200602060702.k167255O007882@www.qbang.org> References: <200602060702.k167255O007882@www.qbang.org> Message-ID: <43EA5707.4020200@mail.island.net> Greetings Folks at RXTX: During the last couple of months I have been alternately testing with javax.comm 2 and RXTX 2.1 under Windows XP and CommApi 3 and RXTX 2.1 under Suse 10.0 Linux. In the process I have learned a little about java multi-threading under NetBeans 5 with Profiler. My java (jdk 1.5_06) application is used for data acquisition and provides a graphical display of A-D conversion data received from a 56KBaud serial port. The actual data throughput is about 10KBaud thus it is well below the speed of the port. I use hardware RTS/CTS flow control which can stall the data acquisition sample rate if necessary. This ensures the display computer has the ability to slow the data acquisition rate should it become too busy to accept the regular data flow. Both the serial port buffer and the java read buffer are set at 16KB. Usually the data transfers into the java read buffer are less than 100 bytes unless the data acquisition is recovering from a stall. The data flow normally hesitates after each 5 KB block as a continue command is needed from the display computer to start the drawing of a new graphics display line. Separate threads have been provided for the serial port event monitoring and data processing. The serial port event thread has been given the maximum priority and data processing thread the minimum priority provided by java. Thread yield statements have been placed within all data processing while/for loops as an effort to ensure quick access to CPU cycles for the serial port event thread. I have found that short data transmissions are essentially error free but occasional dropouts occur with continuous data flow especially under Windows XP. ....................................................................................................................................................................................... Linux results: I am happy to report that RXTX 2.1 appears to work very well under Linux although I did notice some errors when the screen savers were running with my dual monitors. I believe this is a local problem associated with my dual graphics which needs further attention. The recent CommApi 3 Linux release from Sun did not work at all with my program. It seemed to send commands out OK but did not receive any data. Although the serial port event triggered the ISR, the input stream appeared filled with nulls and thus did not contain any data. As my understanding is that CommApi 3 was tested with a Red Hat distribution of Linux I wonder if this problem is distro dependent? Although somewhat off topic here I wonder if anyone reading this has had similar experience? .................................................................................................................................................................................. Windows XP results: There are problems with occasional data dropouts which become more frequent as the sampling rate is increased or if the computer becomes busy with other duties. The dropouts typically consist of a half dozen byte block of lost data. It appears the lost bytes never get added to the java input stream. There has not been any indication of garbled data, overruns or framing errors which suggests the UART communications remains solid. Using javax.comm 2 I found that the setting of SerialPort 'enableReceiveThreshold' to 40 and 'enableReceiveTimeout' of 100mS reduced the dropouts error rate significantly. I found that I could not get RXTX 2.1 to function with the aforementioned threshold and timeout settings. The javax.comm 2 interface is consequently performing better for me under Windows than RXTX 2.1. I wonder if anyone here has any suggestions as to what I might try to improve RXTX 2.1? Although my settings are the same as under Suse 10.0, RXTX 2.1 performs much better for me under Linux than any of the alternatives that I have tried under Windows XP . ............................................................................................................................................................................... I would like to establish, based on the experience of others, if I have reached the normally expected performance limit of java serial port communications? Should I expect to achieve virtually error free serial port data input from a continuous stream under Windows XP java software? I am considering changing my protocol to packets with error checking if necessary but would like to know if the dropout problems I am experiencing are typical or not before I take this rather work intensive plunge. Many thanks in advance for any help! Best Regards, Tom Alldread -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.375 / Virus Database: 267.15.2/253 - Release Date: 2006-02-07 From jlaxson at mac.com Wed Feb 8 23:56:48 2006 From: jlaxson at mac.com (John Laxson) Date: Thu, 9 Feb 2006 00:56:48 -0600 Subject: [Rxtx] PortInUseException: Unknown Application on OSX Message-ID: Hi, I've been trying to get RXTX 2.1.7 going on Mac OS X for a while here, and am running up into a wall here. I've tried with pre- compiled and the source version and get the same problem, a gnu.io.PortInUseException: Unknown Application. I have run the fixperms script included with the source distribution, and id shows me as a member of the uucp group, and permissions on /var/spool/uucp are 775 root:uucp. Running a test program (included at the bottom for clarity) lets me enumerate all the serial ports correctly, but trying to open any of them gives the PortInUseException. If it helps, when I try to open a port that's set to make an outgoing bluetooth connection, there is no delay and no connection attempt at all. Thanks, John Laxson PS: The documentation wiki on qbang.org shows 404, and has for a few days now. My test code: public static void main(String[] args) { SerialPort serialPort; try { Enumeration e = CommPortIdentifier.getPortIdentifiers(); CommPortIdentifier ident; while (e.hasMoreElements()) { ident = (CommPortIdentifier)e.nextElement(); System.out.println(ident.getName()); } ident = CommPortIdentifier.getPortIdentifier("/dev/cu.modem"); serialPort = (SerialPort) ident.open("Me", 5000); } catch (Exception e) { e.printStackTrace(); } } From rajesh.invincible at gmail.com Thu Feb 9 03:39:38 2006 From: rajesh.invincible at gmail.com (Rajesh N) Date: Thu, 9 Feb 2006 16:09:38 +0530 Subject: [Rxtx] Re: Move .java Files in gnu.io filesystem hierarchy - Maven (2) In-Reply-To: <43DF21D2.7090200@ngi.it> References: <43DF21D2.7090200@ngi.it> Message-ID: <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Can anybody tell me how to overcome these EXCEPTIONS I AM WORKING ON SERIAL COMMN IN JAVA ON LINUX. 1. " NOT ALL PARAMETERS SUPPORTED BY THE KERNEL" This i came across the following statement inmy prog. SerialP is A SerialPort object SerialP.setSerialPortParams(9600(BAUDRATE),DATABITS_8,STOPBITS_1,PARITY_NONE) 2. NullPointer Exception at Event Dispatch Now i have checked all my object references for a null reference but i found none i have put up my entire code in try catch blocks but still I AM UNABLE TO CATCH THIS EXCEPTION AND HENCE MY APPLICATION CLOSES HOW DOES THESE GO? PLEASE HELP ME IT IS URGENTTTTTTTTTTTTTTTT yours sincerely RAJESH On 1/31/06, Fabio Frumento wrote: > Hi Xavier, > > I don't know maven at all but the directory hierarchy listed buy Trent > is fine for me... > > I'll take a look to maven, it seems an interesting project > > Regards > > Fabio Frumento > > Trent Jarvi wrote: > > On Tue, 31 Jan 2006, Xavier Frisaye wrote: > > > >> Hi all, > >> > >> If you are going to rearrange the src folder, i will propose to use > >> maven 2 and follow its directory structure > >> > (http://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html). > >> > >> Maven 2 simplify java project and give a standard way to make projects > >> (http://maven.apache.org/). > >> We are using it for internal projects and we are very satisfied. > >> > >> Is anybody interested? > >> > >> I'm not an expert in maven 2 (yet) but i'm agree to help using it if > >> you choose to make so. > >> > > > > so this would be: > > > > rxtx-devel/src/main/java/gnu.io > > rxtx-devel/src/test/java/ManIwish.java > > > > I don't use IDEs very much so I'll let others comment. But I don't see > > a problem with that. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Thu Feb 9 09:50:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 9 Feb 2006 09:50:31 -0700 (MST) Subject: [Rxtx] Re: Move .java Files in gnu.io filesystem hierarchy - Maven (2) In-Reply-To: <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Message-ID: On Thu, 9 Feb 2006, Rajesh N wrote: > Can anybody tell me how to overcome these EXCEPTIONS > I AM WORKING ON SERIAL COMMN IN JAVA ON LINUX. > > 1. " NOT ALL PARAMETERS SUPPORTED BY THE KERNEL" > > This i came across the following statement inmy prog. > SerialP is A SerialPort object > SerialP.setSerialPortParams(9600(BAUDRATE),DATABITS_8,STOPBITS_1,PARITY_NONE) > Strange. The parameters you use are the same the port should open with by default. Could you paste the actual exception you are getting? I don't see that in the rxtx source. Also it would help to know the rxtx version. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Fri Feb 10 15:29:05 2006 From: lux at diesel-research.com (Kim Lux) Date: Fri, 10 Feb 2006 15:29:05 -0700 Subject: [Rxtx] One serial port object for both sending and receiving ? Message-ID: <1139610545.18177.4.camel@zd7280> Is it OK to use one SerialPort ojbect (ex Serial Port serialPort;) and use it for both sending and receiving ? For example: ======================================================================== static SerialPort serialPort = null; static OutputStream serialOut = null; static InputStream serialIn = null; // assign it to an outputStream for use try{ serialOut = serialPort.getOutputStream(); System.out.println("Serial output stream has been assigned."); }//try catch(IOException e) { System.out.println("Error: Couldn't assign output stream to serial port."); }//catch //assign it to an inputStream for use try{ serialIn = serialPort.getInputStream(); System.out.println("Serial input stream has been assigned."); }//try catch(IOException e) { System.out.println("Error: Couldn't assign input stream to serial port."); }//catch ======================================================================== -- Kim Lux, Diesel Research Inc. From lux at diesel-research.com Fri Feb 10 21:23:00 2006 From: lux at diesel-research.com (Kim Lux) Date: Fri, 10 Feb 2006 21:23:00 -0700 Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Message-ID: <1139631780.23882.10.camel@zd7280> I've got a problem receiving chars with my version of serialRead, written in an SWT GUI. I had a Java pro have a good look at my code and he can't see anything wrong with it. I can send chars fine. When I receive a char the cpu usage for the app goes to 100% and the code in the serial event handler doesn't get executed. The instructions on the Java Comm Serial API How-To for Linux page state that I must install javacomm. Is that true ? Everything builds without it and I can send chars on rxtx just fine, but I can't receive them. Could this be the problem ? I downloaded and installed javacomm. I was not able to add "Driver=gnuio.RXTXCommDriver to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 installed in /usr/java/jre1.5.0_05. I added comm.jar to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext to the library paths. Is this OK ? Does it matter that I am receiving on /dev/ttyUSB0 ? Thanks. -- Kim Lux, Diesel Research Inc. From lunareclipse03 at web.de Sat Feb 11 09:44:46 2006 From: lunareclipse03 at web.de (lunareclipse03@web.de) Date: Sat, 11 Feb 2006 17:44:46 +0100 Subject: [Rxtx] Question about Serial I/O under Win32 Message-ID: <662084330@web.de> Hello everybody, I have a strange problem with a piece of code I made for myself. No, this is not really concerning rxtx, but nevertheless I post this to the list, hoping that some of you can help me. I've written two libraries, one for linux and one for win32. The linux port works quite well, I can send / receive faxes and / or replay voice messages over the telephone line using a voice modem. But the win32 port of the library causes some trouble. If, for example, I send out a fax with a certain modem under linux, it works well. The fax is complete when it comes out of the fax machine. If I then use the same modem to send out a fax under win32, the fax coming out of the fax machine gets "stuck" halfways, but the sending modem thinks that transmission was ok and drops the connection. The answering fax machine then gives me "error while receiving." The "upper layer" java code MUST be right, because if I do the same thing under linux (using the linux library), everything is alright. Now I have to ask: Can somebody please help me out with this??!? Could it be the case that some kind of flow control or COMMTIMEOUTS setting causes this behaviour? I set flow control to RTS/CTS before sending out a fax. How can I DISABLE flow control? Or what do you think? Can something else cause this problems? Thank you all for your time and PLEASE write back soon. Regards, --Sven Ahlemann Am Waldrand 31 45721 Haltern am See Germany ______________________________________________________________ Verschicken Sie romantische, coole und witzige Bilder per SMS! Jetzt bei WEB.DE FreeMail: http://f.web.de/?mc=021193 From lux at diesel-research.com Sat Feb 11 10:06:52 2006 From: lux at diesel-research.com (Kim Lux) Date: Sat, 11 Feb 2006 10:06:52 -0700 Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: <1139631780.23882.10.camel@zd7280> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> <1139631780.23882.10.camel@zd7280> Message-ID: <1139677612.3431.5.camel@zd7280> More on this problem. I copied and pasted simpleRead into a console based Eclipse project and I've got the same result, except that cpu usage doesn't go to 100%. I'm beginning to think there is an issue in rxtx. My imports for simpleRead are: ============================ import gnu.io.*; import java.util.*; //import javax.comm.*; import java.io.*; =========================== Any ideas ? I am trying to read from /dev/ttyUSB0 using a serial to USB adapter which has worked well with minicom and gtkterm. Thanks. On Fri, 2006-02-10 at 21:23 -0700, Kim Lux wrote: > I've got a problem receiving chars with my version of serialRead, > written in an SWT GUI. > > I had a Java pro have a good look at my code and he can't see anything > wrong with it. > > I can send chars fine. When I receive a char the cpu usage for the app > goes to 100% and the code in the serial event handler doesn't get > executed. > > The instructions on the Java Comm Serial API How-To for Linux page state > that I must install javacomm. Is that true ? Everything builds without > it and I can send chars on rxtx just fine, but I can't receive them. > Could this be the problem ? > > I downloaded and installed javacomm. I was not able to add > "Driver=gnuio.RXTXCommDriver > to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not > have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 > installed in /usr/java/jre1.5.0_05. I added comm.jar > to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext > to the library paths. Is this OK ? > > Does it matter that I am receiving on /dev/ttyUSB0 ? > > Thanks. > -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Sun Feb 12 21:01:33 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:01:33 -0700 (MST) Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: <1139677612.3431.5.camel@zd7280> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> <1139631780.23882.10.camel@zd7280> <1139677612.3431.5.camel@zd7280> Message-ID: I suspect what is happening is the select() is breaking out in the native code but the driver does not have support for notifying there are X bytes available. On some traditional Unix based systems, the only way you know data is available is the fd status changes and do an FIORDCHK ioctl. Or perhaps the only thing you can know is the fd status changed. It would take reading through the kernel driver code to know for sure. So on USB, depending upon the driver, the same may need to be done or the driver improved a bit if possible to support. Polling reads will also work but don't use the event driven model of CommAPI which isnt acceptable in the long run. The 100% cpu usage can then be explained because select no longer blocks until the data is read; the eventLoop spins loose. You can put a well placed sleep but rxtx only expects those are needed when it knows data is available. This may not be a super simple thing to understand and fix. I do have ideas to get you started. I'm going to be short on time the next couple weeks. I expect to put some good time in and answer some other questions I saw around the 25th. For now, I'd look at the following and go from there with the hints I've given. JNIEXPORT jint JNICALL RXTXPort(nativeavailable)( JNIEnv *env, jobject jobj ) { int fd = get_java_var( env, jobj,"fd","I" ); int result; /* char message[80]; ENTER( "RXTXPort:nativeavailable" ); On SCO OpenServer FIONREAD always fails for serial devices, so try ioctl FIORDCHK instead; will only tell us whether bytes are available, not how many, but better than nothing. This turns out to be true on Solaris also. taj. */ #ifdef FIORDCHK /* __unixware__ __sun__ probably others */ result = ioctl(fd, FIORDCHK, 0); #else if( ioctl( fd, FIONREAD, &result ) < 0 ) { goto fail; } #endif /* FIORDCHK */ On Sat, 11 Feb 2006, Kim Lux wrote: > > More on this problem. I copied and pasted simpleRead into a console > based Eclipse project and I've got the same result, except that cpu > usage doesn't go to 100%. I'm beginning to think there is an issue in > rxtx. > > My imports for simpleRead are: > > ============================ > import gnu.io.*; > import java.util.*; > //import javax.comm.*; > import java.io.*; > =========================== > > Any ideas ? I am trying to read from /dev/ttyUSB0 using a serial to > USB adapter which has worked well with minicom and gtkterm. > > Thanks. > > > > On Fri, 2006-02-10 at 21:23 -0700, Kim Lux wrote: >> I've got a problem receiving chars with my version of serialRead, >> written in an SWT GUI. >> >> I had a Java pro have a good look at my code and he can't see anything >> wrong with it. >> >> I can send chars fine. When I receive a char the cpu usage for the app >> goes to 100% and the code in the serial event handler doesn't get >> executed. >> >> The instructions on the Java Comm Serial API How-To for Linux page state >> that I must install javacomm. Is that true ? Everything builds without >> it and I can send chars on rxtx just fine, but I can't receive them. >> Could this be the problem ? >> >> I downloaded and installed javacomm. I was not able to add >> "Driver=gnuio.RXTXCommDriver >> to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not >> have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 >> installed in /usr/java/jre1.5.0_05. I added comm.jar >> to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext >> to the library paths. Is this OK ? >> >> Does it matter that I am receiving on /dev/ttyUSB0 ? >> >> Thanks. >> > From tjarvi at qbang.org Sun Feb 12 21:03:30 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:03:30 -0700 (MST) Subject: [Rxtx] One serial port object for both sending and receiving ? In-Reply-To: <1139610545.18177.4.camel@zd7280> References: <1139610545.18177.4.camel@zd7280> Message-ID: On Fri, 10 Feb 2006, Kim Lux wrote: > > Is it OK to use one SerialPort ojbect (ex Serial Port serialPort;) and > use it for both sending and receiving ? > > For example: > > ======================================================================== > static SerialPort serialPort = null; > static OutputStream serialOut = null; > static InputStream serialIn = null; > > > > > // assign it to an outputStream for use > try{ > serialOut = serialPort.getOutputStream(); > System.out.println("Serial output stream has been assigned."); > }//try > catch(IOException e) > { > System.out.println("Error: Couldn't assign output stream to serial > port."); > }//catch > > > //assign it to an inputStream for use > try{ > serialIn = serialPort.getInputStream(); > System.out.println("Serial input stream has been assigned."); > }//try > catch(IOException e) > { > System.out.println("Error: Couldn't assign input stream to serial > port."); > }//catch This should be fine. In fact trying to do it another way will probably not work as you will run into lockfile issues. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun Feb 12 21:13:13 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:13:13 -0700 (MST) Subject: [Rxtx] Question about Serial I/O under Win32 In-Reply-To: <662084330@web.de> References: <662084330@web.de> Message-ID: On Sat, 11 Feb 2006 lunareclipse03 at web.de wrote: > Hello everybody, > > I have a strange problem with a piece of code I made for myself. No, > this is not really concerning rxtx, but nevertheless I post this to the > list, hoping that some of you can help me. I've written two libraries, > one for linux and one for win32. The linux port works quite well, I can > send / receive faxes and / or replay voice messages over the telephone > line using a voice modem. But the win32 port of the library causes some > trouble. If, for example, I send out a fax with a certain modem under > linux, it works well. The fax is complete when it comes out of the fax > machine. If I then use the same modem to send out a fax under win32, the > fax coming out of the fax machine gets "stuck" halfways, but the sending > modem thinks that transmission was ok and drops the connection. The > answering fax machine then gives me "error while receiving." The "upper > layer" java code MUST be right, because if I do the same thing under > linux (using the linux library), everything is alright. Now I have to > ask: Can somebody please help me out with this??!? Could it be the case > that some kind of flow control or COMMTIMEOUTS setting causes this > behaviour? I set flow control to RTS/CTS before sending out a fax. How > can I DISABLE flow control? Or what do you think? Can something else > cause this problems? Thank you all for your time and PLEASE write back > soon. > Hi Sven I'm not too willing to talk about flow control at the low level until I confirm some things with test equipment later. It is not clear if you are using rxtx or writing your own native code. So I'm not sure how to answer much of this :) If you are wondering how to change the flow control using rxtx from java, The BlackBox example from Sun flips this back and forth. SerialPort.java in rxtx 2.1 uses the following: SerialPort.java: public static final int FLOWCONTROL_NONE =0; SerialPort.java: public static final int FLOWCONTROL_RTSCTS_IN =1; SerialPort.java: public static final int FLOWCONTROL_RTSCTS_OUT =2; SerialPort.java: public static final int FLOWCONTROL_XONXOFF_IN =4; SerialPort.java: public static final int FLOWCONTROL_XONXOFF_OUT=8; So if you set flowcontrol to RTSCTS, you can set it to NONE to turn it off. If you are looking for how to do it in native code, the rxtx Source is SerialImp.c (unix/linux/mac os x/w32) and termios.c (w32 only with SerialImp.c) You can track the code: SerialImp.c:JNIEXPORT void JNICALL RXTXPort(setflowcontrol)( JNIEnv *env, jobject jobj, jint flowmode ) termios.c:int tcgetattr( int fd, struct termios *s_termios ) termios.c:int tcsetattr( int fd, int when, struct termios *s_termios ) There may be a problem in the rxtx flow control code though. Rather than guess, I want to test this with a gold standard. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Feb 6 00:00:16 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 00:00:16 -0700 (MST) Subject: [Rxtx] wiki delay until tomorrow night. In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: On Sun, 5 Feb 2006, Trent Jarvi wrote: > On Sun, 5 Feb 2006, Kim Lux wrote: > >> usb ? Tell me more... I need that too. > > usb is a very proper design. Thats all it is. > Maybe rxtx could help usb. But it would start with helping bring back the community that was already there. It's not something I'd love to do but maybe its the right thing to do. It would probably take 2 years to do right. But maybe thats better than what we have now. I honestly don't know what IBM is doing which could just run over everything. Just some thoughts after some fine german wine. -- Trent Jarvi tjarvi at qbang.org From gadelavega at yahoo.com.ar Mon Feb 6 02:17:05 2006 From: gadelavega at yahoo.com.ar (Gonzalo A. de la Vega) Date: Mon, 06 Feb 2006 10:17:05 +0100 Subject: [Rxtx] Serial port ownership question In-Reply-To: References: <20060205113618.30274.qmail@web53501.mail.yahoo.com> <1139157422.4553.9.camel@zd7280> <1139158698.4936.9.camel@zd7280> Message-ID: <43E71411.4050402@yahoo.com.ar> On my Fedora Core 4: ls -l /dev/ttyS* crw-rw---- 1 root uucp 4, 64 Feb 6 2006 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Feb 6 2006 /dev/ttyS1 ... and: grep "ttyUSB" /etc/udev/rules.d/50-udev.rules KERNEL=="ttyUSB*", GROUP="uucp", MODE="0660" So anyone in the "uucp" group can use serial ports. On Gentoo the group is "tty". Trent Jarvi escribi?: > > > On Sun, 5 Feb 2006, Dr. Douglas Lyon wrote: > >> I can confirm that this is the case (only root ownership of >> serial ports, under fedora 4). >> Wow, what were they thinking?! >> - DL >> >>> I've found that the newer kernels have the serial ports owned by root. >>> For example, >>> >>> $ls -al /dev/tty* >>> crw-rw-rw- 1 root root 5, 0 Feb 5 02:06 /dev/tty >>> crw-rw---- 1 root root 4, 0 Feb 5 02:06 /dev/tty0 >>> crw------- 1 root root 4, 1 Feb 5 09:07 /dev/tty1 >>> crw-rw---- 1 root tty 4, 10 Feb 5 02:06 /dev/tty10 >>> crw-rw---- 1 root tty 4, 11 Feb 5 02:06 /dev/tty11 >>> ... > > > This is just not a problem jcp or such are going to solve. Its a > platform spitwad fight. But do look at pam. In fact thats what Sun > is doing too. Maybe Linux followed their lead.. I'm not a pam guy. > I've spent 16 hours trying to understand it but your users wont :) > > Solution? I have no clue. Its two tangent mentalities from my > perspective. > > -- > Trent Jarvi > tjarvi at qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mtnvega at yahoo.com.br Mon Feb 6 05:35:43 2006 From: mtnvega at yahoo.com.br (Luiz Jr) Date: Mon, 6 Feb 2006 12:35:43 +0000 (GMT) Subject: [Rxtx] Documentation Wiki In-Reply-To: <1139157422.4553.9.camel@zd7280> Message-ID: <20060206123543.57256.qmail@web53515.mail.yahoo.com> Hello, Thank you for you answer, but so the usage of the API is pretty much like the Java Communications Api? If yes, what version of the Java Comm Api? Thank you, Luiz A. Brandao Jr Kim Lux escreveu: On Sun, 2006-02-05 at 08:36 -0300, Luiz Jr wrote: > Hello, > > I want to start using the RXTX libraries, but I would to know how, > since I can not access the documentation wiki page I just started using them yesterday. Below is how I installed the libraries, if that helps. I used snippets of code from the SimpleWrite application here to get me going. http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html Instead of "import javax.comm.*;", use "import gnu.io.*;" which is gotten from RXTXcomm.jar, which you will need to include in your project references. I am working in Eclipse. BTW: there is no way to open a port without going through the port list and finding it. Maybe sometime in the future someone (me ?) will write a method called openSerialPort that allows the user to give a port identifier, such as "/dev/tty1" and return a port ready to use. It wouldn't take much to write that and it would save users a lot of code. Hope this helps. ======================================================================= 1) Figure out which java you are running, incase there is more than one installed. $ java -version java version "1.5.0_05" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_05-b05) Java HotSpot(TM) Client VM (build 1.5.0_05-b05, mixed mode, sharing) 2) Find all the jre directories and the one from which you are currently running. kfind (jre) 3) cd to that directory plus /lib/i386 cd /usr/java/jre1.5.0_05/lib/i386 4) Copy the library files (*.so) to that directory. cp /home/krlux/Desktop/'Java Controls'/rxtx-linux/bin/* . 5) Check that the copy was successful ls librxtx* librxtxI2C.so librxtxRaw.so librxtxSerial.so librxtxParallel.so librxtxRS485.so 6) cd to the /lib/ext directory for your java. cd /usr/java/jre1.5.0_05/lib/ext 7) Copy the Jar files there cp /home/krlux/Desktop/'Java Controls'/rxtx-linux/lib/ext/* . 8) Check that it was successful ls RXTX* RXTXcomm.jar Rxtx is now installed on your machine ready to use. =================================================================== -- Kim Lux, Diesel Research Inc. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx --------------------------------- Yahoo! Acesso Gr?tis - Internet r?pida e gr?tis. Instale o discador agora! -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/544aa403/attachment-0017.html From lyon at docjava.com Mon Feb 6 05:49:34 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 06 Feb 2006 07:49:34 -0500 Subject: [Rxtx] wiki delay until tomorrow night. In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: Hi All, I have often thought about USB drivers being needed. For example, the ironman watch will not interface to a mac (windows only). It is USB. My dymo label writer has no Java driver (native only). Etc. Most cheap web cameras are USB (and Java drivers go through JAI, if it supports the camera at all). The JAI code shows how sun did the USB drivers. You have to be a member of the jai project to download the source code. https://jai.dev.java.net has the jai distro. And then you are not allowed to redistribute it. However, we can all learn from it (if so inclined). Basically: cvs -d :pserver:lyon at cvs.dev.java.net:/cvs login cvs -d :pserver:lyon at cvs.dev.java.net:/cvs checkout jai-core You will need to user your own uid and pw to get in. The ant build has over 100 warnings from sun deprecations of its own code. You might say that they were hoisted on their own Picard ;) One interesting thing is that they support several platforms: linux-amd64 64-bit Linux-AMD64 linux-i586 32-bit Linux-x86 solaris-amd64 64-bit Solaris-AMD64 solaris-i586 32-bit Solaris-x86 solaris-sparc 32-bit Solaris-SPARC solaris-sparcv9 64-bit Solaris-SPARC windows-i586 32-bit Windows-x86 Thus, ant is used to provide a multi-platform native method distro. Neat. How do they do it? check this out: And: The core download does not contain any C source code (it was all pre-built). Basically, they are just copying .so and .dll files into build directories. I would love to see the C code for this...but Sun does not post it on the https://jai.dev.java.net site. I don't know why...Perhaps I missed it. - Doug >On Sun, 5 Feb 2006, Trent Jarvi wrote: > >>On Sun, 5 Feb 2006, Kim Lux wrote: >> >>>usb ? Tell me more... I need that too. >> >>usb is a very proper design. Thats all it is. >> > >Maybe rxtx could help usb. But it would start with helping bring >back the community that was already there. > >It's not something I'd love to do but maybe its the right thing to do. > >It would probably take 2 years to do right. But maybe thats better >than what we have now. > >I honestly don't know what IBM is doing which could just run over everything. > >Just some thoughts after some fine german wine. > >-- >Trent Jarvi >tjarvi at qbang.org > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tdelenik at gmail.com Mon Feb 6 05:56:32 2006 From: tdelenik at gmail.com (Thanasis Delenikas) Date: Mon, 6 Feb 2006 14:56:32 +0200 Subject: Fwd: [Rxtx] Documentation Wiki In-Reply-To: <1139157422.4553.9.camel@zd7280> References: <20060205113618.30274.qmail@web53501.mail.yahoo.com> <1139157422.4553.9.camel@zd7280> Message-ID: <310a1a930602060456t129f1dc6p5f2b908f13ab5a0b@mail.gmail.com> Hello all, Kim, this is a snippet from the code I use. The closest to directly opening a specific port without enumeration. << ... portId = CommPortIdentifier.getPortIdentifier(getPort()); serialPort = (SerialPort) portId.open("jSMSEngine", 1971); ... >> where getPort() return the string identifier of the port, i.e. "/dev/ttyS0" or "COM1" or whatever. Thanasis. ---------- Forwarded message ---------- From: Kim Lux Date: Feb 5, 2006 6:37 PM Subject: Re: [Rxtx] Documentation Wiki To: RXTX Developers and Users BTW: there is no way to open a port without going through the port list and finding it. Maybe sometime in the future someone (me ?) will write a method called openSerialPort that allows the user to give a port identifier, such as "/dev/tty1" and return a port ready to use. It wouldn't take much to write that and it would save users a lot of code. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/182ab5b8/attachment-0017.html From tjarvi at qbang.org Mon Feb 6 11:53:57 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 11:53:57 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: On Mon, 6 Feb 2006, Dr. Douglas Lyon wrote: > Hi All, > I have often thought about USB drivers being needed. > For example, the ironman watch will not interface > to a mac (windows only). It is USB. > My dymo label writer has no Java driver (native only). > Etc. > Most cheap web cameras are USB (and Java drivers go > through JAI, if it supports the camera at all). > The JAI code shows how sun did the USB drivers. > You have to be a member of the jai project to download > the source code. > https://jai.dev.java.net has the jai distro. > And then you are not allowed to redistribute it. However, > we can all learn from it (if so inclined). Basically: > cvs -d :pserver:lyon at cvs.dev.java.net:/cvs login > cvs -d :pserver:lyon at cvs.dev.java.net:/cvs checkout jai-core > You will need to user your own uid and pw to get in. > The ant build has over 100 warnings from sun deprecations > of its own code. > > You might say that they were hoisted on their own Picard ;) > > One interesting thing is that they support several platforms: > linux-amd64 64-bit Linux-AMD64 > linux-i586 32-bit Linux-x86 > solaris-amd64 64-bit Solaris-AMD64 > solaris-i586 32-bit Solaris-x86 > solaris-sparc 32-bit Solaris-SPARC > solaris-sparcv9 64-bit Solaris-SPARC > windows-i586 32-bit Windows-x86 > Thus, ant is used to provide a multi-platform native method distro. > Neat. > How do they do it? > check this out: > > > > > > > > > > > > > And: > > > > > > > > > > The core download does not contain any C source code (it was all pre-built). > Basically, they are just copying .so and .dll files into build directories. > > I would love to see the C code for this...but Sun does not post it on the > https://jai.dev.java.net site. > > I don't know why...Perhaps I missed it. > > - Doug > > I've looked at moving rxtx to Ant builds. I think that would help IDEs a great deal. I requested a evalutation desk copy the O'Reilly Ant book for some j2ee material I was teaching. http://www.oreilly.com/catalog/anttdg/ It has a one sentence mention of JNI. So there was not luck there. I saw that there is another Ant book that does mention JNI more. I can't find it now. Ant must be able to support it with extensions. http://ant.apache.org/manual/OptionalTasks/javah.html What the auto(break :) tools do in the rxtx build is 4 things really. 1) gcc compile flags 2) ld compile flags 3) config.h 4) compile flags for customizing rxtx (lockfiles, ...) See 1 All of this information except 4 can be static once obtained. So I'm not attached to the auto tools. If I could find an example of Ant being used for JNI code, I'd be one of the first to start moving that direction. Maybe someone saw an example someplace. The other thing we have not completed discussing is the directory structure. There is interest in making rxtx more IDE friendly. I get more mail about that off the list than how to install rxtx. And I see we have Ken Thompson in da house :) He is our trusted CVS maintainer and the guy that purchased the rxtx.org domain. Old community. We will need Ken for changing the directory structure of source. I would like to open up discussion about both of these as it is more than time. The problem is I have little experience with Ant and even less with IDEs. It would be nice if we could work with Eclipse and NetBeans. http://www.netbeans.org/ (sun and some community) http://www.eclipes.org (ibm,rhat,... perhaps more community) http://maven.apache.org/what-is-maven.html (apache. It is community) borland should sortof be here too but I think thats covered in eclipse. >From what I understand so far, we should morph rxtx to support those three maybe trusting apaches lead with maven. But I use vi. I have little to no clues beyond what people have fed me. Can we agree that thats the right direction to go? -- Trent Jarvi tjarvi at qbang.org From brian at mbari.org Mon Feb 6 14:57:50 2006 From: brian at mbari.org (Brian Schlining) Date: Mon, 6 Feb 2006 13:57:50 -0800 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> > The other thing we have not completed discussing is the directory > structure. There is interest in making rxtx more IDE friendly. I > get more mail about that off the list than how to install rxtx. > > And I see we have Ken Thompson in da house :) He is our trusted > CVS maintainer and the guy that purchased the rxtx.org domain. Old > community. We will need Ken for changing the directory structure of > source. > > I would like to open up discussion about both of these as it is > more than time. The problem is I have little experience with Ant > and even less with IDEs. It would be nice if we could work with > Eclipse and NetBeans. > > http://www.netbeans.org/ (sun and some community) > http://www.eclipes.org (ibm,rhat,... perhaps more community) > http://maven.apache.org/what-is-maven.html (apache. It is community) > borland should sortof be here too but I think thats covered in > eclipse. > >> From what I understand so far, we should morph rxtx to support >> those three > maybe trusting apaches lead with maven. But I use vi. I have > little to no clues beyond what people have fed me. > Maven likes the directory structure below for Java code. (From http:// maven.apache.org/guides/getting-started/index.html) This structure works fine with ant, netbeans, and eclipse. rxtx_root_directory `-- src |-- main | `-- java | `-- gnu | `-- io `-- test `-- java `-- gnu `-- io Brian Schlining Software Engineer http://www.mbari.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/d9451eba/attachment-0017.html From tjarvi at qbang.org Mon Feb 6 15:11:45 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 15:11:45 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: > rxtx_root_directory > `-- src > |-- main > | `-- java > | `-- gnu > | `-- io > `-- test > `-- java > `-- gnu > `-- io > >From what I understand this will just be good. For me it makes no difference. So lets do the rxtx thing. Let if fester for two weeks and if nobody objects, we will do it. I'm not doing this because I care. I'm doing this to eliminate much of my inbox. But test... man is rxtx lacking there in the community aspect. It is covered but not right. _maybe_ I can change that this year. -- Trent Jarvi tjarvi at qbang.org (cat hurding since 1997) From lux at diesel-research.com Mon Feb 6 21:38:49 2006 From: lux at diesel-research.com (Kim Lux) Date: Mon, 06 Feb 2006 21:38:49 -0700 Subject: [Rxtx] How can I use Lock Files with rxtx (in FC4) ? Message-ID: <1139287129.17031.3.camel@zd7280> I am now running an rxtx application on FC4. I am getting: ========================================================= check_group_uucp(): error testing lock file creation Error details: Permission denied check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL ========================================================= $ ls -al /var/lock total 32 drwxrwxr-x 4 root lock 4096 Feb 6 16:04 . drwxr-xr-x 24 root root 4096 Nov 14 01:19 .. drwx------ 2 root root 4096 Apr 27 2005 lvm drwxr-xr-x 2 root root 4096 Feb 6 16:04 subsys How do I fix this for regulator users ? -- Kim Lux, Diesel Research Inc. From dmarkman at mac.com Mon Feb 6 22:24:44 2006 From: dmarkman at mac.com (Dmitry Markman) Date: Tue, 7 Feb 2006 00:24:44 -0500 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: if I understands the issue right in order to be able to use ant for c/c++ compilation you have to install ant's cc task http://ant-contrib.sourceforge.net/cc.html it looks like it should work on mac os x (authors claim, that it's platform independent) but I never tested so all you have to do it's providing right command line for the gcc compiler On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: >> rxtx_root_directory >> `-- src >> |-- main >> | `-- java >> | `-- gnu >> | `-- io >> `-- test >> `-- java >> `-- gnu >> `-- io >> > > >> From what I understand this will just be good. > > For me it makes no difference. So lets do the rxtx thing. Let if > fester for two weeks and if nobody objects, we will do it. > > I'm not doing this because I care. I'm doing this to eliminate > much of my inbox. > > But test... man is rxtx lacking there in the community aspect. It > is covered but not right. _maybe_ I can change that this year. > > -- > Trent Jarvi > tjarvi at qbang.org > (cat hurding since 1997) > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx Dmitry Markman From lux at diesel-research.com Mon Feb 6 23:20:15 2006 From: lux at diesel-research.com (Kim Lux) Date: Mon, 06 Feb 2006 23:20:15 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? Message-ID: <1139293215.3689.4.camel@zd7280> I'm running the code below. portlist.hasMoreElements() is false. /dev has ports in it as listed below. What am I doing wrong ? ========================================================== // Step through the list of ports until we find one that matches // the one we are looking for. portList = CommPortIdentifier.getPortIdentifiers(); while(portList.hasMoreElements()) { portID = (CommPortIdentifier) portList.nextElement(); // if (portID.getName().equals("/dev/ttyUSB0")) { myTA.append("Serial port ttyUSB0 has been found\n"); break; }// if portID equals... }// End of while... ========================================================== ls -al /dev/tty* crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 ... crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 -- Kim Lux, Diesel Research Inc. From david.garnier at trusted-logic.com Tue Feb 7 00:46:30 2006 From: david.garnier at trusted-logic.com (David Garnier) Date: Tue, 07 Feb 2006 08:46:30 +0100 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: <43E85056.2090608@trusted-logic.com> Hello, I think that the make-based build process is fine as it is, apart from the location of the Java source files. It is true that putting the Java source in a directory structure that map 1-to-1 to the Java package structure is the norm and should make it easier for everyone to modify the Java source, with or without an IDE. Ant is a good tool, but in the RXTX case I fail to see the advantage of using it compared to the current make-based process. As Trent said, they are more pressing issues, like testing. Regards, David Dmitry Markman wrote: > if I understands the issue right > in order to be able to use ant for c/c++ compilation > you have to install ant's cc task > http://ant-contrib.sourceforge.net/cc.html > > it looks like it should work on mac os x > (authors claim, that it's platform independent) > but I never tested > > so all you have to do it's providing right command line > for the gcc compiler > > > > > On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: > >>> rxtx_root_directory >>> `-- src >>> |-- main >>> | `-- java >>> | `-- gnu >>> | `-- io >>> `-- test >>> `-- java >>> `-- gnu >>> `-- io >>> >> >> >>> From what I understand this will just be good. >> >> For me it makes no difference. So lets do the rxtx thing. Let if >> fester for two weeks and if nobody objects, we will do it. >> >> I'm not doing this because I care. I'm doing this to eliminate much >> of my inbox. >> >> But test... man is rxtx lacking there in the community aspect. It is >> covered but not right. _maybe_ I can change that this year. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> (cat hurding since 1997) From tjarvi at qbang.org Tue Feb 7 01:11:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 01:11:31 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <43E85056.2090608@trusted-logic.com> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: On Tue, 7 Feb 2006, David Garnier wrote: > Hello, > > I think that the make-based build process is fine as it is, apart from the location of the Java > source files. It is true that putting the Java source in a directory structure that map 1-to-1 to > the Java package structure is the norm and should make it easier for everyone to modify the Java > source, with or without an IDE. > > Ant is a good tool, but in the RXTX case I fail to see the advantage of using it compared to the > current make-based process. As Trent said, they are more pressing issues, like testing. > Hi David I have more experience with testing rxtx than I can talk about. But let it be known, rxtx has gone trough 100's of hours of testing. We are hobby folks interested in toys but there is more. rxtx has had some of the best guidance in the industry there. This is not an easy thing. I may be able to come back in a month from the other side of the corperate fence and help. I suspect the tests could just be made public but they are in a very unusual environment that just wont work in a wider sense. This is something I'll be trying to change. At one point it was agreed we could just make the results public so this isnt just noise.. There is interest and I think its safe to mention that much. The big problem with testing in the past is most of it is done with a loopback connection. So we *still* have major questions regarding things like flow control. rxtx talks to itself over a loopback and it works. regardless of right or wrong. This requires more thought to be done right. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Feb 7 02:46:34 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 02:46:34 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: > The big problem with testing in the past is most of it is done with a > loopback connection. So we *still* have major questions regarding things > like flow control. rxtx talks to itself over a loopback and it works. > regardless of right or wrong. With serial communication there are gold standards. ckermit is probably a definitive 'standard.' Maybe its possible to do ping/pong tests with ckermit? Is it scriptable? There are known issues in rxtx. Probably the worst is some threading issues regarding some JREs with multiple JNI threads setting java variables. Man did I get schooled there. Just switch the c functions to returning variables and things go away. Sometimes they work fine, sometimes they blow up. Without understanding everything, somehow rhat got it right and debian (and especially gentoo) grabbed kernel patches causing all sort of harm. Its not hard to fix once you understand whats going on but nearly impossible to track with a debugger. So I have a good idea what 2.1-8 will have outside of the IDE modifications. rxtx 2.1-7 is a release for everyone to sync with. Its not even as stable as -pre17 as far as I know - I ran no test suites. I'll be chasing it too. We just had so many contributions that it was time. It seriously broke internal scheduals but thats a great thing :) The other thing I want to do in 2.1-8 is automagic baud rates. It turns out lots of shops are doing really funky baud rates for things like automobile test equipment. It is possible but it requires a fair amount of change in the native code. Is anyone looking at this? -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Feb 7 02:57:21 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 07 Feb 2006 04:57:21 -0500 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <43E85056.2090608@trusted-logic.com> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: Hi All, I agree, testing is very important. The problem I have been trying to address is related to cross-platform testing and the robust nature of the installs. Typically, I visit 3 platforms to deploy my product, windows, linux and mac. A build is performed on each platform. The idea that you can build for many platforms from one copy the source code seems attractive. This should enable synchronized deployments of identical code. The question of how to achieve this goal remains open. As Trent mentioned, this is hard. Perhaps Ant will help here (but perhaps not). Ant does seem to help with running unit tests. However, it does not help with multi-platform tests. For that you need many machines and different operating environments. Toward that end, I have created a multi-platform test that can be run from web start, located at: http://show.docjava.com:8086/book/cgij/code/jnlp/serialPort.PortTest.jnlp This is interesting because many people in the community can run the test and we can improve the test, as time permits. No, it is not a perfect solution, however, the idea does help with multi-platform tests using many machines and different operating environments. If the group has a good test for a general serial port set-ups, i would be happy to deploy it, for general evaluation using web start. And as for ANT, it is just an idea. Not all my ideas are good ones! - Doug >Hello, > >I think that the make-based build process is fine as it is, apart >from the location of the Java >source files. It is true that putting the Java source in a directory >structure that map 1-to-1 to >the Java package structure is the norm and should make it easier for >everyone to modify the Java >source, with or without an IDE. > >Ant is a good tool, but in the RXTX case I fail to see the advantage >of using it compared to the >current make-based process. As Trent said, they are more pressing >issues, like testing. > >Regards, >David > >Dmitry Markman wrote: >> if I understands the issue right >> in order to be able to use ant for c/c++ compilation >> you have to install ant's cc task >> http://ant-contrib.sourceforge.net/cc.html >> >> it looks like it should work on mac os x >> (authors claim, that it's platform independent) >> but I never tested >> >> so all you have to do it's providing right command line >> for the gcc compiler >> >> >> >> >> On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: >> >>>> rxtx_root_directory >>>> `-- src >>>> |-- main >>>> | `-- java >>>> | `-- gnu >>>> | `-- io >>>> `-- test >>>> `-- java >>>> `-- gnu >>>> `-- io >>>> >>> >>> >>>> From what I understand this will just be good. >>> >>> For me it makes no difference. So lets do the rxtx thing. Let if >>> fester for two weeks and if nobody objects, we will do it. >>> >>> I'm not doing this because I care. I'm doing this to eliminate much >>> of my inbox. >>> >>> But test... man is rxtx lacking there in the community aspect. It is >>> covered but not right. _maybe_ I can change that this year. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> (cat hurding since 1997) > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From matt.higgins at gmail.com Tue Feb 7 08:28:34 2006 From: matt.higgins at gmail.com (Matt Higgins) Date: Tue, 7 Feb 2006 10:28:34 -0500 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final Message-ID: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? import java.io.*; import java.util.*; import gnu.io.*; public class MySimpleRead implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; public static void main(String[] args) { boolean portFound = false; String defaultPort = "COM1"; if (args.length > 0) { defaultPort = args[0]; } portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; MySimpleRead reader = new MySimpleRead(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } } public MySimpleRead() { try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) { e.printStackTrace(); } try { inputStream = serialPort.getInputStream(); } catch (IOException e) { e.printStackTrace(); } try { serialPort.addEventListener(this); } catch (TooManyListenersException e) { e.printStackTrace(); } try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { e.printStackTrace(); } System.out.println("Baud is " + serialPort.getBaudRate()); System.out.println("Bits is " + serialPort.getDataBits()); System.out.println("Stop is " + serialPort.getStopBits()); System.out.println("Par is " + serialPort.getParity()); serialPort.notifyOnDataAvailable(true); readThread = new Thread(this); readThread.start(); } public void run() { // Thread.sleep(20000); //} catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { System.out.println("An event occurred " + event.getEventType()); switch (event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: byte[] readBuffer = new byte[20]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } System.out.print(new String(readBuffer)); } catch (IOException e) {} break; } } } --------------- Result on windows ------------------------------ Stable Library ============================================================== Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port:: COM1 Baud is 9600 Bits is 8 Stop is 1 Par is 0 ----------------- End Results ----------------------------------------- ------------------ Result on Linux ----------------------------------- Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 Found port: /dev/ttyS0 Baud is 9600 Bits is 8 Stop is 1 Par is 0 An event occurred 1 043100066224 ------------------ End Results --------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/a1431630/attachment-0017.html From brian at mbari.org Tue Feb 7 09:48:37 2006 From: brian at mbari.org (Brian Schlining) Date: Tue, 7 Feb 2006 08:48:37 -0800 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> Message-ID: <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> Hi Matt > The following code works fine on Linux but I never see any data > when run on Windows. This is a cut and paste from the SimpleRead > example. > I am attempting to read data from a bar code scanner. I can fire > up HyperTermianl on windows and see that the device is working > properly as I see the barcodes are scanned and echoed back to the > terminal. However when I run the app I don't see any data. It is > however associating with the com port as the informational bits > print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. Cheers Brian Schlining Software Engineer http://www.mbari.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/16d07f37/attachment-0017.html From lux at diesel-research.com Tue Feb 7 11:59:58 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 11:59:58 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139293215.3689.4.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> Message-ID: <1139338798.8145.4.camel@zd7280> Any ideas on this ? Any reason why portList.hasMoreElements() should be false even though there are devices in /dev ? On Mon, 2006-02-06 at 23:20 -0700, Kim Lux wrote: > I'm running the code below. > > portlist.hasMoreElements() is false. > > /dev has ports in it as listed below. > > What am I doing wrong ? > > > ========================================================== > // Step through the list of ports until we find one that matches > // the one we are looking for. > > portList = CommPortIdentifier.getPortIdentifiers(); > > while(portList.hasMoreElements()) > { > portID = (CommPortIdentifier) portList.nextElement(); // > if (portID.getName().equals("/dev/ttyUSB0")) > { > myTA.append("Serial port ttyUSB0 has been found\n"); > break; > }// if portID equals... > }// End of while... > ========================================================== > > ls -al /dev/tty* > crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty > crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 > crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 > crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 > crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 > ... > crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 > crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 > crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 > > > -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 12:20:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 12:20:25 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139338798.8145.4.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> Message-ID: On Tue, 7 Feb 2006, Kim Lux wrote: > > Any ideas on this ? Any reason why portList.hasMoreElements() should be > false even though there are devices in /dev ? > > > On Mon, 2006-02-06 at 23:20 -0700, Kim Lux wrote: >> I'm running the code below. >> >> portlist.hasMoreElements() is false. >> >> /dev has ports in it as listed below. >> >> What am I doing wrong ? >> >> >> ========================================================== >> // Step through the list of ports until we find one that matches >> // the one we are looking for. >> >> portList = CommPortIdentifier.getPortIdentifiers(); >> >> while(portList.hasMoreElements()) >> { >> portID = (CommPortIdentifier) portList.nextElement(); // >> if (portID.getName().equals("/dev/ttyUSB0")) >> { >> myTA.append("Serial port ttyUSB0 has been found\n"); >> break; >> }// if portID equals... >> }// End of while... >> ========================================================== >> >> ls -al /dev/tty* >> crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty >> crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 >> crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 >> crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 >> crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 >> ... >> crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 >> crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 >> crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 >> >> >> > Hi Kim What rxtx does is try to open the port and do a timed out read. If the kernel/... do not complain it's enumarted. I suspect you could do a crude test by doing something like cat /dev/ttyS0 > /dev/null If that barfs then rxtx wont enumerate the port. hmm looking at your question again, I suspect it's a lockfile problem. This is documented in INSTALL with the source. Its easy enough to test this too.. touch /var/lock/testingrxtxlockfiles && rm -f /var/lock/testingrxtxlockfiles If you are not in the right group it will bail. Root will work regardless. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 12:37:56 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 12:37:56 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> Message-ID: <1139341076.8145.11.camel@zd7280> Exactly which ports does rxtx attempt to put into the list ? /dev/* or /dev/tty* or /dev/tty[0-9[0-9] ? or /dev/ttyS* ? For the record, only /dev/ttyUSB0 is a valid port on the machine I am presently on. Will this be a problem ? On Tue, 2006-02-07 at 12:20 -0700, Trent Jarvi wrote: > This is documented in INSTALL with the source. > I was wondering where that file was. I will download source and dig it up. Thanks. -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 12:51:09 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 12:51:09 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139341076.8145.11.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: On Tue, 7 Feb 2006, Kim Lux wrote: > > Exactly which ports does rxtx attempt to put into the list ? /dev/* > or /dev/tty* or /dev/tty[0-9[0-9] ? or /dev/ttyS* ? > > For the record, only /dev/ttyUSB0 is a valid port on the machine I am > presently on. Will this be a problem ? > > > On Tue, 2006-02-07 at 12:20 -0700, Trent Jarvi wrote: >> This is documented in INSTALL with the source. >> > I was wondering where that file was. I will download source and dig it > up. > > Thanks. > Hmm I'm looking at pre17 so this may have changed. (its just what I have on this machine) if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA" // for the IPAQs }; CandidatePortPrefixes=Temp; } So you may need to add "ttyUSB" to that list. RXTX used to enumerate _everything_ see if(osName.equals("Linux-all-ports") But it became less than practical. This is all in RXTXCommDriver.java hmm I just did a cvs update. if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have to get your fingers into the code. We aim for sane defaults. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 13:06:45 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 13:06:45 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139342805.8145.22.camel@zd7280> On Tue, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > Hmm I'm looking at pre17 so this may have changed. (its just what I have > on this machine) > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA" // for the IPAQs > }; > CandidatePortPrefixes=Temp; > } > > > So you may need to add "ttyUSB" to that list. RXTX used to enumerate > _everything_ see if(osName.equals("Linux-all-ports") But it became less > than practical. > > This is all in RXTXCommDriver.java > > hmm I just did a cvs update. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have > to get your fingers into the code. We aim for sane defaults. Excellent. Thanks for taking the time. -- Kim Lux, Diesel Research Inc. From ideiglenes1 at freemail.hu Tue Feb 7 13:53:39 2006 From: ideiglenes1 at freemail.hu (--) Date: Tue, 07 Feb 2006 21:53:39 +0100 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139345619.22534.2.camel@localhost> Hi! I use this code to get all the extra Linux devices. :) if ("Linux".equals(System.getProperty("os.name"))) { System.setProperty("os.name","Linux-all-ports"); } driver = new RXTXCommDriver(); On k, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > On Tue, 7 Feb 2006, Kim Lux wrote: > > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have > to get your fingers into the code. We aim for sane defaults. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From matt.higgins at gmail.com Tue Feb 7 13:45:54 2006 From: matt.higgins at gmail.com (Matt Higgins) Date: Tue, 7 Feb 2006 15:45:54 -0500 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> Message-ID: <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> Sweet this is exactly what I needed. I was searching the archives through marc.theamisgroup they only have archives back to 1/3/05. Should have hit the mailman archive! Thanks a lot! On 2/7/06, Brian Schlining wrote: > > Hi Matt > > The following code works fine on Linux but I never see any data when run > on Windows. This is a cut and paste from the SimpleRead example. > I am attempting to read data from a bar code scanner. I can fire up > HyperTermianl on windows and see that the device is working properly as I > see the barcodes are scanned and echoed back to the terminal. However when I > run the app I don't see any data. It is however associating with the com > port as the informational bits print fine? > > > You're not the only one whose had this problem, I don't know if Trent has > addressed this is the latest release of RXTX but there is a workaround. > Here's the recent thread from the RXTX mailing list regarding this issues: > > Thanasis Delenikas tdelenik at gmail.com > Wed Jan 18 13:56:23 MST 2006 > > * Previous message: [Rxtx] Re: More close() performance fixes > * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] > > Hi all. > (I've subscribed again from my other email account). > > Trent, > > You are right. Linux *always* works, no matter what flow control you set. > Windows *works only* with hardware flow control (I haven't tested what > happens with software XON/XOFF flow control). > > I assume (but I am not certain) that even with no flow control at all, all > platforms should work. Without flow control, you have the risk of bumping > into overflow or framing errors, but that's your (the end programmer, I > mean) problem. > > >From my side, I shouldn't be working without flow control. That was a bug > too... It was some code forgotten from the old times, when I used to work > with phone emulation drivers which didn't support flow control. The > correct > way is to have some flow control enabled and that's why I suppose this is > a > low-severity bug for RxTx. > > I have no idea which platform shows the correct behaviour, since > my knowledge about Linux and the inner workings of these low-level i/o > operations is limited. > > Regards, > Thanasis Delenikas. > > > > > Message: 2 > > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > > From: Trent Jarvi > > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > > To: RXTX Developers and Users > > Message-ID: > > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > > > Hi all, > > > > > > Trent, I have found something. > > > I read your comment about flow control, so I experimented a bit. > > > > > > If you remember, in my sample program I've used no flow control at all > ( > > i.e. > > > Java constant FLOWCONTROL_NONE). > > > > > > Now, during testing, I've switch to hardware inbound flow control (i.e > . > > Java > > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > > beautifully! > > > > > > I think I will switch to H/W flow control and test things for a while, > > but > > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > > > > > Hi Thanasis, > > > > I'm fairly sure you have identified a bug. I would not worry too much > > about what Sun CommAPI w32 defaults are. I think they did more or less > > whatever the port opened with. Just a guess. Linux tries to stomp on > > ports so they are all the same. > > > > So this started out with Linux worked, Windows XP/.. did not as I > recall. > > Something is wrong in rxtx. Do I understand this right? > > > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > > > Perhaps there is something Wayne or I did not understand when we wrote > > that code. I wasnt programming back in the BBS days so modems are not > my > > thing. I have a few questions. > > > > Is the above matrix confirmed by observation? > > Linux just always worked? > > Which one _should_ work? I'm guessing modems work with hardware flow > > control. I'll have to dig around. > > > > The windows flow control changes a couple things with hardware flow > > control. Following the w32 API documentation is confusing sometimes. > > But it looks like Linux could have a bug too. > > Cheers > > Brian Schlining > Software Engineer > http://www.mbari.org > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/9c989144/attachment-0017.html From tjarvi at qbang.org Tue Feb 7 14:06:14 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 14:06:14 -0700 (MST) Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> Message-ID: >> >> You're not the only one whose had this problem, I don't know if Trent has >> addressed this is the latest release of RXTX but there is a workaround. >> Here's the recent thread from the RXTX mailing list regarding this issues: >> I have not. I expect to have access to some test equipment next month and I'll go through all of this. I really don't know whats going on and I need a gold standard. I thought maybe linux was autodetecting the flow control. Your observations would certainly be welcome. I need to talk to Russell King and see what he is doing. Until then I'd just be toying around over a loopback as usual. This is very high on the list though. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 17:25:05 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 17:25:05 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139358305.17994.2.camel@zd7280> My application now works. I installed the libraries and jar from 2.1-7 (Final). portlist.hasMoreElements is no longer false. The application finds the port for /dev/ttyUSB0. Thanks for your help, Trent (et al) Sorry I bothered you with this. Next time I will look in the source first. I didn't think it was an rxtx issue, I thought it was a Linux setup issue . On Tue, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > Hmm I'm looking at pre17 so this may have changed. (its just what I > have > on this machine) > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux > Serial Ports > "ttySA" // for the > IPAQs > }; > > CandidatePortPrefixes=Temp; > } > > > So you may need to add "ttyUSB" to that list. RXTX used to enumerate > _everything_ see if(osName.equals("Linux-all-ports") But it became > less > than practical. > > This is all in RXTXCommDriver.java > > hmm I just did a cvs update. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux > Serial Ports > "ttySA", // for the > IPAQs > "ttyUSB" // for USB > frobs > }; > > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you > have > to get your fingers into the code. We aim for sane defaults. -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 19:21:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 19:21:54 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139358305.17994.2.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> <1139358305.17994.2.camel@zd7280> Message-ID: >Sorry I bothered you with this. Next time I will look in the source >first. I didn't think it was an rxtx issue, I thought it was a Linux >setup issue . Why would you be sorry? I would have done the same. I'm glad it's working :) -- Trent Jarvi tjarvi at qbang.org From tma at mail.island.net Wed Feb 8 13:39:35 2006 From: tma at mail.island.net (Tom Alldread) Date: Wed, 08 Feb 2006 12:39:35 -0800 Subject: [Rxtx] Win32/Linux Serial Port Data Dropouts In-Reply-To: <200602060702.k167255O007882@www.qbang.org> References: <200602060702.k167255O007882@www.qbang.org> Message-ID: <43EA5707.4020200@mail.island.net> Greetings Folks at RXTX: During the last couple of months I have been alternately testing with javax.comm 2 and RXTX 2.1 under Windows XP and CommApi 3 and RXTX 2.1 under Suse 10.0 Linux. In the process I have learned a little about java multi-threading under NetBeans 5 with Profiler. My java (jdk 1.5_06) application is used for data acquisition and provides a graphical display of A-D conversion data received from a 56KBaud serial port. The actual data throughput is about 10KBaud thus it is well below the speed of the port. I use hardware RTS/CTS flow control which can stall the data acquisition sample rate if necessary. This ensures the display computer has the ability to slow the data acquisition rate should it become too busy to accept the regular data flow. Both the serial port buffer and the java read buffer are set at 16KB. Usually the data transfers into the java read buffer are less than 100 bytes unless the data acquisition is recovering from a stall. The data flow normally hesitates after each 5 KB block as a continue command is needed from the display computer to start the drawing of a new graphics display line. Separate threads have been provided for the serial port event monitoring and data processing. The serial port event thread has been given the maximum priority and data processing thread the minimum priority provided by java. Thread yield statements have been placed within all data processing while/for loops as an effort to ensure quick access to CPU cycles for the serial port event thread. I have found that short data transmissions are essentially error free but occasional dropouts occur with continuous data flow especially under Windows XP. ....................................................................................................................................................................................... Linux results: I am happy to report that RXTX 2.1 appears to work very well under Linux although I did notice some errors when the screen savers were running with my dual monitors. I believe this is a local problem associated with my dual graphics which needs further attention. The recent CommApi 3 Linux release from Sun did not work at all with my program. It seemed to send commands out OK but did not receive any data. Although the serial port event triggered the ISR, the input stream appeared filled with nulls and thus did not contain any data. As my understanding is that CommApi 3 was tested with a Red Hat distribution of Linux I wonder if this problem is distro dependent? Although somewhat off topic here I wonder if anyone reading this has had similar experience? .................................................................................................................................................................................. Windows XP results: There are problems with occasional data dropouts which become more frequent as the sampling rate is increased or if the computer becomes busy with other duties. The dropouts typically consist of a half dozen byte block of lost data. It appears the lost bytes never get added to the java input stream. There has not been any indication of garbled data, overruns or framing errors which suggests the UART communications remains solid. Using javax.comm 2 I found that the setting of SerialPort 'enableReceiveThreshold' to 40 and 'enableReceiveTimeout' of 100mS reduced the dropouts error rate significantly. I found that I could not get RXTX 2.1 to function with the aforementioned threshold and timeout settings. The javax.comm 2 interface is consequently performing better for me under Windows than RXTX 2.1. I wonder if anyone here has any suggestions as to what I might try to improve RXTX 2.1? Although my settings are the same as under Suse 10.0, RXTX 2.1 performs much better for me under Linux than any of the alternatives that I have tried under Windows XP . ............................................................................................................................................................................... I would like to establish, based on the experience of others, if I have reached the normally expected performance limit of java serial port communications? Should I expect to achieve virtually error free serial port data input from a continuous stream under Windows XP java software? I am considering changing my protocol to packets with error checking if necessary but would like to know if the dropout problems I am experiencing are typical or not before I take this rather work intensive plunge. Many thanks in advance for any help! Best Regards, Tom Alldread -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.375 / Virus Database: 267.15.2/253 - Release Date: 2006-02-07 From jlaxson at mac.com Wed Feb 8 23:56:48 2006 From: jlaxson at mac.com (John Laxson) Date: Thu, 9 Feb 2006 00:56:48 -0600 Subject: [Rxtx] PortInUseException: Unknown Application on OSX Message-ID: Hi, I've been trying to get RXTX 2.1.7 going on Mac OS X for a while here, and am running up into a wall here. I've tried with pre- compiled and the source version and get the same problem, a gnu.io.PortInUseException: Unknown Application. I have run the fixperms script included with the source distribution, and id shows me as a member of the uucp group, and permissions on /var/spool/uucp are 775 root:uucp. Running a test program (included at the bottom for clarity) lets me enumerate all the serial ports correctly, but trying to open any of them gives the PortInUseException. If it helps, when I try to open a port that's set to make an outgoing bluetooth connection, there is no delay and no connection attempt at all. Thanks, John Laxson PS: The documentation wiki on qbang.org shows 404, and has for a few days now. My test code: public static void main(String[] args) { SerialPort serialPort; try { Enumeration e = CommPortIdentifier.getPortIdentifiers(); CommPortIdentifier ident; while (e.hasMoreElements()) { ident = (CommPortIdentifier)e.nextElement(); System.out.println(ident.getName()); } ident = CommPortIdentifier.getPortIdentifier("/dev/cu.modem"); serialPort = (SerialPort) ident.open("Me", 5000); } catch (Exception e) { e.printStackTrace(); } } From rajesh.invincible at gmail.com Thu Feb 9 03:39:38 2006 From: rajesh.invincible at gmail.com (Rajesh N) Date: Thu, 9 Feb 2006 16:09:38 +0530 Subject: [Rxtx] Re: Move .java Files in gnu.io filesystem hierarchy - Maven (2) In-Reply-To: <43DF21D2.7090200@ngi.it> References: <43DF21D2.7090200@ngi.it> Message-ID: <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Can anybody tell me how to overcome these EXCEPTIONS I AM WORKING ON SERIAL COMMN IN JAVA ON LINUX. 1. " NOT ALL PARAMETERS SUPPORTED BY THE KERNEL" This i came across the following statement inmy prog. SerialP is A SerialPort object SerialP.setSerialPortParams(9600(BAUDRATE),DATABITS_8,STOPBITS_1,PARITY_NONE) 2. NullPointer Exception at Event Dispatch Now i have checked all my object references for a null reference but i found none i have put up my entire code in try catch blocks but still I AM UNABLE TO CATCH THIS EXCEPTION AND HENCE MY APPLICATION CLOSES HOW DOES THESE GO? PLEASE HELP ME IT IS URGENTTTTTTTTTTTTTTTT yours sincerely RAJESH On 1/31/06, Fabio Frumento wrote: > Hi Xavier, > > I don't know maven at all but the directory hierarchy listed buy Trent > is fine for me... > > I'll take a look to maven, it seems an interesting project > > Regards > > Fabio Frumento > > Trent Jarvi wrote: > > On Tue, 31 Jan 2006, Xavier Frisaye wrote: > > > >> Hi all, > >> > >> If you are going to rearrange the src folder, i will propose to use > >> maven 2 and follow its directory structure > >> > (http://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html). > >> > >> Maven 2 simplify java project and give a standard way to make projects > >> (http://maven.apache.org/). > >> We are using it for internal projects and we are very satisfied. > >> > >> Is anybody interested? > >> > >> I'm not an expert in maven 2 (yet) but i'm agree to help using it if > >> you choose to make so. > >> > > > > so this would be: > > > > rxtx-devel/src/main/java/gnu.io > > rxtx-devel/src/test/java/ManIwish.java > > > > I don't use IDEs very much so I'll let others comment. But I don't see > > a problem with that. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Thu Feb 9 09:50:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 9 Feb 2006 09:50:31 -0700 (MST) Subject: [Rxtx] Re: Move .java Files in gnu.io filesystem hierarchy - Maven (2) In-Reply-To: <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Message-ID: On Thu, 9 Feb 2006, Rajesh N wrote: > Can anybody tell me how to overcome these EXCEPTIONS > I AM WORKING ON SERIAL COMMN IN JAVA ON LINUX. > > 1. " NOT ALL PARAMETERS SUPPORTED BY THE KERNEL" > > This i came across the following statement inmy prog. > SerialP is A SerialPort object > SerialP.setSerialPortParams(9600(BAUDRATE),DATABITS_8,STOPBITS_1,PARITY_NONE) > Strange. The parameters you use are the same the port should open with by default. Could you paste the actual exception you are getting? I don't see that in the rxtx source. Also it would help to know the rxtx version. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Fri Feb 10 15:29:05 2006 From: lux at diesel-research.com (Kim Lux) Date: Fri, 10 Feb 2006 15:29:05 -0700 Subject: [Rxtx] One serial port object for both sending and receiving ? Message-ID: <1139610545.18177.4.camel@zd7280> Is it OK to use one SerialPort ojbect (ex Serial Port serialPort;) and use it for both sending and receiving ? For example: ======================================================================== static SerialPort serialPort = null; static OutputStream serialOut = null; static InputStream serialIn = null; // assign it to an outputStream for use try{ serialOut = serialPort.getOutputStream(); System.out.println("Serial output stream has been assigned."); }//try catch(IOException e) { System.out.println("Error: Couldn't assign output stream to serial port."); }//catch //assign it to an inputStream for use try{ serialIn = serialPort.getInputStream(); System.out.println("Serial input stream has been assigned."); }//try catch(IOException e) { System.out.println("Error: Couldn't assign input stream to serial port."); }//catch ======================================================================== -- Kim Lux, Diesel Research Inc. From lux at diesel-research.com Fri Feb 10 21:23:00 2006 From: lux at diesel-research.com (Kim Lux) Date: Fri, 10 Feb 2006 21:23:00 -0700 Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Message-ID: <1139631780.23882.10.camel@zd7280> I've got a problem receiving chars with my version of serialRead, written in an SWT GUI. I had a Java pro have a good look at my code and he can't see anything wrong with it. I can send chars fine. When I receive a char the cpu usage for the app goes to 100% and the code in the serial event handler doesn't get executed. The instructions on the Java Comm Serial API How-To for Linux page state that I must install javacomm. Is that true ? Everything builds without it and I can send chars on rxtx just fine, but I can't receive them. Could this be the problem ? I downloaded and installed javacomm. I was not able to add "Driver=gnuio.RXTXCommDriver to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 installed in /usr/java/jre1.5.0_05. I added comm.jar to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext to the library paths. Is this OK ? Does it matter that I am receiving on /dev/ttyUSB0 ? Thanks. -- Kim Lux, Diesel Research Inc. From lunareclipse03 at web.de Sat Feb 11 09:44:46 2006 From: lunareclipse03 at web.de (lunareclipse03@web.de) Date: Sat, 11 Feb 2006 17:44:46 +0100 Subject: [Rxtx] Question about Serial I/O under Win32 Message-ID: <662084330@web.de> Hello everybody, I have a strange problem with a piece of code I made for myself. No, this is not really concerning rxtx, but nevertheless I post this to the list, hoping that some of you can help me. I've written two libraries, one for linux and one for win32. The linux port works quite well, I can send / receive faxes and / or replay voice messages over the telephone line using a voice modem. But the win32 port of the library causes some trouble. If, for example, I send out a fax with a certain modem under linux, it works well. The fax is complete when it comes out of the fax machine. If I then use the same modem to send out a fax under win32, the fax coming out of the fax machine gets "stuck" halfways, but the sending modem thinks that transmission was ok and drops the connection. The answering fax machine then gives me "error while receiving." The "upper layer" java code MUST be right, because if I do the same thing under linux (using the linux library), everything is alright. Now I have to ask: Can somebody please help me out with this??!? Could it be the case that some kind of flow control or COMMTIMEOUTS setting causes this behaviour? I set flow control to RTS/CTS before sending out a fax. How can I DISABLE flow control? Or what do you think? Can something else cause this problems? Thank you all for your time and PLEASE write back soon. Regards, --Sven Ahlemann Am Waldrand 31 45721 Haltern am See Germany ______________________________________________________________ Verschicken Sie romantische, coole und witzige Bilder per SMS! Jetzt bei WEB.DE FreeMail: http://f.web.de/?mc=021193 From lux at diesel-research.com Sat Feb 11 10:06:52 2006 From: lux at diesel-research.com (Kim Lux) Date: Sat, 11 Feb 2006 10:06:52 -0700 Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: <1139631780.23882.10.camel@zd7280> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> <1139631780.23882.10.camel@zd7280> Message-ID: <1139677612.3431.5.camel@zd7280> More on this problem. I copied and pasted simpleRead into a console based Eclipse project and I've got the same result, except that cpu usage doesn't go to 100%. I'm beginning to think there is an issue in rxtx. My imports for simpleRead are: ============================ import gnu.io.*; import java.util.*; //import javax.comm.*; import java.io.*; =========================== Any ideas ? I am trying to read from /dev/ttyUSB0 using a serial to USB adapter which has worked well with minicom and gtkterm. Thanks. On Fri, 2006-02-10 at 21:23 -0700, Kim Lux wrote: > I've got a problem receiving chars with my version of serialRead, > written in an SWT GUI. > > I had a Java pro have a good look at my code and he can't see anything > wrong with it. > > I can send chars fine. When I receive a char the cpu usage for the app > goes to 100% and the code in the serial event handler doesn't get > executed. > > The instructions on the Java Comm Serial API How-To for Linux page state > that I must install javacomm. Is that true ? Everything builds without > it and I can send chars on rxtx just fine, but I can't receive them. > Could this be the problem ? > > I downloaded and installed javacomm. I was not able to add > "Driver=gnuio.RXTXCommDriver > to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not > have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 > installed in /usr/java/jre1.5.0_05. I added comm.jar > to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext > to the library paths. Is this OK ? > > Does it matter that I am receiving on /dev/ttyUSB0 ? > > Thanks. > -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Sun Feb 12 21:01:33 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:01:33 -0700 (MST) Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: <1139677612.3431.5.camel@zd7280> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> <1139631780.23882.10.camel@zd7280> <1139677612.3431.5.camel@zd7280> Message-ID: I suspect what is happening is the select() is breaking out in the native code but the driver does not have support for notifying there are X bytes available. On some traditional Unix based systems, the only way you know data is available is the fd status changes and do an FIORDCHK ioctl. Or perhaps the only thing you can know is the fd status changed. It would take reading through the kernel driver code to know for sure. So on USB, depending upon the driver, the same may need to be done or the driver improved a bit if possible to support. Polling reads will also work but don't use the event driven model of CommAPI which isnt acceptable in the long run. The 100% cpu usage can then be explained because select no longer blocks until the data is read; the eventLoop spins loose. You can put a well placed sleep but rxtx only expects those are needed when it knows data is available. This may not be a super simple thing to understand and fix. I do have ideas to get you started. I'm going to be short on time the next couple weeks. I expect to put some good time in and answer some other questions I saw around the 25th. For now, I'd look at the following and go from there with the hints I've given. JNIEXPORT jint JNICALL RXTXPort(nativeavailable)( JNIEnv *env, jobject jobj ) { int fd = get_java_var( env, jobj,"fd","I" ); int result; /* char message[80]; ENTER( "RXTXPort:nativeavailable" ); On SCO OpenServer FIONREAD always fails for serial devices, so try ioctl FIORDCHK instead; will only tell us whether bytes are available, not how many, but better than nothing. This turns out to be true on Solaris also. taj. */ #ifdef FIORDCHK /* __unixware__ __sun__ probably others */ result = ioctl(fd, FIORDCHK, 0); #else if( ioctl( fd, FIONREAD, &result ) < 0 ) { goto fail; } #endif /* FIORDCHK */ On Sat, 11 Feb 2006, Kim Lux wrote: > > More on this problem. I copied and pasted simpleRead into a console > based Eclipse project and I've got the same result, except that cpu > usage doesn't go to 100%. I'm beginning to think there is an issue in > rxtx. > > My imports for simpleRead are: > > ============================ > import gnu.io.*; > import java.util.*; > //import javax.comm.*; > import java.io.*; > =========================== > > Any ideas ? I am trying to read from /dev/ttyUSB0 using a serial to > USB adapter which has worked well with minicom and gtkterm. > > Thanks. > > > > On Fri, 2006-02-10 at 21:23 -0700, Kim Lux wrote: >> I've got a problem receiving chars with my version of serialRead, >> written in an SWT GUI. >> >> I had a Java pro have a good look at my code and he can't see anything >> wrong with it. >> >> I can send chars fine. When I receive a char the cpu usage for the app >> goes to 100% and the code in the serial event handler doesn't get >> executed. >> >> The instructions on the Java Comm Serial API How-To for Linux page state >> that I must install javacomm. Is that true ? Everything builds without >> it and I can send chars on rxtx just fine, but I can't receive them. >> Could this be the problem ? >> >> I downloaded and installed javacomm. I was not able to add >> "Driver=gnuio.RXTXCommDriver >> to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not >> have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 >> installed in /usr/java/jre1.5.0_05. I added comm.jar >> to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext >> to the library paths. Is this OK ? >> >> Does it matter that I am receiving on /dev/ttyUSB0 ? >> >> Thanks. >> > From tjarvi at qbang.org Sun Feb 12 21:03:30 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:03:30 -0700 (MST) Subject: [Rxtx] One serial port object for both sending and receiving ? In-Reply-To: <1139610545.18177.4.camel@zd7280> References: <1139610545.18177.4.camel@zd7280> Message-ID: On Fri, 10 Feb 2006, Kim Lux wrote: > > Is it OK to use one SerialPort ojbect (ex Serial Port serialPort;) and > use it for both sending and receiving ? > > For example: > > ======================================================================== > static SerialPort serialPort = null; > static OutputStream serialOut = null; > static InputStream serialIn = null; > > > > > // assign it to an outputStream for use > try{ > serialOut = serialPort.getOutputStream(); > System.out.println("Serial output stream has been assigned."); > }//try > catch(IOException e) > { > System.out.println("Error: Couldn't assign output stream to serial > port."); > }//catch > > > //assign it to an inputStream for use > try{ > serialIn = serialPort.getInputStream(); > System.out.println("Serial input stream has been assigned."); > }//try > catch(IOException e) > { > System.out.println("Error: Couldn't assign input stream to serial > port."); > }//catch This should be fine. In fact trying to do it another way will probably not work as you will run into lockfile issues. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun Feb 12 21:13:13 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:13:13 -0700 (MST) Subject: [Rxtx] Question about Serial I/O under Win32 In-Reply-To: <662084330@web.de> References: <662084330@web.de> Message-ID: On Sat, 11 Feb 2006 lunareclipse03 at web.de wrote: > Hello everybody, > > I have a strange problem with a piece of code I made for myself. No, > this is not really concerning rxtx, but nevertheless I post this to the > list, hoping that some of you can help me. I've written two libraries, > one for linux and one for win32. The linux port works quite well, I can > send / receive faxes and / or replay voice messages over the telephone > line using a voice modem. But the win32 port of the library causes some > trouble. If, for example, I send out a fax with a certain modem under > linux, it works well. The fax is complete when it comes out of the fax > machine. If I then use the same modem to send out a fax under win32, the > fax coming out of the fax machine gets "stuck" halfways, but the sending > modem thinks that transmission was ok and drops the connection. The > answering fax machine then gives me "error while receiving." The "upper > layer" java code MUST be right, because if I do the same thing under > linux (using the linux library), everything is alright. Now I have to > ask: Can somebody please help me out with this??!? Could it be the case > that some kind of flow control or COMMTIMEOUTS setting causes this > behaviour? I set flow control to RTS/CTS before sending out a fax. How > can I DISABLE flow control? Or what do you think? Can something else > cause this problems? Thank you all for your time and PLEASE write back > soon. > Hi Sven I'm not too willing to talk about flow control at the low level until I confirm some things with test equipment later. It is not clear if you are using rxtx or writing your own native code. So I'm not sure how to answer much of this :) If you are wondering how to change the flow control using rxtx from java, The BlackBox example from Sun flips this back and forth. SerialPort.java in rxtx 2.1 uses the following: SerialPort.java: public static final int FLOWCONTROL_NONE =0; SerialPort.java: public static final int FLOWCONTROL_RTSCTS_IN =1; SerialPort.java: public static final int FLOWCONTROL_RTSCTS_OUT =2; SerialPort.java: public static final int FLOWCONTROL_XONXOFF_IN =4; SerialPort.java: public static final int FLOWCONTROL_XONXOFF_OUT=8; So if you set flowcontrol to RTSCTS, you can set it to NONE to turn it off. If you are looking for how to do it in native code, the rxtx Source is SerialImp.c (unix/linux/mac os x/w32) and termios.c (w32 only with SerialImp.c) You can track the code: SerialImp.c:JNIEXPORT void JNICALL RXTXPort(setflowcontrol)( JNIEnv *env, jobject jobj, jint flowmode ) termios.c:int tcgetattr( int fd, struct termios *s_termios ) termios.c:int tcsetattr( int fd, int when, struct termios *s_termios ) There may be a problem in the rxtx flow control code though. Rather than guess, I want to test this with a gold standard. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Feb 6 00:00:16 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 00:00:16 -0700 (MST) Subject: [Rxtx] wiki delay until tomorrow night. In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: On Sun, 5 Feb 2006, Trent Jarvi wrote: > On Sun, 5 Feb 2006, Kim Lux wrote: > >> usb ? Tell me more... I need that too. > > usb is a very proper design. Thats all it is. > Maybe rxtx could help usb. But it would start with helping bring back the community that was already there. It's not something I'd love to do but maybe its the right thing to do. It would probably take 2 years to do right. But maybe thats better than what we have now. I honestly don't know what IBM is doing which could just run over everything. Just some thoughts after some fine german wine. -- Trent Jarvi tjarvi at qbang.org From gadelavega at yahoo.com.ar Mon Feb 6 02:17:05 2006 From: gadelavega at yahoo.com.ar (Gonzalo A. de la Vega) Date: Mon, 06 Feb 2006 10:17:05 +0100 Subject: [Rxtx] Serial port ownership question In-Reply-To: References: <20060205113618.30274.qmail@web53501.mail.yahoo.com> <1139157422.4553.9.camel@zd7280> <1139158698.4936.9.camel@zd7280> Message-ID: <43E71411.4050402@yahoo.com.ar> On my Fedora Core 4: ls -l /dev/ttyS* crw-rw---- 1 root uucp 4, 64 Feb 6 2006 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Feb 6 2006 /dev/ttyS1 ... and: grep "ttyUSB" /etc/udev/rules.d/50-udev.rules KERNEL=="ttyUSB*", GROUP="uucp", MODE="0660" So anyone in the "uucp" group can use serial ports. On Gentoo the group is "tty". Trent Jarvi escribi?: > > > On Sun, 5 Feb 2006, Dr. Douglas Lyon wrote: > >> I can confirm that this is the case (only root ownership of >> serial ports, under fedora 4). >> Wow, what were they thinking?! >> - DL >> >>> I've found that the newer kernels have the serial ports owned by root. >>> For example, >>> >>> $ls -al /dev/tty* >>> crw-rw-rw- 1 root root 5, 0 Feb 5 02:06 /dev/tty >>> crw-rw---- 1 root root 4, 0 Feb 5 02:06 /dev/tty0 >>> crw------- 1 root root 4, 1 Feb 5 09:07 /dev/tty1 >>> crw-rw---- 1 root tty 4, 10 Feb 5 02:06 /dev/tty10 >>> crw-rw---- 1 root tty 4, 11 Feb 5 02:06 /dev/tty11 >>> ... > > > This is just not a problem jcp or such are going to solve. Its a > platform spitwad fight. But do look at pam. In fact thats what Sun > is doing too. Maybe Linux followed their lead.. I'm not a pam guy. > I've spent 16 hours trying to understand it but your users wont :) > > Solution? I have no clue. Its two tangent mentalities from my > perspective. > > -- > Trent Jarvi > tjarvi at qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mtnvega at yahoo.com.br Mon Feb 6 05:35:43 2006 From: mtnvega at yahoo.com.br (Luiz Jr) Date: Mon, 6 Feb 2006 12:35:43 +0000 (GMT) Subject: [Rxtx] Documentation Wiki In-Reply-To: <1139157422.4553.9.camel@zd7280> Message-ID: <20060206123543.57256.qmail@web53515.mail.yahoo.com> Hello, Thank you for you answer, but so the usage of the API is pretty much like the Java Communications Api? If yes, what version of the Java Comm Api? Thank you, Luiz A. Brandao Jr Kim Lux escreveu: On Sun, 2006-02-05 at 08:36 -0300, Luiz Jr wrote: > Hello, > > I want to start using the RXTX libraries, but I would to know how, > since I can not access the documentation wiki page I just started using them yesterday. Below is how I installed the libraries, if that helps. I used snippets of code from the SimpleWrite application here to get me going. http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html Instead of "import javax.comm.*;", use "import gnu.io.*;" which is gotten from RXTXcomm.jar, which you will need to include in your project references. I am working in Eclipse. BTW: there is no way to open a port without going through the port list and finding it. Maybe sometime in the future someone (me ?) will write a method called openSerialPort that allows the user to give a port identifier, such as "/dev/tty1" and return a port ready to use. It wouldn't take much to write that and it would save users a lot of code. Hope this helps. ======================================================================= 1) Figure out which java you are running, incase there is more than one installed. $ java -version java version "1.5.0_05" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_05-b05) Java HotSpot(TM) Client VM (build 1.5.0_05-b05, mixed mode, sharing) 2) Find all the jre directories and the one from which you are currently running. kfind (jre) 3) cd to that directory plus /lib/i386 cd /usr/java/jre1.5.0_05/lib/i386 4) Copy the library files (*.so) to that directory. cp /home/krlux/Desktop/'Java Controls'/rxtx-linux/bin/* . 5) Check that the copy was successful ls librxtx* librxtxI2C.so librxtxRaw.so librxtxSerial.so librxtxParallel.so librxtxRS485.so 6) cd to the /lib/ext directory for your java. cd /usr/java/jre1.5.0_05/lib/ext 7) Copy the Jar files there cp /home/krlux/Desktop/'Java Controls'/rxtx-linux/lib/ext/* . 8) Check that it was successful ls RXTX* RXTXcomm.jar Rxtx is now installed on your machine ready to use. =================================================================== -- Kim Lux, Diesel Research Inc. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx --------------------------------- Yahoo! Acesso Gr?tis - Internet r?pida e gr?tis. Instale o discador agora! -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/544aa403/attachment-0018.html From lyon at docjava.com Mon Feb 6 05:49:34 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 06 Feb 2006 07:49:34 -0500 Subject: [Rxtx] wiki delay until tomorrow night. In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: Hi All, I have often thought about USB drivers being needed. For example, the ironman watch will not interface to a mac (windows only). It is USB. My dymo label writer has no Java driver (native only). Etc. Most cheap web cameras are USB (and Java drivers go through JAI, if it supports the camera at all). The JAI code shows how sun did the USB drivers. You have to be a member of the jai project to download the source code. https://jai.dev.java.net has the jai distro. And then you are not allowed to redistribute it. However, we can all learn from it (if so inclined). Basically: cvs -d :pserver:lyon at cvs.dev.java.net:/cvs login cvs -d :pserver:lyon at cvs.dev.java.net:/cvs checkout jai-core You will need to user your own uid and pw to get in. The ant build has over 100 warnings from sun deprecations of its own code. You might say that they were hoisted on their own Picard ;) One interesting thing is that they support several platforms: linux-amd64 64-bit Linux-AMD64 linux-i586 32-bit Linux-x86 solaris-amd64 64-bit Solaris-AMD64 solaris-i586 32-bit Solaris-x86 solaris-sparc 32-bit Solaris-SPARC solaris-sparcv9 64-bit Solaris-SPARC windows-i586 32-bit Windows-x86 Thus, ant is used to provide a multi-platform native method distro. Neat. How do they do it? check this out: And: The core download does not contain any C source code (it was all pre-built). Basically, they are just copying .so and .dll files into build directories. I would love to see the C code for this...but Sun does not post it on the https://jai.dev.java.net site. I don't know why...Perhaps I missed it. - Doug >On Sun, 5 Feb 2006, Trent Jarvi wrote: > >>On Sun, 5 Feb 2006, Kim Lux wrote: >> >>>usb ? Tell me more... I need that too. >> >>usb is a very proper design. Thats all it is. >> > >Maybe rxtx could help usb. But it would start with helping bring >back the community that was already there. > >It's not something I'd love to do but maybe its the right thing to do. > >It would probably take 2 years to do right. But maybe thats better >than what we have now. > >I honestly don't know what IBM is doing which could just run over everything. > >Just some thoughts after some fine german wine. > >-- >Trent Jarvi >tjarvi at qbang.org > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tdelenik at gmail.com Mon Feb 6 05:56:32 2006 From: tdelenik at gmail.com (Thanasis Delenikas) Date: Mon, 6 Feb 2006 14:56:32 +0200 Subject: Fwd: [Rxtx] Documentation Wiki In-Reply-To: <1139157422.4553.9.camel@zd7280> References: <20060205113618.30274.qmail@web53501.mail.yahoo.com> <1139157422.4553.9.camel@zd7280> Message-ID: <310a1a930602060456t129f1dc6p5f2b908f13ab5a0b@mail.gmail.com> Hello all, Kim, this is a snippet from the code I use. The closest to directly opening a specific port without enumeration. << ... portId = CommPortIdentifier.getPortIdentifier(getPort()); serialPort = (SerialPort) portId.open("jSMSEngine", 1971); ... >> where getPort() return the string identifier of the port, i.e. "/dev/ttyS0" or "COM1" or whatever. Thanasis. ---------- Forwarded message ---------- From: Kim Lux Date: Feb 5, 2006 6:37 PM Subject: Re: [Rxtx] Documentation Wiki To: RXTX Developers and Users BTW: there is no way to open a port without going through the port list and finding it. Maybe sometime in the future someone (me ?) will write a method called openSerialPort that allows the user to give a port identifier, such as "/dev/tty1" and return a port ready to use. It wouldn't take much to write that and it would save users a lot of code. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/182ab5b8/attachment-0018.html From tjarvi at qbang.org Mon Feb 6 11:53:57 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 11:53:57 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: On Mon, 6 Feb 2006, Dr. Douglas Lyon wrote: > Hi All, > I have often thought about USB drivers being needed. > For example, the ironman watch will not interface > to a mac (windows only). It is USB. > My dymo label writer has no Java driver (native only). > Etc. > Most cheap web cameras are USB (and Java drivers go > through JAI, if it supports the camera at all). > The JAI code shows how sun did the USB drivers. > You have to be a member of the jai project to download > the source code. > https://jai.dev.java.net has the jai distro. > And then you are not allowed to redistribute it. However, > we can all learn from it (if so inclined). Basically: > cvs -d :pserver:lyon at cvs.dev.java.net:/cvs login > cvs -d :pserver:lyon at cvs.dev.java.net:/cvs checkout jai-core > You will need to user your own uid and pw to get in. > The ant build has over 100 warnings from sun deprecations > of its own code. > > You might say that they were hoisted on their own Picard ;) > > One interesting thing is that they support several platforms: > linux-amd64 64-bit Linux-AMD64 > linux-i586 32-bit Linux-x86 > solaris-amd64 64-bit Solaris-AMD64 > solaris-i586 32-bit Solaris-x86 > solaris-sparc 32-bit Solaris-SPARC > solaris-sparcv9 64-bit Solaris-SPARC > windows-i586 32-bit Windows-x86 > Thus, ant is used to provide a multi-platform native method distro. > Neat. > How do they do it? > check this out: > > > > > > > > > > > > > And: > > > > > > > > > > The core download does not contain any C source code (it was all pre-built). > Basically, they are just copying .so and .dll files into build directories. > > I would love to see the C code for this...but Sun does not post it on the > https://jai.dev.java.net site. > > I don't know why...Perhaps I missed it. > > - Doug > > I've looked at moving rxtx to Ant builds. I think that would help IDEs a great deal. I requested a evalutation desk copy the O'Reilly Ant book for some j2ee material I was teaching. http://www.oreilly.com/catalog/anttdg/ It has a one sentence mention of JNI. So there was not luck there. I saw that there is another Ant book that does mention JNI more. I can't find it now. Ant must be able to support it with extensions. http://ant.apache.org/manual/OptionalTasks/javah.html What the auto(break :) tools do in the rxtx build is 4 things really. 1) gcc compile flags 2) ld compile flags 3) config.h 4) compile flags for customizing rxtx (lockfiles, ...) See 1 All of this information except 4 can be static once obtained. So I'm not attached to the auto tools. If I could find an example of Ant being used for JNI code, I'd be one of the first to start moving that direction. Maybe someone saw an example someplace. The other thing we have not completed discussing is the directory structure. There is interest in making rxtx more IDE friendly. I get more mail about that off the list than how to install rxtx. And I see we have Ken Thompson in da house :) He is our trusted CVS maintainer and the guy that purchased the rxtx.org domain. Old community. We will need Ken for changing the directory structure of source. I would like to open up discussion about both of these as it is more than time. The problem is I have little experience with Ant and even less with IDEs. It would be nice if we could work with Eclipse and NetBeans. http://www.netbeans.org/ (sun and some community) http://www.eclipes.org (ibm,rhat,... perhaps more community) http://maven.apache.org/what-is-maven.html (apache. It is community) borland should sortof be here too but I think thats covered in eclipse. >From what I understand so far, we should morph rxtx to support those three maybe trusting apaches lead with maven. But I use vi. I have little to no clues beyond what people have fed me. Can we agree that thats the right direction to go? -- Trent Jarvi tjarvi at qbang.org From brian at mbari.org Mon Feb 6 14:57:50 2006 From: brian at mbari.org (Brian Schlining) Date: Mon, 6 Feb 2006 13:57:50 -0800 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> > The other thing we have not completed discussing is the directory > structure. There is interest in making rxtx more IDE friendly. I > get more mail about that off the list than how to install rxtx. > > And I see we have Ken Thompson in da house :) He is our trusted > CVS maintainer and the guy that purchased the rxtx.org domain. Old > community. We will need Ken for changing the directory structure of > source. > > I would like to open up discussion about both of these as it is > more than time. The problem is I have little experience with Ant > and even less with IDEs. It would be nice if we could work with > Eclipse and NetBeans. > > http://www.netbeans.org/ (sun and some community) > http://www.eclipes.org (ibm,rhat,... perhaps more community) > http://maven.apache.org/what-is-maven.html (apache. It is community) > borland should sortof be here too but I think thats covered in > eclipse. > >> From what I understand so far, we should morph rxtx to support >> those three > maybe trusting apaches lead with maven. But I use vi. I have > little to no clues beyond what people have fed me. > Maven likes the directory structure below for Java code. (From http:// maven.apache.org/guides/getting-started/index.html) This structure works fine with ant, netbeans, and eclipse. rxtx_root_directory `-- src |-- main | `-- java | `-- gnu | `-- io `-- test `-- java `-- gnu `-- io Brian Schlining Software Engineer http://www.mbari.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/d9451eba/attachment-0018.html From tjarvi at qbang.org Mon Feb 6 15:11:45 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 15:11:45 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: > rxtx_root_directory > `-- src > |-- main > | `-- java > | `-- gnu > | `-- io > `-- test > `-- java > `-- gnu > `-- io > >From what I understand this will just be good. For me it makes no difference. So lets do the rxtx thing. Let if fester for two weeks and if nobody objects, we will do it. I'm not doing this because I care. I'm doing this to eliminate much of my inbox. But test... man is rxtx lacking there in the community aspect. It is covered but not right. _maybe_ I can change that this year. -- Trent Jarvi tjarvi at qbang.org (cat hurding since 1997) From lux at diesel-research.com Mon Feb 6 21:38:49 2006 From: lux at diesel-research.com (Kim Lux) Date: Mon, 06 Feb 2006 21:38:49 -0700 Subject: [Rxtx] How can I use Lock Files with rxtx (in FC4) ? Message-ID: <1139287129.17031.3.camel@zd7280> I am now running an rxtx application on FC4. I am getting: ========================================================= check_group_uucp(): error testing lock file creation Error details: Permission denied check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL ========================================================= $ ls -al /var/lock total 32 drwxrwxr-x 4 root lock 4096 Feb 6 16:04 . drwxr-xr-x 24 root root 4096 Nov 14 01:19 .. drwx------ 2 root root 4096 Apr 27 2005 lvm drwxr-xr-x 2 root root 4096 Feb 6 16:04 subsys How do I fix this for regulator users ? -- Kim Lux, Diesel Research Inc. From dmarkman at mac.com Mon Feb 6 22:24:44 2006 From: dmarkman at mac.com (Dmitry Markman) Date: Tue, 7 Feb 2006 00:24:44 -0500 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: if I understands the issue right in order to be able to use ant for c/c++ compilation you have to install ant's cc task http://ant-contrib.sourceforge.net/cc.html it looks like it should work on mac os x (authors claim, that it's platform independent) but I never tested so all you have to do it's providing right command line for the gcc compiler On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: >> rxtx_root_directory >> `-- src >> |-- main >> | `-- java >> | `-- gnu >> | `-- io >> `-- test >> `-- java >> `-- gnu >> `-- io >> > > >> From what I understand this will just be good. > > For me it makes no difference. So lets do the rxtx thing. Let if > fester for two weeks and if nobody objects, we will do it. > > I'm not doing this because I care. I'm doing this to eliminate > much of my inbox. > > But test... man is rxtx lacking there in the community aspect. It > is covered but not right. _maybe_ I can change that this year. > > -- > Trent Jarvi > tjarvi at qbang.org > (cat hurding since 1997) > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx Dmitry Markman From lux at diesel-research.com Mon Feb 6 23:20:15 2006 From: lux at diesel-research.com (Kim Lux) Date: Mon, 06 Feb 2006 23:20:15 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? Message-ID: <1139293215.3689.4.camel@zd7280> I'm running the code below. portlist.hasMoreElements() is false. /dev has ports in it as listed below. What am I doing wrong ? ========================================================== // Step through the list of ports until we find one that matches // the one we are looking for. portList = CommPortIdentifier.getPortIdentifiers(); while(portList.hasMoreElements()) { portID = (CommPortIdentifier) portList.nextElement(); // if (portID.getName().equals("/dev/ttyUSB0")) { myTA.append("Serial port ttyUSB0 has been found\n"); break; }// if portID equals... }// End of while... ========================================================== ls -al /dev/tty* crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 ... crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 -- Kim Lux, Diesel Research Inc. From david.garnier at trusted-logic.com Tue Feb 7 00:46:30 2006 From: david.garnier at trusted-logic.com (David Garnier) Date: Tue, 07 Feb 2006 08:46:30 +0100 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: <43E85056.2090608@trusted-logic.com> Hello, I think that the make-based build process is fine as it is, apart from the location of the Java source files. It is true that putting the Java source in a directory structure that map 1-to-1 to the Java package structure is the norm and should make it easier for everyone to modify the Java source, with or without an IDE. Ant is a good tool, but in the RXTX case I fail to see the advantage of using it compared to the current make-based process. As Trent said, they are more pressing issues, like testing. Regards, David Dmitry Markman wrote: > if I understands the issue right > in order to be able to use ant for c/c++ compilation > you have to install ant's cc task > http://ant-contrib.sourceforge.net/cc.html > > it looks like it should work on mac os x > (authors claim, that it's platform independent) > but I never tested > > so all you have to do it's providing right command line > for the gcc compiler > > > > > On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: > >>> rxtx_root_directory >>> `-- src >>> |-- main >>> | `-- java >>> | `-- gnu >>> | `-- io >>> `-- test >>> `-- java >>> `-- gnu >>> `-- io >>> >> >> >>> From what I understand this will just be good. >> >> For me it makes no difference. So lets do the rxtx thing. Let if >> fester for two weeks and if nobody objects, we will do it. >> >> I'm not doing this because I care. I'm doing this to eliminate much >> of my inbox. >> >> But test... man is rxtx lacking there in the community aspect. It is >> covered but not right. _maybe_ I can change that this year. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> (cat hurding since 1997) From tjarvi at qbang.org Tue Feb 7 01:11:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 01:11:31 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <43E85056.2090608@trusted-logic.com> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: On Tue, 7 Feb 2006, David Garnier wrote: > Hello, > > I think that the make-based build process is fine as it is, apart from the location of the Java > source files. It is true that putting the Java source in a directory structure that map 1-to-1 to > the Java package structure is the norm and should make it easier for everyone to modify the Java > source, with or without an IDE. > > Ant is a good tool, but in the RXTX case I fail to see the advantage of using it compared to the > current make-based process. As Trent said, they are more pressing issues, like testing. > Hi David I have more experience with testing rxtx than I can talk about. But let it be known, rxtx has gone trough 100's of hours of testing. We are hobby folks interested in toys but there is more. rxtx has had some of the best guidance in the industry there. This is not an easy thing. I may be able to come back in a month from the other side of the corperate fence and help. I suspect the tests could just be made public but they are in a very unusual environment that just wont work in a wider sense. This is something I'll be trying to change. At one point it was agreed we could just make the results public so this isnt just noise.. There is interest and I think its safe to mention that much. The big problem with testing in the past is most of it is done with a loopback connection. So we *still* have major questions regarding things like flow control. rxtx talks to itself over a loopback and it works. regardless of right or wrong. This requires more thought to be done right. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Feb 7 02:46:34 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 02:46:34 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: > The big problem with testing in the past is most of it is done with a > loopback connection. So we *still* have major questions regarding things > like flow control. rxtx talks to itself over a loopback and it works. > regardless of right or wrong. With serial communication there are gold standards. ckermit is probably a definitive 'standard.' Maybe its possible to do ping/pong tests with ckermit? Is it scriptable? There are known issues in rxtx. Probably the worst is some threading issues regarding some JREs with multiple JNI threads setting java variables. Man did I get schooled there. Just switch the c functions to returning variables and things go away. Sometimes they work fine, sometimes they blow up. Without understanding everything, somehow rhat got it right and debian (and especially gentoo) grabbed kernel patches causing all sort of harm. Its not hard to fix once you understand whats going on but nearly impossible to track with a debugger. So I have a good idea what 2.1-8 will have outside of the IDE modifications. rxtx 2.1-7 is a release for everyone to sync with. Its not even as stable as -pre17 as far as I know - I ran no test suites. I'll be chasing it too. We just had so many contributions that it was time. It seriously broke internal scheduals but thats a great thing :) The other thing I want to do in 2.1-8 is automagic baud rates. It turns out lots of shops are doing really funky baud rates for things like automobile test equipment. It is possible but it requires a fair amount of change in the native code. Is anyone looking at this? -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Feb 7 02:57:21 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 07 Feb 2006 04:57:21 -0500 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <43E85056.2090608@trusted-logic.com> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: Hi All, I agree, testing is very important. The problem I have been trying to address is related to cross-platform testing and the robust nature of the installs. Typically, I visit 3 platforms to deploy my product, windows, linux and mac. A build is performed on each platform. The idea that you can build for many platforms from one copy the source code seems attractive. This should enable synchronized deployments of identical code. The question of how to achieve this goal remains open. As Trent mentioned, this is hard. Perhaps Ant will help here (but perhaps not). Ant does seem to help with running unit tests. However, it does not help with multi-platform tests. For that you need many machines and different operating environments. Toward that end, I have created a multi-platform test that can be run from web start, located at: http://show.docjava.com:8086/book/cgij/code/jnlp/serialPort.PortTest.jnlp This is interesting because many people in the community can run the test and we can improve the test, as time permits. No, it is not a perfect solution, however, the idea does help with multi-platform tests using many machines and different operating environments. If the group has a good test for a general serial port set-ups, i would be happy to deploy it, for general evaluation using web start. And as for ANT, it is just an idea. Not all my ideas are good ones! - Doug >Hello, > >I think that the make-based build process is fine as it is, apart >from the location of the Java >source files. It is true that putting the Java source in a directory >structure that map 1-to-1 to >the Java package structure is the norm and should make it easier for >everyone to modify the Java >source, with or without an IDE. > >Ant is a good tool, but in the RXTX case I fail to see the advantage >of using it compared to the >current make-based process. As Trent said, they are more pressing >issues, like testing. > >Regards, >David > >Dmitry Markman wrote: >> if I understands the issue right >> in order to be able to use ant for c/c++ compilation >> you have to install ant's cc task >> http://ant-contrib.sourceforge.net/cc.html >> >> it looks like it should work on mac os x >> (authors claim, that it's platform independent) >> but I never tested >> >> so all you have to do it's providing right command line >> for the gcc compiler >> >> >> >> >> On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: >> >>>> rxtx_root_directory >>>> `-- src >>>> |-- main >>>> | `-- java >>>> | `-- gnu >>>> | `-- io >>>> `-- test >>>> `-- java >>>> `-- gnu >>>> `-- io >>>> >>> >>> >>>> From what I understand this will just be good. >>> >>> For me it makes no difference. So lets do the rxtx thing. Let if >>> fester for two weeks and if nobody objects, we will do it. >>> >>> I'm not doing this because I care. I'm doing this to eliminate much >>> of my inbox. >>> >>> But test... man is rxtx lacking there in the community aspect. It is >>> covered but not right. _maybe_ I can change that this year. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> (cat hurding since 1997) > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From matt.higgins at gmail.com Tue Feb 7 08:28:34 2006 From: matt.higgins at gmail.com (Matt Higgins) Date: Tue, 7 Feb 2006 10:28:34 -0500 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final Message-ID: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? import java.io.*; import java.util.*; import gnu.io.*; public class MySimpleRead implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; public static void main(String[] args) { boolean portFound = false; String defaultPort = "COM1"; if (args.length > 0) { defaultPort = args[0]; } portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; MySimpleRead reader = new MySimpleRead(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } } public MySimpleRead() { try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) { e.printStackTrace(); } try { inputStream = serialPort.getInputStream(); } catch (IOException e) { e.printStackTrace(); } try { serialPort.addEventListener(this); } catch (TooManyListenersException e) { e.printStackTrace(); } try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { e.printStackTrace(); } System.out.println("Baud is " + serialPort.getBaudRate()); System.out.println("Bits is " + serialPort.getDataBits()); System.out.println("Stop is " + serialPort.getStopBits()); System.out.println("Par is " + serialPort.getParity()); serialPort.notifyOnDataAvailable(true); readThread = new Thread(this); readThread.start(); } public void run() { // Thread.sleep(20000); //} catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { System.out.println("An event occurred " + event.getEventType()); switch (event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: byte[] readBuffer = new byte[20]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } System.out.print(new String(readBuffer)); } catch (IOException e) {} break; } } } --------------- Result on windows ------------------------------ Stable Library ============================================================== Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port:: COM1 Baud is 9600 Bits is 8 Stop is 1 Par is 0 ----------------- End Results ----------------------------------------- ------------------ Result on Linux ----------------------------------- Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 Found port: /dev/ttyS0 Baud is 9600 Bits is 8 Stop is 1 Par is 0 An event occurred 1 043100066224 ------------------ End Results --------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/a1431630/attachment-0018.html From brian at mbari.org Tue Feb 7 09:48:37 2006 From: brian at mbari.org (Brian Schlining) Date: Tue, 7 Feb 2006 08:48:37 -0800 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> Message-ID: <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> Hi Matt > The following code works fine on Linux but I never see any data > when run on Windows. This is a cut and paste from the SimpleRead > example. > I am attempting to read data from a bar code scanner. I can fire > up HyperTermianl on windows and see that the device is working > properly as I see the barcodes are scanned and echoed back to the > terminal. However when I run the app I don't see any data. It is > however associating with the com port as the informational bits > print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. Cheers Brian Schlining Software Engineer http://www.mbari.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/16d07f37/attachment-0018.html From lux at diesel-research.com Tue Feb 7 11:59:58 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 11:59:58 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139293215.3689.4.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> Message-ID: <1139338798.8145.4.camel@zd7280> Any ideas on this ? Any reason why portList.hasMoreElements() should be false even though there are devices in /dev ? On Mon, 2006-02-06 at 23:20 -0700, Kim Lux wrote: > I'm running the code below. > > portlist.hasMoreElements() is false. > > /dev has ports in it as listed below. > > What am I doing wrong ? > > > ========================================================== > // Step through the list of ports until we find one that matches > // the one we are looking for. > > portList = CommPortIdentifier.getPortIdentifiers(); > > while(portList.hasMoreElements()) > { > portID = (CommPortIdentifier) portList.nextElement(); // > if (portID.getName().equals("/dev/ttyUSB0")) > { > myTA.append("Serial port ttyUSB0 has been found\n"); > break; > }// if portID equals... > }// End of while... > ========================================================== > > ls -al /dev/tty* > crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty > crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 > crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 > crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 > crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 > ... > crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 > crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 > crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 > > > -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 12:20:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 12:20:25 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139338798.8145.4.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> Message-ID: On Tue, 7 Feb 2006, Kim Lux wrote: > > Any ideas on this ? Any reason why portList.hasMoreElements() should be > false even though there are devices in /dev ? > > > On Mon, 2006-02-06 at 23:20 -0700, Kim Lux wrote: >> I'm running the code below. >> >> portlist.hasMoreElements() is false. >> >> /dev has ports in it as listed below. >> >> What am I doing wrong ? >> >> >> ========================================================== >> // Step through the list of ports until we find one that matches >> // the one we are looking for. >> >> portList = CommPortIdentifier.getPortIdentifiers(); >> >> while(portList.hasMoreElements()) >> { >> portID = (CommPortIdentifier) portList.nextElement(); // >> if (portID.getName().equals("/dev/ttyUSB0")) >> { >> myTA.append("Serial port ttyUSB0 has been found\n"); >> break; >> }// if portID equals... >> }// End of while... >> ========================================================== >> >> ls -al /dev/tty* >> crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty >> crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 >> crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 >> crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 >> crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 >> ... >> crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 >> crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 >> crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 >> >> >> > Hi Kim What rxtx does is try to open the port and do a timed out read. If the kernel/... do not complain it's enumarted. I suspect you could do a crude test by doing something like cat /dev/ttyS0 > /dev/null If that barfs then rxtx wont enumerate the port. hmm looking at your question again, I suspect it's a lockfile problem. This is documented in INSTALL with the source. Its easy enough to test this too.. touch /var/lock/testingrxtxlockfiles && rm -f /var/lock/testingrxtxlockfiles If you are not in the right group it will bail. Root will work regardless. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 12:37:56 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 12:37:56 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> Message-ID: <1139341076.8145.11.camel@zd7280> Exactly which ports does rxtx attempt to put into the list ? /dev/* or /dev/tty* or /dev/tty[0-9[0-9] ? or /dev/ttyS* ? For the record, only /dev/ttyUSB0 is a valid port on the machine I am presently on. Will this be a problem ? On Tue, 2006-02-07 at 12:20 -0700, Trent Jarvi wrote: > This is documented in INSTALL with the source. > I was wondering where that file was. I will download source and dig it up. Thanks. -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 12:51:09 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 12:51:09 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139341076.8145.11.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: On Tue, 7 Feb 2006, Kim Lux wrote: > > Exactly which ports does rxtx attempt to put into the list ? /dev/* > or /dev/tty* or /dev/tty[0-9[0-9] ? or /dev/ttyS* ? > > For the record, only /dev/ttyUSB0 is a valid port on the machine I am > presently on. Will this be a problem ? > > > On Tue, 2006-02-07 at 12:20 -0700, Trent Jarvi wrote: >> This is documented in INSTALL with the source. >> > I was wondering where that file was. I will download source and dig it > up. > > Thanks. > Hmm I'm looking at pre17 so this may have changed. (its just what I have on this machine) if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA" // for the IPAQs }; CandidatePortPrefixes=Temp; } So you may need to add "ttyUSB" to that list. RXTX used to enumerate _everything_ see if(osName.equals("Linux-all-ports") But it became less than practical. This is all in RXTXCommDriver.java hmm I just did a cvs update. if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have to get your fingers into the code. We aim for sane defaults. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 13:06:45 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 13:06:45 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139342805.8145.22.camel@zd7280> On Tue, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > Hmm I'm looking at pre17 so this may have changed. (its just what I have > on this machine) > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA" // for the IPAQs > }; > CandidatePortPrefixes=Temp; > } > > > So you may need to add "ttyUSB" to that list. RXTX used to enumerate > _everything_ see if(osName.equals("Linux-all-ports") But it became less > than practical. > > This is all in RXTXCommDriver.java > > hmm I just did a cvs update. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have > to get your fingers into the code. We aim for sane defaults. Excellent. Thanks for taking the time. -- Kim Lux, Diesel Research Inc. From ideiglenes1 at freemail.hu Tue Feb 7 13:53:39 2006 From: ideiglenes1 at freemail.hu (--) Date: Tue, 07 Feb 2006 21:53:39 +0100 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139345619.22534.2.camel@localhost> Hi! I use this code to get all the extra Linux devices. :) if ("Linux".equals(System.getProperty("os.name"))) { System.setProperty("os.name","Linux-all-ports"); } driver = new RXTXCommDriver(); On k, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > On Tue, 7 Feb 2006, Kim Lux wrote: > > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have > to get your fingers into the code. We aim for sane defaults. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From matt.higgins at gmail.com Tue Feb 7 13:45:54 2006 From: matt.higgins at gmail.com (Matt Higgins) Date: Tue, 7 Feb 2006 15:45:54 -0500 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> Message-ID: <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> Sweet this is exactly what I needed. I was searching the archives through marc.theamisgroup they only have archives back to 1/3/05. Should have hit the mailman archive! Thanks a lot! On 2/7/06, Brian Schlining wrote: > > Hi Matt > > The following code works fine on Linux but I never see any data when run > on Windows. This is a cut and paste from the SimpleRead example. > I am attempting to read data from a bar code scanner. I can fire up > HyperTermianl on windows and see that the device is working properly as I > see the barcodes are scanned and echoed back to the terminal. However when I > run the app I don't see any data. It is however associating with the com > port as the informational bits print fine? > > > You're not the only one whose had this problem, I don't know if Trent has > addressed this is the latest release of RXTX but there is a workaround. > Here's the recent thread from the RXTX mailing list regarding this issues: > > Thanasis Delenikas tdelenik at gmail.com > Wed Jan 18 13:56:23 MST 2006 > > * Previous message: [Rxtx] Re: More close() performance fixes > * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] > > Hi all. > (I've subscribed again from my other email account). > > Trent, > > You are right. Linux *always* works, no matter what flow control you set. > Windows *works only* with hardware flow control (I haven't tested what > happens with software XON/XOFF flow control). > > I assume (but I am not certain) that even with no flow control at all, all > platforms should work. Without flow control, you have the risk of bumping > into overflow or framing errors, but that's your (the end programmer, I > mean) problem. > > >From my side, I shouldn't be working without flow control. That was a bug > too... It was some code forgotten from the old times, when I used to work > with phone emulation drivers which didn't support flow control. The > correct > way is to have some flow control enabled and that's why I suppose this is > a > low-severity bug for RxTx. > > I have no idea which platform shows the correct behaviour, since > my knowledge about Linux and the inner workings of these low-level i/o > operations is limited. > > Regards, > Thanasis Delenikas. > > > > > Message: 2 > > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > > From: Trent Jarvi > > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > > To: RXTX Developers and Users > > Message-ID: > > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > > > Hi all, > > > > > > Trent, I have found something. > > > I read your comment about flow control, so I experimented a bit. > > > > > > If you remember, in my sample program I've used no flow control at all > ( > > i.e. > > > Java constant FLOWCONTROL_NONE). > > > > > > Now, during testing, I've switch to hardware inbound flow control (i.e > . > > Java > > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > > beautifully! > > > > > > I think I will switch to H/W flow control and test things for a while, > > but > > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > > > > > Hi Thanasis, > > > > I'm fairly sure you have identified a bug. I would not worry too much > > about what Sun CommAPI w32 defaults are. I think they did more or less > > whatever the port opened with. Just a guess. Linux tries to stomp on > > ports so they are all the same. > > > > So this started out with Linux worked, Windows XP/.. did not as I > recall. > > Something is wrong in rxtx. Do I understand this right? > > > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > > > Perhaps there is something Wayne or I did not understand when we wrote > > that code. I wasnt programming back in the BBS days so modems are not > my > > thing. I have a few questions. > > > > Is the above matrix confirmed by observation? > > Linux just always worked? > > Which one _should_ work? I'm guessing modems work with hardware flow > > control. I'll have to dig around. > > > > The windows flow control changes a couple things with hardware flow > > control. Following the w32 API documentation is confusing sometimes. > > But it looks like Linux could have a bug too. > > Cheers > > Brian Schlining > Software Engineer > http://www.mbari.org > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/9c989144/attachment-0018.html From tjarvi at qbang.org Tue Feb 7 14:06:14 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 14:06:14 -0700 (MST) Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> Message-ID: >> >> You're not the only one whose had this problem, I don't know if Trent has >> addressed this is the latest release of RXTX but there is a workaround. >> Here's the recent thread from the RXTX mailing list regarding this issues: >> I have not. I expect to have access to some test equipment next month and I'll go through all of this. I really don't know whats going on and I need a gold standard. I thought maybe linux was autodetecting the flow control. Your observations would certainly be welcome. I need to talk to Russell King and see what he is doing. Until then I'd just be toying around over a loopback as usual. This is very high on the list though. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 17:25:05 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 17:25:05 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139358305.17994.2.camel@zd7280> My application now works. I installed the libraries and jar from 2.1-7 (Final). portlist.hasMoreElements is no longer false. The application finds the port for /dev/ttyUSB0. Thanks for your help, Trent (et al) Sorry I bothered you with this. Next time I will look in the source first. I didn't think it was an rxtx issue, I thought it was a Linux setup issue . On Tue, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > Hmm I'm looking at pre17 so this may have changed. (its just what I > have > on this machine) > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux > Serial Ports > "ttySA" // for the > IPAQs > }; > > CandidatePortPrefixes=Temp; > } > > > So you may need to add "ttyUSB" to that list. RXTX used to enumerate > _everything_ see if(osName.equals("Linux-all-ports") But it became > less > than practical. > > This is all in RXTXCommDriver.java > > hmm I just did a cvs update. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux > Serial Ports > "ttySA", // for the > IPAQs > "ttyUSB" // for USB > frobs > }; > > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you > have > to get your fingers into the code. We aim for sane defaults. -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 19:21:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 19:21:54 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139358305.17994.2.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> <1139358305.17994.2.camel@zd7280> Message-ID: >Sorry I bothered you with this. Next time I will look in the source >first. I didn't think it was an rxtx issue, I thought it was a Linux >setup issue . Why would you be sorry? I would have done the same. I'm glad it's working :) -- Trent Jarvi tjarvi at qbang.org From tma at mail.island.net Wed Feb 8 13:39:35 2006 From: tma at mail.island.net (Tom Alldread) Date: Wed, 08 Feb 2006 12:39:35 -0800 Subject: [Rxtx] Win32/Linux Serial Port Data Dropouts In-Reply-To: <200602060702.k167255O007882@www.qbang.org> References: <200602060702.k167255O007882@www.qbang.org> Message-ID: <43EA5707.4020200@mail.island.net> Greetings Folks at RXTX: During the last couple of months I have been alternately testing with javax.comm 2 and RXTX 2.1 under Windows XP and CommApi 3 and RXTX 2.1 under Suse 10.0 Linux. In the process I have learned a little about java multi-threading under NetBeans 5 with Profiler. My java (jdk 1.5_06) application is used for data acquisition and provides a graphical display of A-D conversion data received from a 56KBaud serial port. The actual data throughput is about 10KBaud thus it is well below the speed of the port. I use hardware RTS/CTS flow control which can stall the data acquisition sample rate if necessary. This ensures the display computer has the ability to slow the data acquisition rate should it become too busy to accept the regular data flow. Both the serial port buffer and the java read buffer are set at 16KB. Usually the data transfers into the java read buffer are less than 100 bytes unless the data acquisition is recovering from a stall. The data flow normally hesitates after each 5 KB block as a continue command is needed from the display computer to start the drawing of a new graphics display line. Separate threads have been provided for the serial port event monitoring and data processing. The serial port event thread has been given the maximum priority and data processing thread the minimum priority provided by java. Thread yield statements have been placed within all data processing while/for loops as an effort to ensure quick access to CPU cycles for the serial port event thread. I have found that short data transmissions are essentially error free but occasional dropouts occur with continuous data flow especially under Windows XP. ....................................................................................................................................................................................... Linux results: I am happy to report that RXTX 2.1 appears to work very well under Linux although I did notice some errors when the screen savers were running with my dual monitors. I believe this is a local problem associated with my dual graphics which needs further attention. The recent CommApi 3 Linux release from Sun did not work at all with my program. It seemed to send commands out OK but did not receive any data. Although the serial port event triggered the ISR, the input stream appeared filled with nulls and thus did not contain any data. As my understanding is that CommApi 3 was tested with a Red Hat distribution of Linux I wonder if this problem is distro dependent? Although somewhat off topic here I wonder if anyone reading this has had similar experience? .................................................................................................................................................................................. Windows XP results: There are problems with occasional data dropouts which become more frequent as the sampling rate is increased or if the computer becomes busy with other duties. The dropouts typically consist of a half dozen byte block of lost data. It appears the lost bytes never get added to the java input stream. There has not been any indication of garbled data, overruns or framing errors which suggests the UART communications remains solid. Using javax.comm 2 I found that the setting of SerialPort 'enableReceiveThreshold' to 40 and 'enableReceiveTimeout' of 100mS reduced the dropouts error rate significantly. I found that I could not get RXTX 2.1 to function with the aforementioned threshold and timeout settings. The javax.comm 2 interface is consequently performing better for me under Windows than RXTX 2.1. I wonder if anyone here has any suggestions as to what I might try to improve RXTX 2.1? Although my settings are the same as under Suse 10.0, RXTX 2.1 performs much better for me under Linux than any of the alternatives that I have tried under Windows XP . ............................................................................................................................................................................... I would like to establish, based on the experience of others, if I have reached the normally expected performance limit of java serial port communications? Should I expect to achieve virtually error free serial port data input from a continuous stream under Windows XP java software? I am considering changing my protocol to packets with error checking if necessary but would like to know if the dropout problems I am experiencing are typical or not before I take this rather work intensive plunge. Many thanks in advance for any help! Best Regards, Tom Alldread -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.375 / Virus Database: 267.15.2/253 - Release Date: 2006-02-07 From jlaxson at mac.com Wed Feb 8 23:56:48 2006 From: jlaxson at mac.com (John Laxson) Date: Thu, 9 Feb 2006 00:56:48 -0600 Subject: [Rxtx] PortInUseException: Unknown Application on OSX Message-ID: Hi, I've been trying to get RXTX 2.1.7 going on Mac OS X for a while here, and am running up into a wall here. I've tried with pre- compiled and the source version and get the same problem, a gnu.io.PortInUseException: Unknown Application. I have run the fixperms script included with the source distribution, and id shows me as a member of the uucp group, and permissions on /var/spool/uucp are 775 root:uucp. Running a test program (included at the bottom for clarity) lets me enumerate all the serial ports correctly, but trying to open any of them gives the PortInUseException. If it helps, when I try to open a port that's set to make an outgoing bluetooth connection, there is no delay and no connection attempt at all. Thanks, John Laxson PS: The documentation wiki on qbang.org shows 404, and has for a few days now. My test code: public static void main(String[] args) { SerialPort serialPort; try { Enumeration e = CommPortIdentifier.getPortIdentifiers(); CommPortIdentifier ident; while (e.hasMoreElements()) { ident = (CommPortIdentifier)e.nextElement(); System.out.println(ident.getName()); } ident = CommPortIdentifier.getPortIdentifier("/dev/cu.modem"); serialPort = (SerialPort) ident.open("Me", 5000); } catch (Exception e) { e.printStackTrace(); } } From rajesh.invincible at gmail.com Thu Feb 9 03:39:38 2006 From: rajesh.invincible at gmail.com (Rajesh N) Date: Thu, 9 Feb 2006 16:09:38 +0530 Subject: [Rxtx] Re: Move .java Files in gnu.io filesystem hierarchy - Maven (2) In-Reply-To: <43DF21D2.7090200@ngi.it> References: <43DF21D2.7090200@ngi.it> Message-ID: <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Can anybody tell me how to overcome these EXCEPTIONS I AM WORKING ON SERIAL COMMN IN JAVA ON LINUX. 1. " NOT ALL PARAMETERS SUPPORTED BY THE KERNEL" This i came across the following statement inmy prog. SerialP is A SerialPort object SerialP.setSerialPortParams(9600(BAUDRATE),DATABITS_8,STOPBITS_1,PARITY_NONE) 2. NullPointer Exception at Event Dispatch Now i have checked all my object references for a null reference but i found none i have put up my entire code in try catch blocks but still I AM UNABLE TO CATCH THIS EXCEPTION AND HENCE MY APPLICATION CLOSES HOW DOES THESE GO? PLEASE HELP ME IT IS URGENTTTTTTTTTTTTTTTT yours sincerely RAJESH On 1/31/06, Fabio Frumento wrote: > Hi Xavier, > > I don't know maven at all but the directory hierarchy listed buy Trent > is fine for me... > > I'll take a look to maven, it seems an interesting project > > Regards > > Fabio Frumento > > Trent Jarvi wrote: > > On Tue, 31 Jan 2006, Xavier Frisaye wrote: > > > >> Hi all, > >> > >> If you are going to rearrange the src folder, i will propose to use > >> maven 2 and follow its directory structure > >> > (http://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html). > >> > >> Maven 2 simplify java project and give a standard way to make projects > >> (http://maven.apache.org/). > >> We are using it for internal projects and we are very satisfied. > >> > >> Is anybody interested? > >> > >> I'm not an expert in maven 2 (yet) but i'm agree to help using it if > >> you choose to make so. > >> > > > > so this would be: > > > > rxtx-devel/src/main/java/gnu.io > > rxtx-devel/src/test/java/ManIwish.java > > > > I don't use IDEs very much so I'll let others comment. But I don't see > > a problem with that. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Thu Feb 9 09:50:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 9 Feb 2006 09:50:31 -0700 (MST) Subject: [Rxtx] Re: Move .java Files in gnu.io filesystem hierarchy - Maven (2) In-Reply-To: <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Message-ID: On Thu, 9 Feb 2006, Rajesh N wrote: > Can anybody tell me how to overcome these EXCEPTIONS > I AM WORKING ON SERIAL COMMN IN JAVA ON LINUX. > > 1. " NOT ALL PARAMETERS SUPPORTED BY THE KERNEL" > > This i came across the following statement inmy prog. > SerialP is A SerialPort object > SerialP.setSerialPortParams(9600(BAUDRATE),DATABITS_8,STOPBITS_1,PARITY_NONE) > Strange. The parameters you use are the same the port should open with by default. Could you paste the actual exception you are getting? I don't see that in the rxtx source. Also it would help to know the rxtx version. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Fri Feb 10 15:29:05 2006 From: lux at diesel-research.com (Kim Lux) Date: Fri, 10 Feb 2006 15:29:05 -0700 Subject: [Rxtx] One serial port object for both sending and receiving ? Message-ID: <1139610545.18177.4.camel@zd7280> Is it OK to use one SerialPort ojbect (ex Serial Port serialPort;) and use it for both sending and receiving ? For example: ======================================================================== static SerialPort serialPort = null; static OutputStream serialOut = null; static InputStream serialIn = null; // assign it to an outputStream for use try{ serialOut = serialPort.getOutputStream(); System.out.println("Serial output stream has been assigned."); }//try catch(IOException e) { System.out.println("Error: Couldn't assign output stream to serial port."); }//catch //assign it to an inputStream for use try{ serialIn = serialPort.getInputStream(); System.out.println("Serial input stream has been assigned."); }//try catch(IOException e) { System.out.println("Error: Couldn't assign input stream to serial port."); }//catch ======================================================================== -- Kim Lux, Diesel Research Inc. From lux at diesel-research.com Fri Feb 10 21:23:00 2006 From: lux at diesel-research.com (Kim Lux) Date: Fri, 10 Feb 2006 21:23:00 -0700 Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Message-ID: <1139631780.23882.10.camel@zd7280> I've got a problem receiving chars with my version of serialRead, written in an SWT GUI. I had a Java pro have a good look at my code and he can't see anything wrong with it. I can send chars fine. When I receive a char the cpu usage for the app goes to 100% and the code in the serial event handler doesn't get executed. The instructions on the Java Comm Serial API How-To for Linux page state that I must install javacomm. Is that true ? Everything builds without it and I can send chars on rxtx just fine, but I can't receive them. Could this be the problem ? I downloaded and installed javacomm. I was not able to add "Driver=gnuio.RXTXCommDriver to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 installed in /usr/java/jre1.5.0_05. I added comm.jar to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext to the library paths. Is this OK ? Does it matter that I am receiving on /dev/ttyUSB0 ? Thanks. -- Kim Lux, Diesel Research Inc. From lunareclipse03 at web.de Sat Feb 11 09:44:46 2006 From: lunareclipse03 at web.de (lunareclipse03@web.de) Date: Sat, 11 Feb 2006 17:44:46 +0100 Subject: [Rxtx] Question about Serial I/O under Win32 Message-ID: <662084330@web.de> Hello everybody, I have a strange problem with a piece of code I made for myself. No, this is not really concerning rxtx, but nevertheless I post this to the list, hoping that some of you can help me. I've written two libraries, one for linux and one for win32. The linux port works quite well, I can send / receive faxes and / or replay voice messages over the telephone line using a voice modem. But the win32 port of the library causes some trouble. If, for example, I send out a fax with a certain modem under linux, it works well. The fax is complete when it comes out of the fax machine. If I then use the same modem to send out a fax under win32, the fax coming out of the fax machine gets "stuck" halfways, but the sending modem thinks that transmission was ok and drops the connection. The answering fax machine then gives me "error while receiving." The "upper layer" java code MUST be right, because if I do the same thing under linux (using the linux library), everything is alright. Now I have to ask: Can somebody please help me out with this??!? Could it be the case that some kind of flow control or COMMTIMEOUTS setting causes this behaviour? I set flow control to RTS/CTS before sending out a fax. How can I DISABLE flow control? Or what do you think? Can something else cause this problems? Thank you all for your time and PLEASE write back soon. Regards, --Sven Ahlemann Am Waldrand 31 45721 Haltern am See Germany ______________________________________________________________ Verschicken Sie romantische, coole und witzige Bilder per SMS! Jetzt bei WEB.DE FreeMail: http://f.web.de/?mc=021193 From lux at diesel-research.com Sat Feb 11 10:06:52 2006 From: lux at diesel-research.com (Kim Lux) Date: Sat, 11 Feb 2006 10:06:52 -0700 Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: <1139631780.23882.10.camel@zd7280> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> <1139631780.23882.10.camel@zd7280> Message-ID: <1139677612.3431.5.camel@zd7280> More on this problem. I copied and pasted simpleRead into a console based Eclipse project and I've got the same result, except that cpu usage doesn't go to 100%. I'm beginning to think there is an issue in rxtx. My imports for simpleRead are: ============================ import gnu.io.*; import java.util.*; //import javax.comm.*; import java.io.*; =========================== Any ideas ? I am trying to read from /dev/ttyUSB0 using a serial to USB adapter which has worked well with minicom and gtkterm. Thanks. On Fri, 2006-02-10 at 21:23 -0700, Kim Lux wrote: > I've got a problem receiving chars with my version of serialRead, > written in an SWT GUI. > > I had a Java pro have a good look at my code and he can't see anything > wrong with it. > > I can send chars fine. When I receive a char the cpu usage for the app > goes to 100% and the code in the serial event handler doesn't get > executed. > > The instructions on the Java Comm Serial API How-To for Linux page state > that I must install javacomm. Is that true ? Everything builds without > it and I can send chars on rxtx just fine, but I can't receive them. > Could this be the problem ? > > I downloaded and installed javacomm. I was not able to add > "Driver=gnuio.RXTXCommDriver > to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not > have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 > installed in /usr/java/jre1.5.0_05. I added comm.jar > to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext > to the library paths. Is this OK ? > > Does it matter that I am receiving on /dev/ttyUSB0 ? > > Thanks. > -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Sun Feb 12 21:01:33 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:01:33 -0700 (MST) Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: <1139677612.3431.5.camel@zd7280> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> <1139631780.23882.10.camel@zd7280> <1139677612.3431.5.camel@zd7280> Message-ID: I suspect what is happening is the select() is breaking out in the native code but the driver does not have support for notifying there are X bytes available. On some traditional Unix based systems, the only way you know data is available is the fd status changes and do an FIORDCHK ioctl. Or perhaps the only thing you can know is the fd status changed. It would take reading through the kernel driver code to know for sure. So on USB, depending upon the driver, the same may need to be done or the driver improved a bit if possible to support. Polling reads will also work but don't use the event driven model of CommAPI which isnt acceptable in the long run. The 100% cpu usage can then be explained because select no longer blocks until the data is read; the eventLoop spins loose. You can put a well placed sleep but rxtx only expects those are needed when it knows data is available. This may not be a super simple thing to understand and fix. I do have ideas to get you started. I'm going to be short on time the next couple weeks. I expect to put some good time in and answer some other questions I saw around the 25th. For now, I'd look at the following and go from there with the hints I've given. JNIEXPORT jint JNICALL RXTXPort(nativeavailable)( JNIEnv *env, jobject jobj ) { int fd = get_java_var( env, jobj,"fd","I" ); int result; /* char message[80]; ENTER( "RXTXPort:nativeavailable" ); On SCO OpenServer FIONREAD always fails for serial devices, so try ioctl FIORDCHK instead; will only tell us whether bytes are available, not how many, but better than nothing. This turns out to be true on Solaris also. taj. */ #ifdef FIORDCHK /* __unixware__ __sun__ probably others */ result = ioctl(fd, FIORDCHK, 0); #else if( ioctl( fd, FIONREAD, &result ) < 0 ) { goto fail; } #endif /* FIORDCHK */ On Sat, 11 Feb 2006, Kim Lux wrote: > > More on this problem. I copied and pasted simpleRead into a console > based Eclipse project and I've got the same result, except that cpu > usage doesn't go to 100%. I'm beginning to think there is an issue in > rxtx. > > My imports for simpleRead are: > > ============================ > import gnu.io.*; > import java.util.*; > //import javax.comm.*; > import java.io.*; > =========================== > > Any ideas ? I am trying to read from /dev/ttyUSB0 using a serial to > USB adapter which has worked well with minicom and gtkterm. > > Thanks. > > > > On Fri, 2006-02-10 at 21:23 -0700, Kim Lux wrote: >> I've got a problem receiving chars with my version of serialRead, >> written in an SWT GUI. >> >> I had a Java pro have a good look at my code and he can't see anything >> wrong with it. >> >> I can send chars fine. When I receive a char the cpu usage for the app >> goes to 100% and the code in the serial event handler doesn't get >> executed. >> >> The instructions on the Java Comm Serial API How-To for Linux page state >> that I must install javacomm. Is that true ? Everything builds without >> it and I can send chars on rxtx just fine, but I can't receive them. >> Could this be the problem ? >> >> I downloaded and installed javacomm. I was not able to add >> "Driver=gnuio.RXTXCommDriver >> to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not >> have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 >> installed in /usr/java/jre1.5.0_05. I added comm.jar >> to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext >> to the library paths. Is this OK ? >> >> Does it matter that I am receiving on /dev/ttyUSB0 ? >> >> Thanks. >> > From tjarvi at qbang.org Sun Feb 12 21:03:30 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:03:30 -0700 (MST) Subject: [Rxtx] One serial port object for both sending and receiving ? In-Reply-To: <1139610545.18177.4.camel@zd7280> References: <1139610545.18177.4.camel@zd7280> Message-ID: On Fri, 10 Feb 2006, Kim Lux wrote: > > Is it OK to use one SerialPort ojbect (ex Serial Port serialPort;) and > use it for both sending and receiving ? > > For example: > > ======================================================================== > static SerialPort serialPort = null; > static OutputStream serialOut = null; > static InputStream serialIn = null; > > > > > // assign it to an outputStream for use > try{ > serialOut = serialPort.getOutputStream(); > System.out.println("Serial output stream has been assigned."); > }//try > catch(IOException e) > { > System.out.println("Error: Couldn't assign output stream to serial > port."); > }//catch > > > //assign it to an inputStream for use > try{ > serialIn = serialPort.getInputStream(); > System.out.println("Serial input stream has been assigned."); > }//try > catch(IOException e) > { > System.out.println("Error: Couldn't assign input stream to serial > port."); > }//catch This should be fine. In fact trying to do it another way will probably not work as you will run into lockfile issues. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun Feb 12 21:13:13 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:13:13 -0700 (MST) Subject: [Rxtx] Question about Serial I/O under Win32 In-Reply-To: <662084330@web.de> References: <662084330@web.de> Message-ID: On Sat, 11 Feb 2006 lunareclipse03 at web.de wrote: > Hello everybody, > > I have a strange problem with a piece of code I made for myself. No, > this is not really concerning rxtx, but nevertheless I post this to the > list, hoping that some of you can help me. I've written two libraries, > one for linux and one for win32. The linux port works quite well, I can > send / receive faxes and / or replay voice messages over the telephone > line using a voice modem. But the win32 port of the library causes some > trouble. If, for example, I send out a fax with a certain modem under > linux, it works well. The fax is complete when it comes out of the fax > machine. If I then use the same modem to send out a fax under win32, the > fax coming out of the fax machine gets "stuck" halfways, but the sending > modem thinks that transmission was ok and drops the connection. The > answering fax machine then gives me "error while receiving." The "upper > layer" java code MUST be right, because if I do the same thing under > linux (using the linux library), everything is alright. Now I have to > ask: Can somebody please help me out with this??!? Could it be the case > that some kind of flow control or COMMTIMEOUTS setting causes this > behaviour? I set flow control to RTS/CTS before sending out a fax. How > can I DISABLE flow control? Or what do you think? Can something else > cause this problems? Thank you all for your time and PLEASE write back > soon. > Hi Sven I'm not too willing to talk about flow control at the low level until I confirm some things with test equipment later. It is not clear if you are using rxtx or writing your own native code. So I'm not sure how to answer much of this :) If you are wondering how to change the flow control using rxtx from java, The BlackBox example from Sun flips this back and forth. SerialPort.java in rxtx 2.1 uses the following: SerialPort.java: public static final int FLOWCONTROL_NONE =0; SerialPort.java: public static final int FLOWCONTROL_RTSCTS_IN =1; SerialPort.java: public static final int FLOWCONTROL_RTSCTS_OUT =2; SerialPort.java: public static final int FLOWCONTROL_XONXOFF_IN =4; SerialPort.java: public static final int FLOWCONTROL_XONXOFF_OUT=8; So if you set flowcontrol to RTSCTS, you can set it to NONE to turn it off. If you are looking for how to do it in native code, the rxtx Source is SerialImp.c (unix/linux/mac os x/w32) and termios.c (w32 only with SerialImp.c) You can track the code: SerialImp.c:JNIEXPORT void JNICALL RXTXPort(setflowcontrol)( JNIEnv *env, jobject jobj, jint flowmode ) termios.c:int tcgetattr( int fd, struct termios *s_termios ) termios.c:int tcsetattr( int fd, int when, struct termios *s_termios ) There may be a problem in the rxtx flow control code though. Rather than guess, I want to test this with a gold standard. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Feb 6 00:00:16 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 00:00:16 -0700 (MST) Subject: [Rxtx] wiki delay until tomorrow night. In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: On Sun, 5 Feb 2006, Trent Jarvi wrote: > On Sun, 5 Feb 2006, Kim Lux wrote: > >> usb ? Tell me more... I need that too. > > usb is a very proper design. Thats all it is. > Maybe rxtx could help usb. But it would start with helping bring back the community that was already there. It's not something I'd love to do but maybe its the right thing to do. It would probably take 2 years to do right. But maybe thats better than what we have now. I honestly don't know what IBM is doing which could just run over everything. Just some thoughts after some fine german wine. -- Trent Jarvi tjarvi at qbang.org From gadelavega at yahoo.com.ar Mon Feb 6 02:17:05 2006 From: gadelavega at yahoo.com.ar (Gonzalo A. de la Vega) Date: Mon, 06 Feb 2006 10:17:05 +0100 Subject: [Rxtx] Serial port ownership question In-Reply-To: References: <20060205113618.30274.qmail@web53501.mail.yahoo.com> <1139157422.4553.9.camel@zd7280> <1139158698.4936.9.camel@zd7280> Message-ID: <43E71411.4050402@yahoo.com.ar> On my Fedora Core 4: ls -l /dev/ttyS* crw-rw---- 1 root uucp 4, 64 Feb 6 2006 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Feb 6 2006 /dev/ttyS1 ... and: grep "ttyUSB" /etc/udev/rules.d/50-udev.rules KERNEL=="ttyUSB*", GROUP="uucp", MODE="0660" So anyone in the "uucp" group can use serial ports. On Gentoo the group is "tty". Trent Jarvi escribi?: > > > On Sun, 5 Feb 2006, Dr. Douglas Lyon wrote: > >> I can confirm that this is the case (only root ownership of >> serial ports, under fedora 4). >> Wow, what were they thinking?! >> - DL >> >>> I've found that the newer kernels have the serial ports owned by root. >>> For example, >>> >>> $ls -al /dev/tty* >>> crw-rw-rw- 1 root root 5, 0 Feb 5 02:06 /dev/tty >>> crw-rw---- 1 root root 4, 0 Feb 5 02:06 /dev/tty0 >>> crw------- 1 root root 4, 1 Feb 5 09:07 /dev/tty1 >>> crw-rw---- 1 root tty 4, 10 Feb 5 02:06 /dev/tty10 >>> crw-rw---- 1 root tty 4, 11 Feb 5 02:06 /dev/tty11 >>> ... > > > This is just not a problem jcp or such are going to solve. Its a > platform spitwad fight. But do look at pam. In fact thats what Sun > is doing too. Maybe Linux followed their lead.. I'm not a pam guy. > I've spent 16 hours trying to understand it but your users wont :) > > Solution? I have no clue. Its two tangent mentalities from my > perspective. > > -- > Trent Jarvi > tjarvi at qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mtnvega at yahoo.com.br Mon Feb 6 05:35:43 2006 From: mtnvega at yahoo.com.br (Luiz Jr) Date: Mon, 6 Feb 2006 12:35:43 +0000 (GMT) Subject: [Rxtx] Documentation Wiki In-Reply-To: <1139157422.4553.9.camel@zd7280> Message-ID: <20060206123543.57256.qmail@web53515.mail.yahoo.com> Hello, Thank you for you answer, but so the usage of the API is pretty much like the Java Communications Api? If yes, what version of the Java Comm Api? Thank you, Luiz A. Brandao Jr Kim Lux escreveu: On Sun, 2006-02-05 at 08:36 -0300, Luiz Jr wrote: > Hello, > > I want to start using the RXTX libraries, but I would to know how, > since I can not access the documentation wiki page I just started using them yesterday. Below is how I installed the libraries, if that helps. I used snippets of code from the SimpleWrite application here to get me going. http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html Instead of "import javax.comm.*;", use "import gnu.io.*;" which is gotten from RXTXcomm.jar, which you will need to include in your project references. I am working in Eclipse. BTW: there is no way to open a port without going through the port list and finding it. Maybe sometime in the future someone (me ?) will write a method called openSerialPort that allows the user to give a port identifier, such as "/dev/tty1" and return a port ready to use. It wouldn't take much to write that and it would save users a lot of code. Hope this helps. ======================================================================= 1) Figure out which java you are running, incase there is more than one installed. $ java -version java version "1.5.0_05" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_05-b05) Java HotSpot(TM) Client VM (build 1.5.0_05-b05, mixed mode, sharing) 2) Find all the jre directories and the one from which you are currently running. kfind (jre) 3) cd to that directory plus /lib/i386 cd /usr/java/jre1.5.0_05/lib/i386 4) Copy the library files (*.so) to that directory. cp /home/krlux/Desktop/'Java Controls'/rxtx-linux/bin/* . 5) Check that the copy was successful ls librxtx* librxtxI2C.so librxtxRaw.so librxtxSerial.so librxtxParallel.so librxtxRS485.so 6) cd to the /lib/ext directory for your java. cd /usr/java/jre1.5.0_05/lib/ext 7) Copy the Jar files there cp /home/krlux/Desktop/'Java Controls'/rxtx-linux/lib/ext/* . 8) Check that it was successful ls RXTX* RXTXcomm.jar Rxtx is now installed on your machine ready to use. =================================================================== -- Kim Lux, Diesel Research Inc. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx --------------------------------- Yahoo! Acesso Gr?tis - Internet r?pida e gr?tis. Instale o discador agora! -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/544aa403/attachment-0019.html From lyon at docjava.com Mon Feb 6 05:49:34 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 06 Feb 2006 07:49:34 -0500 Subject: [Rxtx] wiki delay until tomorrow night. In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: Hi All, I have often thought about USB drivers being needed. For example, the ironman watch will not interface to a mac (windows only). It is USB. My dymo label writer has no Java driver (native only). Etc. Most cheap web cameras are USB (and Java drivers go through JAI, if it supports the camera at all). The JAI code shows how sun did the USB drivers. You have to be a member of the jai project to download the source code. https://jai.dev.java.net has the jai distro. And then you are not allowed to redistribute it. However, we can all learn from it (if so inclined). Basically: cvs -d :pserver:lyon at cvs.dev.java.net:/cvs login cvs -d :pserver:lyon at cvs.dev.java.net:/cvs checkout jai-core You will need to user your own uid and pw to get in. The ant build has over 100 warnings from sun deprecations of its own code. You might say that they were hoisted on their own Picard ;) One interesting thing is that they support several platforms: linux-amd64 64-bit Linux-AMD64 linux-i586 32-bit Linux-x86 solaris-amd64 64-bit Solaris-AMD64 solaris-i586 32-bit Solaris-x86 solaris-sparc 32-bit Solaris-SPARC solaris-sparcv9 64-bit Solaris-SPARC windows-i586 32-bit Windows-x86 Thus, ant is used to provide a multi-platform native method distro. Neat. How do they do it? check this out: And: The core download does not contain any C source code (it was all pre-built). Basically, they are just copying .so and .dll files into build directories. I would love to see the C code for this...but Sun does not post it on the https://jai.dev.java.net site. I don't know why...Perhaps I missed it. - Doug >On Sun, 5 Feb 2006, Trent Jarvi wrote: > >>On Sun, 5 Feb 2006, Kim Lux wrote: >> >>>usb ? Tell me more... I need that too. >> >>usb is a very proper design. Thats all it is. >> > >Maybe rxtx could help usb. But it would start with helping bring >back the community that was already there. > >It's not something I'd love to do but maybe its the right thing to do. > >It would probably take 2 years to do right. But maybe thats better >than what we have now. > >I honestly don't know what IBM is doing which could just run over everything. > >Just some thoughts after some fine german wine. > >-- >Trent Jarvi >tjarvi at qbang.org > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tdelenik at gmail.com Mon Feb 6 05:56:32 2006 From: tdelenik at gmail.com (Thanasis Delenikas) Date: Mon, 6 Feb 2006 14:56:32 +0200 Subject: Fwd: [Rxtx] Documentation Wiki In-Reply-To: <1139157422.4553.9.camel@zd7280> References: <20060205113618.30274.qmail@web53501.mail.yahoo.com> <1139157422.4553.9.camel@zd7280> Message-ID: <310a1a930602060456t129f1dc6p5f2b908f13ab5a0b@mail.gmail.com> Hello all, Kim, this is a snippet from the code I use. The closest to directly opening a specific port without enumeration. << ... portId = CommPortIdentifier.getPortIdentifier(getPort()); serialPort = (SerialPort) portId.open("jSMSEngine", 1971); ... >> where getPort() return the string identifier of the port, i.e. "/dev/ttyS0" or "COM1" or whatever. Thanasis. ---------- Forwarded message ---------- From: Kim Lux Date: Feb 5, 2006 6:37 PM Subject: Re: [Rxtx] Documentation Wiki To: RXTX Developers and Users BTW: there is no way to open a port without going through the port list and finding it. Maybe sometime in the future someone (me ?) will write a method called openSerialPort that allows the user to give a port identifier, such as "/dev/tty1" and return a port ready to use. It wouldn't take much to write that and it would save users a lot of code. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/182ab5b8/attachment-0019.html From tjarvi at qbang.org Mon Feb 6 11:53:57 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 11:53:57 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: On Mon, 6 Feb 2006, Dr. Douglas Lyon wrote: > Hi All, > I have often thought about USB drivers being needed. > For example, the ironman watch will not interface > to a mac (windows only). It is USB. > My dymo label writer has no Java driver (native only). > Etc. > Most cheap web cameras are USB (and Java drivers go > through JAI, if it supports the camera at all). > The JAI code shows how sun did the USB drivers. > You have to be a member of the jai project to download > the source code. > https://jai.dev.java.net has the jai distro. > And then you are not allowed to redistribute it. However, > we can all learn from it (if so inclined). Basically: > cvs -d :pserver:lyon at cvs.dev.java.net:/cvs login > cvs -d :pserver:lyon at cvs.dev.java.net:/cvs checkout jai-core > You will need to user your own uid and pw to get in. > The ant build has over 100 warnings from sun deprecations > of its own code. > > You might say that they were hoisted on their own Picard ;) > > One interesting thing is that they support several platforms: > linux-amd64 64-bit Linux-AMD64 > linux-i586 32-bit Linux-x86 > solaris-amd64 64-bit Solaris-AMD64 > solaris-i586 32-bit Solaris-x86 > solaris-sparc 32-bit Solaris-SPARC > solaris-sparcv9 64-bit Solaris-SPARC > windows-i586 32-bit Windows-x86 > Thus, ant is used to provide a multi-platform native method distro. > Neat. > How do they do it? > check this out: > > > > > > > > > > > > > And: > > > > > > > > > > The core download does not contain any C source code (it was all pre-built). > Basically, they are just copying .so and .dll files into build directories. > > I would love to see the C code for this...but Sun does not post it on the > https://jai.dev.java.net site. > > I don't know why...Perhaps I missed it. > > - Doug > > I've looked at moving rxtx to Ant builds. I think that would help IDEs a great deal. I requested a evalutation desk copy the O'Reilly Ant book for some j2ee material I was teaching. http://www.oreilly.com/catalog/anttdg/ It has a one sentence mention of JNI. So there was not luck there. I saw that there is another Ant book that does mention JNI more. I can't find it now. Ant must be able to support it with extensions. http://ant.apache.org/manual/OptionalTasks/javah.html What the auto(break :) tools do in the rxtx build is 4 things really. 1) gcc compile flags 2) ld compile flags 3) config.h 4) compile flags for customizing rxtx (lockfiles, ...) See 1 All of this information except 4 can be static once obtained. So I'm not attached to the auto tools. If I could find an example of Ant being used for JNI code, I'd be one of the first to start moving that direction. Maybe someone saw an example someplace. The other thing we have not completed discussing is the directory structure. There is interest in making rxtx more IDE friendly. I get more mail about that off the list than how to install rxtx. And I see we have Ken Thompson in da house :) He is our trusted CVS maintainer and the guy that purchased the rxtx.org domain. Old community. We will need Ken for changing the directory structure of source. I would like to open up discussion about both of these as it is more than time. The problem is I have little experience with Ant and even less with IDEs. It would be nice if we could work with Eclipse and NetBeans. http://www.netbeans.org/ (sun and some community) http://www.eclipes.org (ibm,rhat,... perhaps more community) http://maven.apache.org/what-is-maven.html (apache. It is community) borland should sortof be here too but I think thats covered in eclipse. >From what I understand so far, we should morph rxtx to support those three maybe trusting apaches lead with maven. But I use vi. I have little to no clues beyond what people have fed me. Can we agree that thats the right direction to go? -- Trent Jarvi tjarvi at qbang.org From brian at mbari.org Mon Feb 6 14:57:50 2006 From: brian at mbari.org (Brian Schlining) Date: Mon, 6 Feb 2006 13:57:50 -0800 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> > The other thing we have not completed discussing is the directory > structure. There is interest in making rxtx more IDE friendly. I > get more mail about that off the list than how to install rxtx. > > And I see we have Ken Thompson in da house :) He is our trusted > CVS maintainer and the guy that purchased the rxtx.org domain. Old > community. We will need Ken for changing the directory structure of > source. > > I would like to open up discussion about both of these as it is > more than time. The problem is I have little experience with Ant > and even less with IDEs. It would be nice if we could work with > Eclipse and NetBeans. > > http://www.netbeans.org/ (sun and some community) > http://www.eclipes.org (ibm,rhat,... perhaps more community) > http://maven.apache.org/what-is-maven.html (apache. It is community) > borland should sortof be here too but I think thats covered in > eclipse. > >> From what I understand so far, we should morph rxtx to support >> those three > maybe trusting apaches lead with maven. But I use vi. I have > little to no clues beyond what people have fed me. > Maven likes the directory structure below for Java code. (From http:// maven.apache.org/guides/getting-started/index.html) This structure works fine with ant, netbeans, and eclipse. rxtx_root_directory `-- src |-- main | `-- java | `-- gnu | `-- io `-- test `-- java `-- gnu `-- io Brian Schlining Software Engineer http://www.mbari.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/d9451eba/attachment-0019.html From tjarvi at qbang.org Mon Feb 6 15:11:45 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 15:11:45 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: > rxtx_root_directory > `-- src > |-- main > | `-- java > | `-- gnu > | `-- io > `-- test > `-- java > `-- gnu > `-- io > >From what I understand this will just be good. For me it makes no difference. So lets do the rxtx thing. Let if fester for two weeks and if nobody objects, we will do it. I'm not doing this because I care. I'm doing this to eliminate much of my inbox. But test... man is rxtx lacking there in the community aspect. It is covered but not right. _maybe_ I can change that this year. -- Trent Jarvi tjarvi at qbang.org (cat hurding since 1997) From lux at diesel-research.com Mon Feb 6 21:38:49 2006 From: lux at diesel-research.com (Kim Lux) Date: Mon, 06 Feb 2006 21:38:49 -0700 Subject: [Rxtx] How can I use Lock Files with rxtx (in FC4) ? Message-ID: <1139287129.17031.3.camel@zd7280> I am now running an rxtx application on FC4. I am getting: ========================================================= check_group_uucp(): error testing lock file creation Error details: Permission denied check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL ========================================================= $ ls -al /var/lock total 32 drwxrwxr-x 4 root lock 4096 Feb 6 16:04 . drwxr-xr-x 24 root root 4096 Nov 14 01:19 .. drwx------ 2 root root 4096 Apr 27 2005 lvm drwxr-xr-x 2 root root 4096 Feb 6 16:04 subsys How do I fix this for regulator users ? -- Kim Lux, Diesel Research Inc. From dmarkman at mac.com Mon Feb 6 22:24:44 2006 From: dmarkman at mac.com (Dmitry Markman) Date: Tue, 7 Feb 2006 00:24:44 -0500 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: if I understands the issue right in order to be able to use ant for c/c++ compilation you have to install ant's cc task http://ant-contrib.sourceforge.net/cc.html it looks like it should work on mac os x (authors claim, that it's platform independent) but I never tested so all you have to do it's providing right command line for the gcc compiler On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: >> rxtx_root_directory >> `-- src >> |-- main >> | `-- java >> | `-- gnu >> | `-- io >> `-- test >> `-- java >> `-- gnu >> `-- io >> > > >> From what I understand this will just be good. > > For me it makes no difference. So lets do the rxtx thing. Let if > fester for two weeks and if nobody objects, we will do it. > > I'm not doing this because I care. I'm doing this to eliminate > much of my inbox. > > But test... man is rxtx lacking there in the community aspect. It > is covered but not right. _maybe_ I can change that this year. > > -- > Trent Jarvi > tjarvi at qbang.org > (cat hurding since 1997) > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx Dmitry Markman From lux at diesel-research.com Mon Feb 6 23:20:15 2006 From: lux at diesel-research.com (Kim Lux) Date: Mon, 06 Feb 2006 23:20:15 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? Message-ID: <1139293215.3689.4.camel@zd7280> I'm running the code below. portlist.hasMoreElements() is false. /dev has ports in it as listed below. What am I doing wrong ? ========================================================== // Step through the list of ports until we find one that matches // the one we are looking for. portList = CommPortIdentifier.getPortIdentifiers(); while(portList.hasMoreElements()) { portID = (CommPortIdentifier) portList.nextElement(); // if (portID.getName().equals("/dev/ttyUSB0")) { myTA.append("Serial port ttyUSB0 has been found\n"); break; }// if portID equals... }// End of while... ========================================================== ls -al /dev/tty* crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 ... crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 -- Kim Lux, Diesel Research Inc. From david.garnier at trusted-logic.com Tue Feb 7 00:46:30 2006 From: david.garnier at trusted-logic.com (David Garnier) Date: Tue, 07 Feb 2006 08:46:30 +0100 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: <43E85056.2090608@trusted-logic.com> Hello, I think that the make-based build process is fine as it is, apart from the location of the Java source files. It is true that putting the Java source in a directory structure that map 1-to-1 to the Java package structure is the norm and should make it easier for everyone to modify the Java source, with or without an IDE. Ant is a good tool, but in the RXTX case I fail to see the advantage of using it compared to the current make-based process. As Trent said, they are more pressing issues, like testing. Regards, David Dmitry Markman wrote: > if I understands the issue right > in order to be able to use ant for c/c++ compilation > you have to install ant's cc task > http://ant-contrib.sourceforge.net/cc.html > > it looks like it should work on mac os x > (authors claim, that it's platform independent) > but I never tested > > so all you have to do it's providing right command line > for the gcc compiler > > > > > On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: > >>> rxtx_root_directory >>> `-- src >>> |-- main >>> | `-- java >>> | `-- gnu >>> | `-- io >>> `-- test >>> `-- java >>> `-- gnu >>> `-- io >>> >> >> >>> From what I understand this will just be good. >> >> For me it makes no difference. So lets do the rxtx thing. Let if >> fester for two weeks and if nobody objects, we will do it. >> >> I'm not doing this because I care. I'm doing this to eliminate much >> of my inbox. >> >> But test... man is rxtx lacking there in the community aspect. It is >> covered but not right. _maybe_ I can change that this year. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> (cat hurding since 1997) From tjarvi at qbang.org Tue Feb 7 01:11:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 01:11:31 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <43E85056.2090608@trusted-logic.com> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: On Tue, 7 Feb 2006, David Garnier wrote: > Hello, > > I think that the make-based build process is fine as it is, apart from the location of the Java > source files. It is true that putting the Java source in a directory structure that map 1-to-1 to > the Java package structure is the norm and should make it easier for everyone to modify the Java > source, with or without an IDE. > > Ant is a good tool, but in the RXTX case I fail to see the advantage of using it compared to the > current make-based process. As Trent said, they are more pressing issues, like testing. > Hi David I have more experience with testing rxtx than I can talk about. But let it be known, rxtx has gone trough 100's of hours of testing. We are hobby folks interested in toys but there is more. rxtx has had some of the best guidance in the industry there. This is not an easy thing. I may be able to come back in a month from the other side of the corperate fence and help. I suspect the tests could just be made public but they are in a very unusual environment that just wont work in a wider sense. This is something I'll be trying to change. At one point it was agreed we could just make the results public so this isnt just noise.. There is interest and I think its safe to mention that much. The big problem with testing in the past is most of it is done with a loopback connection. So we *still* have major questions regarding things like flow control. rxtx talks to itself over a loopback and it works. regardless of right or wrong. This requires more thought to be done right. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Feb 7 02:46:34 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 02:46:34 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: > The big problem with testing in the past is most of it is done with a > loopback connection. So we *still* have major questions regarding things > like flow control. rxtx talks to itself over a loopback and it works. > regardless of right or wrong. With serial communication there are gold standards. ckermit is probably a definitive 'standard.' Maybe its possible to do ping/pong tests with ckermit? Is it scriptable? There are known issues in rxtx. Probably the worst is some threading issues regarding some JREs with multiple JNI threads setting java variables. Man did I get schooled there. Just switch the c functions to returning variables and things go away. Sometimes they work fine, sometimes they blow up. Without understanding everything, somehow rhat got it right and debian (and especially gentoo) grabbed kernel patches causing all sort of harm. Its not hard to fix once you understand whats going on but nearly impossible to track with a debugger. So I have a good idea what 2.1-8 will have outside of the IDE modifications. rxtx 2.1-7 is a release for everyone to sync with. Its not even as stable as -pre17 as far as I know - I ran no test suites. I'll be chasing it too. We just had so many contributions that it was time. It seriously broke internal scheduals but thats a great thing :) The other thing I want to do in 2.1-8 is automagic baud rates. It turns out lots of shops are doing really funky baud rates for things like automobile test equipment. It is possible but it requires a fair amount of change in the native code. Is anyone looking at this? -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Feb 7 02:57:21 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 07 Feb 2006 04:57:21 -0500 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <43E85056.2090608@trusted-logic.com> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: Hi All, I agree, testing is very important. The problem I have been trying to address is related to cross-platform testing and the robust nature of the installs. Typically, I visit 3 platforms to deploy my product, windows, linux and mac. A build is performed on each platform. The idea that you can build for many platforms from one copy the source code seems attractive. This should enable synchronized deployments of identical code. The question of how to achieve this goal remains open. As Trent mentioned, this is hard. Perhaps Ant will help here (but perhaps not). Ant does seem to help with running unit tests. However, it does not help with multi-platform tests. For that you need many machines and different operating environments. Toward that end, I have created a multi-platform test that can be run from web start, located at: http://show.docjava.com:8086/book/cgij/code/jnlp/serialPort.PortTest.jnlp This is interesting because many people in the community can run the test and we can improve the test, as time permits. No, it is not a perfect solution, however, the idea does help with multi-platform tests using many machines and different operating environments. If the group has a good test for a general serial port set-ups, i would be happy to deploy it, for general evaluation using web start. And as for ANT, it is just an idea. Not all my ideas are good ones! - Doug >Hello, > >I think that the make-based build process is fine as it is, apart >from the location of the Java >source files. It is true that putting the Java source in a directory >structure that map 1-to-1 to >the Java package structure is the norm and should make it easier for >everyone to modify the Java >source, with or without an IDE. > >Ant is a good tool, but in the RXTX case I fail to see the advantage >of using it compared to the >current make-based process. As Trent said, they are more pressing >issues, like testing. > >Regards, >David > >Dmitry Markman wrote: >> if I understands the issue right >> in order to be able to use ant for c/c++ compilation >> you have to install ant's cc task >> http://ant-contrib.sourceforge.net/cc.html >> >> it looks like it should work on mac os x >> (authors claim, that it's platform independent) >> but I never tested >> >> so all you have to do it's providing right command line >> for the gcc compiler >> >> >> >> >> On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: >> >>>> rxtx_root_directory >>>> `-- src >>>> |-- main >>>> | `-- java >>>> | `-- gnu >>>> | `-- io >>>> `-- test >>>> `-- java >>>> `-- gnu >>>> `-- io >>>> >>> >>> >>>> From what I understand this will just be good. >>> >>> For me it makes no difference. So lets do the rxtx thing. Let if >>> fester for two weeks and if nobody objects, we will do it. >>> >>> I'm not doing this because I care. I'm doing this to eliminate much >>> of my inbox. >>> >>> But test... man is rxtx lacking there in the community aspect. It is >>> covered but not right. _maybe_ I can change that this year. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> (cat hurding since 1997) > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From matt.higgins at gmail.com Tue Feb 7 08:28:34 2006 From: matt.higgins at gmail.com (Matt Higgins) Date: Tue, 7 Feb 2006 10:28:34 -0500 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final Message-ID: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? import java.io.*; import java.util.*; import gnu.io.*; public class MySimpleRead implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; public static void main(String[] args) { boolean portFound = false; String defaultPort = "COM1"; if (args.length > 0) { defaultPort = args[0]; } portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; MySimpleRead reader = new MySimpleRead(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } } public MySimpleRead() { try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) { e.printStackTrace(); } try { inputStream = serialPort.getInputStream(); } catch (IOException e) { e.printStackTrace(); } try { serialPort.addEventListener(this); } catch (TooManyListenersException e) { e.printStackTrace(); } try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { e.printStackTrace(); } System.out.println("Baud is " + serialPort.getBaudRate()); System.out.println("Bits is " + serialPort.getDataBits()); System.out.println("Stop is " + serialPort.getStopBits()); System.out.println("Par is " + serialPort.getParity()); serialPort.notifyOnDataAvailable(true); readThread = new Thread(this); readThread.start(); } public void run() { // Thread.sleep(20000); //} catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { System.out.println("An event occurred " + event.getEventType()); switch (event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: byte[] readBuffer = new byte[20]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } System.out.print(new String(readBuffer)); } catch (IOException e) {} break; } } } --------------- Result on windows ------------------------------ Stable Library ============================================================== Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port:: COM1 Baud is 9600 Bits is 8 Stop is 1 Par is 0 ----------------- End Results ----------------------------------------- ------------------ Result on Linux ----------------------------------- Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 Found port: /dev/ttyS0 Baud is 9600 Bits is 8 Stop is 1 Par is 0 An event occurred 1 043100066224 ------------------ End Results --------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/a1431630/attachment-0019.html From brian at mbari.org Tue Feb 7 09:48:37 2006 From: brian at mbari.org (Brian Schlining) Date: Tue, 7 Feb 2006 08:48:37 -0800 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> Message-ID: <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> Hi Matt > The following code works fine on Linux but I never see any data > when run on Windows. This is a cut and paste from the SimpleRead > example. > I am attempting to read data from a bar code scanner. I can fire > up HyperTermianl on windows and see that the device is working > properly as I see the barcodes are scanned and echoed back to the > terminal. However when I run the app I don't see any data. It is > however associating with the com port as the informational bits > print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. Cheers Brian Schlining Software Engineer http://www.mbari.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/16d07f37/attachment-0019.html From lux at diesel-research.com Tue Feb 7 11:59:58 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 11:59:58 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139293215.3689.4.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> Message-ID: <1139338798.8145.4.camel@zd7280> Any ideas on this ? Any reason why portList.hasMoreElements() should be false even though there are devices in /dev ? On Mon, 2006-02-06 at 23:20 -0700, Kim Lux wrote: > I'm running the code below. > > portlist.hasMoreElements() is false. > > /dev has ports in it as listed below. > > What am I doing wrong ? > > > ========================================================== > // Step through the list of ports until we find one that matches > // the one we are looking for. > > portList = CommPortIdentifier.getPortIdentifiers(); > > while(portList.hasMoreElements()) > { > portID = (CommPortIdentifier) portList.nextElement(); // > if (portID.getName().equals("/dev/ttyUSB0")) > { > myTA.append("Serial port ttyUSB0 has been found\n"); > break; > }// if portID equals... > }// End of while... > ========================================================== > > ls -al /dev/tty* > crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty > crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 > crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 > crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 > crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 > ... > crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 > crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 > crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 > > > -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 12:20:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 12:20:25 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139338798.8145.4.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> Message-ID: On Tue, 7 Feb 2006, Kim Lux wrote: > > Any ideas on this ? Any reason why portList.hasMoreElements() should be > false even though there are devices in /dev ? > > > On Mon, 2006-02-06 at 23:20 -0700, Kim Lux wrote: >> I'm running the code below. >> >> portlist.hasMoreElements() is false. >> >> /dev has ports in it as listed below. >> >> What am I doing wrong ? >> >> >> ========================================================== >> // Step through the list of ports until we find one that matches >> // the one we are looking for. >> >> portList = CommPortIdentifier.getPortIdentifiers(); >> >> while(portList.hasMoreElements()) >> { >> portID = (CommPortIdentifier) portList.nextElement(); // >> if (portID.getName().equals("/dev/ttyUSB0")) >> { >> myTA.append("Serial port ttyUSB0 has been found\n"); >> break; >> }// if portID equals... >> }// End of while... >> ========================================================== >> >> ls -al /dev/tty* >> crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty >> crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 >> crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 >> crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 >> crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 >> ... >> crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 >> crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 >> crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 >> >> >> > Hi Kim What rxtx does is try to open the port and do a timed out read. If the kernel/... do not complain it's enumarted. I suspect you could do a crude test by doing something like cat /dev/ttyS0 > /dev/null If that barfs then rxtx wont enumerate the port. hmm looking at your question again, I suspect it's a lockfile problem. This is documented in INSTALL with the source. Its easy enough to test this too.. touch /var/lock/testingrxtxlockfiles && rm -f /var/lock/testingrxtxlockfiles If you are not in the right group it will bail. Root will work regardless. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 12:37:56 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 12:37:56 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> Message-ID: <1139341076.8145.11.camel@zd7280> Exactly which ports does rxtx attempt to put into the list ? /dev/* or /dev/tty* or /dev/tty[0-9[0-9] ? or /dev/ttyS* ? For the record, only /dev/ttyUSB0 is a valid port on the machine I am presently on. Will this be a problem ? On Tue, 2006-02-07 at 12:20 -0700, Trent Jarvi wrote: > This is documented in INSTALL with the source. > I was wondering where that file was. I will download source and dig it up. Thanks. -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 12:51:09 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 12:51:09 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139341076.8145.11.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: On Tue, 7 Feb 2006, Kim Lux wrote: > > Exactly which ports does rxtx attempt to put into the list ? /dev/* > or /dev/tty* or /dev/tty[0-9[0-9] ? or /dev/ttyS* ? > > For the record, only /dev/ttyUSB0 is a valid port on the machine I am > presently on. Will this be a problem ? > > > On Tue, 2006-02-07 at 12:20 -0700, Trent Jarvi wrote: >> This is documented in INSTALL with the source. >> > I was wondering where that file was. I will download source and dig it > up. > > Thanks. > Hmm I'm looking at pre17 so this may have changed. (its just what I have on this machine) if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA" // for the IPAQs }; CandidatePortPrefixes=Temp; } So you may need to add "ttyUSB" to that list. RXTX used to enumerate _everything_ see if(osName.equals("Linux-all-ports") But it became less than practical. This is all in RXTXCommDriver.java hmm I just did a cvs update. if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have to get your fingers into the code. We aim for sane defaults. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 13:06:45 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 13:06:45 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139342805.8145.22.camel@zd7280> On Tue, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > Hmm I'm looking at pre17 so this may have changed. (its just what I have > on this machine) > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA" // for the IPAQs > }; > CandidatePortPrefixes=Temp; > } > > > So you may need to add "ttyUSB" to that list. RXTX used to enumerate > _everything_ see if(osName.equals("Linux-all-ports") But it became less > than practical. > > This is all in RXTXCommDriver.java > > hmm I just did a cvs update. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have > to get your fingers into the code. We aim for sane defaults. Excellent. Thanks for taking the time. -- Kim Lux, Diesel Research Inc. From ideiglenes1 at freemail.hu Tue Feb 7 13:53:39 2006 From: ideiglenes1 at freemail.hu (--) Date: Tue, 07 Feb 2006 21:53:39 +0100 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139345619.22534.2.camel@localhost> Hi! I use this code to get all the extra Linux devices. :) if ("Linux".equals(System.getProperty("os.name"))) { System.setProperty("os.name","Linux-all-ports"); } driver = new RXTXCommDriver(); On k, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > On Tue, 7 Feb 2006, Kim Lux wrote: > > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have > to get your fingers into the code. We aim for sane defaults. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From matt.higgins at gmail.com Tue Feb 7 13:45:54 2006 From: matt.higgins at gmail.com (Matt Higgins) Date: Tue, 7 Feb 2006 15:45:54 -0500 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> Message-ID: <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> Sweet this is exactly what I needed. I was searching the archives through marc.theamisgroup they only have archives back to 1/3/05. Should have hit the mailman archive! Thanks a lot! On 2/7/06, Brian Schlining wrote: > > Hi Matt > > The following code works fine on Linux but I never see any data when run > on Windows. This is a cut and paste from the SimpleRead example. > I am attempting to read data from a bar code scanner. I can fire up > HyperTermianl on windows and see that the device is working properly as I > see the barcodes are scanned and echoed back to the terminal. However when I > run the app I don't see any data. It is however associating with the com > port as the informational bits print fine? > > > You're not the only one whose had this problem, I don't know if Trent has > addressed this is the latest release of RXTX but there is a workaround. > Here's the recent thread from the RXTX mailing list regarding this issues: > > Thanasis Delenikas tdelenik at gmail.com > Wed Jan 18 13:56:23 MST 2006 > > * Previous message: [Rxtx] Re: More close() performance fixes > * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] > > Hi all. > (I've subscribed again from my other email account). > > Trent, > > You are right. Linux *always* works, no matter what flow control you set. > Windows *works only* with hardware flow control (I haven't tested what > happens with software XON/XOFF flow control). > > I assume (but I am not certain) that even with no flow control at all, all > platforms should work. Without flow control, you have the risk of bumping > into overflow or framing errors, but that's your (the end programmer, I > mean) problem. > > >From my side, I shouldn't be working without flow control. That was a bug > too... It was some code forgotten from the old times, when I used to work > with phone emulation drivers which didn't support flow control. The > correct > way is to have some flow control enabled and that's why I suppose this is > a > low-severity bug for RxTx. > > I have no idea which platform shows the correct behaviour, since > my knowledge about Linux and the inner workings of these low-level i/o > operations is limited. > > Regards, > Thanasis Delenikas. > > > > > Message: 2 > > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > > From: Trent Jarvi > > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > > To: RXTX Developers and Users > > Message-ID: > > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > > > Hi all, > > > > > > Trent, I have found something. > > > I read your comment about flow control, so I experimented a bit. > > > > > > If you remember, in my sample program I've used no flow control at all > ( > > i.e. > > > Java constant FLOWCONTROL_NONE). > > > > > > Now, during testing, I've switch to hardware inbound flow control (i.e > . > > Java > > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > > beautifully! > > > > > > I think I will switch to H/W flow control and test things for a while, > > but > > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > > > > > Hi Thanasis, > > > > I'm fairly sure you have identified a bug. I would not worry too much > > about what Sun CommAPI w32 defaults are. I think they did more or less > > whatever the port opened with. Just a guess. Linux tries to stomp on > > ports so they are all the same. > > > > So this started out with Linux worked, Windows XP/.. did not as I > recall. > > Something is wrong in rxtx. Do I understand this right? > > > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > > > Perhaps there is something Wayne or I did not understand when we wrote > > that code. I wasnt programming back in the BBS days so modems are not > my > > thing. I have a few questions. > > > > Is the above matrix confirmed by observation? > > Linux just always worked? > > Which one _should_ work? I'm guessing modems work with hardware flow > > control. I'll have to dig around. > > > > The windows flow control changes a couple things with hardware flow > > control. Following the w32 API documentation is confusing sometimes. > > But it looks like Linux could have a bug too. > > Cheers > > Brian Schlining > Software Engineer > http://www.mbari.org > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/9c989144/attachment-0019.html From tjarvi at qbang.org Tue Feb 7 14:06:14 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 14:06:14 -0700 (MST) Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> Message-ID: >> >> You're not the only one whose had this problem, I don't know if Trent has >> addressed this is the latest release of RXTX but there is a workaround. >> Here's the recent thread from the RXTX mailing list regarding this issues: >> I have not. I expect to have access to some test equipment next month and I'll go through all of this. I really don't know whats going on and I need a gold standard. I thought maybe linux was autodetecting the flow control. Your observations would certainly be welcome. I need to talk to Russell King and see what he is doing. Until then I'd just be toying around over a loopback as usual. This is very high on the list though. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 17:25:05 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 17:25:05 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139358305.17994.2.camel@zd7280> My application now works. I installed the libraries and jar from 2.1-7 (Final). portlist.hasMoreElements is no longer false. The application finds the port for /dev/ttyUSB0. Thanks for your help, Trent (et al) Sorry I bothered you with this. Next time I will look in the source first. I didn't think it was an rxtx issue, I thought it was a Linux setup issue . On Tue, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > Hmm I'm looking at pre17 so this may have changed. (its just what I > have > on this machine) > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux > Serial Ports > "ttySA" // for the > IPAQs > }; > > CandidatePortPrefixes=Temp; > } > > > So you may need to add "ttyUSB" to that list. RXTX used to enumerate > _everything_ see if(osName.equals("Linux-all-ports") But it became > less > than practical. > > This is all in RXTXCommDriver.java > > hmm I just did a cvs update. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux > Serial Ports > "ttySA", // for the > IPAQs > "ttyUSB" // for USB > frobs > }; > > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you > have > to get your fingers into the code. We aim for sane defaults. -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 19:21:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 19:21:54 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139358305.17994.2.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> <1139358305.17994.2.camel@zd7280> Message-ID: >Sorry I bothered you with this. Next time I will look in the source >first. I didn't think it was an rxtx issue, I thought it was a Linux >setup issue . Why would you be sorry? I would have done the same. I'm glad it's working :) -- Trent Jarvi tjarvi at qbang.org From tma at mail.island.net Wed Feb 8 13:39:35 2006 From: tma at mail.island.net (Tom Alldread) Date: Wed, 08 Feb 2006 12:39:35 -0800 Subject: [Rxtx] Win32/Linux Serial Port Data Dropouts In-Reply-To: <200602060702.k167255O007882@www.qbang.org> References: <200602060702.k167255O007882@www.qbang.org> Message-ID: <43EA5707.4020200@mail.island.net> Greetings Folks at RXTX: During the last couple of months I have been alternately testing with javax.comm 2 and RXTX 2.1 under Windows XP and CommApi 3 and RXTX 2.1 under Suse 10.0 Linux. In the process I have learned a little about java multi-threading under NetBeans 5 with Profiler. My java (jdk 1.5_06) application is used for data acquisition and provides a graphical display of A-D conversion data received from a 56KBaud serial port. The actual data throughput is about 10KBaud thus it is well below the speed of the port. I use hardware RTS/CTS flow control which can stall the data acquisition sample rate if necessary. This ensures the display computer has the ability to slow the data acquisition rate should it become too busy to accept the regular data flow. Both the serial port buffer and the java read buffer are set at 16KB. Usually the data transfers into the java read buffer are less than 100 bytes unless the data acquisition is recovering from a stall. The data flow normally hesitates after each 5 KB block as a continue command is needed from the display computer to start the drawing of a new graphics display line. Separate threads have been provided for the serial port event monitoring and data processing. The serial port event thread has been given the maximum priority and data processing thread the minimum priority provided by java. Thread yield statements have been placed within all data processing while/for loops as an effort to ensure quick access to CPU cycles for the serial port event thread. I have found that short data transmissions are essentially error free but occasional dropouts occur with continuous data flow especially under Windows XP. ....................................................................................................................................................................................... Linux results: I am happy to report that RXTX 2.1 appears to work very well under Linux although I did notice some errors when the screen savers were running with my dual monitors. I believe this is a local problem associated with my dual graphics which needs further attention. The recent CommApi 3 Linux release from Sun did not work at all with my program. It seemed to send commands out OK but did not receive any data. Although the serial port event triggered the ISR, the input stream appeared filled with nulls and thus did not contain any data. As my understanding is that CommApi 3 was tested with a Red Hat distribution of Linux I wonder if this problem is distro dependent? Although somewhat off topic here I wonder if anyone reading this has had similar experience? .................................................................................................................................................................................. Windows XP results: There are problems with occasional data dropouts which become more frequent as the sampling rate is increased or if the computer becomes busy with other duties. The dropouts typically consist of a half dozen byte block of lost data. It appears the lost bytes never get added to the java input stream. There has not been any indication of garbled data, overruns or framing errors which suggests the UART communications remains solid. Using javax.comm 2 I found that the setting of SerialPort 'enableReceiveThreshold' to 40 and 'enableReceiveTimeout' of 100mS reduced the dropouts error rate significantly. I found that I could not get RXTX 2.1 to function with the aforementioned threshold and timeout settings. The javax.comm 2 interface is consequently performing better for me under Windows than RXTX 2.1. I wonder if anyone here has any suggestions as to what I might try to improve RXTX 2.1? Although my settings are the same as under Suse 10.0, RXTX 2.1 performs much better for me under Linux than any of the alternatives that I have tried under Windows XP . ............................................................................................................................................................................... I would like to establish, based on the experience of others, if I have reached the normally expected performance limit of java serial port communications? Should I expect to achieve virtually error free serial port data input from a continuous stream under Windows XP java software? I am considering changing my protocol to packets with error checking if necessary but would like to know if the dropout problems I am experiencing are typical or not before I take this rather work intensive plunge. Many thanks in advance for any help! Best Regards, Tom Alldread -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.375 / Virus Database: 267.15.2/253 - Release Date: 2006-02-07 From jlaxson at mac.com Wed Feb 8 23:56:48 2006 From: jlaxson at mac.com (John Laxson) Date: Thu, 9 Feb 2006 00:56:48 -0600 Subject: [Rxtx] PortInUseException: Unknown Application on OSX Message-ID: Hi, I've been trying to get RXTX 2.1.7 going on Mac OS X for a while here, and am running up into a wall here. I've tried with pre- compiled and the source version and get the same problem, a gnu.io.PortInUseException: Unknown Application. I have run the fixperms script included with the source distribution, and id shows me as a member of the uucp group, and permissions on /var/spool/uucp are 775 root:uucp. Running a test program (included at the bottom for clarity) lets me enumerate all the serial ports correctly, but trying to open any of them gives the PortInUseException. If it helps, when I try to open a port that's set to make an outgoing bluetooth connection, there is no delay and no connection attempt at all. Thanks, John Laxson PS: The documentation wiki on qbang.org shows 404, and has for a few days now. My test code: public static void main(String[] args) { SerialPort serialPort; try { Enumeration e = CommPortIdentifier.getPortIdentifiers(); CommPortIdentifier ident; while (e.hasMoreElements()) { ident = (CommPortIdentifier)e.nextElement(); System.out.println(ident.getName()); } ident = CommPortIdentifier.getPortIdentifier("/dev/cu.modem"); serialPort = (SerialPort) ident.open("Me", 5000); } catch (Exception e) { e.printStackTrace(); } } From rajesh.invincible at gmail.com Thu Feb 9 03:39:38 2006 From: rajesh.invincible at gmail.com (Rajesh N) Date: Thu, 9 Feb 2006 16:09:38 +0530 Subject: [Rxtx] Re: Move .java Files in gnu.io filesystem hierarchy - Maven (2) In-Reply-To: <43DF21D2.7090200@ngi.it> References: <43DF21D2.7090200@ngi.it> Message-ID: <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Can anybody tell me how to overcome these EXCEPTIONS I AM WORKING ON SERIAL COMMN IN JAVA ON LINUX. 1. " NOT ALL PARAMETERS SUPPORTED BY THE KERNEL" This i came across the following statement inmy prog. SerialP is A SerialPort object SerialP.setSerialPortParams(9600(BAUDRATE),DATABITS_8,STOPBITS_1,PARITY_NONE) 2. NullPointer Exception at Event Dispatch Now i have checked all my object references for a null reference but i found none i have put up my entire code in try catch blocks but still I AM UNABLE TO CATCH THIS EXCEPTION AND HENCE MY APPLICATION CLOSES HOW DOES THESE GO? PLEASE HELP ME IT IS URGENTTTTTTTTTTTTTTTT yours sincerely RAJESH On 1/31/06, Fabio Frumento wrote: > Hi Xavier, > > I don't know maven at all but the directory hierarchy listed buy Trent > is fine for me... > > I'll take a look to maven, it seems an interesting project > > Regards > > Fabio Frumento > > Trent Jarvi wrote: > > On Tue, 31 Jan 2006, Xavier Frisaye wrote: > > > >> Hi all, > >> > >> If you are going to rearrange the src folder, i will propose to use > >> maven 2 and follow its directory structure > >> > (http://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html). > >> > >> Maven 2 simplify java project and give a standard way to make projects > >> (http://maven.apache.org/). > >> We are using it for internal projects and we are very satisfied. > >> > >> Is anybody interested? > >> > >> I'm not an expert in maven 2 (yet) but i'm agree to help using it if > >> you choose to make so. > >> > > > > so this would be: > > > > rxtx-devel/src/main/java/gnu.io > > rxtx-devel/src/test/java/ManIwish.java > > > > I don't use IDEs very much so I'll let others comment. But I don't see > > a problem with that. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Thu Feb 9 09:50:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 9 Feb 2006 09:50:31 -0700 (MST) Subject: [Rxtx] Re: Move .java Files in gnu.io filesystem hierarchy - Maven (2) In-Reply-To: <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Message-ID: On Thu, 9 Feb 2006, Rajesh N wrote: > Can anybody tell me how to overcome these EXCEPTIONS > I AM WORKING ON SERIAL COMMN IN JAVA ON LINUX. > > 1. " NOT ALL PARAMETERS SUPPORTED BY THE KERNEL" > > This i came across the following statement inmy prog. > SerialP is A SerialPort object > SerialP.setSerialPortParams(9600(BAUDRATE),DATABITS_8,STOPBITS_1,PARITY_NONE) > Strange. The parameters you use are the same the port should open with by default. Could you paste the actual exception you are getting? I don't see that in the rxtx source. Also it would help to know the rxtx version. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Fri Feb 10 15:29:05 2006 From: lux at diesel-research.com (Kim Lux) Date: Fri, 10 Feb 2006 15:29:05 -0700 Subject: [Rxtx] One serial port object for both sending and receiving ? Message-ID: <1139610545.18177.4.camel@zd7280> Is it OK to use one SerialPort ojbect (ex Serial Port serialPort;) and use it for both sending and receiving ? For example: ======================================================================== static SerialPort serialPort = null; static OutputStream serialOut = null; static InputStream serialIn = null; // assign it to an outputStream for use try{ serialOut = serialPort.getOutputStream(); System.out.println("Serial output stream has been assigned."); }//try catch(IOException e) { System.out.println("Error: Couldn't assign output stream to serial port."); }//catch //assign it to an inputStream for use try{ serialIn = serialPort.getInputStream(); System.out.println("Serial input stream has been assigned."); }//try catch(IOException e) { System.out.println("Error: Couldn't assign input stream to serial port."); }//catch ======================================================================== -- Kim Lux, Diesel Research Inc. From lux at diesel-research.com Fri Feb 10 21:23:00 2006 From: lux at diesel-research.com (Kim Lux) Date: Fri, 10 Feb 2006 21:23:00 -0700 Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Message-ID: <1139631780.23882.10.camel@zd7280> I've got a problem receiving chars with my version of serialRead, written in an SWT GUI. I had a Java pro have a good look at my code and he can't see anything wrong with it. I can send chars fine. When I receive a char the cpu usage for the app goes to 100% and the code in the serial event handler doesn't get executed. The instructions on the Java Comm Serial API How-To for Linux page state that I must install javacomm. Is that true ? Everything builds without it and I can send chars on rxtx just fine, but I can't receive them. Could this be the problem ? I downloaded and installed javacomm. I was not able to add "Driver=gnuio.RXTXCommDriver to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 installed in /usr/java/jre1.5.0_05. I added comm.jar to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext to the library paths. Is this OK ? Does it matter that I am receiving on /dev/ttyUSB0 ? Thanks. -- Kim Lux, Diesel Research Inc. From lunareclipse03 at web.de Sat Feb 11 09:44:46 2006 From: lunareclipse03 at web.de (lunareclipse03@web.de) Date: Sat, 11 Feb 2006 17:44:46 +0100 Subject: [Rxtx] Question about Serial I/O under Win32 Message-ID: <662084330@web.de> Hello everybody, I have a strange problem with a piece of code I made for myself. No, this is not really concerning rxtx, but nevertheless I post this to the list, hoping that some of you can help me. I've written two libraries, one for linux and one for win32. The linux port works quite well, I can send / receive faxes and / or replay voice messages over the telephone line using a voice modem. But the win32 port of the library causes some trouble. If, for example, I send out a fax with a certain modem under linux, it works well. The fax is complete when it comes out of the fax machine. If I then use the same modem to send out a fax under win32, the fax coming out of the fax machine gets "stuck" halfways, but the sending modem thinks that transmission was ok and drops the connection. The answering fax machine then gives me "error while receiving." The "upper layer" java code MUST be right, because if I do the same thing under linux (using the linux library), everything is alright. Now I have to ask: Can somebody please help me out with this??!? Could it be the case that some kind of flow control or COMMTIMEOUTS setting causes this behaviour? I set flow control to RTS/CTS before sending out a fax. How can I DISABLE flow control? Or what do you think? Can something else cause this problems? Thank you all for your time and PLEASE write back soon. Regards, --Sven Ahlemann Am Waldrand 31 45721 Haltern am See Germany ______________________________________________________________ Verschicken Sie romantische, coole und witzige Bilder per SMS! Jetzt bei WEB.DE FreeMail: http://f.web.de/?mc=021193 From lux at diesel-research.com Sat Feb 11 10:06:52 2006 From: lux at diesel-research.com (Kim Lux) Date: Sat, 11 Feb 2006 10:06:52 -0700 Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: <1139631780.23882.10.camel@zd7280> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> <1139631780.23882.10.camel@zd7280> Message-ID: <1139677612.3431.5.camel@zd7280> More on this problem. I copied and pasted simpleRead into a console based Eclipse project and I've got the same result, except that cpu usage doesn't go to 100%. I'm beginning to think there is an issue in rxtx. My imports for simpleRead are: ============================ import gnu.io.*; import java.util.*; //import javax.comm.*; import java.io.*; =========================== Any ideas ? I am trying to read from /dev/ttyUSB0 using a serial to USB adapter which has worked well with minicom and gtkterm. Thanks. On Fri, 2006-02-10 at 21:23 -0700, Kim Lux wrote: > I've got a problem receiving chars with my version of serialRead, > written in an SWT GUI. > > I had a Java pro have a good look at my code and he can't see anything > wrong with it. > > I can send chars fine. When I receive a char the cpu usage for the app > goes to 100% and the code in the serial event handler doesn't get > executed. > > The instructions on the Java Comm Serial API How-To for Linux page state > that I must install javacomm. Is that true ? Everything builds without > it and I can send chars on rxtx just fine, but I can't receive them. > Could this be the problem ? > > I downloaded and installed javacomm. I was not able to add > "Driver=gnuio.RXTXCommDriver > to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not > have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 > installed in /usr/java/jre1.5.0_05. I added comm.jar > to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext > to the library paths. Is this OK ? > > Does it matter that I am receiving on /dev/ttyUSB0 ? > > Thanks. > -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Sun Feb 12 21:01:33 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:01:33 -0700 (MST) Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: <1139677612.3431.5.camel@zd7280> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> <1139631780.23882.10.camel@zd7280> <1139677612.3431.5.camel@zd7280> Message-ID: I suspect what is happening is the select() is breaking out in the native code but the driver does not have support for notifying there are X bytes available. On some traditional Unix based systems, the only way you know data is available is the fd status changes and do an FIORDCHK ioctl. Or perhaps the only thing you can know is the fd status changed. It would take reading through the kernel driver code to know for sure. So on USB, depending upon the driver, the same may need to be done or the driver improved a bit if possible to support. Polling reads will also work but don't use the event driven model of CommAPI which isnt acceptable in the long run. The 100% cpu usage can then be explained because select no longer blocks until the data is read; the eventLoop spins loose. You can put a well placed sleep but rxtx only expects those are needed when it knows data is available. This may not be a super simple thing to understand and fix. I do have ideas to get you started. I'm going to be short on time the next couple weeks. I expect to put some good time in and answer some other questions I saw around the 25th. For now, I'd look at the following and go from there with the hints I've given. JNIEXPORT jint JNICALL RXTXPort(nativeavailable)( JNIEnv *env, jobject jobj ) { int fd = get_java_var( env, jobj,"fd","I" ); int result; /* char message[80]; ENTER( "RXTXPort:nativeavailable" ); On SCO OpenServer FIONREAD always fails for serial devices, so try ioctl FIORDCHK instead; will only tell us whether bytes are available, not how many, but better than nothing. This turns out to be true on Solaris also. taj. */ #ifdef FIORDCHK /* __unixware__ __sun__ probably others */ result = ioctl(fd, FIORDCHK, 0); #else if( ioctl( fd, FIONREAD, &result ) < 0 ) { goto fail; } #endif /* FIORDCHK */ On Sat, 11 Feb 2006, Kim Lux wrote: > > More on this problem. I copied and pasted simpleRead into a console > based Eclipse project and I've got the same result, except that cpu > usage doesn't go to 100%. I'm beginning to think there is an issue in > rxtx. > > My imports for simpleRead are: > > ============================ > import gnu.io.*; > import java.util.*; > //import javax.comm.*; > import java.io.*; > =========================== > > Any ideas ? I am trying to read from /dev/ttyUSB0 using a serial to > USB adapter which has worked well with minicom and gtkterm. > > Thanks. > > > > On Fri, 2006-02-10 at 21:23 -0700, Kim Lux wrote: >> I've got a problem receiving chars with my version of serialRead, >> written in an SWT GUI. >> >> I had a Java pro have a good look at my code and he can't see anything >> wrong with it. >> >> I can send chars fine. When I receive a char the cpu usage for the app >> goes to 100% and the code in the serial event handler doesn't get >> executed. >> >> The instructions on the Java Comm Serial API How-To for Linux page state >> that I must install javacomm. Is that true ? Everything builds without >> it and I can send chars on rxtx just fine, but I can't receive them. >> Could this be the problem ? >> >> I downloaded and installed javacomm. I was not able to add >> "Driver=gnuio.RXTXCommDriver >> to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not >> have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 >> installed in /usr/java/jre1.5.0_05. I added comm.jar >> to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext >> to the library paths. Is this OK ? >> >> Does it matter that I am receiving on /dev/ttyUSB0 ? >> >> Thanks. >> > From tjarvi at qbang.org Sun Feb 12 21:03:30 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:03:30 -0700 (MST) Subject: [Rxtx] One serial port object for both sending and receiving ? In-Reply-To: <1139610545.18177.4.camel@zd7280> References: <1139610545.18177.4.camel@zd7280> Message-ID: On Fri, 10 Feb 2006, Kim Lux wrote: > > Is it OK to use one SerialPort ojbect (ex Serial Port serialPort;) and > use it for both sending and receiving ? > > For example: > > ======================================================================== > static SerialPort serialPort = null; > static OutputStream serialOut = null; > static InputStream serialIn = null; > > > > > // assign it to an outputStream for use > try{ > serialOut = serialPort.getOutputStream(); > System.out.println("Serial output stream has been assigned."); > }//try > catch(IOException e) > { > System.out.println("Error: Couldn't assign output stream to serial > port."); > }//catch > > > //assign it to an inputStream for use > try{ > serialIn = serialPort.getInputStream(); > System.out.println("Serial input stream has been assigned."); > }//try > catch(IOException e) > { > System.out.println("Error: Couldn't assign input stream to serial > port."); > }//catch This should be fine. In fact trying to do it another way will probably not work as you will run into lockfile issues. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun Feb 12 21:13:13 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:13:13 -0700 (MST) Subject: [Rxtx] Question about Serial I/O under Win32 In-Reply-To: <662084330@web.de> References: <662084330@web.de> Message-ID: On Sat, 11 Feb 2006 lunareclipse03 at web.de wrote: > Hello everybody, > > I have a strange problem with a piece of code I made for myself. No, > this is not really concerning rxtx, but nevertheless I post this to the > list, hoping that some of you can help me. I've written two libraries, > one for linux and one for win32. The linux port works quite well, I can > send / receive faxes and / or replay voice messages over the telephone > line using a voice modem. But the win32 port of the library causes some > trouble. If, for example, I send out a fax with a certain modem under > linux, it works well. The fax is complete when it comes out of the fax > machine. If I then use the same modem to send out a fax under win32, the > fax coming out of the fax machine gets "stuck" halfways, but the sending > modem thinks that transmission was ok and drops the connection. The > answering fax machine then gives me "error while receiving." The "upper > layer" java code MUST be right, because if I do the same thing under > linux (using the linux library), everything is alright. Now I have to > ask: Can somebody please help me out with this??!? Could it be the case > that some kind of flow control or COMMTIMEOUTS setting causes this > behaviour? I set flow control to RTS/CTS before sending out a fax. How > can I DISABLE flow control? Or what do you think? Can something else > cause this problems? Thank you all for your time and PLEASE write back > soon. > Hi Sven I'm not too willing to talk about flow control at the low level until I confirm some things with test equipment later. It is not clear if you are using rxtx or writing your own native code. So I'm not sure how to answer much of this :) If you are wondering how to change the flow control using rxtx from java, The BlackBox example from Sun flips this back and forth. SerialPort.java in rxtx 2.1 uses the following: SerialPort.java: public static final int FLOWCONTROL_NONE =0; SerialPort.java: public static final int FLOWCONTROL_RTSCTS_IN =1; SerialPort.java: public static final int FLOWCONTROL_RTSCTS_OUT =2; SerialPort.java: public static final int FLOWCONTROL_XONXOFF_IN =4; SerialPort.java: public static final int FLOWCONTROL_XONXOFF_OUT=8; So if you set flowcontrol to RTSCTS, you can set it to NONE to turn it off. If you are looking for how to do it in native code, the rxtx Source is SerialImp.c (unix/linux/mac os x/w32) and termios.c (w32 only with SerialImp.c) You can track the code: SerialImp.c:JNIEXPORT void JNICALL RXTXPort(setflowcontrol)( JNIEnv *env, jobject jobj, jint flowmode ) termios.c:int tcgetattr( int fd, struct termios *s_termios ) termios.c:int tcsetattr( int fd, int when, struct termios *s_termios ) There may be a problem in the rxtx flow control code though. Rather than guess, I want to test this with a gold standard. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Feb 6 00:00:16 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 00:00:16 -0700 (MST) Subject: [Rxtx] wiki delay until tomorrow night. In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: On Sun, 5 Feb 2006, Trent Jarvi wrote: > On Sun, 5 Feb 2006, Kim Lux wrote: > >> usb ? Tell me more... I need that too. > > usb is a very proper design. Thats all it is. > Maybe rxtx could help usb. But it would start with helping bring back the community that was already there. It's not something I'd love to do but maybe its the right thing to do. It would probably take 2 years to do right. But maybe thats better than what we have now. I honestly don't know what IBM is doing which could just run over everything. Just some thoughts after some fine german wine. -- Trent Jarvi tjarvi at qbang.org From gadelavega at yahoo.com.ar Mon Feb 6 02:17:05 2006 From: gadelavega at yahoo.com.ar (Gonzalo A. de la Vega) Date: Mon, 06 Feb 2006 10:17:05 +0100 Subject: [Rxtx] Serial port ownership question In-Reply-To: References: <20060205113618.30274.qmail@web53501.mail.yahoo.com> <1139157422.4553.9.camel@zd7280> <1139158698.4936.9.camel@zd7280> Message-ID: <43E71411.4050402@yahoo.com.ar> On my Fedora Core 4: ls -l /dev/ttyS* crw-rw---- 1 root uucp 4, 64 Feb 6 2006 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Feb 6 2006 /dev/ttyS1 ... and: grep "ttyUSB" /etc/udev/rules.d/50-udev.rules KERNEL=="ttyUSB*", GROUP="uucp", MODE="0660" So anyone in the "uucp" group can use serial ports. On Gentoo the group is "tty". Trent Jarvi escribi?: > > > On Sun, 5 Feb 2006, Dr. Douglas Lyon wrote: > >> I can confirm that this is the case (only root ownership of >> serial ports, under fedora 4). >> Wow, what were they thinking?! >> - DL >> >>> I've found that the newer kernels have the serial ports owned by root. >>> For example, >>> >>> $ls -al /dev/tty* >>> crw-rw-rw- 1 root root 5, 0 Feb 5 02:06 /dev/tty >>> crw-rw---- 1 root root 4, 0 Feb 5 02:06 /dev/tty0 >>> crw------- 1 root root 4, 1 Feb 5 09:07 /dev/tty1 >>> crw-rw---- 1 root tty 4, 10 Feb 5 02:06 /dev/tty10 >>> crw-rw---- 1 root tty 4, 11 Feb 5 02:06 /dev/tty11 >>> ... > > > This is just not a problem jcp or such are going to solve. Its a > platform spitwad fight. But do look at pam. In fact thats what Sun > is doing too. Maybe Linux followed their lead.. I'm not a pam guy. > I've spent 16 hours trying to understand it but your users wont :) > > Solution? I have no clue. Its two tangent mentalities from my > perspective. > > -- > Trent Jarvi > tjarvi at qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mtnvega at yahoo.com.br Mon Feb 6 05:35:43 2006 From: mtnvega at yahoo.com.br (Luiz Jr) Date: Mon, 6 Feb 2006 12:35:43 +0000 (GMT) Subject: [Rxtx] Documentation Wiki In-Reply-To: <1139157422.4553.9.camel@zd7280> Message-ID: <20060206123543.57256.qmail@web53515.mail.yahoo.com> Hello, Thank you for you answer, but so the usage of the API is pretty much like the Java Communications Api? If yes, what version of the Java Comm Api? Thank you, Luiz A. Brandao Jr Kim Lux escreveu: On Sun, 2006-02-05 at 08:36 -0300, Luiz Jr wrote: > Hello, > > I want to start using the RXTX libraries, but I would to know how, > since I can not access the documentation wiki page I just started using them yesterday. Below is how I installed the libraries, if that helps. I used snippets of code from the SimpleWrite application here to get me going. http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html Instead of "import javax.comm.*;", use "import gnu.io.*;" which is gotten from RXTXcomm.jar, which you will need to include in your project references. I am working in Eclipse. BTW: there is no way to open a port without going through the port list and finding it. Maybe sometime in the future someone (me ?) will write a method called openSerialPort that allows the user to give a port identifier, such as "/dev/tty1" and return a port ready to use. It wouldn't take much to write that and it would save users a lot of code. Hope this helps. ======================================================================= 1) Figure out which java you are running, incase there is more than one installed. $ java -version java version "1.5.0_05" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_05-b05) Java HotSpot(TM) Client VM (build 1.5.0_05-b05, mixed mode, sharing) 2) Find all the jre directories and the one from which you are currently running. kfind (jre) 3) cd to that directory plus /lib/i386 cd /usr/java/jre1.5.0_05/lib/i386 4) Copy the library files (*.so) to that directory. cp /home/krlux/Desktop/'Java Controls'/rxtx-linux/bin/* . 5) Check that the copy was successful ls librxtx* librxtxI2C.so librxtxRaw.so librxtxSerial.so librxtxParallel.so librxtxRS485.so 6) cd to the /lib/ext directory for your java. cd /usr/java/jre1.5.0_05/lib/ext 7) Copy the Jar files there cp /home/krlux/Desktop/'Java Controls'/rxtx-linux/lib/ext/* . 8) Check that it was successful ls RXTX* RXTXcomm.jar Rxtx is now installed on your machine ready to use. =================================================================== -- Kim Lux, Diesel Research Inc. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx --------------------------------- Yahoo! Acesso Gr?tis - Internet r?pida e gr?tis. Instale o discador agora! -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/544aa403/attachment-0020.html From lyon at docjava.com Mon Feb 6 05:49:34 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 06 Feb 2006 07:49:34 -0500 Subject: [Rxtx] wiki delay until tomorrow night. In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: Hi All, I have often thought about USB drivers being needed. For example, the ironman watch will not interface to a mac (windows only). It is USB. My dymo label writer has no Java driver (native only). Etc. Most cheap web cameras are USB (and Java drivers go through JAI, if it supports the camera at all). The JAI code shows how sun did the USB drivers. You have to be a member of the jai project to download the source code. https://jai.dev.java.net has the jai distro. And then you are not allowed to redistribute it. However, we can all learn from it (if so inclined). Basically: cvs -d :pserver:lyon at cvs.dev.java.net:/cvs login cvs -d :pserver:lyon at cvs.dev.java.net:/cvs checkout jai-core You will need to user your own uid and pw to get in. The ant build has over 100 warnings from sun deprecations of its own code. You might say that they were hoisted on their own Picard ;) One interesting thing is that they support several platforms: linux-amd64 64-bit Linux-AMD64 linux-i586 32-bit Linux-x86 solaris-amd64 64-bit Solaris-AMD64 solaris-i586 32-bit Solaris-x86 solaris-sparc 32-bit Solaris-SPARC solaris-sparcv9 64-bit Solaris-SPARC windows-i586 32-bit Windows-x86 Thus, ant is used to provide a multi-platform native method distro. Neat. How do they do it? check this out: And: The core download does not contain any C source code (it was all pre-built). Basically, they are just copying .so and .dll files into build directories. I would love to see the C code for this...but Sun does not post it on the https://jai.dev.java.net site. I don't know why...Perhaps I missed it. - Doug >On Sun, 5 Feb 2006, Trent Jarvi wrote: > >>On Sun, 5 Feb 2006, Kim Lux wrote: >> >>>usb ? Tell me more... I need that too. >> >>usb is a very proper design. Thats all it is. >> > >Maybe rxtx could help usb. But it would start with helping bring >back the community that was already there. > >It's not something I'd love to do but maybe its the right thing to do. > >It would probably take 2 years to do right. But maybe thats better >than what we have now. > >I honestly don't know what IBM is doing which could just run over everything. > >Just some thoughts after some fine german wine. > >-- >Trent Jarvi >tjarvi at qbang.org > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tdelenik at gmail.com Mon Feb 6 05:56:32 2006 From: tdelenik at gmail.com (Thanasis Delenikas) Date: Mon, 6 Feb 2006 14:56:32 +0200 Subject: Fwd: [Rxtx] Documentation Wiki In-Reply-To: <1139157422.4553.9.camel@zd7280> References: <20060205113618.30274.qmail@web53501.mail.yahoo.com> <1139157422.4553.9.camel@zd7280> Message-ID: <310a1a930602060456t129f1dc6p5f2b908f13ab5a0b@mail.gmail.com> Hello all, Kim, this is a snippet from the code I use. The closest to directly opening a specific port without enumeration. << ... portId = CommPortIdentifier.getPortIdentifier(getPort()); serialPort = (SerialPort) portId.open("jSMSEngine", 1971); ... >> where getPort() return the string identifier of the port, i.e. "/dev/ttyS0" or "COM1" or whatever. Thanasis. ---------- Forwarded message ---------- From: Kim Lux Date: Feb 5, 2006 6:37 PM Subject: Re: [Rxtx] Documentation Wiki To: RXTX Developers and Users BTW: there is no way to open a port without going through the port list and finding it. Maybe sometime in the future someone (me ?) will write a method called openSerialPort that allows the user to give a port identifier, such as "/dev/tty1" and return a port ready to use. It wouldn't take much to write that and it would save users a lot of code. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/182ab5b8/attachment-0020.html From tjarvi at qbang.org Mon Feb 6 11:53:57 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 11:53:57 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: On Mon, 6 Feb 2006, Dr. Douglas Lyon wrote: > Hi All, > I have often thought about USB drivers being needed. > For example, the ironman watch will not interface > to a mac (windows only). It is USB. > My dymo label writer has no Java driver (native only). > Etc. > Most cheap web cameras are USB (and Java drivers go > through JAI, if it supports the camera at all). > The JAI code shows how sun did the USB drivers. > You have to be a member of the jai project to download > the source code. > https://jai.dev.java.net has the jai distro. > And then you are not allowed to redistribute it. However, > we can all learn from it (if so inclined). Basically: > cvs -d :pserver:lyon at cvs.dev.java.net:/cvs login > cvs -d :pserver:lyon at cvs.dev.java.net:/cvs checkout jai-core > You will need to user your own uid and pw to get in. > The ant build has over 100 warnings from sun deprecations > of its own code. > > You might say that they were hoisted on their own Picard ;) > > One interesting thing is that they support several platforms: > linux-amd64 64-bit Linux-AMD64 > linux-i586 32-bit Linux-x86 > solaris-amd64 64-bit Solaris-AMD64 > solaris-i586 32-bit Solaris-x86 > solaris-sparc 32-bit Solaris-SPARC > solaris-sparcv9 64-bit Solaris-SPARC > windows-i586 32-bit Windows-x86 > Thus, ant is used to provide a multi-platform native method distro. > Neat. > How do they do it? > check this out: > > > > > > > > > > > > > And: > > > > > > > > > > The core download does not contain any C source code (it was all pre-built). > Basically, they are just copying .so and .dll files into build directories. > > I would love to see the C code for this...but Sun does not post it on the > https://jai.dev.java.net site. > > I don't know why...Perhaps I missed it. > > - Doug > > I've looked at moving rxtx to Ant builds. I think that would help IDEs a great deal. I requested a evalutation desk copy the O'Reilly Ant book for some j2ee material I was teaching. http://www.oreilly.com/catalog/anttdg/ It has a one sentence mention of JNI. So there was not luck there. I saw that there is another Ant book that does mention JNI more. I can't find it now. Ant must be able to support it with extensions. http://ant.apache.org/manual/OptionalTasks/javah.html What the auto(break :) tools do in the rxtx build is 4 things really. 1) gcc compile flags 2) ld compile flags 3) config.h 4) compile flags for customizing rxtx (lockfiles, ...) See 1 All of this information except 4 can be static once obtained. So I'm not attached to the auto tools. If I could find an example of Ant being used for JNI code, I'd be one of the first to start moving that direction. Maybe someone saw an example someplace. The other thing we have not completed discussing is the directory structure. There is interest in making rxtx more IDE friendly. I get more mail about that off the list than how to install rxtx. And I see we have Ken Thompson in da house :) He is our trusted CVS maintainer and the guy that purchased the rxtx.org domain. Old community. We will need Ken for changing the directory structure of source. I would like to open up discussion about both of these as it is more than time. The problem is I have little experience with Ant and even less with IDEs. It would be nice if we could work with Eclipse and NetBeans. http://www.netbeans.org/ (sun and some community) http://www.eclipes.org (ibm,rhat,... perhaps more community) http://maven.apache.org/what-is-maven.html (apache. It is community) borland should sortof be here too but I think thats covered in eclipse. >From what I understand so far, we should morph rxtx to support those three maybe trusting apaches lead with maven. But I use vi. I have little to no clues beyond what people have fed me. Can we agree that thats the right direction to go? -- Trent Jarvi tjarvi at qbang.org From brian at mbari.org Mon Feb 6 14:57:50 2006 From: brian at mbari.org (Brian Schlining) Date: Mon, 6 Feb 2006 13:57:50 -0800 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> > The other thing we have not completed discussing is the directory > structure. There is interest in making rxtx more IDE friendly. I > get more mail about that off the list than how to install rxtx. > > And I see we have Ken Thompson in da house :) He is our trusted > CVS maintainer and the guy that purchased the rxtx.org domain. Old > community. We will need Ken for changing the directory structure of > source. > > I would like to open up discussion about both of these as it is > more than time. The problem is I have little experience with Ant > and even less with IDEs. It would be nice if we could work with > Eclipse and NetBeans. > > http://www.netbeans.org/ (sun and some community) > http://www.eclipes.org (ibm,rhat,... perhaps more community) > http://maven.apache.org/what-is-maven.html (apache. It is community) > borland should sortof be here too but I think thats covered in > eclipse. > >> From what I understand so far, we should morph rxtx to support >> those three > maybe trusting apaches lead with maven. But I use vi. I have > little to no clues beyond what people have fed me. > Maven likes the directory structure below for Java code. (From http:// maven.apache.org/guides/getting-started/index.html) This structure works fine with ant, netbeans, and eclipse. rxtx_root_directory `-- src |-- main | `-- java | `-- gnu | `-- io `-- test `-- java `-- gnu `-- io Brian Schlining Software Engineer http://www.mbari.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/d9451eba/attachment-0020.html From tjarvi at qbang.org Mon Feb 6 15:11:45 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 15:11:45 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: > rxtx_root_directory > `-- src > |-- main > | `-- java > | `-- gnu > | `-- io > `-- test > `-- java > `-- gnu > `-- io > >From what I understand this will just be good. For me it makes no difference. So lets do the rxtx thing. Let if fester for two weeks and if nobody objects, we will do it. I'm not doing this because I care. I'm doing this to eliminate much of my inbox. But test... man is rxtx lacking there in the community aspect. It is covered but not right. _maybe_ I can change that this year. -- Trent Jarvi tjarvi at qbang.org (cat hurding since 1997) From lux at diesel-research.com Mon Feb 6 21:38:49 2006 From: lux at diesel-research.com (Kim Lux) Date: Mon, 06 Feb 2006 21:38:49 -0700 Subject: [Rxtx] How can I use Lock Files with rxtx (in FC4) ? Message-ID: <1139287129.17031.3.camel@zd7280> I am now running an rxtx application on FC4. I am getting: ========================================================= check_group_uucp(): error testing lock file creation Error details: Permission denied check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL ========================================================= $ ls -al /var/lock total 32 drwxrwxr-x 4 root lock 4096 Feb 6 16:04 . drwxr-xr-x 24 root root 4096 Nov 14 01:19 .. drwx------ 2 root root 4096 Apr 27 2005 lvm drwxr-xr-x 2 root root 4096 Feb 6 16:04 subsys How do I fix this for regulator users ? -- Kim Lux, Diesel Research Inc. From dmarkman at mac.com Mon Feb 6 22:24:44 2006 From: dmarkman at mac.com (Dmitry Markman) Date: Tue, 7 Feb 2006 00:24:44 -0500 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: if I understands the issue right in order to be able to use ant for c/c++ compilation you have to install ant's cc task http://ant-contrib.sourceforge.net/cc.html it looks like it should work on mac os x (authors claim, that it's platform independent) but I never tested so all you have to do it's providing right command line for the gcc compiler On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: >> rxtx_root_directory >> `-- src >> |-- main >> | `-- java >> | `-- gnu >> | `-- io >> `-- test >> `-- java >> `-- gnu >> `-- io >> > > >> From what I understand this will just be good. > > For me it makes no difference. So lets do the rxtx thing. Let if > fester for two weeks and if nobody objects, we will do it. > > I'm not doing this because I care. I'm doing this to eliminate > much of my inbox. > > But test... man is rxtx lacking there in the community aspect. It > is covered but not right. _maybe_ I can change that this year. > > -- > Trent Jarvi > tjarvi at qbang.org > (cat hurding since 1997) > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx Dmitry Markman From lux at diesel-research.com Mon Feb 6 23:20:15 2006 From: lux at diesel-research.com (Kim Lux) Date: Mon, 06 Feb 2006 23:20:15 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? Message-ID: <1139293215.3689.4.camel@zd7280> I'm running the code below. portlist.hasMoreElements() is false. /dev has ports in it as listed below. What am I doing wrong ? ========================================================== // Step through the list of ports until we find one that matches // the one we are looking for. portList = CommPortIdentifier.getPortIdentifiers(); while(portList.hasMoreElements()) { portID = (CommPortIdentifier) portList.nextElement(); // if (portID.getName().equals("/dev/ttyUSB0")) { myTA.append("Serial port ttyUSB0 has been found\n"); break; }// if portID equals... }// End of while... ========================================================== ls -al /dev/tty* crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 ... crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 -- Kim Lux, Diesel Research Inc. From david.garnier at trusted-logic.com Tue Feb 7 00:46:30 2006 From: david.garnier at trusted-logic.com (David Garnier) Date: Tue, 07 Feb 2006 08:46:30 +0100 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: <43E85056.2090608@trusted-logic.com> Hello, I think that the make-based build process is fine as it is, apart from the location of the Java source files. It is true that putting the Java source in a directory structure that map 1-to-1 to the Java package structure is the norm and should make it easier for everyone to modify the Java source, with or without an IDE. Ant is a good tool, but in the RXTX case I fail to see the advantage of using it compared to the current make-based process. As Trent said, they are more pressing issues, like testing. Regards, David Dmitry Markman wrote: > if I understands the issue right > in order to be able to use ant for c/c++ compilation > you have to install ant's cc task > http://ant-contrib.sourceforge.net/cc.html > > it looks like it should work on mac os x > (authors claim, that it's platform independent) > but I never tested > > so all you have to do it's providing right command line > for the gcc compiler > > > > > On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: > >>> rxtx_root_directory >>> `-- src >>> |-- main >>> | `-- java >>> | `-- gnu >>> | `-- io >>> `-- test >>> `-- java >>> `-- gnu >>> `-- io >>> >> >> >>> From what I understand this will just be good. >> >> For me it makes no difference. So lets do the rxtx thing. Let if >> fester for two weeks and if nobody objects, we will do it. >> >> I'm not doing this because I care. I'm doing this to eliminate much >> of my inbox. >> >> But test... man is rxtx lacking there in the community aspect. It is >> covered but not right. _maybe_ I can change that this year. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> (cat hurding since 1997) From tjarvi at qbang.org Tue Feb 7 01:11:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 01:11:31 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <43E85056.2090608@trusted-logic.com> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: On Tue, 7 Feb 2006, David Garnier wrote: > Hello, > > I think that the make-based build process is fine as it is, apart from the location of the Java > source files. It is true that putting the Java source in a directory structure that map 1-to-1 to > the Java package structure is the norm and should make it easier for everyone to modify the Java > source, with or without an IDE. > > Ant is a good tool, but in the RXTX case I fail to see the advantage of using it compared to the > current make-based process. As Trent said, they are more pressing issues, like testing. > Hi David I have more experience with testing rxtx than I can talk about. But let it be known, rxtx has gone trough 100's of hours of testing. We are hobby folks interested in toys but there is more. rxtx has had some of the best guidance in the industry there. This is not an easy thing. I may be able to come back in a month from the other side of the corperate fence and help. I suspect the tests could just be made public but they are in a very unusual environment that just wont work in a wider sense. This is something I'll be trying to change. At one point it was agreed we could just make the results public so this isnt just noise.. There is interest and I think its safe to mention that much. The big problem with testing in the past is most of it is done with a loopback connection. So we *still* have major questions regarding things like flow control. rxtx talks to itself over a loopback and it works. regardless of right or wrong. This requires more thought to be done right. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Feb 7 02:46:34 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 02:46:34 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: > The big problem with testing in the past is most of it is done with a > loopback connection. So we *still* have major questions regarding things > like flow control. rxtx talks to itself over a loopback and it works. > regardless of right or wrong. With serial communication there are gold standards. ckermit is probably a definitive 'standard.' Maybe its possible to do ping/pong tests with ckermit? Is it scriptable? There are known issues in rxtx. Probably the worst is some threading issues regarding some JREs with multiple JNI threads setting java variables. Man did I get schooled there. Just switch the c functions to returning variables and things go away. Sometimes they work fine, sometimes they blow up. Without understanding everything, somehow rhat got it right and debian (and especially gentoo) grabbed kernel patches causing all sort of harm. Its not hard to fix once you understand whats going on but nearly impossible to track with a debugger. So I have a good idea what 2.1-8 will have outside of the IDE modifications. rxtx 2.1-7 is a release for everyone to sync with. Its not even as stable as -pre17 as far as I know - I ran no test suites. I'll be chasing it too. We just had so many contributions that it was time. It seriously broke internal scheduals but thats a great thing :) The other thing I want to do in 2.1-8 is automagic baud rates. It turns out lots of shops are doing really funky baud rates for things like automobile test equipment. It is possible but it requires a fair amount of change in the native code. Is anyone looking at this? -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Feb 7 02:57:21 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 07 Feb 2006 04:57:21 -0500 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <43E85056.2090608@trusted-logic.com> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: Hi All, I agree, testing is very important. The problem I have been trying to address is related to cross-platform testing and the robust nature of the installs. Typically, I visit 3 platforms to deploy my product, windows, linux and mac. A build is performed on each platform. The idea that you can build for many platforms from one copy the source code seems attractive. This should enable synchronized deployments of identical code. The question of how to achieve this goal remains open. As Trent mentioned, this is hard. Perhaps Ant will help here (but perhaps not). Ant does seem to help with running unit tests. However, it does not help with multi-platform tests. For that you need many machines and different operating environments. Toward that end, I have created a multi-platform test that can be run from web start, located at: http://show.docjava.com:8086/book/cgij/code/jnlp/serialPort.PortTest.jnlp This is interesting because many people in the community can run the test and we can improve the test, as time permits. No, it is not a perfect solution, however, the idea does help with multi-platform tests using many machines and different operating environments. If the group has a good test for a general serial port set-ups, i would be happy to deploy it, for general evaluation using web start. And as for ANT, it is just an idea. Not all my ideas are good ones! - Doug >Hello, > >I think that the make-based build process is fine as it is, apart >from the location of the Java >source files. It is true that putting the Java source in a directory >structure that map 1-to-1 to >the Java package structure is the norm and should make it easier for >everyone to modify the Java >source, with or without an IDE. > >Ant is a good tool, but in the RXTX case I fail to see the advantage >of using it compared to the >current make-based process. As Trent said, they are more pressing >issues, like testing. > >Regards, >David > >Dmitry Markman wrote: >> if I understands the issue right >> in order to be able to use ant for c/c++ compilation >> you have to install ant's cc task >> http://ant-contrib.sourceforge.net/cc.html >> >> it looks like it should work on mac os x >> (authors claim, that it's platform independent) >> but I never tested >> >> so all you have to do it's providing right command line >> for the gcc compiler >> >> >> >> >> On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: >> >>>> rxtx_root_directory >>>> `-- src >>>> |-- main >>>> | `-- java >>>> | `-- gnu >>>> | `-- io >>>> `-- test >>>> `-- java >>>> `-- gnu >>>> `-- io >>>> >>> >>> >>>> From what I understand this will just be good. >>> >>> For me it makes no difference. So lets do the rxtx thing. Let if >>> fester for two weeks and if nobody objects, we will do it. >>> >>> I'm not doing this because I care. I'm doing this to eliminate much >>> of my inbox. >>> >>> But test... man is rxtx lacking there in the community aspect. It is >>> covered but not right. _maybe_ I can change that this year. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> (cat hurding since 1997) > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From matt.higgins at gmail.com Tue Feb 7 08:28:34 2006 From: matt.higgins at gmail.com (Matt Higgins) Date: Tue, 7 Feb 2006 10:28:34 -0500 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final Message-ID: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? import java.io.*; import java.util.*; import gnu.io.*; public class MySimpleRead implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; public static void main(String[] args) { boolean portFound = false; String defaultPort = "COM1"; if (args.length > 0) { defaultPort = args[0]; } portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; MySimpleRead reader = new MySimpleRead(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } } public MySimpleRead() { try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) { e.printStackTrace(); } try { inputStream = serialPort.getInputStream(); } catch (IOException e) { e.printStackTrace(); } try { serialPort.addEventListener(this); } catch (TooManyListenersException e) { e.printStackTrace(); } try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { e.printStackTrace(); } System.out.println("Baud is " + serialPort.getBaudRate()); System.out.println("Bits is " + serialPort.getDataBits()); System.out.println("Stop is " + serialPort.getStopBits()); System.out.println("Par is " + serialPort.getParity()); serialPort.notifyOnDataAvailable(true); readThread = new Thread(this); readThread.start(); } public void run() { // Thread.sleep(20000); //} catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { System.out.println("An event occurred " + event.getEventType()); switch (event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: byte[] readBuffer = new byte[20]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } System.out.print(new String(readBuffer)); } catch (IOException e) {} break; } } } --------------- Result on windows ------------------------------ Stable Library ============================================================== Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port:: COM1 Baud is 9600 Bits is 8 Stop is 1 Par is 0 ----------------- End Results ----------------------------------------- ------------------ Result on Linux ----------------------------------- Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 Found port: /dev/ttyS0 Baud is 9600 Bits is 8 Stop is 1 Par is 0 An event occurred 1 043100066224 ------------------ End Results --------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/a1431630/attachment-0020.html From brian at mbari.org Tue Feb 7 09:48:37 2006 From: brian at mbari.org (Brian Schlining) Date: Tue, 7 Feb 2006 08:48:37 -0800 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> Message-ID: <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> Hi Matt > The following code works fine on Linux but I never see any data > when run on Windows. This is a cut and paste from the SimpleRead > example. > I am attempting to read data from a bar code scanner. I can fire > up HyperTermianl on windows and see that the device is working > properly as I see the barcodes are scanned and echoed back to the > terminal. However when I run the app I don't see any data. It is > however associating with the com port as the informational bits > print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. Cheers Brian Schlining Software Engineer http://www.mbari.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/16d07f37/attachment-0020.html From lux at diesel-research.com Tue Feb 7 11:59:58 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 11:59:58 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139293215.3689.4.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> Message-ID: <1139338798.8145.4.camel@zd7280> Any ideas on this ? Any reason why portList.hasMoreElements() should be false even though there are devices in /dev ? On Mon, 2006-02-06 at 23:20 -0700, Kim Lux wrote: > I'm running the code below. > > portlist.hasMoreElements() is false. > > /dev has ports in it as listed below. > > What am I doing wrong ? > > > ========================================================== > // Step through the list of ports until we find one that matches > // the one we are looking for. > > portList = CommPortIdentifier.getPortIdentifiers(); > > while(portList.hasMoreElements()) > { > portID = (CommPortIdentifier) portList.nextElement(); // > if (portID.getName().equals("/dev/ttyUSB0")) > { > myTA.append("Serial port ttyUSB0 has been found\n"); > break; > }// if portID equals... > }// End of while... > ========================================================== > > ls -al /dev/tty* > crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty > crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 > crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 > crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 > crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 > ... > crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 > crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 > crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 > > > -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 12:20:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 12:20:25 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139338798.8145.4.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> Message-ID: On Tue, 7 Feb 2006, Kim Lux wrote: > > Any ideas on this ? Any reason why portList.hasMoreElements() should be > false even though there are devices in /dev ? > > > On Mon, 2006-02-06 at 23:20 -0700, Kim Lux wrote: >> I'm running the code below. >> >> portlist.hasMoreElements() is false. >> >> /dev has ports in it as listed below. >> >> What am I doing wrong ? >> >> >> ========================================================== >> // Step through the list of ports until we find one that matches >> // the one we are looking for. >> >> portList = CommPortIdentifier.getPortIdentifiers(); >> >> while(portList.hasMoreElements()) >> { >> portID = (CommPortIdentifier) portList.nextElement(); // >> if (portID.getName().equals("/dev/ttyUSB0")) >> { >> myTA.append("Serial port ttyUSB0 has been found\n"); >> break; >> }// if portID equals... >> }// End of while... >> ========================================================== >> >> ls -al /dev/tty* >> crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty >> crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 >> crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 >> crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 >> crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 >> ... >> crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 >> crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 >> crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 >> >> >> > Hi Kim What rxtx does is try to open the port and do a timed out read. If the kernel/... do not complain it's enumarted. I suspect you could do a crude test by doing something like cat /dev/ttyS0 > /dev/null If that barfs then rxtx wont enumerate the port. hmm looking at your question again, I suspect it's a lockfile problem. This is documented in INSTALL with the source. Its easy enough to test this too.. touch /var/lock/testingrxtxlockfiles && rm -f /var/lock/testingrxtxlockfiles If you are not in the right group it will bail. Root will work regardless. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 12:37:56 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 12:37:56 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> Message-ID: <1139341076.8145.11.camel@zd7280> Exactly which ports does rxtx attempt to put into the list ? /dev/* or /dev/tty* or /dev/tty[0-9[0-9] ? or /dev/ttyS* ? For the record, only /dev/ttyUSB0 is a valid port on the machine I am presently on. Will this be a problem ? On Tue, 2006-02-07 at 12:20 -0700, Trent Jarvi wrote: > This is documented in INSTALL with the source. > I was wondering where that file was. I will download source and dig it up. Thanks. -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 12:51:09 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 12:51:09 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139341076.8145.11.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: On Tue, 7 Feb 2006, Kim Lux wrote: > > Exactly which ports does rxtx attempt to put into the list ? /dev/* > or /dev/tty* or /dev/tty[0-9[0-9] ? or /dev/ttyS* ? > > For the record, only /dev/ttyUSB0 is a valid port on the machine I am > presently on. Will this be a problem ? > > > On Tue, 2006-02-07 at 12:20 -0700, Trent Jarvi wrote: >> This is documented in INSTALL with the source. >> > I was wondering where that file was. I will download source and dig it > up. > > Thanks. > Hmm I'm looking at pre17 so this may have changed. (its just what I have on this machine) if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA" // for the IPAQs }; CandidatePortPrefixes=Temp; } So you may need to add "ttyUSB" to that list. RXTX used to enumerate _everything_ see if(osName.equals("Linux-all-ports") But it became less than practical. This is all in RXTXCommDriver.java hmm I just did a cvs update. if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have to get your fingers into the code. We aim for sane defaults. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 13:06:45 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 13:06:45 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139342805.8145.22.camel@zd7280> On Tue, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > Hmm I'm looking at pre17 so this may have changed. (its just what I have > on this machine) > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA" // for the IPAQs > }; > CandidatePortPrefixes=Temp; > } > > > So you may need to add "ttyUSB" to that list. RXTX used to enumerate > _everything_ see if(osName.equals("Linux-all-ports") But it became less > than practical. > > This is all in RXTXCommDriver.java > > hmm I just did a cvs update. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have > to get your fingers into the code. We aim for sane defaults. Excellent. Thanks for taking the time. -- Kim Lux, Diesel Research Inc. From ideiglenes1 at freemail.hu Tue Feb 7 13:53:39 2006 From: ideiglenes1 at freemail.hu (--) Date: Tue, 07 Feb 2006 21:53:39 +0100 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139345619.22534.2.camel@localhost> Hi! I use this code to get all the extra Linux devices. :) if ("Linux".equals(System.getProperty("os.name"))) { System.setProperty("os.name","Linux-all-ports"); } driver = new RXTXCommDriver(); On k, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > On Tue, 7 Feb 2006, Kim Lux wrote: > > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have > to get your fingers into the code. We aim for sane defaults. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From matt.higgins at gmail.com Tue Feb 7 13:45:54 2006 From: matt.higgins at gmail.com (Matt Higgins) Date: Tue, 7 Feb 2006 15:45:54 -0500 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> Message-ID: <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> Sweet this is exactly what I needed. I was searching the archives through marc.theamisgroup they only have archives back to 1/3/05. Should have hit the mailman archive! Thanks a lot! On 2/7/06, Brian Schlining wrote: > > Hi Matt > > The following code works fine on Linux but I never see any data when run > on Windows. This is a cut and paste from the SimpleRead example. > I am attempting to read data from a bar code scanner. I can fire up > HyperTermianl on windows and see that the device is working properly as I > see the barcodes are scanned and echoed back to the terminal. However when I > run the app I don't see any data. It is however associating with the com > port as the informational bits print fine? > > > You're not the only one whose had this problem, I don't know if Trent has > addressed this is the latest release of RXTX but there is a workaround. > Here's the recent thread from the RXTX mailing list regarding this issues: > > Thanasis Delenikas tdelenik at gmail.com > Wed Jan 18 13:56:23 MST 2006 > > * Previous message: [Rxtx] Re: More close() performance fixes > * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] > > Hi all. > (I've subscribed again from my other email account). > > Trent, > > You are right. Linux *always* works, no matter what flow control you set. > Windows *works only* with hardware flow control (I haven't tested what > happens with software XON/XOFF flow control). > > I assume (but I am not certain) that even with no flow control at all, all > platforms should work. Without flow control, you have the risk of bumping > into overflow or framing errors, but that's your (the end programmer, I > mean) problem. > > >From my side, I shouldn't be working without flow control. That was a bug > too... It was some code forgotten from the old times, when I used to work > with phone emulation drivers which didn't support flow control. The > correct > way is to have some flow control enabled and that's why I suppose this is > a > low-severity bug for RxTx. > > I have no idea which platform shows the correct behaviour, since > my knowledge about Linux and the inner workings of these low-level i/o > operations is limited. > > Regards, > Thanasis Delenikas. > > > > > Message: 2 > > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > > From: Trent Jarvi > > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > > To: RXTX Developers and Users > > Message-ID: > > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > > > Hi all, > > > > > > Trent, I have found something. > > > I read your comment about flow control, so I experimented a bit. > > > > > > If you remember, in my sample program I've used no flow control at all > ( > > i.e. > > > Java constant FLOWCONTROL_NONE). > > > > > > Now, during testing, I've switch to hardware inbound flow control (i.e > . > > Java > > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > > beautifully! > > > > > > I think I will switch to H/W flow control and test things for a while, > > but > > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > > > > > Hi Thanasis, > > > > I'm fairly sure you have identified a bug. I would not worry too much > > about what Sun CommAPI w32 defaults are. I think they did more or less > > whatever the port opened with. Just a guess. Linux tries to stomp on > > ports so they are all the same. > > > > So this started out with Linux worked, Windows XP/.. did not as I > recall. > > Something is wrong in rxtx. Do I understand this right? > > > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > > > Perhaps there is something Wayne or I did not understand when we wrote > > that code. I wasnt programming back in the BBS days so modems are not > my > > thing. I have a few questions. > > > > Is the above matrix confirmed by observation? > > Linux just always worked? > > Which one _should_ work? I'm guessing modems work with hardware flow > > control. I'll have to dig around. > > > > The windows flow control changes a couple things with hardware flow > > control. Following the w32 API documentation is confusing sometimes. > > But it looks like Linux could have a bug too. > > Cheers > > Brian Schlining > Software Engineer > http://www.mbari.org > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/9c989144/attachment-0020.html From tjarvi at qbang.org Tue Feb 7 14:06:14 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 14:06:14 -0700 (MST) Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> Message-ID: >> >> You're not the only one whose had this problem, I don't know if Trent has >> addressed this is the latest release of RXTX but there is a workaround. >> Here's the recent thread from the RXTX mailing list regarding this issues: >> I have not. I expect to have access to some test equipment next month and I'll go through all of this. I really don't know whats going on and I need a gold standard. I thought maybe linux was autodetecting the flow control. Your observations would certainly be welcome. I need to talk to Russell King and see what he is doing. Until then I'd just be toying around over a loopback as usual. This is very high on the list though. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 17:25:05 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 17:25:05 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139358305.17994.2.camel@zd7280> My application now works. I installed the libraries and jar from 2.1-7 (Final). portlist.hasMoreElements is no longer false. The application finds the port for /dev/ttyUSB0. Thanks for your help, Trent (et al) Sorry I bothered you with this. Next time I will look in the source first. I didn't think it was an rxtx issue, I thought it was a Linux setup issue . On Tue, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > Hmm I'm looking at pre17 so this may have changed. (its just what I > have > on this machine) > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux > Serial Ports > "ttySA" // for the > IPAQs > }; > > CandidatePortPrefixes=Temp; > } > > > So you may need to add "ttyUSB" to that list. RXTX used to enumerate > _everything_ see if(osName.equals("Linux-all-ports") But it became > less > than practical. > > This is all in RXTXCommDriver.java > > hmm I just did a cvs update. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux > Serial Ports > "ttySA", // for the > IPAQs > "ttyUSB" // for USB > frobs > }; > > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you > have > to get your fingers into the code. We aim for sane defaults. -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 19:21:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 19:21:54 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139358305.17994.2.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> <1139358305.17994.2.camel@zd7280> Message-ID: >Sorry I bothered you with this. Next time I will look in the source >first. I didn't think it was an rxtx issue, I thought it was a Linux >setup issue . Why would you be sorry? I would have done the same. I'm glad it's working :) -- Trent Jarvi tjarvi at qbang.org From tma at mail.island.net Wed Feb 8 13:39:35 2006 From: tma at mail.island.net (Tom Alldread) Date: Wed, 08 Feb 2006 12:39:35 -0800 Subject: [Rxtx] Win32/Linux Serial Port Data Dropouts In-Reply-To: <200602060702.k167255O007882@www.qbang.org> References: <200602060702.k167255O007882@www.qbang.org> Message-ID: <43EA5707.4020200@mail.island.net> Greetings Folks at RXTX: During the last couple of months I have been alternately testing with javax.comm 2 and RXTX 2.1 under Windows XP and CommApi 3 and RXTX 2.1 under Suse 10.0 Linux. In the process I have learned a little about java multi-threading under NetBeans 5 with Profiler. My java (jdk 1.5_06) application is used for data acquisition and provides a graphical display of A-D conversion data received from a 56KBaud serial port. The actual data throughput is about 10KBaud thus it is well below the speed of the port. I use hardware RTS/CTS flow control which can stall the data acquisition sample rate if necessary. This ensures the display computer has the ability to slow the data acquisition rate should it become too busy to accept the regular data flow. Both the serial port buffer and the java read buffer are set at 16KB. Usually the data transfers into the java read buffer are less than 100 bytes unless the data acquisition is recovering from a stall. The data flow normally hesitates after each 5 KB block as a continue command is needed from the display computer to start the drawing of a new graphics display line. Separate threads have been provided for the serial port event monitoring and data processing. The serial port event thread has been given the maximum priority and data processing thread the minimum priority provided by java. Thread yield statements have been placed within all data processing while/for loops as an effort to ensure quick access to CPU cycles for the serial port event thread. I have found that short data transmissions are essentially error free but occasional dropouts occur with continuous data flow especially under Windows XP. ....................................................................................................................................................................................... Linux results: I am happy to report that RXTX 2.1 appears to work very well under Linux although I did notice some errors when the screen savers were running with my dual monitors. I believe this is a local problem associated with my dual graphics which needs further attention. The recent CommApi 3 Linux release from Sun did not work at all with my program. It seemed to send commands out OK but did not receive any data. Although the serial port event triggered the ISR, the input stream appeared filled with nulls and thus did not contain any data. As my understanding is that CommApi 3 was tested with a Red Hat distribution of Linux I wonder if this problem is distro dependent? Although somewhat off topic here I wonder if anyone reading this has had similar experience? .................................................................................................................................................................................. Windows XP results: There are problems with occasional data dropouts which become more frequent as the sampling rate is increased or if the computer becomes busy with other duties. The dropouts typically consist of a half dozen byte block of lost data. It appears the lost bytes never get added to the java input stream. There has not been any indication of garbled data, overruns or framing errors which suggests the UART communications remains solid. Using javax.comm 2 I found that the setting of SerialPort 'enableReceiveThreshold' to 40 and 'enableReceiveTimeout' of 100mS reduced the dropouts error rate significantly. I found that I could not get RXTX 2.1 to function with the aforementioned threshold and timeout settings. The javax.comm 2 interface is consequently performing better for me under Windows than RXTX 2.1. I wonder if anyone here has any suggestions as to what I might try to improve RXTX 2.1? Although my settings are the same as under Suse 10.0, RXTX 2.1 performs much better for me under Linux than any of the alternatives that I have tried under Windows XP . ............................................................................................................................................................................... I would like to establish, based on the experience of others, if I have reached the normally expected performance limit of java serial port communications? Should I expect to achieve virtually error free serial port data input from a continuous stream under Windows XP java software? I am considering changing my protocol to packets with error checking if necessary but would like to know if the dropout problems I am experiencing are typical or not before I take this rather work intensive plunge. Many thanks in advance for any help! Best Regards, Tom Alldread -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.375 / Virus Database: 267.15.2/253 - Release Date: 2006-02-07 From jlaxson at mac.com Wed Feb 8 23:56:48 2006 From: jlaxson at mac.com (John Laxson) Date: Thu, 9 Feb 2006 00:56:48 -0600 Subject: [Rxtx] PortInUseException: Unknown Application on OSX Message-ID: Hi, I've been trying to get RXTX 2.1.7 going on Mac OS X for a while here, and am running up into a wall here. I've tried with pre- compiled and the source version and get the same problem, a gnu.io.PortInUseException: Unknown Application. I have run the fixperms script included with the source distribution, and id shows me as a member of the uucp group, and permissions on /var/spool/uucp are 775 root:uucp. Running a test program (included at the bottom for clarity) lets me enumerate all the serial ports correctly, but trying to open any of them gives the PortInUseException. If it helps, when I try to open a port that's set to make an outgoing bluetooth connection, there is no delay and no connection attempt at all. Thanks, John Laxson PS: The documentation wiki on qbang.org shows 404, and has for a few days now. My test code: public static void main(String[] args) { SerialPort serialPort; try { Enumeration e = CommPortIdentifier.getPortIdentifiers(); CommPortIdentifier ident; while (e.hasMoreElements()) { ident = (CommPortIdentifier)e.nextElement(); System.out.println(ident.getName()); } ident = CommPortIdentifier.getPortIdentifier("/dev/cu.modem"); serialPort = (SerialPort) ident.open("Me", 5000); } catch (Exception e) { e.printStackTrace(); } } From rajesh.invincible at gmail.com Thu Feb 9 03:39:38 2006 From: rajesh.invincible at gmail.com (Rajesh N) Date: Thu, 9 Feb 2006 16:09:38 +0530 Subject: [Rxtx] Re: Move .java Files in gnu.io filesystem hierarchy - Maven (2) In-Reply-To: <43DF21D2.7090200@ngi.it> References: <43DF21D2.7090200@ngi.it> Message-ID: <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Can anybody tell me how to overcome these EXCEPTIONS I AM WORKING ON SERIAL COMMN IN JAVA ON LINUX. 1. " NOT ALL PARAMETERS SUPPORTED BY THE KERNEL" This i came across the following statement inmy prog. SerialP is A SerialPort object SerialP.setSerialPortParams(9600(BAUDRATE),DATABITS_8,STOPBITS_1,PARITY_NONE) 2. NullPointer Exception at Event Dispatch Now i have checked all my object references for a null reference but i found none i have put up my entire code in try catch blocks but still I AM UNABLE TO CATCH THIS EXCEPTION AND HENCE MY APPLICATION CLOSES HOW DOES THESE GO? PLEASE HELP ME IT IS URGENTTTTTTTTTTTTTTTT yours sincerely RAJESH On 1/31/06, Fabio Frumento wrote: > Hi Xavier, > > I don't know maven at all but the directory hierarchy listed buy Trent > is fine for me... > > I'll take a look to maven, it seems an interesting project > > Regards > > Fabio Frumento > > Trent Jarvi wrote: > > On Tue, 31 Jan 2006, Xavier Frisaye wrote: > > > >> Hi all, > >> > >> If you are going to rearrange the src folder, i will propose to use > >> maven 2 and follow its directory structure > >> > (http://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html). > >> > >> Maven 2 simplify java project and give a standard way to make projects > >> (http://maven.apache.org/). > >> We are using it for internal projects and we are very satisfied. > >> > >> Is anybody interested? > >> > >> I'm not an expert in maven 2 (yet) but i'm agree to help using it if > >> you choose to make so. > >> > > > > so this would be: > > > > rxtx-devel/src/main/java/gnu.io > > rxtx-devel/src/test/java/ManIwish.java > > > > I don't use IDEs very much so I'll let others comment. But I don't see > > a problem with that. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Thu Feb 9 09:50:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 9 Feb 2006 09:50:31 -0700 (MST) Subject: [Rxtx] Re: Move .java Files in gnu.io filesystem hierarchy - Maven (2) In-Reply-To: <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Message-ID: On Thu, 9 Feb 2006, Rajesh N wrote: > Can anybody tell me how to overcome these EXCEPTIONS > I AM WORKING ON SERIAL COMMN IN JAVA ON LINUX. > > 1. " NOT ALL PARAMETERS SUPPORTED BY THE KERNEL" > > This i came across the following statement inmy prog. > SerialP is A SerialPort object > SerialP.setSerialPortParams(9600(BAUDRATE),DATABITS_8,STOPBITS_1,PARITY_NONE) > Strange. The parameters you use are the same the port should open with by default. Could you paste the actual exception you are getting? I don't see that in the rxtx source. Also it would help to know the rxtx version. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Fri Feb 10 15:29:05 2006 From: lux at diesel-research.com (Kim Lux) Date: Fri, 10 Feb 2006 15:29:05 -0700 Subject: [Rxtx] One serial port object for both sending and receiving ? Message-ID: <1139610545.18177.4.camel@zd7280> Is it OK to use one SerialPort ojbect (ex Serial Port serialPort;) and use it for both sending and receiving ? For example: ======================================================================== static SerialPort serialPort = null; static OutputStream serialOut = null; static InputStream serialIn = null; // assign it to an outputStream for use try{ serialOut = serialPort.getOutputStream(); System.out.println("Serial output stream has been assigned."); }//try catch(IOException e) { System.out.println("Error: Couldn't assign output stream to serial port."); }//catch //assign it to an inputStream for use try{ serialIn = serialPort.getInputStream(); System.out.println("Serial input stream has been assigned."); }//try catch(IOException e) { System.out.println("Error: Couldn't assign input stream to serial port."); }//catch ======================================================================== -- Kim Lux, Diesel Research Inc. From lux at diesel-research.com Fri Feb 10 21:23:00 2006 From: lux at diesel-research.com (Kim Lux) Date: Fri, 10 Feb 2006 21:23:00 -0700 Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Message-ID: <1139631780.23882.10.camel@zd7280> I've got a problem receiving chars with my version of serialRead, written in an SWT GUI. I had a Java pro have a good look at my code and he can't see anything wrong with it. I can send chars fine. When I receive a char the cpu usage for the app goes to 100% and the code in the serial event handler doesn't get executed. The instructions on the Java Comm Serial API How-To for Linux page state that I must install javacomm. Is that true ? Everything builds without it and I can send chars on rxtx just fine, but I can't receive them. Could this be the problem ? I downloaded and installed javacomm. I was not able to add "Driver=gnuio.RXTXCommDriver to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 installed in /usr/java/jre1.5.0_05. I added comm.jar to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext to the library paths. Is this OK ? Does it matter that I am receiving on /dev/ttyUSB0 ? Thanks. -- Kim Lux, Diesel Research Inc. From lunareclipse03 at web.de Sat Feb 11 09:44:46 2006 From: lunareclipse03 at web.de (lunareclipse03@web.de) Date: Sat, 11 Feb 2006 17:44:46 +0100 Subject: [Rxtx] Question about Serial I/O under Win32 Message-ID: <662084330@web.de> Hello everybody, I have a strange problem with a piece of code I made for myself. No, this is not really concerning rxtx, but nevertheless I post this to the list, hoping that some of you can help me. I've written two libraries, one for linux and one for win32. The linux port works quite well, I can send / receive faxes and / or replay voice messages over the telephone line using a voice modem. But the win32 port of the library causes some trouble. If, for example, I send out a fax with a certain modem under linux, it works well. The fax is complete when it comes out of the fax machine. If I then use the same modem to send out a fax under win32, the fax coming out of the fax machine gets "stuck" halfways, but the sending modem thinks that transmission was ok and drops the connection. The answering fax machine then gives me "error while receiving." The "upper layer" java code MUST be right, because if I do the same thing under linux (using the linux library), everything is alright. Now I have to ask: Can somebody please help me out with this??!? Could it be the case that some kind of flow control or COMMTIMEOUTS setting causes this behaviour? I set flow control to RTS/CTS before sending out a fax. How can I DISABLE flow control? Or what do you think? Can something else cause this problems? Thank you all for your time and PLEASE write back soon. Regards, --Sven Ahlemann Am Waldrand 31 45721 Haltern am See Germany ______________________________________________________________ Verschicken Sie romantische, coole und witzige Bilder per SMS! Jetzt bei WEB.DE FreeMail: http://f.web.de/?mc=021193 From lux at diesel-research.com Sat Feb 11 10:06:52 2006 From: lux at diesel-research.com (Kim Lux) Date: Sat, 11 Feb 2006 10:06:52 -0700 Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: <1139631780.23882.10.camel@zd7280> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> <1139631780.23882.10.camel@zd7280> Message-ID: <1139677612.3431.5.camel@zd7280> More on this problem. I copied and pasted simpleRead into a console based Eclipse project and I've got the same result, except that cpu usage doesn't go to 100%. I'm beginning to think there is an issue in rxtx. My imports for simpleRead are: ============================ import gnu.io.*; import java.util.*; //import javax.comm.*; import java.io.*; =========================== Any ideas ? I am trying to read from /dev/ttyUSB0 using a serial to USB adapter which has worked well with minicom and gtkterm. Thanks. On Fri, 2006-02-10 at 21:23 -0700, Kim Lux wrote: > I've got a problem receiving chars with my version of serialRead, > written in an SWT GUI. > > I had a Java pro have a good look at my code and he can't see anything > wrong with it. > > I can send chars fine. When I receive a char the cpu usage for the app > goes to 100% and the code in the serial event handler doesn't get > executed. > > The instructions on the Java Comm Serial API How-To for Linux page state > that I must install javacomm. Is that true ? Everything builds without > it and I can send chars on rxtx just fine, but I can't receive them. > Could this be the problem ? > > I downloaded and installed javacomm. I was not able to add > "Driver=gnuio.RXTXCommDriver > to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not > have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 > installed in /usr/java/jre1.5.0_05. I added comm.jar > to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext > to the library paths. Is this OK ? > > Does it matter that I am receiving on /dev/ttyUSB0 ? > > Thanks. > -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Sun Feb 12 21:01:33 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:01:33 -0700 (MST) Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: <1139677612.3431.5.camel@zd7280> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> <1139631780.23882.10.camel@zd7280> <1139677612.3431.5.camel@zd7280> Message-ID: I suspect what is happening is the select() is breaking out in the native code but the driver does not have support for notifying there are X bytes available. On some traditional Unix based systems, the only way you know data is available is the fd status changes and do an FIORDCHK ioctl. Or perhaps the only thing you can know is the fd status changed. It would take reading through the kernel driver code to know for sure. So on USB, depending upon the driver, the same may need to be done or the driver improved a bit if possible to support. Polling reads will also work but don't use the event driven model of CommAPI which isnt acceptable in the long run. The 100% cpu usage can then be explained because select no longer blocks until the data is read; the eventLoop spins loose. You can put a well placed sleep but rxtx only expects those are needed when it knows data is available. This may not be a super simple thing to understand and fix. I do have ideas to get you started. I'm going to be short on time the next couple weeks. I expect to put some good time in and answer some other questions I saw around the 25th. For now, I'd look at the following and go from there with the hints I've given. JNIEXPORT jint JNICALL RXTXPort(nativeavailable)( JNIEnv *env, jobject jobj ) { int fd = get_java_var( env, jobj,"fd","I" ); int result; /* char message[80]; ENTER( "RXTXPort:nativeavailable" ); On SCO OpenServer FIONREAD always fails for serial devices, so try ioctl FIORDCHK instead; will only tell us whether bytes are available, not how many, but better than nothing. This turns out to be true on Solaris also. taj. */ #ifdef FIORDCHK /* __unixware__ __sun__ probably others */ result = ioctl(fd, FIORDCHK, 0); #else if( ioctl( fd, FIONREAD, &result ) < 0 ) { goto fail; } #endif /* FIORDCHK */ On Sat, 11 Feb 2006, Kim Lux wrote: > > More on this problem. I copied and pasted simpleRead into a console > based Eclipse project and I've got the same result, except that cpu > usage doesn't go to 100%. I'm beginning to think there is an issue in > rxtx. > > My imports for simpleRead are: > > ============================ > import gnu.io.*; > import java.util.*; > //import javax.comm.*; > import java.io.*; > =========================== > > Any ideas ? I am trying to read from /dev/ttyUSB0 using a serial to > USB adapter which has worked well with minicom and gtkterm. > > Thanks. > > > > On Fri, 2006-02-10 at 21:23 -0700, Kim Lux wrote: >> I've got a problem receiving chars with my version of serialRead, >> written in an SWT GUI. >> >> I had a Java pro have a good look at my code and he can't see anything >> wrong with it. >> >> I can send chars fine. When I receive a char the cpu usage for the app >> goes to 100% and the code in the serial event handler doesn't get >> executed. >> >> The instructions on the Java Comm Serial API How-To for Linux page state >> that I must install javacomm. Is that true ? Everything builds without >> it and I can send chars on rxtx just fine, but I can't receive them. >> Could this be the problem ? >> >> I downloaded and installed javacomm. I was not able to add >> "Driver=gnuio.RXTXCommDriver >> to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not >> have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 >> installed in /usr/java/jre1.5.0_05. I added comm.jar >> to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext >> to the library paths. Is this OK ? >> >> Does it matter that I am receiving on /dev/ttyUSB0 ? >> >> Thanks. >> > From tjarvi at qbang.org Sun Feb 12 21:03:30 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:03:30 -0700 (MST) Subject: [Rxtx] One serial port object for both sending and receiving ? In-Reply-To: <1139610545.18177.4.camel@zd7280> References: <1139610545.18177.4.camel@zd7280> Message-ID: On Fri, 10 Feb 2006, Kim Lux wrote: > > Is it OK to use one SerialPort ojbect (ex Serial Port serialPort;) and > use it for both sending and receiving ? > > For example: > > ======================================================================== > static SerialPort serialPort = null; > static OutputStream serialOut = null; > static InputStream serialIn = null; > > > > > // assign it to an outputStream for use > try{ > serialOut = serialPort.getOutputStream(); > System.out.println("Serial output stream has been assigned."); > }//try > catch(IOException e) > { > System.out.println("Error: Couldn't assign output stream to serial > port."); > }//catch > > > //assign it to an inputStream for use > try{ > serialIn = serialPort.getInputStream(); > System.out.println("Serial input stream has been assigned."); > }//try > catch(IOException e) > { > System.out.println("Error: Couldn't assign input stream to serial > port."); > }//catch This should be fine. In fact trying to do it another way will probably not work as you will run into lockfile issues. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun Feb 12 21:13:13 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:13:13 -0700 (MST) Subject: [Rxtx] Question about Serial I/O under Win32 In-Reply-To: <662084330@web.de> References: <662084330@web.de> Message-ID: On Sat, 11 Feb 2006 lunareclipse03 at web.de wrote: > Hello everybody, > > I have a strange problem with a piece of code I made for myself. No, > this is not really concerning rxtx, but nevertheless I post this to the > list, hoping that some of you can help me. I've written two libraries, > one for linux and one for win32. The linux port works quite well, I can > send / receive faxes and / or replay voice messages over the telephone > line using a voice modem. But the win32 port of the library causes some > trouble. If, for example, I send out a fax with a certain modem under > linux, it works well. The fax is complete when it comes out of the fax > machine. If I then use the same modem to send out a fax under win32, the > fax coming out of the fax machine gets "stuck" halfways, but the sending > modem thinks that transmission was ok and drops the connection. The > answering fax machine then gives me "error while receiving." The "upper > layer" java code MUST be right, because if I do the same thing under > linux (using the linux library), everything is alright. Now I have to > ask: Can somebody please help me out with this??!? Could it be the case > that some kind of flow control or COMMTIMEOUTS setting causes this > behaviour? I set flow control to RTS/CTS before sending out a fax. How > can I DISABLE flow control? Or what do you think? Can something else > cause this problems? Thank you all for your time and PLEASE write back > soon. > Hi Sven I'm not too willing to talk about flow control at the low level until I confirm some things with test equipment later. It is not clear if you are using rxtx or writing your own native code. So I'm not sure how to answer much of this :) If you are wondering how to change the flow control using rxtx from java, The BlackBox example from Sun flips this back and forth. SerialPort.java in rxtx 2.1 uses the following: SerialPort.java: public static final int FLOWCONTROL_NONE =0; SerialPort.java: public static final int FLOWCONTROL_RTSCTS_IN =1; SerialPort.java: public static final int FLOWCONTROL_RTSCTS_OUT =2; SerialPort.java: public static final int FLOWCONTROL_XONXOFF_IN =4; SerialPort.java: public static final int FLOWCONTROL_XONXOFF_OUT=8; So if you set flowcontrol to RTSCTS, you can set it to NONE to turn it off. If you are looking for how to do it in native code, the rxtx Source is SerialImp.c (unix/linux/mac os x/w32) and termios.c (w32 only with SerialImp.c) You can track the code: SerialImp.c:JNIEXPORT void JNICALL RXTXPort(setflowcontrol)( JNIEnv *env, jobject jobj, jint flowmode ) termios.c:int tcgetattr( int fd, struct termios *s_termios ) termios.c:int tcsetattr( int fd, int when, struct termios *s_termios ) There may be a problem in the rxtx flow control code though. Rather than guess, I want to test this with a gold standard. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Feb 6 00:00:16 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 00:00:16 -0700 (MST) Subject: [Rxtx] wiki delay until tomorrow night. In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: On Sun, 5 Feb 2006, Trent Jarvi wrote: > On Sun, 5 Feb 2006, Kim Lux wrote: > >> usb ? Tell me more... I need that too. > > usb is a very proper design. Thats all it is. > Maybe rxtx could help usb. But it would start with helping bring back the community that was already there. It's not something I'd love to do but maybe its the right thing to do. It would probably take 2 years to do right. But maybe thats better than what we have now. I honestly don't know what IBM is doing which could just run over everything. Just some thoughts after some fine german wine. -- Trent Jarvi tjarvi at qbang.org From gadelavega at yahoo.com.ar Mon Feb 6 02:17:05 2006 From: gadelavega at yahoo.com.ar (Gonzalo A. de la Vega) Date: Mon, 06 Feb 2006 10:17:05 +0100 Subject: [Rxtx] Serial port ownership question In-Reply-To: References: <20060205113618.30274.qmail@web53501.mail.yahoo.com> <1139157422.4553.9.camel@zd7280> <1139158698.4936.9.camel@zd7280> Message-ID: <43E71411.4050402@yahoo.com.ar> On my Fedora Core 4: ls -l /dev/ttyS* crw-rw---- 1 root uucp 4, 64 Feb 6 2006 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Feb 6 2006 /dev/ttyS1 ... and: grep "ttyUSB" /etc/udev/rules.d/50-udev.rules KERNEL=="ttyUSB*", GROUP="uucp", MODE="0660" So anyone in the "uucp" group can use serial ports. On Gentoo the group is "tty". Trent Jarvi escribi?: > > > On Sun, 5 Feb 2006, Dr. Douglas Lyon wrote: > >> I can confirm that this is the case (only root ownership of >> serial ports, under fedora 4). >> Wow, what were they thinking?! >> - DL >> >>> I've found that the newer kernels have the serial ports owned by root. >>> For example, >>> >>> $ls -al /dev/tty* >>> crw-rw-rw- 1 root root 5, 0 Feb 5 02:06 /dev/tty >>> crw-rw---- 1 root root 4, 0 Feb 5 02:06 /dev/tty0 >>> crw------- 1 root root 4, 1 Feb 5 09:07 /dev/tty1 >>> crw-rw---- 1 root tty 4, 10 Feb 5 02:06 /dev/tty10 >>> crw-rw---- 1 root tty 4, 11 Feb 5 02:06 /dev/tty11 >>> ... > > > This is just not a problem jcp or such are going to solve. Its a > platform spitwad fight. But do look at pam. In fact thats what Sun > is doing too. Maybe Linux followed their lead.. I'm not a pam guy. > I've spent 16 hours trying to understand it but your users wont :) > > Solution? I have no clue. Its two tangent mentalities from my > perspective. > > -- > Trent Jarvi > tjarvi at qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mtnvega at yahoo.com.br Mon Feb 6 05:35:43 2006 From: mtnvega at yahoo.com.br (Luiz Jr) Date: Mon, 6 Feb 2006 12:35:43 +0000 (GMT) Subject: [Rxtx] Documentation Wiki In-Reply-To: <1139157422.4553.9.camel@zd7280> Message-ID: <20060206123543.57256.qmail@web53515.mail.yahoo.com> Hello, Thank you for you answer, but so the usage of the API is pretty much like the Java Communications Api? If yes, what version of the Java Comm Api? Thank you, Luiz A. Brandao Jr Kim Lux escreveu: On Sun, 2006-02-05 at 08:36 -0300, Luiz Jr wrote: > Hello, > > I want to start using the RXTX libraries, but I would to know how, > since I can not access the documentation wiki page I just started using them yesterday. Below is how I installed the libraries, if that helps. I used snippets of code from the SimpleWrite application here to get me going. http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html Instead of "import javax.comm.*;", use "import gnu.io.*;" which is gotten from RXTXcomm.jar, which you will need to include in your project references. I am working in Eclipse. BTW: there is no way to open a port without going through the port list and finding it. Maybe sometime in the future someone (me ?) will write a method called openSerialPort that allows the user to give a port identifier, such as "/dev/tty1" and return a port ready to use. It wouldn't take much to write that and it would save users a lot of code. Hope this helps. ======================================================================= 1) Figure out which java you are running, incase there is more than one installed. $ java -version java version "1.5.0_05" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_05-b05) Java HotSpot(TM) Client VM (build 1.5.0_05-b05, mixed mode, sharing) 2) Find all the jre directories and the one from which you are currently running. kfind (jre) 3) cd to that directory plus /lib/i386 cd /usr/java/jre1.5.0_05/lib/i386 4) Copy the library files (*.so) to that directory. cp /home/krlux/Desktop/'Java Controls'/rxtx-linux/bin/* . 5) Check that the copy was successful ls librxtx* librxtxI2C.so librxtxRaw.so librxtxSerial.so librxtxParallel.so librxtxRS485.so 6) cd to the /lib/ext directory for your java. cd /usr/java/jre1.5.0_05/lib/ext 7) Copy the Jar files there cp /home/krlux/Desktop/'Java Controls'/rxtx-linux/lib/ext/* . 8) Check that it was successful ls RXTX* RXTXcomm.jar Rxtx is now installed on your machine ready to use. =================================================================== -- Kim Lux, Diesel Research Inc. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx --------------------------------- Yahoo! Acesso Gr?tis - Internet r?pida e gr?tis. Instale o discador agora! -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/544aa403/attachment-0021.html From lyon at docjava.com Mon Feb 6 05:49:34 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 06 Feb 2006 07:49:34 -0500 Subject: [Rxtx] wiki delay until tomorrow night. In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: Hi All, I have often thought about USB drivers being needed. For example, the ironman watch will not interface to a mac (windows only). It is USB. My dymo label writer has no Java driver (native only). Etc. Most cheap web cameras are USB (and Java drivers go through JAI, if it supports the camera at all). The JAI code shows how sun did the USB drivers. You have to be a member of the jai project to download the source code. https://jai.dev.java.net has the jai distro. And then you are not allowed to redistribute it. However, we can all learn from it (if so inclined). Basically: cvs -d :pserver:lyon at cvs.dev.java.net:/cvs login cvs -d :pserver:lyon at cvs.dev.java.net:/cvs checkout jai-core You will need to user your own uid and pw to get in. The ant build has over 100 warnings from sun deprecations of its own code. You might say that they were hoisted on their own Picard ;) One interesting thing is that they support several platforms: linux-amd64 64-bit Linux-AMD64 linux-i586 32-bit Linux-x86 solaris-amd64 64-bit Solaris-AMD64 solaris-i586 32-bit Solaris-x86 solaris-sparc 32-bit Solaris-SPARC solaris-sparcv9 64-bit Solaris-SPARC windows-i586 32-bit Windows-x86 Thus, ant is used to provide a multi-platform native method distro. Neat. How do they do it? check this out: And: The core download does not contain any C source code (it was all pre-built). Basically, they are just copying .so and .dll files into build directories. I would love to see the C code for this...but Sun does not post it on the https://jai.dev.java.net site. I don't know why...Perhaps I missed it. - Doug >On Sun, 5 Feb 2006, Trent Jarvi wrote: > >>On Sun, 5 Feb 2006, Kim Lux wrote: >> >>>usb ? Tell me more... I need that too. >> >>usb is a very proper design. Thats all it is. >> > >Maybe rxtx could help usb. But it would start with helping bring >back the community that was already there. > >It's not something I'd love to do but maybe its the right thing to do. > >It would probably take 2 years to do right. But maybe thats better >than what we have now. > >I honestly don't know what IBM is doing which could just run over everything. > >Just some thoughts after some fine german wine. > >-- >Trent Jarvi >tjarvi at qbang.org > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tdelenik at gmail.com Mon Feb 6 05:56:32 2006 From: tdelenik at gmail.com (Thanasis Delenikas) Date: Mon, 6 Feb 2006 14:56:32 +0200 Subject: Fwd: [Rxtx] Documentation Wiki In-Reply-To: <1139157422.4553.9.camel@zd7280> References: <20060205113618.30274.qmail@web53501.mail.yahoo.com> <1139157422.4553.9.camel@zd7280> Message-ID: <310a1a930602060456t129f1dc6p5f2b908f13ab5a0b@mail.gmail.com> Hello all, Kim, this is a snippet from the code I use. The closest to directly opening a specific port without enumeration. << ... portId = CommPortIdentifier.getPortIdentifier(getPort()); serialPort = (SerialPort) portId.open("jSMSEngine", 1971); ... >> where getPort() return the string identifier of the port, i.e. "/dev/ttyS0" or "COM1" or whatever. Thanasis. ---------- Forwarded message ---------- From: Kim Lux Date: Feb 5, 2006 6:37 PM Subject: Re: [Rxtx] Documentation Wiki To: RXTX Developers and Users BTW: there is no way to open a port without going through the port list and finding it. Maybe sometime in the future someone (me ?) will write a method called openSerialPort that allows the user to give a port identifier, such as "/dev/tty1" and return a port ready to use. It wouldn't take much to write that and it would save users a lot of code. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/182ab5b8/attachment-0021.html From tjarvi at qbang.org Mon Feb 6 11:53:57 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 11:53:57 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: On Mon, 6 Feb 2006, Dr. Douglas Lyon wrote: > Hi All, > I have often thought about USB drivers being needed. > For example, the ironman watch will not interface > to a mac (windows only). It is USB. > My dymo label writer has no Java driver (native only). > Etc. > Most cheap web cameras are USB (and Java drivers go > through JAI, if it supports the camera at all). > The JAI code shows how sun did the USB drivers. > You have to be a member of the jai project to download > the source code. > https://jai.dev.java.net has the jai distro. > And then you are not allowed to redistribute it. However, > we can all learn from it (if so inclined). Basically: > cvs -d :pserver:lyon at cvs.dev.java.net:/cvs login > cvs -d :pserver:lyon at cvs.dev.java.net:/cvs checkout jai-core > You will need to user your own uid and pw to get in. > The ant build has over 100 warnings from sun deprecations > of its own code. > > You might say that they were hoisted on their own Picard ;) > > One interesting thing is that they support several platforms: > linux-amd64 64-bit Linux-AMD64 > linux-i586 32-bit Linux-x86 > solaris-amd64 64-bit Solaris-AMD64 > solaris-i586 32-bit Solaris-x86 > solaris-sparc 32-bit Solaris-SPARC > solaris-sparcv9 64-bit Solaris-SPARC > windows-i586 32-bit Windows-x86 > Thus, ant is used to provide a multi-platform native method distro. > Neat. > How do they do it? > check this out: > > > > > > > > > > > > > And: > > > > > > > > > > The core download does not contain any C source code (it was all pre-built). > Basically, they are just copying .so and .dll files into build directories. > > I would love to see the C code for this...but Sun does not post it on the > https://jai.dev.java.net site. > > I don't know why...Perhaps I missed it. > > - Doug > > I've looked at moving rxtx to Ant builds. I think that would help IDEs a great deal. I requested a evalutation desk copy the O'Reilly Ant book for some j2ee material I was teaching. http://www.oreilly.com/catalog/anttdg/ It has a one sentence mention of JNI. So there was not luck there. I saw that there is another Ant book that does mention JNI more. I can't find it now. Ant must be able to support it with extensions. http://ant.apache.org/manual/OptionalTasks/javah.html What the auto(break :) tools do in the rxtx build is 4 things really. 1) gcc compile flags 2) ld compile flags 3) config.h 4) compile flags for customizing rxtx (lockfiles, ...) See 1 All of this information except 4 can be static once obtained. So I'm not attached to the auto tools. If I could find an example of Ant being used for JNI code, I'd be one of the first to start moving that direction. Maybe someone saw an example someplace. The other thing we have not completed discussing is the directory structure. There is interest in making rxtx more IDE friendly. I get more mail about that off the list than how to install rxtx. And I see we have Ken Thompson in da house :) He is our trusted CVS maintainer and the guy that purchased the rxtx.org domain. Old community. We will need Ken for changing the directory structure of source. I would like to open up discussion about both of these as it is more than time. The problem is I have little experience with Ant and even less with IDEs. It would be nice if we could work with Eclipse and NetBeans. http://www.netbeans.org/ (sun and some community) http://www.eclipes.org (ibm,rhat,... perhaps more community) http://maven.apache.org/what-is-maven.html (apache. It is community) borland should sortof be here too but I think thats covered in eclipse. >From what I understand so far, we should morph rxtx to support those three maybe trusting apaches lead with maven. But I use vi. I have little to no clues beyond what people have fed me. Can we agree that thats the right direction to go? -- Trent Jarvi tjarvi at qbang.org From brian at mbari.org Mon Feb 6 14:57:50 2006 From: brian at mbari.org (Brian Schlining) Date: Mon, 6 Feb 2006 13:57:50 -0800 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> > The other thing we have not completed discussing is the directory > structure. There is interest in making rxtx more IDE friendly. I > get more mail about that off the list than how to install rxtx. > > And I see we have Ken Thompson in da house :) He is our trusted > CVS maintainer and the guy that purchased the rxtx.org domain. Old > community. We will need Ken for changing the directory structure of > source. > > I would like to open up discussion about both of these as it is > more than time. The problem is I have little experience with Ant > and even less with IDEs. It would be nice if we could work with > Eclipse and NetBeans. > > http://www.netbeans.org/ (sun and some community) > http://www.eclipes.org (ibm,rhat,... perhaps more community) > http://maven.apache.org/what-is-maven.html (apache. It is community) > borland should sortof be here too but I think thats covered in > eclipse. > >> From what I understand so far, we should morph rxtx to support >> those three > maybe trusting apaches lead with maven. But I use vi. I have > little to no clues beyond what people have fed me. > Maven likes the directory structure below for Java code. (From http:// maven.apache.org/guides/getting-started/index.html) This structure works fine with ant, netbeans, and eclipse. rxtx_root_directory `-- src |-- main | `-- java | `-- gnu | `-- io `-- test `-- java `-- gnu `-- io Brian Schlining Software Engineer http://www.mbari.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/d9451eba/attachment-0021.html From tjarvi at qbang.org Mon Feb 6 15:11:45 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 15:11:45 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: > rxtx_root_directory > `-- src > |-- main > | `-- java > | `-- gnu > | `-- io > `-- test > `-- java > `-- gnu > `-- io > >From what I understand this will just be good. For me it makes no difference. So lets do the rxtx thing. Let if fester for two weeks and if nobody objects, we will do it. I'm not doing this because I care. I'm doing this to eliminate much of my inbox. But test... man is rxtx lacking there in the community aspect. It is covered but not right. _maybe_ I can change that this year. -- Trent Jarvi tjarvi at qbang.org (cat hurding since 1997) From lux at diesel-research.com Mon Feb 6 21:38:49 2006 From: lux at diesel-research.com (Kim Lux) Date: Mon, 06 Feb 2006 21:38:49 -0700 Subject: [Rxtx] How can I use Lock Files with rxtx (in FC4) ? Message-ID: <1139287129.17031.3.camel@zd7280> I am now running an rxtx application on FC4. I am getting: ========================================================= check_group_uucp(): error testing lock file creation Error details: Permission denied check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL ========================================================= $ ls -al /var/lock total 32 drwxrwxr-x 4 root lock 4096 Feb 6 16:04 . drwxr-xr-x 24 root root 4096 Nov 14 01:19 .. drwx------ 2 root root 4096 Apr 27 2005 lvm drwxr-xr-x 2 root root 4096 Feb 6 16:04 subsys How do I fix this for regulator users ? -- Kim Lux, Diesel Research Inc. From dmarkman at mac.com Mon Feb 6 22:24:44 2006 From: dmarkman at mac.com (Dmitry Markman) Date: Tue, 7 Feb 2006 00:24:44 -0500 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: if I understands the issue right in order to be able to use ant for c/c++ compilation you have to install ant's cc task http://ant-contrib.sourceforge.net/cc.html it looks like it should work on mac os x (authors claim, that it's platform independent) but I never tested so all you have to do it's providing right command line for the gcc compiler On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: >> rxtx_root_directory >> `-- src >> |-- main >> | `-- java >> | `-- gnu >> | `-- io >> `-- test >> `-- java >> `-- gnu >> `-- io >> > > >> From what I understand this will just be good. > > For me it makes no difference. So lets do the rxtx thing. Let if > fester for two weeks and if nobody objects, we will do it. > > I'm not doing this because I care. I'm doing this to eliminate > much of my inbox. > > But test... man is rxtx lacking there in the community aspect. It > is covered but not right. _maybe_ I can change that this year. > > -- > Trent Jarvi > tjarvi at qbang.org > (cat hurding since 1997) > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx Dmitry Markman From lux at diesel-research.com Mon Feb 6 23:20:15 2006 From: lux at diesel-research.com (Kim Lux) Date: Mon, 06 Feb 2006 23:20:15 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? Message-ID: <1139293215.3689.4.camel@zd7280> I'm running the code below. portlist.hasMoreElements() is false. /dev has ports in it as listed below. What am I doing wrong ? ========================================================== // Step through the list of ports until we find one that matches // the one we are looking for. portList = CommPortIdentifier.getPortIdentifiers(); while(portList.hasMoreElements()) { portID = (CommPortIdentifier) portList.nextElement(); // if (portID.getName().equals("/dev/ttyUSB0")) { myTA.append("Serial port ttyUSB0 has been found\n"); break; }// if portID equals... }// End of while... ========================================================== ls -al /dev/tty* crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 ... crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 -- Kim Lux, Diesel Research Inc. From david.garnier at trusted-logic.com Tue Feb 7 00:46:30 2006 From: david.garnier at trusted-logic.com (David Garnier) Date: Tue, 07 Feb 2006 08:46:30 +0100 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: <43E85056.2090608@trusted-logic.com> Hello, I think that the make-based build process is fine as it is, apart from the location of the Java source files. It is true that putting the Java source in a directory structure that map 1-to-1 to the Java package structure is the norm and should make it easier for everyone to modify the Java source, with or without an IDE. Ant is a good tool, but in the RXTX case I fail to see the advantage of using it compared to the current make-based process. As Trent said, they are more pressing issues, like testing. Regards, David Dmitry Markman wrote: > if I understands the issue right > in order to be able to use ant for c/c++ compilation > you have to install ant's cc task > http://ant-contrib.sourceforge.net/cc.html > > it looks like it should work on mac os x > (authors claim, that it's platform independent) > but I never tested > > so all you have to do it's providing right command line > for the gcc compiler > > > > > On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: > >>> rxtx_root_directory >>> `-- src >>> |-- main >>> | `-- java >>> | `-- gnu >>> | `-- io >>> `-- test >>> `-- java >>> `-- gnu >>> `-- io >>> >> >> >>> From what I understand this will just be good. >> >> For me it makes no difference. So lets do the rxtx thing. Let if >> fester for two weeks and if nobody objects, we will do it. >> >> I'm not doing this because I care. I'm doing this to eliminate much >> of my inbox. >> >> But test... man is rxtx lacking there in the community aspect. It is >> covered but not right. _maybe_ I can change that this year. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> (cat hurding since 1997) From tjarvi at qbang.org Tue Feb 7 01:11:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 01:11:31 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <43E85056.2090608@trusted-logic.com> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: On Tue, 7 Feb 2006, David Garnier wrote: > Hello, > > I think that the make-based build process is fine as it is, apart from the location of the Java > source files. It is true that putting the Java source in a directory structure that map 1-to-1 to > the Java package structure is the norm and should make it easier for everyone to modify the Java > source, with or without an IDE. > > Ant is a good tool, but in the RXTX case I fail to see the advantage of using it compared to the > current make-based process. As Trent said, they are more pressing issues, like testing. > Hi David I have more experience with testing rxtx than I can talk about. But let it be known, rxtx has gone trough 100's of hours of testing. We are hobby folks interested in toys but there is more. rxtx has had some of the best guidance in the industry there. This is not an easy thing. I may be able to come back in a month from the other side of the corperate fence and help. I suspect the tests could just be made public but they are in a very unusual environment that just wont work in a wider sense. This is something I'll be trying to change. At one point it was agreed we could just make the results public so this isnt just noise.. There is interest and I think its safe to mention that much. The big problem with testing in the past is most of it is done with a loopback connection. So we *still* have major questions regarding things like flow control. rxtx talks to itself over a loopback and it works. regardless of right or wrong. This requires more thought to be done right. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Feb 7 02:46:34 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 02:46:34 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: > The big problem with testing in the past is most of it is done with a > loopback connection. So we *still* have major questions regarding things > like flow control. rxtx talks to itself over a loopback and it works. > regardless of right or wrong. With serial communication there are gold standards. ckermit is probably a definitive 'standard.' Maybe its possible to do ping/pong tests with ckermit? Is it scriptable? There are known issues in rxtx. Probably the worst is some threading issues regarding some JREs with multiple JNI threads setting java variables. Man did I get schooled there. Just switch the c functions to returning variables and things go away. Sometimes they work fine, sometimes they blow up. Without understanding everything, somehow rhat got it right and debian (and especially gentoo) grabbed kernel patches causing all sort of harm. Its not hard to fix once you understand whats going on but nearly impossible to track with a debugger. So I have a good idea what 2.1-8 will have outside of the IDE modifications. rxtx 2.1-7 is a release for everyone to sync with. Its not even as stable as -pre17 as far as I know - I ran no test suites. I'll be chasing it too. We just had so many contributions that it was time. It seriously broke internal scheduals but thats a great thing :) The other thing I want to do in 2.1-8 is automagic baud rates. It turns out lots of shops are doing really funky baud rates for things like automobile test equipment. It is possible but it requires a fair amount of change in the native code. Is anyone looking at this? -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Feb 7 02:57:21 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 07 Feb 2006 04:57:21 -0500 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <43E85056.2090608@trusted-logic.com> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: Hi All, I agree, testing is very important. The problem I have been trying to address is related to cross-platform testing and the robust nature of the installs. Typically, I visit 3 platforms to deploy my product, windows, linux and mac. A build is performed on each platform. The idea that you can build for many platforms from one copy the source code seems attractive. This should enable synchronized deployments of identical code. The question of how to achieve this goal remains open. As Trent mentioned, this is hard. Perhaps Ant will help here (but perhaps not). Ant does seem to help with running unit tests. However, it does not help with multi-platform tests. For that you need many machines and different operating environments. Toward that end, I have created a multi-platform test that can be run from web start, located at: http://show.docjava.com:8086/book/cgij/code/jnlp/serialPort.PortTest.jnlp This is interesting because many people in the community can run the test and we can improve the test, as time permits. No, it is not a perfect solution, however, the idea does help with multi-platform tests using many machines and different operating environments. If the group has a good test for a general serial port set-ups, i would be happy to deploy it, for general evaluation using web start. And as for ANT, it is just an idea. Not all my ideas are good ones! - Doug >Hello, > >I think that the make-based build process is fine as it is, apart >from the location of the Java >source files. It is true that putting the Java source in a directory >structure that map 1-to-1 to >the Java package structure is the norm and should make it easier for >everyone to modify the Java >source, with or without an IDE. > >Ant is a good tool, but in the RXTX case I fail to see the advantage >of using it compared to the >current make-based process. As Trent said, they are more pressing >issues, like testing. > >Regards, >David > >Dmitry Markman wrote: >> if I understands the issue right >> in order to be able to use ant for c/c++ compilation >> you have to install ant's cc task >> http://ant-contrib.sourceforge.net/cc.html >> >> it looks like it should work on mac os x >> (authors claim, that it's platform independent) >> but I never tested >> >> so all you have to do it's providing right command line >> for the gcc compiler >> >> >> >> >> On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: >> >>>> rxtx_root_directory >>>> `-- src >>>> |-- main >>>> | `-- java >>>> | `-- gnu >>>> | `-- io >>>> `-- test >>>> `-- java >>>> `-- gnu >>>> `-- io >>>> >>> >>> >>>> From what I understand this will just be good. >>> >>> For me it makes no difference. So lets do the rxtx thing. Let if >>> fester for two weeks and if nobody objects, we will do it. >>> >>> I'm not doing this because I care. I'm doing this to eliminate much >>> of my inbox. >>> >>> But test... man is rxtx lacking there in the community aspect. It is >>> covered but not right. _maybe_ I can change that this year. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> (cat hurding since 1997) > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From matt.higgins at gmail.com Tue Feb 7 08:28:34 2006 From: matt.higgins at gmail.com (Matt Higgins) Date: Tue, 7 Feb 2006 10:28:34 -0500 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final Message-ID: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? import java.io.*; import java.util.*; import gnu.io.*; public class MySimpleRead implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; public static void main(String[] args) { boolean portFound = false; String defaultPort = "COM1"; if (args.length > 0) { defaultPort = args[0]; } portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; MySimpleRead reader = new MySimpleRead(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } } public MySimpleRead() { try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) { e.printStackTrace(); } try { inputStream = serialPort.getInputStream(); } catch (IOException e) { e.printStackTrace(); } try { serialPort.addEventListener(this); } catch (TooManyListenersException e) { e.printStackTrace(); } try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { e.printStackTrace(); } System.out.println("Baud is " + serialPort.getBaudRate()); System.out.println("Bits is " + serialPort.getDataBits()); System.out.println("Stop is " + serialPort.getStopBits()); System.out.println("Par is " + serialPort.getParity()); serialPort.notifyOnDataAvailable(true); readThread = new Thread(this); readThread.start(); } public void run() { // Thread.sleep(20000); //} catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { System.out.println("An event occurred " + event.getEventType()); switch (event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: byte[] readBuffer = new byte[20]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } System.out.print(new String(readBuffer)); } catch (IOException e) {} break; } } } --------------- Result on windows ------------------------------ Stable Library ============================================================== Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port:: COM1 Baud is 9600 Bits is 8 Stop is 1 Par is 0 ----------------- End Results ----------------------------------------- ------------------ Result on Linux ----------------------------------- Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 Found port: /dev/ttyS0 Baud is 9600 Bits is 8 Stop is 1 Par is 0 An event occurred 1 043100066224 ------------------ End Results --------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/a1431630/attachment-0021.html From brian at mbari.org Tue Feb 7 09:48:37 2006 From: brian at mbari.org (Brian Schlining) Date: Tue, 7 Feb 2006 08:48:37 -0800 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> Message-ID: <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> Hi Matt > The following code works fine on Linux but I never see any data > when run on Windows. This is a cut and paste from the SimpleRead > example. > I am attempting to read data from a bar code scanner. I can fire > up HyperTermianl on windows and see that the device is working > properly as I see the barcodes are scanned and echoed back to the > terminal. However when I run the app I don't see any data. It is > however associating with the com port as the informational bits > print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. Cheers Brian Schlining Software Engineer http://www.mbari.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/16d07f37/attachment-0021.html From lux at diesel-research.com Tue Feb 7 11:59:58 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 11:59:58 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139293215.3689.4.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> Message-ID: <1139338798.8145.4.camel@zd7280> Any ideas on this ? Any reason why portList.hasMoreElements() should be false even though there are devices in /dev ? On Mon, 2006-02-06 at 23:20 -0700, Kim Lux wrote: > I'm running the code below. > > portlist.hasMoreElements() is false. > > /dev has ports in it as listed below. > > What am I doing wrong ? > > > ========================================================== > // Step through the list of ports until we find one that matches > // the one we are looking for. > > portList = CommPortIdentifier.getPortIdentifiers(); > > while(portList.hasMoreElements()) > { > portID = (CommPortIdentifier) portList.nextElement(); // > if (portID.getName().equals("/dev/ttyUSB0")) > { > myTA.append("Serial port ttyUSB0 has been found\n"); > break; > }// if portID equals... > }// End of while... > ========================================================== > > ls -al /dev/tty* > crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty > crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 > crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 > crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 > crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 > ... > crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 > crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 > crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 > > > -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 12:20:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 12:20:25 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139338798.8145.4.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> Message-ID: On Tue, 7 Feb 2006, Kim Lux wrote: > > Any ideas on this ? Any reason why portList.hasMoreElements() should be > false even though there are devices in /dev ? > > > On Mon, 2006-02-06 at 23:20 -0700, Kim Lux wrote: >> I'm running the code below. >> >> portlist.hasMoreElements() is false. >> >> /dev has ports in it as listed below. >> >> What am I doing wrong ? >> >> >> ========================================================== >> // Step through the list of ports until we find one that matches >> // the one we are looking for. >> >> portList = CommPortIdentifier.getPortIdentifiers(); >> >> while(portList.hasMoreElements()) >> { >> portID = (CommPortIdentifier) portList.nextElement(); // >> if (portID.getName().equals("/dev/ttyUSB0")) >> { >> myTA.append("Serial port ttyUSB0 has been found\n"); >> break; >> }// if portID equals... >> }// End of while... >> ========================================================== >> >> ls -al /dev/tty* >> crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty >> crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 >> crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 >> crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 >> crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 >> ... >> crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 >> crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 >> crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 >> >> >> > Hi Kim What rxtx does is try to open the port and do a timed out read. If the kernel/... do not complain it's enumarted. I suspect you could do a crude test by doing something like cat /dev/ttyS0 > /dev/null If that barfs then rxtx wont enumerate the port. hmm looking at your question again, I suspect it's a lockfile problem. This is documented in INSTALL with the source. Its easy enough to test this too.. touch /var/lock/testingrxtxlockfiles && rm -f /var/lock/testingrxtxlockfiles If you are not in the right group it will bail. Root will work regardless. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 12:37:56 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 12:37:56 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> Message-ID: <1139341076.8145.11.camel@zd7280> Exactly which ports does rxtx attempt to put into the list ? /dev/* or /dev/tty* or /dev/tty[0-9[0-9] ? or /dev/ttyS* ? For the record, only /dev/ttyUSB0 is a valid port on the machine I am presently on. Will this be a problem ? On Tue, 2006-02-07 at 12:20 -0700, Trent Jarvi wrote: > This is documented in INSTALL with the source. > I was wondering where that file was. I will download source and dig it up. Thanks. -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 12:51:09 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 12:51:09 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139341076.8145.11.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: On Tue, 7 Feb 2006, Kim Lux wrote: > > Exactly which ports does rxtx attempt to put into the list ? /dev/* > or /dev/tty* or /dev/tty[0-9[0-9] ? or /dev/ttyS* ? > > For the record, only /dev/ttyUSB0 is a valid port on the machine I am > presently on. Will this be a problem ? > > > On Tue, 2006-02-07 at 12:20 -0700, Trent Jarvi wrote: >> This is documented in INSTALL with the source. >> > I was wondering where that file was. I will download source and dig it > up. > > Thanks. > Hmm I'm looking at pre17 so this may have changed. (its just what I have on this machine) if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA" // for the IPAQs }; CandidatePortPrefixes=Temp; } So you may need to add "ttyUSB" to that list. RXTX used to enumerate _everything_ see if(osName.equals("Linux-all-ports") But it became less than practical. This is all in RXTXCommDriver.java hmm I just did a cvs update. if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have to get your fingers into the code. We aim for sane defaults. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 13:06:45 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 13:06:45 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139342805.8145.22.camel@zd7280> On Tue, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > Hmm I'm looking at pre17 so this may have changed. (its just what I have > on this machine) > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA" // for the IPAQs > }; > CandidatePortPrefixes=Temp; > } > > > So you may need to add "ttyUSB" to that list. RXTX used to enumerate > _everything_ see if(osName.equals("Linux-all-ports") But it became less > than practical. > > This is all in RXTXCommDriver.java > > hmm I just did a cvs update. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have > to get your fingers into the code. We aim for sane defaults. Excellent. Thanks for taking the time. -- Kim Lux, Diesel Research Inc. From ideiglenes1 at freemail.hu Tue Feb 7 13:53:39 2006 From: ideiglenes1 at freemail.hu (--) Date: Tue, 07 Feb 2006 21:53:39 +0100 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139345619.22534.2.camel@localhost> Hi! I use this code to get all the extra Linux devices. :) if ("Linux".equals(System.getProperty("os.name"))) { System.setProperty("os.name","Linux-all-ports"); } driver = new RXTXCommDriver(); On k, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > On Tue, 7 Feb 2006, Kim Lux wrote: > > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have > to get your fingers into the code. We aim for sane defaults. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From matt.higgins at gmail.com Tue Feb 7 13:45:54 2006 From: matt.higgins at gmail.com (Matt Higgins) Date: Tue, 7 Feb 2006 15:45:54 -0500 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> Message-ID: <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> Sweet this is exactly what I needed. I was searching the archives through marc.theamisgroup they only have archives back to 1/3/05. Should have hit the mailman archive! Thanks a lot! On 2/7/06, Brian Schlining wrote: > > Hi Matt > > The following code works fine on Linux but I never see any data when run > on Windows. This is a cut and paste from the SimpleRead example. > I am attempting to read data from a bar code scanner. I can fire up > HyperTermianl on windows and see that the device is working properly as I > see the barcodes are scanned and echoed back to the terminal. However when I > run the app I don't see any data. It is however associating with the com > port as the informational bits print fine? > > > You're not the only one whose had this problem, I don't know if Trent has > addressed this is the latest release of RXTX but there is a workaround. > Here's the recent thread from the RXTX mailing list regarding this issues: > > Thanasis Delenikas tdelenik at gmail.com > Wed Jan 18 13:56:23 MST 2006 > > * Previous message: [Rxtx] Re: More close() performance fixes > * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] > > Hi all. > (I've subscribed again from my other email account). > > Trent, > > You are right. Linux *always* works, no matter what flow control you set. > Windows *works only* with hardware flow control (I haven't tested what > happens with software XON/XOFF flow control). > > I assume (but I am not certain) that even with no flow control at all, all > platforms should work. Without flow control, you have the risk of bumping > into overflow or framing errors, but that's your (the end programmer, I > mean) problem. > > >From my side, I shouldn't be working without flow control. That was a bug > too... It was some code forgotten from the old times, when I used to work > with phone emulation drivers which didn't support flow control. The > correct > way is to have some flow control enabled and that's why I suppose this is > a > low-severity bug for RxTx. > > I have no idea which platform shows the correct behaviour, since > my knowledge about Linux and the inner workings of these low-level i/o > operations is limited. > > Regards, > Thanasis Delenikas. > > > > > Message: 2 > > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > > From: Trent Jarvi > > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > > To: RXTX Developers and Users > > Message-ID: > > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > > > Hi all, > > > > > > Trent, I have found something. > > > I read your comment about flow control, so I experimented a bit. > > > > > > If you remember, in my sample program I've used no flow control at all > ( > > i.e. > > > Java constant FLOWCONTROL_NONE). > > > > > > Now, during testing, I've switch to hardware inbound flow control (i.e > . > > Java > > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > > beautifully! > > > > > > I think I will switch to H/W flow control and test things for a while, > > but > > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > > > > > Hi Thanasis, > > > > I'm fairly sure you have identified a bug. I would not worry too much > > about what Sun CommAPI w32 defaults are. I think they did more or less > > whatever the port opened with. Just a guess. Linux tries to stomp on > > ports so they are all the same. > > > > So this started out with Linux worked, Windows XP/.. did not as I > recall. > > Something is wrong in rxtx. Do I understand this right? > > > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > > > Perhaps there is something Wayne or I did not understand when we wrote > > that code. I wasnt programming back in the BBS days so modems are not > my > > thing. I have a few questions. > > > > Is the above matrix confirmed by observation? > > Linux just always worked? > > Which one _should_ work? I'm guessing modems work with hardware flow > > control. I'll have to dig around. > > > > The windows flow control changes a couple things with hardware flow > > control. Following the w32 API documentation is confusing sometimes. > > But it looks like Linux could have a bug too. > > Cheers > > Brian Schlining > Software Engineer > http://www.mbari.org > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/9c989144/attachment-0021.html From tjarvi at qbang.org Tue Feb 7 14:06:14 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 14:06:14 -0700 (MST) Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> Message-ID: >> >> You're not the only one whose had this problem, I don't know if Trent has >> addressed this is the latest release of RXTX but there is a workaround. >> Here's the recent thread from the RXTX mailing list regarding this issues: >> I have not. I expect to have access to some test equipment next month and I'll go through all of this. I really don't know whats going on and I need a gold standard. I thought maybe linux was autodetecting the flow control. Your observations would certainly be welcome. I need to talk to Russell King and see what he is doing. Until then I'd just be toying around over a loopback as usual. This is very high on the list though. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 17:25:05 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 17:25:05 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139358305.17994.2.camel@zd7280> My application now works. I installed the libraries and jar from 2.1-7 (Final). portlist.hasMoreElements is no longer false. The application finds the port for /dev/ttyUSB0. Thanks for your help, Trent (et al) Sorry I bothered you with this. Next time I will look in the source first. I didn't think it was an rxtx issue, I thought it was a Linux setup issue . On Tue, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > Hmm I'm looking at pre17 so this may have changed. (its just what I > have > on this machine) > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux > Serial Ports > "ttySA" // for the > IPAQs > }; > > CandidatePortPrefixes=Temp; > } > > > So you may need to add "ttyUSB" to that list. RXTX used to enumerate > _everything_ see if(osName.equals("Linux-all-ports") But it became > less > than practical. > > This is all in RXTXCommDriver.java > > hmm I just did a cvs update. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux > Serial Ports > "ttySA", // for the > IPAQs > "ttyUSB" // for USB > frobs > }; > > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you > have > to get your fingers into the code. We aim for sane defaults. -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 19:21:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 19:21:54 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139358305.17994.2.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> <1139358305.17994.2.camel@zd7280> Message-ID: >Sorry I bothered you with this. Next time I will look in the source >first. I didn't think it was an rxtx issue, I thought it was a Linux >setup issue . Why would you be sorry? I would have done the same. I'm glad it's working :) -- Trent Jarvi tjarvi at qbang.org From tma at mail.island.net Wed Feb 8 13:39:35 2006 From: tma at mail.island.net (Tom Alldread) Date: Wed, 08 Feb 2006 12:39:35 -0800 Subject: [Rxtx] Win32/Linux Serial Port Data Dropouts In-Reply-To: <200602060702.k167255O007882@www.qbang.org> References: <200602060702.k167255O007882@www.qbang.org> Message-ID: <43EA5707.4020200@mail.island.net> Greetings Folks at RXTX: During the last couple of months I have been alternately testing with javax.comm 2 and RXTX 2.1 under Windows XP and CommApi 3 and RXTX 2.1 under Suse 10.0 Linux. In the process I have learned a little about java multi-threading under NetBeans 5 with Profiler. My java (jdk 1.5_06) application is used for data acquisition and provides a graphical display of A-D conversion data received from a 56KBaud serial port. The actual data throughput is about 10KBaud thus it is well below the speed of the port. I use hardware RTS/CTS flow control which can stall the data acquisition sample rate if necessary. This ensures the display computer has the ability to slow the data acquisition rate should it become too busy to accept the regular data flow. Both the serial port buffer and the java read buffer are set at 16KB. Usually the data transfers into the java read buffer are less than 100 bytes unless the data acquisition is recovering from a stall. The data flow normally hesitates after each 5 KB block as a continue command is needed from the display computer to start the drawing of a new graphics display line. Separate threads have been provided for the serial port event monitoring and data processing. The serial port event thread has been given the maximum priority and data processing thread the minimum priority provided by java. Thread yield statements have been placed within all data processing while/for loops as an effort to ensure quick access to CPU cycles for the serial port event thread. I have found that short data transmissions are essentially error free but occasional dropouts occur with continuous data flow especially under Windows XP. ....................................................................................................................................................................................... Linux results: I am happy to report that RXTX 2.1 appears to work very well under Linux although I did notice some errors when the screen savers were running with my dual monitors. I believe this is a local problem associated with my dual graphics which needs further attention. The recent CommApi 3 Linux release from Sun did not work at all with my program. It seemed to send commands out OK but did not receive any data. Although the serial port event triggered the ISR, the input stream appeared filled with nulls and thus did not contain any data. As my understanding is that CommApi 3 was tested with a Red Hat distribution of Linux I wonder if this problem is distro dependent? Although somewhat off topic here I wonder if anyone reading this has had similar experience? .................................................................................................................................................................................. Windows XP results: There are problems with occasional data dropouts which become more frequent as the sampling rate is increased or if the computer becomes busy with other duties. The dropouts typically consist of a half dozen byte block of lost data. It appears the lost bytes never get added to the java input stream. There has not been any indication of garbled data, overruns or framing errors which suggests the UART communications remains solid. Using javax.comm 2 I found that the setting of SerialPort 'enableReceiveThreshold' to 40 and 'enableReceiveTimeout' of 100mS reduced the dropouts error rate significantly. I found that I could not get RXTX 2.1 to function with the aforementioned threshold and timeout settings. The javax.comm 2 interface is consequently performing better for me under Windows than RXTX 2.1. I wonder if anyone here has any suggestions as to what I might try to improve RXTX 2.1? Although my settings are the same as under Suse 10.0, RXTX 2.1 performs much better for me under Linux than any of the alternatives that I have tried under Windows XP . ............................................................................................................................................................................... I would like to establish, based on the experience of others, if I have reached the normally expected performance limit of java serial port communications? Should I expect to achieve virtually error free serial port data input from a continuous stream under Windows XP java software? I am considering changing my protocol to packets with error checking if necessary but would like to know if the dropout problems I am experiencing are typical or not before I take this rather work intensive plunge. Many thanks in advance for any help! Best Regards, Tom Alldread -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.375 / Virus Database: 267.15.2/253 - Release Date: 2006-02-07 From jlaxson at mac.com Wed Feb 8 23:56:48 2006 From: jlaxson at mac.com (John Laxson) Date: Thu, 9 Feb 2006 00:56:48 -0600 Subject: [Rxtx] PortInUseException: Unknown Application on OSX Message-ID: Hi, I've been trying to get RXTX 2.1.7 going on Mac OS X for a while here, and am running up into a wall here. I've tried with pre- compiled and the source version and get the same problem, a gnu.io.PortInUseException: Unknown Application. I have run the fixperms script included with the source distribution, and id shows me as a member of the uucp group, and permissions on /var/spool/uucp are 775 root:uucp. Running a test program (included at the bottom for clarity) lets me enumerate all the serial ports correctly, but trying to open any of them gives the PortInUseException. If it helps, when I try to open a port that's set to make an outgoing bluetooth connection, there is no delay and no connection attempt at all. Thanks, John Laxson PS: The documentation wiki on qbang.org shows 404, and has for a few days now. My test code: public static void main(String[] args) { SerialPort serialPort; try { Enumeration e = CommPortIdentifier.getPortIdentifiers(); CommPortIdentifier ident; while (e.hasMoreElements()) { ident = (CommPortIdentifier)e.nextElement(); System.out.println(ident.getName()); } ident = CommPortIdentifier.getPortIdentifier("/dev/cu.modem"); serialPort = (SerialPort) ident.open("Me", 5000); } catch (Exception e) { e.printStackTrace(); } } From rajesh.invincible at gmail.com Thu Feb 9 03:39:38 2006 From: rajesh.invincible at gmail.com (Rajesh N) Date: Thu, 9 Feb 2006 16:09:38 +0530 Subject: [Rxtx] Re: Move .java Files in gnu.io filesystem hierarchy - Maven (2) In-Reply-To: <43DF21D2.7090200@ngi.it> References: <43DF21D2.7090200@ngi.it> Message-ID: <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Can anybody tell me how to overcome these EXCEPTIONS I AM WORKING ON SERIAL COMMN IN JAVA ON LINUX. 1. " NOT ALL PARAMETERS SUPPORTED BY THE KERNEL" This i came across the following statement inmy prog. SerialP is A SerialPort object SerialP.setSerialPortParams(9600(BAUDRATE),DATABITS_8,STOPBITS_1,PARITY_NONE) 2. NullPointer Exception at Event Dispatch Now i have checked all my object references for a null reference but i found none i have put up my entire code in try catch blocks but still I AM UNABLE TO CATCH THIS EXCEPTION AND HENCE MY APPLICATION CLOSES HOW DOES THESE GO? PLEASE HELP ME IT IS URGENTTTTTTTTTTTTTTTT yours sincerely RAJESH On 1/31/06, Fabio Frumento wrote: > Hi Xavier, > > I don't know maven at all but the directory hierarchy listed buy Trent > is fine for me... > > I'll take a look to maven, it seems an interesting project > > Regards > > Fabio Frumento > > Trent Jarvi wrote: > > On Tue, 31 Jan 2006, Xavier Frisaye wrote: > > > >> Hi all, > >> > >> If you are going to rearrange the src folder, i will propose to use > >> maven 2 and follow its directory structure > >> > (http://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html). > >> > >> Maven 2 simplify java project and give a standard way to make projects > >> (http://maven.apache.org/). > >> We are using it for internal projects and we are very satisfied. > >> > >> Is anybody interested? > >> > >> I'm not an expert in maven 2 (yet) but i'm agree to help using it if > >> you choose to make so. > >> > > > > so this would be: > > > > rxtx-devel/src/main/java/gnu.io > > rxtx-devel/src/test/java/ManIwish.java > > > > I don't use IDEs very much so I'll let others comment. But I don't see > > a problem with that. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Thu Feb 9 09:50:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 9 Feb 2006 09:50:31 -0700 (MST) Subject: [Rxtx] Re: Move .java Files in gnu.io filesystem hierarchy - Maven (2) In-Reply-To: <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Message-ID: On Thu, 9 Feb 2006, Rajesh N wrote: > Can anybody tell me how to overcome these EXCEPTIONS > I AM WORKING ON SERIAL COMMN IN JAVA ON LINUX. > > 1. " NOT ALL PARAMETERS SUPPORTED BY THE KERNEL" > > This i came across the following statement inmy prog. > SerialP is A SerialPort object > SerialP.setSerialPortParams(9600(BAUDRATE),DATABITS_8,STOPBITS_1,PARITY_NONE) > Strange. The parameters you use are the same the port should open with by default. Could you paste the actual exception you are getting? I don't see that in the rxtx source. Also it would help to know the rxtx version. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Fri Feb 10 15:29:05 2006 From: lux at diesel-research.com (Kim Lux) Date: Fri, 10 Feb 2006 15:29:05 -0700 Subject: [Rxtx] One serial port object for both sending and receiving ? Message-ID: <1139610545.18177.4.camel@zd7280> Is it OK to use one SerialPort ojbect (ex Serial Port serialPort;) and use it for both sending and receiving ? For example: ======================================================================== static SerialPort serialPort = null; static OutputStream serialOut = null; static InputStream serialIn = null; // assign it to an outputStream for use try{ serialOut = serialPort.getOutputStream(); System.out.println("Serial output stream has been assigned."); }//try catch(IOException e) { System.out.println("Error: Couldn't assign output stream to serial port."); }//catch //assign it to an inputStream for use try{ serialIn = serialPort.getInputStream(); System.out.println("Serial input stream has been assigned."); }//try catch(IOException e) { System.out.println("Error: Couldn't assign input stream to serial port."); }//catch ======================================================================== -- Kim Lux, Diesel Research Inc. From lux at diesel-research.com Fri Feb 10 21:23:00 2006 From: lux at diesel-research.com (Kim Lux) Date: Fri, 10 Feb 2006 21:23:00 -0700 Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Message-ID: <1139631780.23882.10.camel@zd7280> I've got a problem receiving chars with my version of serialRead, written in an SWT GUI. I had a Java pro have a good look at my code and he can't see anything wrong with it. I can send chars fine. When I receive a char the cpu usage for the app goes to 100% and the code in the serial event handler doesn't get executed. The instructions on the Java Comm Serial API How-To for Linux page state that I must install javacomm. Is that true ? Everything builds without it and I can send chars on rxtx just fine, but I can't receive them. Could this be the problem ? I downloaded and installed javacomm. I was not able to add "Driver=gnuio.RXTXCommDriver to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 installed in /usr/java/jre1.5.0_05. I added comm.jar to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext to the library paths. Is this OK ? Does it matter that I am receiving on /dev/ttyUSB0 ? Thanks. -- Kim Lux, Diesel Research Inc. From lunareclipse03 at web.de Sat Feb 11 09:44:46 2006 From: lunareclipse03 at web.de (lunareclipse03@web.de) Date: Sat, 11 Feb 2006 17:44:46 +0100 Subject: [Rxtx] Question about Serial I/O under Win32 Message-ID: <662084330@web.de> Hello everybody, I have a strange problem with a piece of code I made for myself. No, this is not really concerning rxtx, but nevertheless I post this to the list, hoping that some of you can help me. I've written two libraries, one for linux and one for win32. The linux port works quite well, I can send / receive faxes and / or replay voice messages over the telephone line using a voice modem. But the win32 port of the library causes some trouble. If, for example, I send out a fax with a certain modem under linux, it works well. The fax is complete when it comes out of the fax machine. If I then use the same modem to send out a fax under win32, the fax coming out of the fax machine gets "stuck" halfways, but the sending modem thinks that transmission was ok and drops the connection. The answering fax machine then gives me "error while receiving." The "upper layer" java code MUST be right, because if I do the same thing under linux (using the linux library), everything is alright. Now I have to ask: Can somebody please help me out with this??!? Could it be the case that some kind of flow control or COMMTIMEOUTS setting causes this behaviour? I set flow control to RTS/CTS before sending out a fax. How can I DISABLE flow control? Or what do you think? Can something else cause this problems? Thank you all for your time and PLEASE write back soon. Regards, --Sven Ahlemann Am Waldrand 31 45721 Haltern am See Germany ______________________________________________________________ Verschicken Sie romantische, coole und witzige Bilder per SMS! Jetzt bei WEB.DE FreeMail: http://f.web.de/?mc=021193 From lux at diesel-research.com Sat Feb 11 10:06:52 2006 From: lux at diesel-research.com (Kim Lux) Date: Sat, 11 Feb 2006 10:06:52 -0700 Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: <1139631780.23882.10.camel@zd7280> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> <1139631780.23882.10.camel@zd7280> Message-ID: <1139677612.3431.5.camel@zd7280> More on this problem. I copied and pasted simpleRead into a console based Eclipse project and I've got the same result, except that cpu usage doesn't go to 100%. I'm beginning to think there is an issue in rxtx. My imports for simpleRead are: ============================ import gnu.io.*; import java.util.*; //import javax.comm.*; import java.io.*; =========================== Any ideas ? I am trying to read from /dev/ttyUSB0 using a serial to USB adapter which has worked well with minicom and gtkterm. Thanks. On Fri, 2006-02-10 at 21:23 -0700, Kim Lux wrote: > I've got a problem receiving chars with my version of serialRead, > written in an SWT GUI. > > I had a Java pro have a good look at my code and he can't see anything > wrong with it. > > I can send chars fine. When I receive a char the cpu usage for the app > goes to 100% and the code in the serial event handler doesn't get > executed. > > The instructions on the Java Comm Serial API How-To for Linux page state > that I must install javacomm. Is that true ? Everything builds without > it and I can send chars on rxtx just fine, but I can't receive them. > Could this be the problem ? > > I downloaded and installed javacomm. I was not able to add > "Driver=gnuio.RXTXCommDriver > to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not > have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 > installed in /usr/java/jre1.5.0_05. I added comm.jar > to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext > to the library paths. Is this OK ? > > Does it matter that I am receiving on /dev/ttyUSB0 ? > > Thanks. > -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Sun Feb 12 21:01:33 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:01:33 -0700 (MST) Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: <1139677612.3431.5.camel@zd7280> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> <1139631780.23882.10.camel@zd7280> <1139677612.3431.5.camel@zd7280> Message-ID: I suspect what is happening is the select() is breaking out in the native code but the driver does not have support for notifying there are X bytes available. On some traditional Unix based systems, the only way you know data is available is the fd status changes and do an FIORDCHK ioctl. Or perhaps the only thing you can know is the fd status changed. It would take reading through the kernel driver code to know for sure. So on USB, depending upon the driver, the same may need to be done or the driver improved a bit if possible to support. Polling reads will also work but don't use the event driven model of CommAPI which isnt acceptable in the long run. The 100% cpu usage can then be explained because select no longer blocks until the data is read; the eventLoop spins loose. You can put a well placed sleep but rxtx only expects those are needed when it knows data is available. This may not be a super simple thing to understand and fix. I do have ideas to get you started. I'm going to be short on time the next couple weeks. I expect to put some good time in and answer some other questions I saw around the 25th. For now, I'd look at the following and go from there with the hints I've given. JNIEXPORT jint JNICALL RXTXPort(nativeavailable)( JNIEnv *env, jobject jobj ) { int fd = get_java_var( env, jobj,"fd","I" ); int result; /* char message[80]; ENTER( "RXTXPort:nativeavailable" ); On SCO OpenServer FIONREAD always fails for serial devices, so try ioctl FIORDCHK instead; will only tell us whether bytes are available, not how many, but better than nothing. This turns out to be true on Solaris also. taj. */ #ifdef FIORDCHK /* __unixware__ __sun__ probably others */ result = ioctl(fd, FIORDCHK, 0); #else if( ioctl( fd, FIONREAD, &result ) < 0 ) { goto fail; } #endif /* FIORDCHK */ On Sat, 11 Feb 2006, Kim Lux wrote: > > More on this problem. I copied and pasted simpleRead into a console > based Eclipse project and I've got the same result, except that cpu > usage doesn't go to 100%. I'm beginning to think there is an issue in > rxtx. > > My imports for simpleRead are: > > ============================ > import gnu.io.*; > import java.util.*; > //import javax.comm.*; > import java.io.*; > =========================== > > Any ideas ? I am trying to read from /dev/ttyUSB0 using a serial to > USB adapter which has worked well with minicom and gtkterm. > > Thanks. > > > > On Fri, 2006-02-10 at 21:23 -0700, Kim Lux wrote: >> I've got a problem receiving chars with my version of serialRead, >> written in an SWT GUI. >> >> I had a Java pro have a good look at my code and he can't see anything >> wrong with it. >> >> I can send chars fine. When I receive a char the cpu usage for the app >> goes to 100% and the code in the serial event handler doesn't get >> executed. >> >> The instructions on the Java Comm Serial API How-To for Linux page state >> that I must install javacomm. Is that true ? Everything builds without >> it and I can send chars on rxtx just fine, but I can't receive them. >> Could this be the problem ? >> >> I downloaded and installed javacomm. I was not able to add >> "Driver=gnuio.RXTXCommDriver >> to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not >> have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 >> installed in /usr/java/jre1.5.0_05. I added comm.jar >> to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext >> to the library paths. Is this OK ? >> >> Does it matter that I am receiving on /dev/ttyUSB0 ? >> >> Thanks. >> > From tjarvi at qbang.org Sun Feb 12 21:03:30 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:03:30 -0700 (MST) Subject: [Rxtx] One serial port object for both sending and receiving ? In-Reply-To: <1139610545.18177.4.camel@zd7280> References: <1139610545.18177.4.camel@zd7280> Message-ID: On Fri, 10 Feb 2006, Kim Lux wrote: > > Is it OK to use one SerialPort ojbect (ex Serial Port serialPort;) and > use it for both sending and receiving ? > > For example: > > ======================================================================== > static SerialPort serialPort = null; > static OutputStream serialOut = null; > static InputStream serialIn = null; > > > > > // assign it to an outputStream for use > try{ > serialOut = serialPort.getOutputStream(); > System.out.println("Serial output stream has been assigned."); > }//try > catch(IOException e) > { > System.out.println("Error: Couldn't assign output stream to serial > port."); > }//catch > > > //assign it to an inputStream for use > try{ > serialIn = serialPort.getInputStream(); > System.out.println("Serial input stream has been assigned."); > }//try > catch(IOException e) > { > System.out.println("Error: Couldn't assign input stream to serial > port."); > }//catch This should be fine. In fact trying to do it another way will probably not work as you will run into lockfile issues. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun Feb 12 21:13:13 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:13:13 -0700 (MST) Subject: [Rxtx] Question about Serial I/O under Win32 In-Reply-To: <662084330@web.de> References: <662084330@web.de> Message-ID: On Sat, 11 Feb 2006 lunareclipse03 at web.de wrote: > Hello everybody, > > I have a strange problem with a piece of code I made for myself. No, > this is not really concerning rxtx, but nevertheless I post this to the > list, hoping that some of you can help me. I've written two libraries, > one for linux and one for win32. The linux port works quite well, I can > send / receive faxes and / or replay voice messages over the telephone > line using a voice modem. But the win32 port of the library causes some > trouble. If, for example, I send out a fax with a certain modem under > linux, it works well. The fax is complete when it comes out of the fax > machine. If I then use the same modem to send out a fax under win32, the > fax coming out of the fax machine gets "stuck" halfways, but the sending > modem thinks that transmission was ok and drops the connection. The > answering fax machine then gives me "error while receiving." The "upper > layer" java code MUST be right, because if I do the same thing under > linux (using the linux library), everything is alright. Now I have to > ask: Can somebody please help me out with this??!? Could it be the case > that some kind of flow control or COMMTIMEOUTS setting causes this > behaviour? I set flow control to RTS/CTS before sending out a fax. How > can I DISABLE flow control? Or what do you think? Can something else > cause this problems? Thank you all for your time and PLEASE write back > soon. > Hi Sven I'm not too willing to talk about flow control at the low level until I confirm some things with test equipment later. It is not clear if you are using rxtx or writing your own native code. So I'm not sure how to answer much of this :) If you are wondering how to change the flow control using rxtx from java, The BlackBox example from Sun flips this back and forth. SerialPort.java in rxtx 2.1 uses the following: SerialPort.java: public static final int FLOWCONTROL_NONE =0; SerialPort.java: public static final int FLOWCONTROL_RTSCTS_IN =1; SerialPort.java: public static final int FLOWCONTROL_RTSCTS_OUT =2; SerialPort.java: public static final int FLOWCONTROL_XONXOFF_IN =4; SerialPort.java: public static final int FLOWCONTROL_XONXOFF_OUT=8; So if you set flowcontrol to RTSCTS, you can set it to NONE to turn it off. If you are looking for how to do it in native code, the rxtx Source is SerialImp.c (unix/linux/mac os x/w32) and termios.c (w32 only with SerialImp.c) You can track the code: SerialImp.c:JNIEXPORT void JNICALL RXTXPort(setflowcontrol)( JNIEnv *env, jobject jobj, jint flowmode ) termios.c:int tcgetattr( int fd, struct termios *s_termios ) termios.c:int tcsetattr( int fd, int when, struct termios *s_termios ) There may be a problem in the rxtx flow control code though. Rather than guess, I want to test this with a gold standard. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Feb 6 00:00:16 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 00:00:16 -0700 (MST) Subject: [Rxtx] wiki delay until tomorrow night. In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: On Sun, 5 Feb 2006, Trent Jarvi wrote: > On Sun, 5 Feb 2006, Kim Lux wrote: > >> usb ? Tell me more... I need that too. > > usb is a very proper design. Thats all it is. > Maybe rxtx could help usb. But it would start with helping bring back the community that was already there. It's not something I'd love to do but maybe its the right thing to do. It would probably take 2 years to do right. But maybe thats better than what we have now. I honestly don't know what IBM is doing which could just run over everything. Just some thoughts after some fine german wine. -- Trent Jarvi tjarvi at qbang.org From gadelavega at yahoo.com.ar Mon Feb 6 02:17:05 2006 From: gadelavega at yahoo.com.ar (Gonzalo A. de la Vega) Date: Mon, 06 Feb 2006 10:17:05 +0100 Subject: [Rxtx] Serial port ownership question In-Reply-To: References: <20060205113618.30274.qmail@web53501.mail.yahoo.com> <1139157422.4553.9.camel@zd7280> <1139158698.4936.9.camel@zd7280> Message-ID: <43E71411.4050402@yahoo.com.ar> On my Fedora Core 4: ls -l /dev/ttyS* crw-rw---- 1 root uucp 4, 64 Feb 6 2006 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Feb 6 2006 /dev/ttyS1 ... and: grep "ttyUSB" /etc/udev/rules.d/50-udev.rules KERNEL=="ttyUSB*", GROUP="uucp", MODE="0660" So anyone in the "uucp" group can use serial ports. On Gentoo the group is "tty". Trent Jarvi escribi?: > > > On Sun, 5 Feb 2006, Dr. Douglas Lyon wrote: > >> I can confirm that this is the case (only root ownership of >> serial ports, under fedora 4). >> Wow, what were they thinking?! >> - DL >> >>> I've found that the newer kernels have the serial ports owned by root. >>> For example, >>> >>> $ls -al /dev/tty* >>> crw-rw-rw- 1 root root 5, 0 Feb 5 02:06 /dev/tty >>> crw-rw---- 1 root root 4, 0 Feb 5 02:06 /dev/tty0 >>> crw------- 1 root root 4, 1 Feb 5 09:07 /dev/tty1 >>> crw-rw---- 1 root tty 4, 10 Feb 5 02:06 /dev/tty10 >>> crw-rw---- 1 root tty 4, 11 Feb 5 02:06 /dev/tty11 >>> ... > > > This is just not a problem jcp or such are going to solve. Its a > platform spitwad fight. But do look at pam. In fact thats what Sun > is doing too. Maybe Linux followed their lead.. I'm not a pam guy. > I've spent 16 hours trying to understand it but your users wont :) > > Solution? I have no clue. Its two tangent mentalities from my > perspective. > > -- > Trent Jarvi > tjarvi at qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mtnvega at yahoo.com.br Mon Feb 6 05:35:43 2006 From: mtnvega at yahoo.com.br (Luiz Jr) Date: Mon, 6 Feb 2006 12:35:43 +0000 (GMT) Subject: [Rxtx] Documentation Wiki In-Reply-To: <1139157422.4553.9.camel@zd7280> Message-ID: <20060206123543.57256.qmail@web53515.mail.yahoo.com> Hello, Thank you for you answer, but so the usage of the API is pretty much like the Java Communications Api? If yes, what version of the Java Comm Api? Thank you, Luiz A. Brandao Jr Kim Lux escreveu: On Sun, 2006-02-05 at 08:36 -0300, Luiz Jr wrote: > Hello, > > I want to start using the RXTX libraries, but I would to know how, > since I can not access the documentation wiki page I just started using them yesterday. Below is how I installed the libraries, if that helps. I used snippets of code from the SimpleWrite application here to get me going. http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html Instead of "import javax.comm.*;", use "import gnu.io.*;" which is gotten from RXTXcomm.jar, which you will need to include in your project references. I am working in Eclipse. BTW: there is no way to open a port without going through the port list and finding it. Maybe sometime in the future someone (me ?) will write a method called openSerialPort that allows the user to give a port identifier, such as "/dev/tty1" and return a port ready to use. It wouldn't take much to write that and it would save users a lot of code. Hope this helps. ======================================================================= 1) Figure out which java you are running, incase there is more than one installed. $ java -version java version "1.5.0_05" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_05-b05) Java HotSpot(TM) Client VM (build 1.5.0_05-b05, mixed mode, sharing) 2) Find all the jre directories and the one from which you are currently running. kfind (jre) 3) cd to that directory plus /lib/i386 cd /usr/java/jre1.5.0_05/lib/i386 4) Copy the library files (*.so) to that directory. cp /home/krlux/Desktop/'Java Controls'/rxtx-linux/bin/* . 5) Check that the copy was successful ls librxtx* librxtxI2C.so librxtxRaw.so librxtxSerial.so librxtxParallel.so librxtxRS485.so 6) cd to the /lib/ext directory for your java. cd /usr/java/jre1.5.0_05/lib/ext 7) Copy the Jar files there cp /home/krlux/Desktop/'Java Controls'/rxtx-linux/lib/ext/* . 8) Check that it was successful ls RXTX* RXTXcomm.jar Rxtx is now installed on your machine ready to use. =================================================================== -- Kim Lux, Diesel Research Inc. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx --------------------------------- Yahoo! Acesso Gr?tis - Internet r?pida e gr?tis. Instale o discador agora! -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/544aa403/attachment-0022.html From lyon at docjava.com Mon Feb 6 05:49:34 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 06 Feb 2006 07:49:34 -0500 Subject: [Rxtx] wiki delay until tomorrow night. In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: Hi All, I have often thought about USB drivers being needed. For example, the ironman watch will not interface to a mac (windows only). It is USB. My dymo label writer has no Java driver (native only). Etc. Most cheap web cameras are USB (and Java drivers go through JAI, if it supports the camera at all). The JAI code shows how sun did the USB drivers. You have to be a member of the jai project to download the source code. https://jai.dev.java.net has the jai distro. And then you are not allowed to redistribute it. However, we can all learn from it (if so inclined). Basically: cvs -d :pserver:lyon at cvs.dev.java.net:/cvs login cvs -d :pserver:lyon at cvs.dev.java.net:/cvs checkout jai-core You will need to user your own uid and pw to get in. The ant build has over 100 warnings from sun deprecations of its own code. You might say that they were hoisted on their own Picard ;) One interesting thing is that they support several platforms: linux-amd64 64-bit Linux-AMD64 linux-i586 32-bit Linux-x86 solaris-amd64 64-bit Solaris-AMD64 solaris-i586 32-bit Solaris-x86 solaris-sparc 32-bit Solaris-SPARC solaris-sparcv9 64-bit Solaris-SPARC windows-i586 32-bit Windows-x86 Thus, ant is used to provide a multi-platform native method distro. Neat. How do they do it? check this out: And: The core download does not contain any C source code (it was all pre-built). Basically, they are just copying .so and .dll files into build directories. I would love to see the C code for this...but Sun does not post it on the https://jai.dev.java.net site. I don't know why...Perhaps I missed it. - Doug >On Sun, 5 Feb 2006, Trent Jarvi wrote: > >>On Sun, 5 Feb 2006, Kim Lux wrote: >> >>>usb ? Tell me more... I need that too. >> >>usb is a very proper design. Thats all it is. >> > >Maybe rxtx could help usb. But it would start with helping bring >back the community that was already there. > >It's not something I'd love to do but maybe its the right thing to do. > >It would probably take 2 years to do right. But maybe thats better >than what we have now. > >I honestly don't know what IBM is doing which could just run over everything. > >Just some thoughts after some fine german wine. > >-- >Trent Jarvi >tjarvi at qbang.org > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tdelenik at gmail.com Mon Feb 6 05:56:32 2006 From: tdelenik at gmail.com (Thanasis Delenikas) Date: Mon, 6 Feb 2006 14:56:32 +0200 Subject: Fwd: [Rxtx] Documentation Wiki In-Reply-To: <1139157422.4553.9.camel@zd7280> References: <20060205113618.30274.qmail@web53501.mail.yahoo.com> <1139157422.4553.9.camel@zd7280> Message-ID: <310a1a930602060456t129f1dc6p5f2b908f13ab5a0b@mail.gmail.com> Hello all, Kim, this is a snippet from the code I use. The closest to directly opening a specific port without enumeration. << ... portId = CommPortIdentifier.getPortIdentifier(getPort()); serialPort = (SerialPort) portId.open("jSMSEngine", 1971); ... >> where getPort() return the string identifier of the port, i.e. "/dev/ttyS0" or "COM1" or whatever. Thanasis. ---------- Forwarded message ---------- From: Kim Lux Date: Feb 5, 2006 6:37 PM Subject: Re: [Rxtx] Documentation Wiki To: RXTX Developers and Users BTW: there is no way to open a port without going through the port list and finding it. Maybe sometime in the future someone (me ?) will write a method called openSerialPort that allows the user to give a port identifier, such as "/dev/tty1" and return a port ready to use. It wouldn't take much to write that and it would save users a lot of code. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/182ab5b8/attachment-0022.html From tjarvi at qbang.org Mon Feb 6 11:53:57 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 11:53:57 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: On Mon, 6 Feb 2006, Dr. Douglas Lyon wrote: > Hi All, > I have often thought about USB drivers being needed. > For example, the ironman watch will not interface > to a mac (windows only). It is USB. > My dymo label writer has no Java driver (native only). > Etc. > Most cheap web cameras are USB (and Java drivers go > through JAI, if it supports the camera at all). > The JAI code shows how sun did the USB drivers. > You have to be a member of the jai project to download > the source code. > https://jai.dev.java.net has the jai distro. > And then you are not allowed to redistribute it. However, > we can all learn from it (if so inclined). Basically: > cvs -d :pserver:lyon at cvs.dev.java.net:/cvs login > cvs -d :pserver:lyon at cvs.dev.java.net:/cvs checkout jai-core > You will need to user your own uid and pw to get in. > The ant build has over 100 warnings from sun deprecations > of its own code. > > You might say that they were hoisted on their own Picard ;) > > One interesting thing is that they support several platforms: > linux-amd64 64-bit Linux-AMD64 > linux-i586 32-bit Linux-x86 > solaris-amd64 64-bit Solaris-AMD64 > solaris-i586 32-bit Solaris-x86 > solaris-sparc 32-bit Solaris-SPARC > solaris-sparcv9 64-bit Solaris-SPARC > windows-i586 32-bit Windows-x86 > Thus, ant is used to provide a multi-platform native method distro. > Neat. > How do they do it? > check this out: > > > > > > > > > > > > > And: > > > > > > > > > > The core download does not contain any C source code (it was all pre-built). > Basically, they are just copying .so and .dll files into build directories. > > I would love to see the C code for this...but Sun does not post it on the > https://jai.dev.java.net site. > > I don't know why...Perhaps I missed it. > > - Doug > > I've looked at moving rxtx to Ant builds. I think that would help IDEs a great deal. I requested a evalutation desk copy the O'Reilly Ant book for some j2ee material I was teaching. http://www.oreilly.com/catalog/anttdg/ It has a one sentence mention of JNI. So there was not luck there. I saw that there is another Ant book that does mention JNI more. I can't find it now. Ant must be able to support it with extensions. http://ant.apache.org/manual/OptionalTasks/javah.html What the auto(break :) tools do in the rxtx build is 4 things really. 1) gcc compile flags 2) ld compile flags 3) config.h 4) compile flags for customizing rxtx (lockfiles, ...) See 1 All of this information except 4 can be static once obtained. So I'm not attached to the auto tools. If I could find an example of Ant being used for JNI code, I'd be one of the first to start moving that direction. Maybe someone saw an example someplace. The other thing we have not completed discussing is the directory structure. There is interest in making rxtx more IDE friendly. I get more mail about that off the list than how to install rxtx. And I see we have Ken Thompson in da house :) He is our trusted CVS maintainer and the guy that purchased the rxtx.org domain. Old community. We will need Ken for changing the directory structure of source. I would like to open up discussion about both of these as it is more than time. The problem is I have little experience with Ant and even less with IDEs. It would be nice if we could work with Eclipse and NetBeans. http://www.netbeans.org/ (sun and some community) http://www.eclipes.org (ibm,rhat,... perhaps more community) http://maven.apache.org/what-is-maven.html (apache. It is community) borland should sortof be here too but I think thats covered in eclipse. >From what I understand so far, we should morph rxtx to support those three maybe trusting apaches lead with maven. But I use vi. I have little to no clues beyond what people have fed me. Can we agree that thats the right direction to go? -- Trent Jarvi tjarvi at qbang.org From brian at mbari.org Mon Feb 6 14:57:50 2006 From: brian at mbari.org (Brian Schlining) Date: Mon, 6 Feb 2006 13:57:50 -0800 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> > The other thing we have not completed discussing is the directory > structure. There is interest in making rxtx more IDE friendly. I > get more mail about that off the list than how to install rxtx. > > And I see we have Ken Thompson in da house :) He is our trusted > CVS maintainer and the guy that purchased the rxtx.org domain. Old > community. We will need Ken for changing the directory structure of > source. > > I would like to open up discussion about both of these as it is > more than time. The problem is I have little experience with Ant > and even less with IDEs. It would be nice if we could work with > Eclipse and NetBeans. > > http://www.netbeans.org/ (sun and some community) > http://www.eclipes.org (ibm,rhat,... perhaps more community) > http://maven.apache.org/what-is-maven.html (apache. It is community) > borland should sortof be here too but I think thats covered in > eclipse. > >> From what I understand so far, we should morph rxtx to support >> those three > maybe trusting apaches lead with maven. But I use vi. I have > little to no clues beyond what people have fed me. > Maven likes the directory structure below for Java code. (From http:// maven.apache.org/guides/getting-started/index.html) This structure works fine with ant, netbeans, and eclipse. rxtx_root_directory `-- src |-- main | `-- java | `-- gnu | `-- io `-- test `-- java `-- gnu `-- io Brian Schlining Software Engineer http://www.mbari.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/d9451eba/attachment-0022.html From tjarvi at qbang.org Mon Feb 6 15:11:45 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 15:11:45 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: > rxtx_root_directory > `-- src > |-- main > | `-- java > | `-- gnu > | `-- io > `-- test > `-- java > `-- gnu > `-- io > >From what I understand this will just be good. For me it makes no difference. So lets do the rxtx thing. Let if fester for two weeks and if nobody objects, we will do it. I'm not doing this because I care. I'm doing this to eliminate much of my inbox. But test... man is rxtx lacking there in the community aspect. It is covered but not right. _maybe_ I can change that this year. -- Trent Jarvi tjarvi at qbang.org (cat hurding since 1997) From lux at diesel-research.com Mon Feb 6 21:38:49 2006 From: lux at diesel-research.com (Kim Lux) Date: Mon, 06 Feb 2006 21:38:49 -0700 Subject: [Rxtx] How can I use Lock Files with rxtx (in FC4) ? Message-ID: <1139287129.17031.3.camel@zd7280> I am now running an rxtx application on FC4. I am getting: ========================================================= check_group_uucp(): error testing lock file creation Error details: Permission denied check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL ========================================================= $ ls -al /var/lock total 32 drwxrwxr-x 4 root lock 4096 Feb 6 16:04 . drwxr-xr-x 24 root root 4096 Nov 14 01:19 .. drwx------ 2 root root 4096 Apr 27 2005 lvm drwxr-xr-x 2 root root 4096 Feb 6 16:04 subsys How do I fix this for regulator users ? -- Kim Lux, Diesel Research Inc. From dmarkman at mac.com Mon Feb 6 22:24:44 2006 From: dmarkman at mac.com (Dmitry Markman) Date: Tue, 7 Feb 2006 00:24:44 -0500 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: if I understands the issue right in order to be able to use ant for c/c++ compilation you have to install ant's cc task http://ant-contrib.sourceforge.net/cc.html it looks like it should work on mac os x (authors claim, that it's platform independent) but I never tested so all you have to do it's providing right command line for the gcc compiler On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: >> rxtx_root_directory >> `-- src >> |-- main >> | `-- java >> | `-- gnu >> | `-- io >> `-- test >> `-- java >> `-- gnu >> `-- io >> > > >> From what I understand this will just be good. > > For me it makes no difference. So lets do the rxtx thing. Let if > fester for two weeks and if nobody objects, we will do it. > > I'm not doing this because I care. I'm doing this to eliminate > much of my inbox. > > But test... man is rxtx lacking there in the community aspect. It > is covered but not right. _maybe_ I can change that this year. > > -- > Trent Jarvi > tjarvi at qbang.org > (cat hurding since 1997) > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx Dmitry Markman From lux at diesel-research.com Mon Feb 6 23:20:15 2006 From: lux at diesel-research.com (Kim Lux) Date: Mon, 06 Feb 2006 23:20:15 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? Message-ID: <1139293215.3689.4.camel@zd7280> I'm running the code below. portlist.hasMoreElements() is false. /dev has ports in it as listed below. What am I doing wrong ? ========================================================== // Step through the list of ports until we find one that matches // the one we are looking for. portList = CommPortIdentifier.getPortIdentifiers(); while(portList.hasMoreElements()) { portID = (CommPortIdentifier) portList.nextElement(); // if (portID.getName().equals("/dev/ttyUSB0")) { myTA.append("Serial port ttyUSB0 has been found\n"); break; }// if portID equals... }// End of while... ========================================================== ls -al /dev/tty* crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 ... crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 -- Kim Lux, Diesel Research Inc. From david.garnier at trusted-logic.com Tue Feb 7 00:46:30 2006 From: david.garnier at trusted-logic.com (David Garnier) Date: Tue, 07 Feb 2006 08:46:30 +0100 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: <43E85056.2090608@trusted-logic.com> Hello, I think that the make-based build process is fine as it is, apart from the location of the Java source files. It is true that putting the Java source in a directory structure that map 1-to-1 to the Java package structure is the norm and should make it easier for everyone to modify the Java source, with or without an IDE. Ant is a good tool, but in the RXTX case I fail to see the advantage of using it compared to the current make-based process. As Trent said, they are more pressing issues, like testing. Regards, David Dmitry Markman wrote: > if I understands the issue right > in order to be able to use ant for c/c++ compilation > you have to install ant's cc task > http://ant-contrib.sourceforge.net/cc.html > > it looks like it should work on mac os x > (authors claim, that it's platform independent) > but I never tested > > so all you have to do it's providing right command line > for the gcc compiler > > > > > On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: > >>> rxtx_root_directory >>> `-- src >>> |-- main >>> | `-- java >>> | `-- gnu >>> | `-- io >>> `-- test >>> `-- java >>> `-- gnu >>> `-- io >>> >> >> >>> From what I understand this will just be good. >> >> For me it makes no difference. So lets do the rxtx thing. Let if >> fester for two weeks and if nobody objects, we will do it. >> >> I'm not doing this because I care. I'm doing this to eliminate much >> of my inbox. >> >> But test... man is rxtx lacking there in the community aspect. It is >> covered but not right. _maybe_ I can change that this year. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> (cat hurding since 1997) From tjarvi at qbang.org Tue Feb 7 01:11:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 01:11:31 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <43E85056.2090608@trusted-logic.com> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: On Tue, 7 Feb 2006, David Garnier wrote: > Hello, > > I think that the make-based build process is fine as it is, apart from the location of the Java > source files. It is true that putting the Java source in a directory structure that map 1-to-1 to > the Java package structure is the norm and should make it easier for everyone to modify the Java > source, with or without an IDE. > > Ant is a good tool, but in the RXTX case I fail to see the advantage of using it compared to the > current make-based process. As Trent said, they are more pressing issues, like testing. > Hi David I have more experience with testing rxtx than I can talk about. But let it be known, rxtx has gone trough 100's of hours of testing. We are hobby folks interested in toys but there is more. rxtx has had some of the best guidance in the industry there. This is not an easy thing. I may be able to come back in a month from the other side of the corperate fence and help. I suspect the tests could just be made public but they are in a very unusual environment that just wont work in a wider sense. This is something I'll be trying to change. At one point it was agreed we could just make the results public so this isnt just noise.. There is interest and I think its safe to mention that much. The big problem with testing in the past is most of it is done with a loopback connection. So we *still* have major questions regarding things like flow control. rxtx talks to itself over a loopback and it works. regardless of right or wrong. This requires more thought to be done right. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Feb 7 02:46:34 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 02:46:34 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: > The big problem with testing in the past is most of it is done with a > loopback connection. So we *still* have major questions regarding things > like flow control. rxtx talks to itself over a loopback and it works. > regardless of right or wrong. With serial communication there are gold standards. ckermit is probably a definitive 'standard.' Maybe its possible to do ping/pong tests with ckermit? Is it scriptable? There are known issues in rxtx. Probably the worst is some threading issues regarding some JREs with multiple JNI threads setting java variables. Man did I get schooled there. Just switch the c functions to returning variables and things go away. Sometimes they work fine, sometimes they blow up. Without understanding everything, somehow rhat got it right and debian (and especially gentoo) grabbed kernel patches causing all sort of harm. Its not hard to fix once you understand whats going on but nearly impossible to track with a debugger. So I have a good idea what 2.1-8 will have outside of the IDE modifications. rxtx 2.1-7 is a release for everyone to sync with. Its not even as stable as -pre17 as far as I know - I ran no test suites. I'll be chasing it too. We just had so many contributions that it was time. It seriously broke internal scheduals but thats a great thing :) The other thing I want to do in 2.1-8 is automagic baud rates. It turns out lots of shops are doing really funky baud rates for things like automobile test equipment. It is possible but it requires a fair amount of change in the native code. Is anyone looking at this? -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Feb 7 02:57:21 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 07 Feb 2006 04:57:21 -0500 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <43E85056.2090608@trusted-logic.com> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: Hi All, I agree, testing is very important. The problem I have been trying to address is related to cross-platform testing and the robust nature of the installs. Typically, I visit 3 platforms to deploy my product, windows, linux and mac. A build is performed on each platform. The idea that you can build for many platforms from one copy the source code seems attractive. This should enable synchronized deployments of identical code. The question of how to achieve this goal remains open. As Trent mentioned, this is hard. Perhaps Ant will help here (but perhaps not). Ant does seem to help with running unit tests. However, it does not help with multi-platform tests. For that you need many machines and different operating environments. Toward that end, I have created a multi-platform test that can be run from web start, located at: http://show.docjava.com:8086/book/cgij/code/jnlp/serialPort.PortTest.jnlp This is interesting because many people in the community can run the test and we can improve the test, as time permits. No, it is not a perfect solution, however, the idea does help with multi-platform tests using many machines and different operating environments. If the group has a good test for a general serial port set-ups, i would be happy to deploy it, for general evaluation using web start. And as for ANT, it is just an idea. Not all my ideas are good ones! - Doug >Hello, > >I think that the make-based build process is fine as it is, apart >from the location of the Java >source files. It is true that putting the Java source in a directory >structure that map 1-to-1 to >the Java package structure is the norm and should make it easier for >everyone to modify the Java >source, with or without an IDE. > >Ant is a good tool, but in the RXTX case I fail to see the advantage >of using it compared to the >current make-based process. As Trent said, they are more pressing >issues, like testing. > >Regards, >David > >Dmitry Markman wrote: >> if I understands the issue right >> in order to be able to use ant for c/c++ compilation >> you have to install ant's cc task >> http://ant-contrib.sourceforge.net/cc.html >> >> it looks like it should work on mac os x >> (authors claim, that it's platform independent) >> but I never tested >> >> so all you have to do it's providing right command line >> for the gcc compiler >> >> >> >> >> On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: >> >>>> rxtx_root_directory >>>> `-- src >>>> |-- main >>>> | `-- java >>>> | `-- gnu >>>> | `-- io >>>> `-- test >>>> `-- java >>>> `-- gnu >>>> `-- io >>>> >>> >>> >>>> From what I understand this will just be good. >>> >>> For me it makes no difference. So lets do the rxtx thing. Let if >>> fester for two weeks and if nobody objects, we will do it. >>> >>> I'm not doing this because I care. I'm doing this to eliminate much >>> of my inbox. >>> >>> But test... man is rxtx lacking there in the community aspect. It is >>> covered but not right. _maybe_ I can change that this year. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> (cat hurding since 1997) > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From matt.higgins at gmail.com Tue Feb 7 08:28:34 2006 From: matt.higgins at gmail.com (Matt Higgins) Date: Tue, 7 Feb 2006 10:28:34 -0500 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final Message-ID: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? import java.io.*; import java.util.*; import gnu.io.*; public class MySimpleRead implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; public static void main(String[] args) { boolean portFound = false; String defaultPort = "COM1"; if (args.length > 0) { defaultPort = args[0]; } portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; MySimpleRead reader = new MySimpleRead(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } } public MySimpleRead() { try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) { e.printStackTrace(); } try { inputStream = serialPort.getInputStream(); } catch (IOException e) { e.printStackTrace(); } try { serialPort.addEventListener(this); } catch (TooManyListenersException e) { e.printStackTrace(); } try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { e.printStackTrace(); } System.out.println("Baud is " + serialPort.getBaudRate()); System.out.println("Bits is " + serialPort.getDataBits()); System.out.println("Stop is " + serialPort.getStopBits()); System.out.println("Par is " + serialPort.getParity()); serialPort.notifyOnDataAvailable(true); readThread = new Thread(this); readThread.start(); } public void run() { // Thread.sleep(20000); //} catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { System.out.println("An event occurred " + event.getEventType()); switch (event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: byte[] readBuffer = new byte[20]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } System.out.print(new String(readBuffer)); } catch (IOException e) {} break; } } } --------------- Result on windows ------------------------------ Stable Library ============================================================== Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port:: COM1 Baud is 9600 Bits is 8 Stop is 1 Par is 0 ----------------- End Results ----------------------------------------- ------------------ Result on Linux ----------------------------------- Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 Found port: /dev/ttyS0 Baud is 9600 Bits is 8 Stop is 1 Par is 0 An event occurred 1 043100066224 ------------------ End Results --------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/a1431630/attachment-0022.html From brian at mbari.org Tue Feb 7 09:48:37 2006 From: brian at mbari.org (Brian Schlining) Date: Tue, 7 Feb 2006 08:48:37 -0800 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> Message-ID: <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> Hi Matt > The following code works fine on Linux but I never see any data > when run on Windows. This is a cut and paste from the SimpleRead > example. > I am attempting to read data from a bar code scanner. I can fire > up HyperTermianl on windows and see that the device is working > properly as I see the barcodes are scanned and echoed back to the > terminal. However when I run the app I don't see any data. It is > however associating with the com port as the informational bits > print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. Cheers Brian Schlining Software Engineer http://www.mbari.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/16d07f37/attachment-0022.html From lux at diesel-research.com Tue Feb 7 11:59:58 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 11:59:58 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139293215.3689.4.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> Message-ID: <1139338798.8145.4.camel@zd7280> Any ideas on this ? Any reason why portList.hasMoreElements() should be false even though there are devices in /dev ? On Mon, 2006-02-06 at 23:20 -0700, Kim Lux wrote: > I'm running the code below. > > portlist.hasMoreElements() is false. > > /dev has ports in it as listed below. > > What am I doing wrong ? > > > ========================================================== > // Step through the list of ports until we find one that matches > // the one we are looking for. > > portList = CommPortIdentifier.getPortIdentifiers(); > > while(portList.hasMoreElements()) > { > portID = (CommPortIdentifier) portList.nextElement(); // > if (portID.getName().equals("/dev/ttyUSB0")) > { > myTA.append("Serial port ttyUSB0 has been found\n"); > break; > }// if portID equals... > }// End of while... > ========================================================== > > ls -al /dev/tty* > crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty > crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 > crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 > crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 > crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 > ... > crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 > crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 > crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 > > > -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 12:20:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 12:20:25 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139338798.8145.4.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> Message-ID: On Tue, 7 Feb 2006, Kim Lux wrote: > > Any ideas on this ? Any reason why portList.hasMoreElements() should be > false even though there are devices in /dev ? > > > On Mon, 2006-02-06 at 23:20 -0700, Kim Lux wrote: >> I'm running the code below. >> >> portlist.hasMoreElements() is false. >> >> /dev has ports in it as listed below. >> >> What am I doing wrong ? >> >> >> ========================================================== >> // Step through the list of ports until we find one that matches >> // the one we are looking for. >> >> portList = CommPortIdentifier.getPortIdentifiers(); >> >> while(portList.hasMoreElements()) >> { >> portID = (CommPortIdentifier) portList.nextElement(); // >> if (portID.getName().equals("/dev/ttyUSB0")) >> { >> myTA.append("Serial port ttyUSB0 has been found\n"); >> break; >> }// if portID equals... >> }// End of while... >> ========================================================== >> >> ls -al /dev/tty* >> crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty >> crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 >> crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 >> crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 >> crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 >> ... >> crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 >> crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 >> crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 >> >> >> > Hi Kim What rxtx does is try to open the port and do a timed out read. If the kernel/... do not complain it's enumarted. I suspect you could do a crude test by doing something like cat /dev/ttyS0 > /dev/null If that barfs then rxtx wont enumerate the port. hmm looking at your question again, I suspect it's a lockfile problem. This is documented in INSTALL with the source. Its easy enough to test this too.. touch /var/lock/testingrxtxlockfiles && rm -f /var/lock/testingrxtxlockfiles If you are not in the right group it will bail. Root will work regardless. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 12:37:56 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 12:37:56 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> Message-ID: <1139341076.8145.11.camel@zd7280> Exactly which ports does rxtx attempt to put into the list ? /dev/* or /dev/tty* or /dev/tty[0-9[0-9] ? or /dev/ttyS* ? For the record, only /dev/ttyUSB0 is a valid port on the machine I am presently on. Will this be a problem ? On Tue, 2006-02-07 at 12:20 -0700, Trent Jarvi wrote: > This is documented in INSTALL with the source. > I was wondering where that file was. I will download source and dig it up. Thanks. -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 12:51:09 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 12:51:09 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139341076.8145.11.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: On Tue, 7 Feb 2006, Kim Lux wrote: > > Exactly which ports does rxtx attempt to put into the list ? /dev/* > or /dev/tty* or /dev/tty[0-9[0-9] ? or /dev/ttyS* ? > > For the record, only /dev/ttyUSB0 is a valid port on the machine I am > presently on. Will this be a problem ? > > > On Tue, 2006-02-07 at 12:20 -0700, Trent Jarvi wrote: >> This is documented in INSTALL with the source. >> > I was wondering where that file was. I will download source and dig it > up. > > Thanks. > Hmm I'm looking at pre17 so this may have changed. (its just what I have on this machine) if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA" // for the IPAQs }; CandidatePortPrefixes=Temp; } So you may need to add "ttyUSB" to that list. RXTX used to enumerate _everything_ see if(osName.equals("Linux-all-ports") But it became less than practical. This is all in RXTXCommDriver.java hmm I just did a cvs update. if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have to get your fingers into the code. We aim for sane defaults. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 13:06:45 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 13:06:45 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139342805.8145.22.camel@zd7280> On Tue, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > Hmm I'm looking at pre17 so this may have changed. (its just what I have > on this machine) > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA" // for the IPAQs > }; > CandidatePortPrefixes=Temp; > } > > > So you may need to add "ttyUSB" to that list. RXTX used to enumerate > _everything_ see if(osName.equals("Linux-all-ports") But it became less > than practical. > > This is all in RXTXCommDriver.java > > hmm I just did a cvs update. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have > to get your fingers into the code. We aim for sane defaults. Excellent. Thanks for taking the time. -- Kim Lux, Diesel Research Inc. From ideiglenes1 at freemail.hu Tue Feb 7 13:53:39 2006 From: ideiglenes1 at freemail.hu (--) Date: Tue, 07 Feb 2006 21:53:39 +0100 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139345619.22534.2.camel@localhost> Hi! I use this code to get all the extra Linux devices. :) if ("Linux".equals(System.getProperty("os.name"))) { System.setProperty("os.name","Linux-all-ports"); } driver = new RXTXCommDriver(); On k, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > On Tue, 7 Feb 2006, Kim Lux wrote: > > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have > to get your fingers into the code. We aim for sane defaults. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From matt.higgins at gmail.com Tue Feb 7 13:45:54 2006 From: matt.higgins at gmail.com (Matt Higgins) Date: Tue, 7 Feb 2006 15:45:54 -0500 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> Message-ID: <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> Sweet this is exactly what I needed. I was searching the archives through marc.theamisgroup they only have archives back to 1/3/05. Should have hit the mailman archive! Thanks a lot! On 2/7/06, Brian Schlining wrote: > > Hi Matt > > The following code works fine on Linux but I never see any data when run > on Windows. This is a cut and paste from the SimpleRead example. > I am attempting to read data from a bar code scanner. I can fire up > HyperTermianl on windows and see that the device is working properly as I > see the barcodes are scanned and echoed back to the terminal. However when I > run the app I don't see any data. It is however associating with the com > port as the informational bits print fine? > > > You're not the only one whose had this problem, I don't know if Trent has > addressed this is the latest release of RXTX but there is a workaround. > Here's the recent thread from the RXTX mailing list regarding this issues: > > Thanasis Delenikas tdelenik at gmail.com > Wed Jan 18 13:56:23 MST 2006 > > * Previous message: [Rxtx] Re: More close() performance fixes > * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] > > Hi all. > (I've subscribed again from my other email account). > > Trent, > > You are right. Linux *always* works, no matter what flow control you set. > Windows *works only* with hardware flow control (I haven't tested what > happens with software XON/XOFF flow control). > > I assume (but I am not certain) that even with no flow control at all, all > platforms should work. Without flow control, you have the risk of bumping > into overflow or framing errors, but that's your (the end programmer, I > mean) problem. > > >From my side, I shouldn't be working without flow control. That was a bug > too... It was some code forgotten from the old times, when I used to work > with phone emulation drivers which didn't support flow control. The > correct > way is to have some flow control enabled and that's why I suppose this is > a > low-severity bug for RxTx. > > I have no idea which platform shows the correct behaviour, since > my knowledge about Linux and the inner workings of these low-level i/o > operations is limited. > > Regards, > Thanasis Delenikas. > > > > > Message: 2 > > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > > From: Trent Jarvi > > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > > To: RXTX Developers and Users > > Message-ID: > > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > > > Hi all, > > > > > > Trent, I have found something. > > > I read your comment about flow control, so I experimented a bit. > > > > > > If you remember, in my sample program I've used no flow control at all > ( > > i.e. > > > Java constant FLOWCONTROL_NONE). > > > > > > Now, during testing, I've switch to hardware inbound flow control (i.e > . > > Java > > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > > beautifully! > > > > > > I think I will switch to H/W flow control and test things for a while, > > but > > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > > > > > Hi Thanasis, > > > > I'm fairly sure you have identified a bug. I would not worry too much > > about what Sun CommAPI w32 defaults are. I think they did more or less > > whatever the port opened with. Just a guess. Linux tries to stomp on > > ports so they are all the same. > > > > So this started out with Linux worked, Windows XP/.. did not as I > recall. > > Something is wrong in rxtx. Do I understand this right? > > > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > > > Perhaps there is something Wayne or I did not understand when we wrote > > that code. I wasnt programming back in the BBS days so modems are not > my > > thing. I have a few questions. > > > > Is the above matrix confirmed by observation? > > Linux just always worked? > > Which one _should_ work? I'm guessing modems work with hardware flow > > control. I'll have to dig around. > > > > The windows flow control changes a couple things with hardware flow > > control. Following the w32 API documentation is confusing sometimes. > > But it looks like Linux could have a bug too. > > Cheers > > Brian Schlining > Software Engineer > http://www.mbari.org > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/9c989144/attachment-0022.html From tjarvi at qbang.org Tue Feb 7 14:06:14 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 14:06:14 -0700 (MST) Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> Message-ID: >> >> You're not the only one whose had this problem, I don't know if Trent has >> addressed this is the latest release of RXTX but there is a workaround. >> Here's the recent thread from the RXTX mailing list regarding this issues: >> I have not. I expect to have access to some test equipment next month and I'll go through all of this. I really don't know whats going on and I need a gold standard. I thought maybe linux was autodetecting the flow control. Your observations would certainly be welcome. I need to talk to Russell King and see what he is doing. Until then I'd just be toying around over a loopback as usual. This is very high on the list though. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 17:25:05 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 17:25:05 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139358305.17994.2.camel@zd7280> My application now works. I installed the libraries and jar from 2.1-7 (Final). portlist.hasMoreElements is no longer false. The application finds the port for /dev/ttyUSB0. Thanks for your help, Trent (et al) Sorry I bothered you with this. Next time I will look in the source first. I didn't think it was an rxtx issue, I thought it was a Linux setup issue . On Tue, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > Hmm I'm looking at pre17 so this may have changed. (its just what I > have > on this machine) > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux > Serial Ports > "ttySA" // for the > IPAQs > }; > > CandidatePortPrefixes=Temp; > } > > > So you may need to add "ttyUSB" to that list. RXTX used to enumerate > _everything_ see if(osName.equals("Linux-all-ports") But it became > less > than practical. > > This is all in RXTXCommDriver.java > > hmm I just did a cvs update. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux > Serial Ports > "ttySA", // for the > IPAQs > "ttyUSB" // for USB > frobs > }; > > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you > have > to get your fingers into the code. We aim for sane defaults. -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 19:21:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 19:21:54 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139358305.17994.2.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> <1139358305.17994.2.camel@zd7280> Message-ID: >Sorry I bothered you with this. Next time I will look in the source >first. I didn't think it was an rxtx issue, I thought it was a Linux >setup issue . Why would you be sorry? I would have done the same. I'm glad it's working :) -- Trent Jarvi tjarvi at qbang.org From tma at mail.island.net Wed Feb 8 13:39:35 2006 From: tma at mail.island.net (Tom Alldread) Date: Wed, 08 Feb 2006 12:39:35 -0800 Subject: [Rxtx] Win32/Linux Serial Port Data Dropouts In-Reply-To: <200602060702.k167255O007882@www.qbang.org> References: <200602060702.k167255O007882@www.qbang.org> Message-ID: <43EA5707.4020200@mail.island.net> Greetings Folks at RXTX: During the last couple of months I have been alternately testing with javax.comm 2 and RXTX 2.1 under Windows XP and CommApi 3 and RXTX 2.1 under Suse 10.0 Linux. In the process I have learned a little about java multi-threading under NetBeans 5 with Profiler. My java (jdk 1.5_06) application is used for data acquisition and provides a graphical display of A-D conversion data received from a 56KBaud serial port. The actual data throughput is about 10KBaud thus it is well below the speed of the port. I use hardware RTS/CTS flow control which can stall the data acquisition sample rate if necessary. This ensures the display computer has the ability to slow the data acquisition rate should it become too busy to accept the regular data flow. Both the serial port buffer and the java read buffer are set at 16KB. Usually the data transfers into the java read buffer are less than 100 bytes unless the data acquisition is recovering from a stall. The data flow normally hesitates after each 5 KB block as a continue command is needed from the display computer to start the drawing of a new graphics display line. Separate threads have been provided for the serial port event monitoring and data processing. The serial port event thread has been given the maximum priority and data processing thread the minimum priority provided by java. Thread yield statements have been placed within all data processing while/for loops as an effort to ensure quick access to CPU cycles for the serial port event thread. I have found that short data transmissions are essentially error free but occasional dropouts occur with continuous data flow especially under Windows XP. ....................................................................................................................................................................................... Linux results: I am happy to report that RXTX 2.1 appears to work very well under Linux although I did notice some errors when the screen savers were running with my dual monitors. I believe this is a local problem associated with my dual graphics which needs further attention. The recent CommApi 3 Linux release from Sun did not work at all with my program. It seemed to send commands out OK but did not receive any data. Although the serial port event triggered the ISR, the input stream appeared filled with nulls and thus did not contain any data. As my understanding is that CommApi 3 was tested with a Red Hat distribution of Linux I wonder if this problem is distro dependent? Although somewhat off topic here I wonder if anyone reading this has had similar experience? .................................................................................................................................................................................. Windows XP results: There are problems with occasional data dropouts which become more frequent as the sampling rate is increased or if the computer becomes busy with other duties. The dropouts typically consist of a half dozen byte block of lost data. It appears the lost bytes never get added to the java input stream. There has not been any indication of garbled data, overruns or framing errors which suggests the UART communications remains solid. Using javax.comm 2 I found that the setting of SerialPort 'enableReceiveThreshold' to 40 and 'enableReceiveTimeout' of 100mS reduced the dropouts error rate significantly. I found that I could not get RXTX 2.1 to function with the aforementioned threshold and timeout settings. The javax.comm 2 interface is consequently performing better for me under Windows than RXTX 2.1. I wonder if anyone here has any suggestions as to what I might try to improve RXTX 2.1? Although my settings are the same as under Suse 10.0, RXTX 2.1 performs much better for me under Linux than any of the alternatives that I have tried under Windows XP . ............................................................................................................................................................................... I would like to establish, based on the experience of others, if I have reached the normally expected performance limit of java serial port communications? Should I expect to achieve virtually error free serial port data input from a continuous stream under Windows XP java software? I am considering changing my protocol to packets with error checking if necessary but would like to know if the dropout problems I am experiencing are typical or not before I take this rather work intensive plunge. Many thanks in advance for any help! Best Regards, Tom Alldread -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.375 / Virus Database: 267.15.2/253 - Release Date: 2006-02-07 From jlaxson at mac.com Wed Feb 8 23:56:48 2006 From: jlaxson at mac.com (John Laxson) Date: Thu, 9 Feb 2006 00:56:48 -0600 Subject: [Rxtx] PortInUseException: Unknown Application on OSX Message-ID: Hi, I've been trying to get RXTX 2.1.7 going on Mac OS X for a while here, and am running up into a wall here. I've tried with pre- compiled and the source version and get the same problem, a gnu.io.PortInUseException: Unknown Application. I have run the fixperms script included with the source distribution, and id shows me as a member of the uucp group, and permissions on /var/spool/uucp are 775 root:uucp. Running a test program (included at the bottom for clarity) lets me enumerate all the serial ports correctly, but trying to open any of them gives the PortInUseException. If it helps, when I try to open a port that's set to make an outgoing bluetooth connection, there is no delay and no connection attempt at all. Thanks, John Laxson PS: The documentation wiki on qbang.org shows 404, and has for a few days now. My test code: public static void main(String[] args) { SerialPort serialPort; try { Enumeration e = CommPortIdentifier.getPortIdentifiers(); CommPortIdentifier ident; while (e.hasMoreElements()) { ident = (CommPortIdentifier)e.nextElement(); System.out.println(ident.getName()); } ident = CommPortIdentifier.getPortIdentifier("/dev/cu.modem"); serialPort = (SerialPort) ident.open("Me", 5000); } catch (Exception e) { e.printStackTrace(); } } From rajesh.invincible at gmail.com Thu Feb 9 03:39:38 2006 From: rajesh.invincible at gmail.com (Rajesh N) Date: Thu, 9 Feb 2006 16:09:38 +0530 Subject: [Rxtx] Re: Move .java Files in gnu.io filesystem hierarchy - Maven (2) In-Reply-To: <43DF21D2.7090200@ngi.it> References: <43DF21D2.7090200@ngi.it> Message-ID: <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Can anybody tell me how to overcome these EXCEPTIONS I AM WORKING ON SERIAL COMMN IN JAVA ON LINUX. 1. " NOT ALL PARAMETERS SUPPORTED BY THE KERNEL" This i came across the following statement inmy prog. SerialP is A SerialPort object SerialP.setSerialPortParams(9600(BAUDRATE),DATABITS_8,STOPBITS_1,PARITY_NONE) 2. NullPointer Exception at Event Dispatch Now i have checked all my object references for a null reference but i found none i have put up my entire code in try catch blocks but still I AM UNABLE TO CATCH THIS EXCEPTION AND HENCE MY APPLICATION CLOSES HOW DOES THESE GO? PLEASE HELP ME IT IS URGENTTTTTTTTTTTTTTTT yours sincerely RAJESH On 1/31/06, Fabio Frumento wrote: > Hi Xavier, > > I don't know maven at all but the directory hierarchy listed buy Trent > is fine for me... > > I'll take a look to maven, it seems an interesting project > > Regards > > Fabio Frumento > > Trent Jarvi wrote: > > On Tue, 31 Jan 2006, Xavier Frisaye wrote: > > > >> Hi all, > >> > >> If you are going to rearrange the src folder, i will propose to use > >> maven 2 and follow its directory structure > >> > (http://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html). > >> > >> Maven 2 simplify java project and give a standard way to make projects > >> (http://maven.apache.org/). > >> We are using it for internal projects and we are very satisfied. > >> > >> Is anybody interested? > >> > >> I'm not an expert in maven 2 (yet) but i'm agree to help using it if > >> you choose to make so. > >> > > > > so this would be: > > > > rxtx-devel/src/main/java/gnu.io > > rxtx-devel/src/test/java/ManIwish.java > > > > I don't use IDEs very much so I'll let others comment. But I don't see > > a problem with that. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Thu Feb 9 09:50:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 9 Feb 2006 09:50:31 -0700 (MST) Subject: [Rxtx] Re: Move .java Files in gnu.io filesystem hierarchy - Maven (2) In-Reply-To: <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Message-ID: On Thu, 9 Feb 2006, Rajesh N wrote: > Can anybody tell me how to overcome these EXCEPTIONS > I AM WORKING ON SERIAL COMMN IN JAVA ON LINUX. > > 1. " NOT ALL PARAMETERS SUPPORTED BY THE KERNEL" > > This i came across the following statement inmy prog. > SerialP is A SerialPort object > SerialP.setSerialPortParams(9600(BAUDRATE),DATABITS_8,STOPBITS_1,PARITY_NONE) > Strange. The parameters you use are the same the port should open with by default. Could you paste the actual exception you are getting? I don't see that in the rxtx source. Also it would help to know the rxtx version. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Fri Feb 10 15:29:05 2006 From: lux at diesel-research.com (Kim Lux) Date: Fri, 10 Feb 2006 15:29:05 -0700 Subject: [Rxtx] One serial port object for both sending and receiving ? Message-ID: <1139610545.18177.4.camel@zd7280> Is it OK to use one SerialPort ojbect (ex Serial Port serialPort;) and use it for both sending and receiving ? For example: ======================================================================== static SerialPort serialPort = null; static OutputStream serialOut = null; static InputStream serialIn = null; // assign it to an outputStream for use try{ serialOut = serialPort.getOutputStream(); System.out.println("Serial output stream has been assigned."); }//try catch(IOException e) { System.out.println("Error: Couldn't assign output stream to serial port."); }//catch //assign it to an inputStream for use try{ serialIn = serialPort.getInputStream(); System.out.println("Serial input stream has been assigned."); }//try catch(IOException e) { System.out.println("Error: Couldn't assign input stream to serial port."); }//catch ======================================================================== -- Kim Lux, Diesel Research Inc. From lux at diesel-research.com Fri Feb 10 21:23:00 2006 From: lux at diesel-research.com (Kim Lux) Date: Fri, 10 Feb 2006 21:23:00 -0700 Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Message-ID: <1139631780.23882.10.camel@zd7280> I've got a problem receiving chars with my version of serialRead, written in an SWT GUI. I had a Java pro have a good look at my code and he can't see anything wrong with it. I can send chars fine. When I receive a char the cpu usage for the app goes to 100% and the code in the serial event handler doesn't get executed. The instructions on the Java Comm Serial API How-To for Linux page state that I must install javacomm. Is that true ? Everything builds without it and I can send chars on rxtx just fine, but I can't receive them. Could this be the problem ? I downloaded and installed javacomm. I was not able to add "Driver=gnuio.RXTXCommDriver to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 installed in /usr/java/jre1.5.0_05. I added comm.jar to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext to the library paths. Is this OK ? Does it matter that I am receiving on /dev/ttyUSB0 ? Thanks. -- Kim Lux, Diesel Research Inc. From lunareclipse03 at web.de Sat Feb 11 09:44:46 2006 From: lunareclipse03 at web.de (lunareclipse03@web.de) Date: Sat, 11 Feb 2006 17:44:46 +0100 Subject: [Rxtx] Question about Serial I/O under Win32 Message-ID: <662084330@web.de> Hello everybody, I have a strange problem with a piece of code I made for myself. No, this is not really concerning rxtx, but nevertheless I post this to the list, hoping that some of you can help me. I've written two libraries, one for linux and one for win32. The linux port works quite well, I can send / receive faxes and / or replay voice messages over the telephone line using a voice modem. But the win32 port of the library causes some trouble. If, for example, I send out a fax with a certain modem under linux, it works well. The fax is complete when it comes out of the fax machine. If I then use the same modem to send out a fax under win32, the fax coming out of the fax machine gets "stuck" halfways, but the sending modem thinks that transmission was ok and drops the connection. The answering fax machine then gives me "error while receiving." The "upper layer" java code MUST be right, because if I do the same thing under linux (using the linux library), everything is alright. Now I have to ask: Can somebody please help me out with this??!? Could it be the case that some kind of flow control or COMMTIMEOUTS setting causes this behaviour? I set flow control to RTS/CTS before sending out a fax. How can I DISABLE flow control? Or what do you think? Can something else cause this problems? Thank you all for your time and PLEASE write back soon. Regards, --Sven Ahlemann Am Waldrand 31 45721 Haltern am See Germany ______________________________________________________________ Verschicken Sie romantische, coole und witzige Bilder per SMS! Jetzt bei WEB.DE FreeMail: http://f.web.de/?mc=021193 From lux at diesel-research.com Sat Feb 11 10:06:52 2006 From: lux at diesel-research.com (Kim Lux) Date: Sat, 11 Feb 2006 10:06:52 -0700 Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: <1139631780.23882.10.camel@zd7280> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> <1139631780.23882.10.camel@zd7280> Message-ID: <1139677612.3431.5.camel@zd7280> More on this problem. I copied and pasted simpleRead into a console based Eclipse project and I've got the same result, except that cpu usage doesn't go to 100%. I'm beginning to think there is an issue in rxtx. My imports for simpleRead are: ============================ import gnu.io.*; import java.util.*; //import javax.comm.*; import java.io.*; =========================== Any ideas ? I am trying to read from /dev/ttyUSB0 using a serial to USB adapter which has worked well with minicom and gtkterm. Thanks. On Fri, 2006-02-10 at 21:23 -0700, Kim Lux wrote: > I've got a problem receiving chars with my version of serialRead, > written in an SWT GUI. > > I had a Java pro have a good look at my code and he can't see anything > wrong with it. > > I can send chars fine. When I receive a char the cpu usage for the app > goes to 100% and the code in the serial event handler doesn't get > executed. > > The instructions on the Java Comm Serial API How-To for Linux page state > that I must install javacomm. Is that true ? Everything builds without > it and I can send chars on rxtx just fine, but I can't receive them. > Could this be the problem ? > > I downloaded and installed javacomm. I was not able to add > "Driver=gnuio.RXTXCommDriver > to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not > have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 > installed in /usr/java/jre1.5.0_05. I added comm.jar > to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext > to the library paths. Is this OK ? > > Does it matter that I am receiving on /dev/ttyUSB0 ? > > Thanks. > -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Sun Feb 12 21:01:33 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:01:33 -0700 (MST) Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: <1139677612.3431.5.camel@zd7280> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> <1139631780.23882.10.camel@zd7280> <1139677612.3431.5.camel@zd7280> Message-ID: I suspect what is happening is the select() is breaking out in the native code but the driver does not have support for notifying there are X bytes available. On some traditional Unix based systems, the only way you know data is available is the fd status changes and do an FIORDCHK ioctl. Or perhaps the only thing you can know is the fd status changed. It would take reading through the kernel driver code to know for sure. So on USB, depending upon the driver, the same may need to be done or the driver improved a bit if possible to support. Polling reads will also work but don't use the event driven model of CommAPI which isnt acceptable in the long run. The 100% cpu usage can then be explained because select no longer blocks until the data is read; the eventLoop spins loose. You can put a well placed sleep but rxtx only expects those are needed when it knows data is available. This may not be a super simple thing to understand and fix. I do have ideas to get you started. I'm going to be short on time the next couple weeks. I expect to put some good time in and answer some other questions I saw around the 25th. For now, I'd look at the following and go from there with the hints I've given. JNIEXPORT jint JNICALL RXTXPort(nativeavailable)( JNIEnv *env, jobject jobj ) { int fd = get_java_var( env, jobj,"fd","I" ); int result; /* char message[80]; ENTER( "RXTXPort:nativeavailable" ); On SCO OpenServer FIONREAD always fails for serial devices, so try ioctl FIORDCHK instead; will only tell us whether bytes are available, not how many, but better than nothing. This turns out to be true on Solaris also. taj. */ #ifdef FIORDCHK /* __unixware__ __sun__ probably others */ result = ioctl(fd, FIORDCHK, 0); #else if( ioctl( fd, FIONREAD, &result ) < 0 ) { goto fail; } #endif /* FIORDCHK */ On Sat, 11 Feb 2006, Kim Lux wrote: > > More on this problem. I copied and pasted simpleRead into a console > based Eclipse project and I've got the same result, except that cpu > usage doesn't go to 100%. I'm beginning to think there is an issue in > rxtx. > > My imports for simpleRead are: > > ============================ > import gnu.io.*; > import java.util.*; > //import javax.comm.*; > import java.io.*; > =========================== > > Any ideas ? I am trying to read from /dev/ttyUSB0 using a serial to > USB adapter which has worked well with minicom and gtkterm. > > Thanks. > > > > On Fri, 2006-02-10 at 21:23 -0700, Kim Lux wrote: >> I've got a problem receiving chars with my version of serialRead, >> written in an SWT GUI. >> >> I had a Java pro have a good look at my code and he can't see anything >> wrong with it. >> >> I can send chars fine. When I receive a char the cpu usage for the app >> goes to 100% and the code in the serial event handler doesn't get >> executed. >> >> The instructions on the Java Comm Serial API How-To for Linux page state >> that I must install javacomm. Is that true ? Everything builds without >> it and I can send chars on rxtx just fine, but I can't receive them. >> Could this be the problem ? >> >> I downloaded and installed javacomm. I was not able to add >> "Driver=gnuio.RXTXCommDriver >> to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not >> have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 >> installed in /usr/java/jre1.5.0_05. I added comm.jar >> to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext >> to the library paths. Is this OK ? >> >> Does it matter that I am receiving on /dev/ttyUSB0 ? >> >> Thanks. >> > From tjarvi at qbang.org Sun Feb 12 21:03:30 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:03:30 -0700 (MST) Subject: [Rxtx] One serial port object for both sending and receiving ? In-Reply-To: <1139610545.18177.4.camel@zd7280> References: <1139610545.18177.4.camel@zd7280> Message-ID: On Fri, 10 Feb 2006, Kim Lux wrote: > > Is it OK to use one SerialPort ojbect (ex Serial Port serialPort;) and > use it for both sending and receiving ? > > For example: > > ======================================================================== > static SerialPort serialPort = null; > static OutputStream serialOut = null; > static InputStream serialIn = null; > > > > > // assign it to an outputStream for use > try{ > serialOut = serialPort.getOutputStream(); > System.out.println("Serial output stream has been assigned."); > }//try > catch(IOException e) > { > System.out.println("Error: Couldn't assign output stream to serial > port."); > }//catch > > > //assign it to an inputStream for use > try{ > serialIn = serialPort.getInputStream(); > System.out.println("Serial input stream has been assigned."); > }//try > catch(IOException e) > { > System.out.println("Error: Couldn't assign input stream to serial > port."); > }//catch This should be fine. In fact trying to do it another way will probably not work as you will run into lockfile issues. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun Feb 12 21:13:13 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:13:13 -0700 (MST) Subject: [Rxtx] Question about Serial I/O under Win32 In-Reply-To: <662084330@web.de> References: <662084330@web.de> Message-ID: On Sat, 11 Feb 2006 lunareclipse03 at web.de wrote: > Hello everybody, > > I have a strange problem with a piece of code I made for myself. No, > this is not really concerning rxtx, but nevertheless I post this to the > list, hoping that some of you can help me. I've written two libraries, > one for linux and one for win32. The linux port works quite well, I can > send / receive faxes and / or replay voice messages over the telephone > line using a voice modem. But the win32 port of the library causes some > trouble. If, for example, I send out a fax with a certain modem under > linux, it works well. The fax is complete when it comes out of the fax > machine. If I then use the same modem to send out a fax under win32, the > fax coming out of the fax machine gets "stuck" halfways, but the sending > modem thinks that transmission was ok and drops the connection. The > answering fax machine then gives me "error while receiving." The "upper > layer" java code MUST be right, because if I do the same thing under > linux (using the linux library), everything is alright. Now I have to > ask: Can somebody please help me out with this??!? Could it be the case > that some kind of flow control or COMMTIMEOUTS setting causes this > behaviour? I set flow control to RTS/CTS before sending out a fax. How > can I DISABLE flow control? Or what do you think? Can something else > cause this problems? Thank you all for your time and PLEASE write back > soon. > Hi Sven I'm not too willing to talk about flow control at the low level until I confirm some things with test equipment later. It is not clear if you are using rxtx or writing your own native code. So I'm not sure how to answer much of this :) If you are wondering how to change the flow control using rxtx from java, The BlackBox example from Sun flips this back and forth. SerialPort.java in rxtx 2.1 uses the following: SerialPort.java: public static final int FLOWCONTROL_NONE =0; SerialPort.java: public static final int FLOWCONTROL_RTSCTS_IN =1; SerialPort.java: public static final int FLOWCONTROL_RTSCTS_OUT =2; SerialPort.java: public static final int FLOWCONTROL_XONXOFF_IN =4; SerialPort.java: public static final int FLOWCONTROL_XONXOFF_OUT=8; So if you set flowcontrol to RTSCTS, you can set it to NONE to turn it off. If you are looking for how to do it in native code, the rxtx Source is SerialImp.c (unix/linux/mac os x/w32) and termios.c (w32 only with SerialImp.c) You can track the code: SerialImp.c:JNIEXPORT void JNICALL RXTXPort(setflowcontrol)( JNIEnv *env, jobject jobj, jint flowmode ) termios.c:int tcgetattr( int fd, struct termios *s_termios ) termios.c:int tcsetattr( int fd, int when, struct termios *s_termios ) There may be a problem in the rxtx flow control code though. Rather than guess, I want to test this with a gold standard. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Feb 6 00:00:16 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 00:00:16 -0700 (MST) Subject: [Rxtx] wiki delay until tomorrow night. In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: On Sun, 5 Feb 2006, Trent Jarvi wrote: > On Sun, 5 Feb 2006, Kim Lux wrote: > >> usb ? Tell me more... I need that too. > > usb is a very proper design. Thats all it is. > Maybe rxtx could help usb. But it would start with helping bring back the community that was already there. It's not something I'd love to do but maybe its the right thing to do. It would probably take 2 years to do right. But maybe thats better than what we have now. I honestly don't know what IBM is doing which could just run over everything. Just some thoughts after some fine german wine. -- Trent Jarvi tjarvi at qbang.org From gadelavega at yahoo.com.ar Mon Feb 6 02:17:05 2006 From: gadelavega at yahoo.com.ar (Gonzalo A. de la Vega) Date: Mon, 06 Feb 2006 10:17:05 +0100 Subject: [Rxtx] Serial port ownership question In-Reply-To: References: <20060205113618.30274.qmail@web53501.mail.yahoo.com> <1139157422.4553.9.camel@zd7280> <1139158698.4936.9.camel@zd7280> Message-ID: <43E71411.4050402@yahoo.com.ar> On my Fedora Core 4: ls -l /dev/ttyS* crw-rw---- 1 root uucp 4, 64 Feb 6 2006 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Feb 6 2006 /dev/ttyS1 ... and: grep "ttyUSB" /etc/udev/rules.d/50-udev.rules KERNEL=="ttyUSB*", GROUP="uucp", MODE="0660" So anyone in the "uucp" group can use serial ports. On Gentoo the group is "tty". Trent Jarvi escribi?: > > > On Sun, 5 Feb 2006, Dr. Douglas Lyon wrote: > >> I can confirm that this is the case (only root ownership of >> serial ports, under fedora 4). >> Wow, what were they thinking?! >> - DL >> >>> I've found that the newer kernels have the serial ports owned by root. >>> For example, >>> >>> $ls -al /dev/tty* >>> crw-rw-rw- 1 root root 5, 0 Feb 5 02:06 /dev/tty >>> crw-rw---- 1 root root 4, 0 Feb 5 02:06 /dev/tty0 >>> crw------- 1 root root 4, 1 Feb 5 09:07 /dev/tty1 >>> crw-rw---- 1 root tty 4, 10 Feb 5 02:06 /dev/tty10 >>> crw-rw---- 1 root tty 4, 11 Feb 5 02:06 /dev/tty11 >>> ... > > > This is just not a problem jcp or such are going to solve. Its a > platform spitwad fight. But do look at pam. In fact thats what Sun > is doing too. Maybe Linux followed their lead.. I'm not a pam guy. > I've spent 16 hours trying to understand it but your users wont :) > > Solution? I have no clue. Its two tangent mentalities from my > perspective. > > -- > Trent Jarvi > tjarvi at qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mtnvega at yahoo.com.br Mon Feb 6 05:35:43 2006 From: mtnvega at yahoo.com.br (Luiz Jr) Date: Mon, 6 Feb 2006 12:35:43 +0000 (GMT) Subject: [Rxtx] Documentation Wiki In-Reply-To: <1139157422.4553.9.camel@zd7280> Message-ID: <20060206123543.57256.qmail@web53515.mail.yahoo.com> Hello, Thank you for you answer, but so the usage of the API is pretty much like the Java Communications Api? If yes, what version of the Java Comm Api? Thank you, Luiz A. Brandao Jr Kim Lux escreveu: On Sun, 2006-02-05 at 08:36 -0300, Luiz Jr wrote: > Hello, > > I want to start using the RXTX libraries, but I would to know how, > since I can not access the documentation wiki page I just started using them yesterday. Below is how I installed the libraries, if that helps. I used snippets of code from the SimpleWrite application here to get me going. http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html Instead of "import javax.comm.*;", use "import gnu.io.*;" which is gotten from RXTXcomm.jar, which you will need to include in your project references. I am working in Eclipse. BTW: there is no way to open a port without going through the port list and finding it. Maybe sometime in the future someone (me ?) will write a method called openSerialPort that allows the user to give a port identifier, such as "/dev/tty1" and return a port ready to use. It wouldn't take much to write that and it would save users a lot of code. Hope this helps. ======================================================================= 1) Figure out which java you are running, incase there is more than one installed. $ java -version java version "1.5.0_05" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_05-b05) Java HotSpot(TM) Client VM (build 1.5.0_05-b05, mixed mode, sharing) 2) Find all the jre directories and the one from which you are currently running. kfind (jre) 3) cd to that directory plus /lib/i386 cd /usr/java/jre1.5.0_05/lib/i386 4) Copy the library files (*.so) to that directory. cp /home/krlux/Desktop/'Java Controls'/rxtx-linux/bin/* . 5) Check that the copy was successful ls librxtx* librxtxI2C.so librxtxRaw.so librxtxSerial.so librxtxParallel.so librxtxRS485.so 6) cd to the /lib/ext directory for your java. cd /usr/java/jre1.5.0_05/lib/ext 7) Copy the Jar files there cp /home/krlux/Desktop/'Java Controls'/rxtx-linux/lib/ext/* . 8) Check that it was successful ls RXTX* RXTXcomm.jar Rxtx is now installed on your machine ready to use. =================================================================== -- Kim Lux, Diesel Research Inc. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx --------------------------------- Yahoo! Acesso Gr?tis - Internet r?pida e gr?tis. Instale o discador agora! -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/544aa403/attachment-0023.html From lyon at docjava.com Mon Feb 6 05:49:34 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 06 Feb 2006 07:49:34 -0500 Subject: [Rxtx] wiki delay until tomorrow night. In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: Hi All, I have often thought about USB drivers being needed. For example, the ironman watch will not interface to a mac (windows only). It is USB. My dymo label writer has no Java driver (native only). Etc. Most cheap web cameras are USB (and Java drivers go through JAI, if it supports the camera at all). The JAI code shows how sun did the USB drivers. You have to be a member of the jai project to download the source code. https://jai.dev.java.net has the jai distro. And then you are not allowed to redistribute it. However, we can all learn from it (if so inclined). Basically: cvs -d :pserver:lyon at cvs.dev.java.net:/cvs login cvs -d :pserver:lyon at cvs.dev.java.net:/cvs checkout jai-core You will need to user your own uid and pw to get in. The ant build has over 100 warnings from sun deprecations of its own code. You might say that they were hoisted on their own Picard ;) One interesting thing is that they support several platforms: linux-amd64 64-bit Linux-AMD64 linux-i586 32-bit Linux-x86 solaris-amd64 64-bit Solaris-AMD64 solaris-i586 32-bit Solaris-x86 solaris-sparc 32-bit Solaris-SPARC solaris-sparcv9 64-bit Solaris-SPARC windows-i586 32-bit Windows-x86 Thus, ant is used to provide a multi-platform native method distro. Neat. How do they do it? check this out: And: The core download does not contain any C source code (it was all pre-built). Basically, they are just copying .so and .dll files into build directories. I would love to see the C code for this...but Sun does not post it on the https://jai.dev.java.net site. I don't know why...Perhaps I missed it. - Doug >On Sun, 5 Feb 2006, Trent Jarvi wrote: > >>On Sun, 5 Feb 2006, Kim Lux wrote: >> >>>usb ? Tell me more... I need that too. >> >>usb is a very proper design. Thats all it is. >> > >Maybe rxtx could help usb. But it would start with helping bring >back the community that was already there. > >It's not something I'd love to do but maybe its the right thing to do. > >It would probably take 2 years to do right. But maybe thats better >than what we have now. > >I honestly don't know what IBM is doing which could just run over everything. > >Just some thoughts after some fine german wine. > >-- >Trent Jarvi >tjarvi at qbang.org > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tdelenik at gmail.com Mon Feb 6 05:56:32 2006 From: tdelenik at gmail.com (Thanasis Delenikas) Date: Mon, 6 Feb 2006 14:56:32 +0200 Subject: Fwd: [Rxtx] Documentation Wiki In-Reply-To: <1139157422.4553.9.camel@zd7280> References: <20060205113618.30274.qmail@web53501.mail.yahoo.com> <1139157422.4553.9.camel@zd7280> Message-ID: <310a1a930602060456t129f1dc6p5f2b908f13ab5a0b@mail.gmail.com> Hello all, Kim, this is a snippet from the code I use. The closest to directly opening a specific port without enumeration. << ... portId = CommPortIdentifier.getPortIdentifier(getPort()); serialPort = (SerialPort) portId.open("jSMSEngine", 1971); ... >> where getPort() return the string identifier of the port, i.e. "/dev/ttyS0" or "COM1" or whatever. Thanasis. ---------- Forwarded message ---------- From: Kim Lux Date: Feb 5, 2006 6:37 PM Subject: Re: [Rxtx] Documentation Wiki To: RXTX Developers and Users BTW: there is no way to open a port without going through the port list and finding it. Maybe sometime in the future someone (me ?) will write a method called openSerialPort that allows the user to give a port identifier, such as "/dev/tty1" and return a port ready to use. It wouldn't take much to write that and it would save users a lot of code. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/182ab5b8/attachment-0023.html From tjarvi at qbang.org Mon Feb 6 11:53:57 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 11:53:57 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: On Mon, 6 Feb 2006, Dr. Douglas Lyon wrote: > Hi All, > I have often thought about USB drivers being needed. > For example, the ironman watch will not interface > to a mac (windows only). It is USB. > My dymo label writer has no Java driver (native only). > Etc. > Most cheap web cameras are USB (and Java drivers go > through JAI, if it supports the camera at all). > The JAI code shows how sun did the USB drivers. > You have to be a member of the jai project to download > the source code. > https://jai.dev.java.net has the jai distro. > And then you are not allowed to redistribute it. However, > we can all learn from it (if so inclined). Basically: > cvs -d :pserver:lyon at cvs.dev.java.net:/cvs login > cvs -d :pserver:lyon at cvs.dev.java.net:/cvs checkout jai-core > You will need to user your own uid and pw to get in. > The ant build has over 100 warnings from sun deprecations > of its own code. > > You might say that they were hoisted on their own Picard ;) > > One interesting thing is that they support several platforms: > linux-amd64 64-bit Linux-AMD64 > linux-i586 32-bit Linux-x86 > solaris-amd64 64-bit Solaris-AMD64 > solaris-i586 32-bit Solaris-x86 > solaris-sparc 32-bit Solaris-SPARC > solaris-sparcv9 64-bit Solaris-SPARC > windows-i586 32-bit Windows-x86 > Thus, ant is used to provide a multi-platform native method distro. > Neat. > How do they do it? > check this out: > > > > > > > > > > > > > And: > > > > > > > > > > The core download does not contain any C source code (it was all pre-built). > Basically, they are just copying .so and .dll files into build directories. > > I would love to see the C code for this...but Sun does not post it on the > https://jai.dev.java.net site. > > I don't know why...Perhaps I missed it. > > - Doug > > I've looked at moving rxtx to Ant builds. I think that would help IDEs a great deal. I requested a evalutation desk copy the O'Reilly Ant book for some j2ee material I was teaching. http://www.oreilly.com/catalog/anttdg/ It has a one sentence mention of JNI. So there was not luck there. I saw that there is another Ant book that does mention JNI more. I can't find it now. Ant must be able to support it with extensions. http://ant.apache.org/manual/OptionalTasks/javah.html What the auto(break :) tools do in the rxtx build is 4 things really. 1) gcc compile flags 2) ld compile flags 3) config.h 4) compile flags for customizing rxtx (lockfiles, ...) See 1 All of this information except 4 can be static once obtained. So I'm not attached to the auto tools. If I could find an example of Ant being used for JNI code, I'd be one of the first to start moving that direction. Maybe someone saw an example someplace. The other thing we have not completed discussing is the directory structure. There is interest in making rxtx more IDE friendly. I get more mail about that off the list than how to install rxtx. And I see we have Ken Thompson in da house :) He is our trusted CVS maintainer and the guy that purchased the rxtx.org domain. Old community. We will need Ken for changing the directory structure of source. I would like to open up discussion about both of these as it is more than time. The problem is I have little experience with Ant and even less with IDEs. It would be nice if we could work with Eclipse and NetBeans. http://www.netbeans.org/ (sun and some community) http://www.eclipes.org (ibm,rhat,... perhaps more community) http://maven.apache.org/what-is-maven.html (apache. It is community) borland should sortof be here too but I think thats covered in eclipse. >From what I understand so far, we should morph rxtx to support those three maybe trusting apaches lead with maven. But I use vi. I have little to no clues beyond what people have fed me. Can we agree that thats the right direction to go? -- Trent Jarvi tjarvi at qbang.org From brian at mbari.org Mon Feb 6 14:57:50 2006 From: brian at mbari.org (Brian Schlining) Date: Mon, 6 Feb 2006 13:57:50 -0800 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> > The other thing we have not completed discussing is the directory > structure. There is interest in making rxtx more IDE friendly. I > get more mail about that off the list than how to install rxtx. > > And I see we have Ken Thompson in da house :) He is our trusted > CVS maintainer and the guy that purchased the rxtx.org domain. Old > community. We will need Ken for changing the directory structure of > source. > > I would like to open up discussion about both of these as it is > more than time. The problem is I have little experience with Ant > and even less with IDEs. It would be nice if we could work with > Eclipse and NetBeans. > > http://www.netbeans.org/ (sun and some community) > http://www.eclipes.org (ibm,rhat,... perhaps more community) > http://maven.apache.org/what-is-maven.html (apache. It is community) > borland should sortof be here too but I think thats covered in > eclipse. > >> From what I understand so far, we should morph rxtx to support >> those three > maybe trusting apaches lead with maven. But I use vi. I have > little to no clues beyond what people have fed me. > Maven likes the directory structure below for Java code. (From http:// maven.apache.org/guides/getting-started/index.html) This structure works fine with ant, netbeans, and eclipse. rxtx_root_directory `-- src |-- main | `-- java | `-- gnu | `-- io `-- test `-- java `-- gnu `-- io Brian Schlining Software Engineer http://www.mbari.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/d9451eba/attachment-0023.html From tjarvi at qbang.org Mon Feb 6 15:11:45 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 15:11:45 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: > rxtx_root_directory > `-- src > |-- main > | `-- java > | `-- gnu > | `-- io > `-- test > `-- java > `-- gnu > `-- io > >From what I understand this will just be good. For me it makes no difference. So lets do the rxtx thing. Let if fester for two weeks and if nobody objects, we will do it. I'm not doing this because I care. I'm doing this to eliminate much of my inbox. But test... man is rxtx lacking there in the community aspect. It is covered but not right. _maybe_ I can change that this year. -- Trent Jarvi tjarvi at qbang.org (cat hurding since 1997) From lux at diesel-research.com Mon Feb 6 21:38:49 2006 From: lux at diesel-research.com (Kim Lux) Date: Mon, 06 Feb 2006 21:38:49 -0700 Subject: [Rxtx] How can I use Lock Files with rxtx (in FC4) ? Message-ID: <1139287129.17031.3.camel@zd7280> I am now running an rxtx application on FC4. I am getting: ========================================================= check_group_uucp(): error testing lock file creation Error details: Permission denied check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL ========================================================= $ ls -al /var/lock total 32 drwxrwxr-x 4 root lock 4096 Feb 6 16:04 . drwxr-xr-x 24 root root 4096 Nov 14 01:19 .. drwx------ 2 root root 4096 Apr 27 2005 lvm drwxr-xr-x 2 root root 4096 Feb 6 16:04 subsys How do I fix this for regulator users ? -- Kim Lux, Diesel Research Inc. From dmarkman at mac.com Mon Feb 6 22:24:44 2006 From: dmarkman at mac.com (Dmitry Markman) Date: Tue, 7 Feb 2006 00:24:44 -0500 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: if I understands the issue right in order to be able to use ant for c/c++ compilation you have to install ant's cc task http://ant-contrib.sourceforge.net/cc.html it looks like it should work on mac os x (authors claim, that it's platform independent) but I never tested so all you have to do it's providing right command line for the gcc compiler On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: >> rxtx_root_directory >> `-- src >> |-- main >> | `-- java >> | `-- gnu >> | `-- io >> `-- test >> `-- java >> `-- gnu >> `-- io >> > > >> From what I understand this will just be good. > > For me it makes no difference. So lets do the rxtx thing. Let if > fester for two weeks and if nobody objects, we will do it. > > I'm not doing this because I care. I'm doing this to eliminate > much of my inbox. > > But test... man is rxtx lacking there in the community aspect. It > is covered but not right. _maybe_ I can change that this year. > > -- > Trent Jarvi > tjarvi at qbang.org > (cat hurding since 1997) > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx Dmitry Markman From lux at diesel-research.com Mon Feb 6 23:20:15 2006 From: lux at diesel-research.com (Kim Lux) Date: Mon, 06 Feb 2006 23:20:15 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? Message-ID: <1139293215.3689.4.camel@zd7280> I'm running the code below. portlist.hasMoreElements() is false. /dev has ports in it as listed below. What am I doing wrong ? ========================================================== // Step through the list of ports until we find one that matches // the one we are looking for. portList = CommPortIdentifier.getPortIdentifiers(); while(portList.hasMoreElements()) { portID = (CommPortIdentifier) portList.nextElement(); // if (portID.getName().equals("/dev/ttyUSB0")) { myTA.append("Serial port ttyUSB0 has been found\n"); break; }// if portID equals... }// End of while... ========================================================== ls -al /dev/tty* crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 ... crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 -- Kim Lux, Diesel Research Inc. From david.garnier at trusted-logic.com Tue Feb 7 00:46:30 2006 From: david.garnier at trusted-logic.com (David Garnier) Date: Tue, 07 Feb 2006 08:46:30 +0100 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: <43E85056.2090608@trusted-logic.com> Hello, I think that the make-based build process is fine as it is, apart from the location of the Java source files. It is true that putting the Java source in a directory structure that map 1-to-1 to the Java package structure is the norm and should make it easier for everyone to modify the Java source, with or without an IDE. Ant is a good tool, but in the RXTX case I fail to see the advantage of using it compared to the current make-based process. As Trent said, they are more pressing issues, like testing. Regards, David Dmitry Markman wrote: > if I understands the issue right > in order to be able to use ant for c/c++ compilation > you have to install ant's cc task > http://ant-contrib.sourceforge.net/cc.html > > it looks like it should work on mac os x > (authors claim, that it's platform independent) > but I never tested > > so all you have to do it's providing right command line > for the gcc compiler > > > > > On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: > >>> rxtx_root_directory >>> `-- src >>> |-- main >>> | `-- java >>> | `-- gnu >>> | `-- io >>> `-- test >>> `-- java >>> `-- gnu >>> `-- io >>> >> >> >>> From what I understand this will just be good. >> >> For me it makes no difference. So lets do the rxtx thing. Let if >> fester for two weeks and if nobody objects, we will do it. >> >> I'm not doing this because I care. I'm doing this to eliminate much >> of my inbox. >> >> But test... man is rxtx lacking there in the community aspect. It is >> covered but not right. _maybe_ I can change that this year. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> (cat hurding since 1997) From tjarvi at qbang.org Tue Feb 7 01:11:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 01:11:31 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <43E85056.2090608@trusted-logic.com> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: On Tue, 7 Feb 2006, David Garnier wrote: > Hello, > > I think that the make-based build process is fine as it is, apart from the location of the Java > source files. It is true that putting the Java source in a directory structure that map 1-to-1 to > the Java package structure is the norm and should make it easier for everyone to modify the Java > source, with or without an IDE. > > Ant is a good tool, but in the RXTX case I fail to see the advantage of using it compared to the > current make-based process. As Trent said, they are more pressing issues, like testing. > Hi David I have more experience with testing rxtx than I can talk about. But let it be known, rxtx has gone trough 100's of hours of testing. We are hobby folks interested in toys but there is more. rxtx has had some of the best guidance in the industry there. This is not an easy thing. I may be able to come back in a month from the other side of the corperate fence and help. I suspect the tests could just be made public but they are in a very unusual environment that just wont work in a wider sense. This is something I'll be trying to change. At one point it was agreed we could just make the results public so this isnt just noise.. There is interest and I think its safe to mention that much. The big problem with testing in the past is most of it is done with a loopback connection. So we *still* have major questions regarding things like flow control. rxtx talks to itself over a loopback and it works. regardless of right or wrong. This requires more thought to be done right. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Feb 7 02:46:34 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 02:46:34 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: > The big problem with testing in the past is most of it is done with a > loopback connection. So we *still* have major questions regarding things > like flow control. rxtx talks to itself over a loopback and it works. > regardless of right or wrong. With serial communication there are gold standards. ckermit is probably a definitive 'standard.' Maybe its possible to do ping/pong tests with ckermit? Is it scriptable? There are known issues in rxtx. Probably the worst is some threading issues regarding some JREs with multiple JNI threads setting java variables. Man did I get schooled there. Just switch the c functions to returning variables and things go away. Sometimes they work fine, sometimes they blow up. Without understanding everything, somehow rhat got it right and debian (and especially gentoo) grabbed kernel patches causing all sort of harm. Its not hard to fix once you understand whats going on but nearly impossible to track with a debugger. So I have a good idea what 2.1-8 will have outside of the IDE modifications. rxtx 2.1-7 is a release for everyone to sync with. Its not even as stable as -pre17 as far as I know - I ran no test suites. I'll be chasing it too. We just had so many contributions that it was time. It seriously broke internal scheduals but thats a great thing :) The other thing I want to do in 2.1-8 is automagic baud rates. It turns out lots of shops are doing really funky baud rates for things like automobile test equipment. It is possible but it requires a fair amount of change in the native code. Is anyone looking at this? -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Feb 7 02:57:21 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 07 Feb 2006 04:57:21 -0500 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <43E85056.2090608@trusted-logic.com> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: Hi All, I agree, testing is very important. The problem I have been trying to address is related to cross-platform testing and the robust nature of the installs. Typically, I visit 3 platforms to deploy my product, windows, linux and mac. A build is performed on each platform. The idea that you can build for many platforms from one copy the source code seems attractive. This should enable synchronized deployments of identical code. The question of how to achieve this goal remains open. As Trent mentioned, this is hard. Perhaps Ant will help here (but perhaps not). Ant does seem to help with running unit tests. However, it does not help with multi-platform tests. For that you need many machines and different operating environments. Toward that end, I have created a multi-platform test that can be run from web start, located at: http://show.docjava.com:8086/book/cgij/code/jnlp/serialPort.PortTest.jnlp This is interesting because many people in the community can run the test and we can improve the test, as time permits. No, it is not a perfect solution, however, the idea does help with multi-platform tests using many machines and different operating environments. If the group has a good test for a general serial port set-ups, i would be happy to deploy it, for general evaluation using web start. And as for ANT, it is just an idea. Not all my ideas are good ones! - Doug >Hello, > >I think that the make-based build process is fine as it is, apart >from the location of the Java >source files. It is true that putting the Java source in a directory >structure that map 1-to-1 to >the Java package structure is the norm and should make it easier for >everyone to modify the Java >source, with or without an IDE. > >Ant is a good tool, but in the RXTX case I fail to see the advantage >of using it compared to the >current make-based process. As Trent said, they are more pressing >issues, like testing. > >Regards, >David > >Dmitry Markman wrote: >> if I understands the issue right >> in order to be able to use ant for c/c++ compilation >> you have to install ant's cc task >> http://ant-contrib.sourceforge.net/cc.html >> >> it looks like it should work on mac os x >> (authors claim, that it's platform independent) >> but I never tested >> >> so all you have to do it's providing right command line >> for the gcc compiler >> >> >> >> >> On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: >> >>>> rxtx_root_directory >>>> `-- src >>>> |-- main >>>> | `-- java >>>> | `-- gnu >>>> | `-- io >>>> `-- test >>>> `-- java >>>> `-- gnu >>>> `-- io >>>> >>> >>> >>>> From what I understand this will just be good. >>> >>> For me it makes no difference. So lets do the rxtx thing. Let if >>> fester for two weeks and if nobody objects, we will do it. >>> >>> I'm not doing this because I care. I'm doing this to eliminate much >>> of my inbox. >>> >>> But test... man is rxtx lacking there in the community aspect. It is >>> covered but not right. _maybe_ I can change that this year. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> (cat hurding since 1997) > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From matt.higgins at gmail.com Tue Feb 7 08:28:34 2006 From: matt.higgins at gmail.com (Matt Higgins) Date: Tue, 7 Feb 2006 10:28:34 -0500 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final Message-ID: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? import java.io.*; import java.util.*; import gnu.io.*; public class MySimpleRead implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; public static void main(String[] args) { boolean portFound = false; String defaultPort = "COM1"; if (args.length > 0) { defaultPort = args[0]; } portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; MySimpleRead reader = new MySimpleRead(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } } public MySimpleRead() { try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) { e.printStackTrace(); } try { inputStream = serialPort.getInputStream(); } catch (IOException e) { e.printStackTrace(); } try { serialPort.addEventListener(this); } catch (TooManyListenersException e) { e.printStackTrace(); } try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { e.printStackTrace(); } System.out.println("Baud is " + serialPort.getBaudRate()); System.out.println("Bits is " + serialPort.getDataBits()); System.out.println("Stop is " + serialPort.getStopBits()); System.out.println("Par is " + serialPort.getParity()); serialPort.notifyOnDataAvailable(true); readThread = new Thread(this); readThread.start(); } public void run() { // Thread.sleep(20000); //} catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { System.out.println("An event occurred " + event.getEventType()); switch (event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: byte[] readBuffer = new byte[20]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } System.out.print(new String(readBuffer)); } catch (IOException e) {} break; } } } --------------- Result on windows ------------------------------ Stable Library ============================================================== Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port:: COM1 Baud is 9600 Bits is 8 Stop is 1 Par is 0 ----------------- End Results ----------------------------------------- ------------------ Result on Linux ----------------------------------- Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 Found port: /dev/ttyS0 Baud is 9600 Bits is 8 Stop is 1 Par is 0 An event occurred 1 043100066224 ------------------ End Results --------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/a1431630/attachment-0023.html From brian at mbari.org Tue Feb 7 09:48:37 2006 From: brian at mbari.org (Brian Schlining) Date: Tue, 7 Feb 2006 08:48:37 -0800 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> Message-ID: <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> Hi Matt > The following code works fine on Linux but I never see any data > when run on Windows. This is a cut and paste from the SimpleRead > example. > I am attempting to read data from a bar code scanner. I can fire > up HyperTermianl on windows and see that the device is working > properly as I see the barcodes are scanned and echoed back to the > terminal. However when I run the app I don't see any data. It is > however associating with the com port as the informational bits > print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. Cheers Brian Schlining Software Engineer http://www.mbari.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/16d07f37/attachment-0023.html From lux at diesel-research.com Tue Feb 7 11:59:58 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 11:59:58 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139293215.3689.4.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> Message-ID: <1139338798.8145.4.camel@zd7280> Any ideas on this ? Any reason why portList.hasMoreElements() should be false even though there are devices in /dev ? On Mon, 2006-02-06 at 23:20 -0700, Kim Lux wrote: > I'm running the code below. > > portlist.hasMoreElements() is false. > > /dev has ports in it as listed below. > > What am I doing wrong ? > > > ========================================================== > // Step through the list of ports until we find one that matches > // the one we are looking for. > > portList = CommPortIdentifier.getPortIdentifiers(); > > while(portList.hasMoreElements()) > { > portID = (CommPortIdentifier) portList.nextElement(); // > if (portID.getName().equals("/dev/ttyUSB0")) > { > myTA.append("Serial port ttyUSB0 has been found\n"); > break; > }// if portID equals... > }// End of while... > ========================================================== > > ls -al /dev/tty* > crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty > crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 > crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 > crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 > crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 > ... > crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 > crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 > crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 > > > -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 12:20:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 12:20:25 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139338798.8145.4.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> Message-ID: On Tue, 7 Feb 2006, Kim Lux wrote: > > Any ideas on this ? Any reason why portList.hasMoreElements() should be > false even though there are devices in /dev ? > > > On Mon, 2006-02-06 at 23:20 -0700, Kim Lux wrote: >> I'm running the code below. >> >> portlist.hasMoreElements() is false. >> >> /dev has ports in it as listed below. >> >> What am I doing wrong ? >> >> >> ========================================================== >> // Step through the list of ports until we find one that matches >> // the one we are looking for. >> >> portList = CommPortIdentifier.getPortIdentifiers(); >> >> while(portList.hasMoreElements()) >> { >> portID = (CommPortIdentifier) portList.nextElement(); // >> if (portID.getName().equals("/dev/ttyUSB0")) >> { >> myTA.append("Serial port ttyUSB0 has been found\n"); >> break; >> }// if portID equals... >> }// End of while... >> ========================================================== >> >> ls -al /dev/tty* >> crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty >> crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 >> crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 >> crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 >> crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 >> ... >> crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 >> crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 >> crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 >> >> >> > Hi Kim What rxtx does is try to open the port and do a timed out read. If the kernel/... do not complain it's enumarted. I suspect you could do a crude test by doing something like cat /dev/ttyS0 > /dev/null If that barfs then rxtx wont enumerate the port. hmm looking at your question again, I suspect it's a lockfile problem. This is documented in INSTALL with the source. Its easy enough to test this too.. touch /var/lock/testingrxtxlockfiles && rm -f /var/lock/testingrxtxlockfiles If you are not in the right group it will bail. Root will work regardless. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 12:37:56 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 12:37:56 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> Message-ID: <1139341076.8145.11.camel@zd7280> Exactly which ports does rxtx attempt to put into the list ? /dev/* or /dev/tty* or /dev/tty[0-9[0-9] ? or /dev/ttyS* ? For the record, only /dev/ttyUSB0 is a valid port on the machine I am presently on. Will this be a problem ? On Tue, 2006-02-07 at 12:20 -0700, Trent Jarvi wrote: > This is documented in INSTALL with the source. > I was wondering where that file was. I will download source and dig it up. Thanks. -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 12:51:09 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 12:51:09 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139341076.8145.11.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: On Tue, 7 Feb 2006, Kim Lux wrote: > > Exactly which ports does rxtx attempt to put into the list ? /dev/* > or /dev/tty* or /dev/tty[0-9[0-9] ? or /dev/ttyS* ? > > For the record, only /dev/ttyUSB0 is a valid port on the machine I am > presently on. Will this be a problem ? > > > On Tue, 2006-02-07 at 12:20 -0700, Trent Jarvi wrote: >> This is documented in INSTALL with the source. >> > I was wondering where that file was. I will download source and dig it > up. > > Thanks. > Hmm I'm looking at pre17 so this may have changed. (its just what I have on this machine) if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA" // for the IPAQs }; CandidatePortPrefixes=Temp; } So you may need to add "ttyUSB" to that list. RXTX used to enumerate _everything_ see if(osName.equals("Linux-all-ports") But it became less than practical. This is all in RXTXCommDriver.java hmm I just did a cvs update. if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have to get your fingers into the code. We aim for sane defaults. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 13:06:45 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 13:06:45 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139342805.8145.22.camel@zd7280> On Tue, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > Hmm I'm looking at pre17 so this may have changed. (its just what I have > on this machine) > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA" // for the IPAQs > }; > CandidatePortPrefixes=Temp; > } > > > So you may need to add "ttyUSB" to that list. RXTX used to enumerate > _everything_ see if(osName.equals("Linux-all-ports") But it became less > than practical. > > This is all in RXTXCommDriver.java > > hmm I just did a cvs update. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have > to get your fingers into the code. We aim for sane defaults. Excellent. Thanks for taking the time. -- Kim Lux, Diesel Research Inc. From ideiglenes1 at freemail.hu Tue Feb 7 13:53:39 2006 From: ideiglenes1 at freemail.hu (--) Date: Tue, 07 Feb 2006 21:53:39 +0100 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139345619.22534.2.camel@localhost> Hi! I use this code to get all the extra Linux devices. :) if ("Linux".equals(System.getProperty("os.name"))) { System.setProperty("os.name","Linux-all-ports"); } driver = new RXTXCommDriver(); On k, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > On Tue, 7 Feb 2006, Kim Lux wrote: > > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have > to get your fingers into the code. We aim for sane defaults. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From matt.higgins at gmail.com Tue Feb 7 13:45:54 2006 From: matt.higgins at gmail.com (Matt Higgins) Date: Tue, 7 Feb 2006 15:45:54 -0500 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> Message-ID: <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> Sweet this is exactly what I needed. I was searching the archives through marc.theamisgroup they only have archives back to 1/3/05. Should have hit the mailman archive! Thanks a lot! On 2/7/06, Brian Schlining wrote: > > Hi Matt > > The following code works fine on Linux but I never see any data when run > on Windows. This is a cut and paste from the SimpleRead example. > I am attempting to read data from a bar code scanner. I can fire up > HyperTermianl on windows and see that the device is working properly as I > see the barcodes are scanned and echoed back to the terminal. However when I > run the app I don't see any data. It is however associating with the com > port as the informational bits print fine? > > > You're not the only one whose had this problem, I don't know if Trent has > addressed this is the latest release of RXTX but there is a workaround. > Here's the recent thread from the RXTX mailing list regarding this issues: > > Thanasis Delenikas tdelenik at gmail.com > Wed Jan 18 13:56:23 MST 2006 > > * Previous message: [Rxtx] Re: More close() performance fixes > * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] > > Hi all. > (I've subscribed again from my other email account). > > Trent, > > You are right. Linux *always* works, no matter what flow control you set. > Windows *works only* with hardware flow control (I haven't tested what > happens with software XON/XOFF flow control). > > I assume (but I am not certain) that even with no flow control at all, all > platforms should work. Without flow control, you have the risk of bumping > into overflow or framing errors, but that's your (the end programmer, I > mean) problem. > > >From my side, I shouldn't be working without flow control. That was a bug > too... It was some code forgotten from the old times, when I used to work > with phone emulation drivers which didn't support flow control. The > correct > way is to have some flow control enabled and that's why I suppose this is > a > low-severity bug for RxTx. > > I have no idea which platform shows the correct behaviour, since > my knowledge about Linux and the inner workings of these low-level i/o > operations is limited. > > Regards, > Thanasis Delenikas. > > > > > Message: 2 > > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > > From: Trent Jarvi > > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > > To: RXTX Developers and Users > > Message-ID: > > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > > > Hi all, > > > > > > Trent, I have found something. > > > I read your comment about flow control, so I experimented a bit. > > > > > > If you remember, in my sample program I've used no flow control at all > ( > > i.e. > > > Java constant FLOWCONTROL_NONE). > > > > > > Now, during testing, I've switch to hardware inbound flow control (i.e > . > > Java > > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > > beautifully! > > > > > > I think I will switch to H/W flow control and test things for a while, > > but > > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > > > > > Hi Thanasis, > > > > I'm fairly sure you have identified a bug. I would not worry too much > > about what Sun CommAPI w32 defaults are. I think they did more or less > > whatever the port opened with. Just a guess. Linux tries to stomp on > > ports so they are all the same. > > > > So this started out with Linux worked, Windows XP/.. did not as I > recall. > > Something is wrong in rxtx. Do I understand this right? > > > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > > > Perhaps there is something Wayne or I did not understand when we wrote > > that code. I wasnt programming back in the BBS days so modems are not > my > > thing. I have a few questions. > > > > Is the above matrix confirmed by observation? > > Linux just always worked? > > Which one _should_ work? I'm guessing modems work with hardware flow > > control. I'll have to dig around. > > > > The windows flow control changes a couple things with hardware flow > > control. Following the w32 API documentation is confusing sometimes. > > But it looks like Linux could have a bug too. > > Cheers > > Brian Schlining > Software Engineer > http://www.mbari.org > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/9c989144/attachment-0023.html From tjarvi at qbang.org Tue Feb 7 14:06:14 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 14:06:14 -0700 (MST) Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> Message-ID: >> >> You're not the only one whose had this problem, I don't know if Trent has >> addressed this is the latest release of RXTX but there is a workaround. >> Here's the recent thread from the RXTX mailing list regarding this issues: >> I have not. I expect to have access to some test equipment next month and I'll go through all of this. I really don't know whats going on and I need a gold standard. I thought maybe linux was autodetecting the flow control. Your observations would certainly be welcome. I need to talk to Russell King and see what he is doing. Until then I'd just be toying around over a loopback as usual. This is very high on the list though. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 17:25:05 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 17:25:05 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139358305.17994.2.camel@zd7280> My application now works. I installed the libraries and jar from 2.1-7 (Final). portlist.hasMoreElements is no longer false. The application finds the port for /dev/ttyUSB0. Thanks for your help, Trent (et al) Sorry I bothered you with this. Next time I will look in the source first. I didn't think it was an rxtx issue, I thought it was a Linux setup issue . On Tue, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > Hmm I'm looking at pre17 so this may have changed. (its just what I > have > on this machine) > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux > Serial Ports > "ttySA" // for the > IPAQs > }; > > CandidatePortPrefixes=Temp; > } > > > So you may need to add "ttyUSB" to that list. RXTX used to enumerate > _everything_ see if(osName.equals("Linux-all-ports") But it became > less > than practical. > > This is all in RXTXCommDriver.java > > hmm I just did a cvs update. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux > Serial Ports > "ttySA", // for the > IPAQs > "ttyUSB" // for USB > frobs > }; > > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you > have > to get your fingers into the code. We aim for sane defaults. -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 19:21:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 19:21:54 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139358305.17994.2.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> <1139358305.17994.2.camel@zd7280> Message-ID: >Sorry I bothered you with this. Next time I will look in the source >first. I didn't think it was an rxtx issue, I thought it was a Linux >setup issue . Why would you be sorry? I would have done the same. I'm glad it's working :) -- Trent Jarvi tjarvi at qbang.org From tma at mail.island.net Wed Feb 8 13:39:35 2006 From: tma at mail.island.net (Tom Alldread) Date: Wed, 08 Feb 2006 12:39:35 -0800 Subject: [Rxtx] Win32/Linux Serial Port Data Dropouts In-Reply-To: <200602060702.k167255O007882@www.qbang.org> References: <200602060702.k167255O007882@www.qbang.org> Message-ID: <43EA5707.4020200@mail.island.net> Greetings Folks at RXTX: During the last couple of months I have been alternately testing with javax.comm 2 and RXTX 2.1 under Windows XP and CommApi 3 and RXTX 2.1 under Suse 10.0 Linux. In the process I have learned a little about java multi-threading under NetBeans 5 with Profiler. My java (jdk 1.5_06) application is used for data acquisition and provides a graphical display of A-D conversion data received from a 56KBaud serial port. The actual data throughput is about 10KBaud thus it is well below the speed of the port. I use hardware RTS/CTS flow control which can stall the data acquisition sample rate if necessary. This ensures the display computer has the ability to slow the data acquisition rate should it become too busy to accept the regular data flow. Both the serial port buffer and the java read buffer are set at 16KB. Usually the data transfers into the java read buffer are less than 100 bytes unless the data acquisition is recovering from a stall. The data flow normally hesitates after each 5 KB block as a continue command is needed from the display computer to start the drawing of a new graphics display line. Separate threads have been provided for the serial port event monitoring and data processing. The serial port event thread has been given the maximum priority and data processing thread the minimum priority provided by java. Thread yield statements have been placed within all data processing while/for loops as an effort to ensure quick access to CPU cycles for the serial port event thread. I have found that short data transmissions are essentially error free but occasional dropouts occur with continuous data flow especially under Windows XP. ....................................................................................................................................................................................... Linux results: I am happy to report that RXTX 2.1 appears to work very well under Linux although I did notice some errors when the screen savers were running with my dual monitors. I believe this is a local problem associated with my dual graphics which needs further attention. The recent CommApi 3 Linux release from Sun did not work at all with my program. It seemed to send commands out OK but did not receive any data. Although the serial port event triggered the ISR, the input stream appeared filled with nulls and thus did not contain any data. As my understanding is that CommApi 3 was tested with a Red Hat distribution of Linux I wonder if this problem is distro dependent? Although somewhat off topic here I wonder if anyone reading this has had similar experience? .................................................................................................................................................................................. Windows XP results: There are problems with occasional data dropouts which become more frequent as the sampling rate is increased or if the computer becomes busy with other duties. The dropouts typically consist of a half dozen byte block of lost data. It appears the lost bytes never get added to the java input stream. There has not been any indication of garbled data, overruns or framing errors which suggests the UART communications remains solid. Using javax.comm 2 I found that the setting of SerialPort 'enableReceiveThreshold' to 40 and 'enableReceiveTimeout' of 100mS reduced the dropouts error rate significantly. I found that I could not get RXTX 2.1 to function with the aforementioned threshold and timeout settings. The javax.comm 2 interface is consequently performing better for me under Windows than RXTX 2.1. I wonder if anyone here has any suggestions as to what I might try to improve RXTX 2.1? Although my settings are the same as under Suse 10.0, RXTX 2.1 performs much better for me under Linux than any of the alternatives that I have tried under Windows XP . ............................................................................................................................................................................... I would like to establish, based on the experience of others, if I have reached the normally expected performance limit of java serial port communications? Should I expect to achieve virtually error free serial port data input from a continuous stream under Windows XP java software? I am considering changing my protocol to packets with error checking if necessary but would like to know if the dropout problems I am experiencing are typical or not before I take this rather work intensive plunge. Many thanks in advance for any help! Best Regards, Tom Alldread -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.375 / Virus Database: 267.15.2/253 - Release Date: 2006-02-07 From jlaxson at mac.com Wed Feb 8 23:56:48 2006 From: jlaxson at mac.com (John Laxson) Date: Thu, 9 Feb 2006 00:56:48 -0600 Subject: [Rxtx] PortInUseException: Unknown Application on OSX Message-ID: Hi, I've been trying to get RXTX 2.1.7 going on Mac OS X for a while here, and am running up into a wall here. I've tried with pre- compiled and the source version and get the same problem, a gnu.io.PortInUseException: Unknown Application. I have run the fixperms script included with the source distribution, and id shows me as a member of the uucp group, and permissions on /var/spool/uucp are 775 root:uucp. Running a test program (included at the bottom for clarity) lets me enumerate all the serial ports correctly, but trying to open any of them gives the PortInUseException. If it helps, when I try to open a port that's set to make an outgoing bluetooth connection, there is no delay and no connection attempt at all. Thanks, John Laxson PS: The documentation wiki on qbang.org shows 404, and has for a few days now. My test code: public static void main(String[] args) { SerialPort serialPort; try { Enumeration e = CommPortIdentifier.getPortIdentifiers(); CommPortIdentifier ident; while (e.hasMoreElements()) { ident = (CommPortIdentifier)e.nextElement(); System.out.println(ident.getName()); } ident = CommPortIdentifier.getPortIdentifier("/dev/cu.modem"); serialPort = (SerialPort) ident.open("Me", 5000); } catch (Exception e) { e.printStackTrace(); } } From rajesh.invincible at gmail.com Thu Feb 9 03:39:38 2006 From: rajesh.invincible at gmail.com (Rajesh N) Date: Thu, 9 Feb 2006 16:09:38 +0530 Subject: [Rxtx] Re: Move .java Files in gnu.io filesystem hierarchy - Maven (2) In-Reply-To: <43DF21D2.7090200@ngi.it> References: <43DF21D2.7090200@ngi.it> Message-ID: <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Can anybody tell me how to overcome these EXCEPTIONS I AM WORKING ON SERIAL COMMN IN JAVA ON LINUX. 1. " NOT ALL PARAMETERS SUPPORTED BY THE KERNEL" This i came across the following statement inmy prog. SerialP is A SerialPort object SerialP.setSerialPortParams(9600(BAUDRATE),DATABITS_8,STOPBITS_1,PARITY_NONE) 2. NullPointer Exception at Event Dispatch Now i have checked all my object references for a null reference but i found none i have put up my entire code in try catch blocks but still I AM UNABLE TO CATCH THIS EXCEPTION AND HENCE MY APPLICATION CLOSES HOW DOES THESE GO? PLEASE HELP ME IT IS URGENTTTTTTTTTTTTTTTT yours sincerely RAJESH On 1/31/06, Fabio Frumento wrote: > Hi Xavier, > > I don't know maven at all but the directory hierarchy listed buy Trent > is fine for me... > > I'll take a look to maven, it seems an interesting project > > Regards > > Fabio Frumento > > Trent Jarvi wrote: > > On Tue, 31 Jan 2006, Xavier Frisaye wrote: > > > >> Hi all, > >> > >> If you are going to rearrange the src folder, i will propose to use > >> maven 2 and follow its directory structure > >> > (http://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html). > >> > >> Maven 2 simplify java project and give a standard way to make projects > >> (http://maven.apache.org/). > >> We are using it for internal projects and we are very satisfied. > >> > >> Is anybody interested? > >> > >> I'm not an expert in maven 2 (yet) but i'm agree to help using it if > >> you choose to make so. > >> > > > > so this would be: > > > > rxtx-devel/src/main/java/gnu.io > > rxtx-devel/src/test/java/ManIwish.java > > > > I don't use IDEs very much so I'll let others comment. But I don't see > > a problem with that. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Thu Feb 9 09:50:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 9 Feb 2006 09:50:31 -0700 (MST) Subject: [Rxtx] Re: Move .java Files in gnu.io filesystem hierarchy - Maven (2) In-Reply-To: <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Message-ID: On Thu, 9 Feb 2006, Rajesh N wrote: > Can anybody tell me how to overcome these EXCEPTIONS > I AM WORKING ON SERIAL COMMN IN JAVA ON LINUX. > > 1. " NOT ALL PARAMETERS SUPPORTED BY THE KERNEL" > > This i came across the following statement inmy prog. > SerialP is A SerialPort object > SerialP.setSerialPortParams(9600(BAUDRATE),DATABITS_8,STOPBITS_1,PARITY_NONE) > Strange. The parameters you use are the same the port should open with by default. Could you paste the actual exception you are getting? I don't see that in the rxtx source. Also it would help to know the rxtx version. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Fri Feb 10 15:29:05 2006 From: lux at diesel-research.com (Kim Lux) Date: Fri, 10 Feb 2006 15:29:05 -0700 Subject: [Rxtx] One serial port object for both sending and receiving ? Message-ID: <1139610545.18177.4.camel@zd7280> Is it OK to use one SerialPort ojbect (ex Serial Port serialPort;) and use it for both sending and receiving ? For example: ======================================================================== static SerialPort serialPort = null; static OutputStream serialOut = null; static InputStream serialIn = null; // assign it to an outputStream for use try{ serialOut = serialPort.getOutputStream(); System.out.println("Serial output stream has been assigned."); }//try catch(IOException e) { System.out.println("Error: Couldn't assign output stream to serial port."); }//catch //assign it to an inputStream for use try{ serialIn = serialPort.getInputStream(); System.out.println("Serial input stream has been assigned."); }//try catch(IOException e) { System.out.println("Error: Couldn't assign input stream to serial port."); }//catch ======================================================================== -- Kim Lux, Diesel Research Inc. From lux at diesel-research.com Fri Feb 10 21:23:00 2006 From: lux at diesel-research.com (Kim Lux) Date: Fri, 10 Feb 2006 21:23:00 -0700 Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Message-ID: <1139631780.23882.10.camel@zd7280> I've got a problem receiving chars with my version of serialRead, written in an SWT GUI. I had a Java pro have a good look at my code and he can't see anything wrong with it. I can send chars fine. When I receive a char the cpu usage for the app goes to 100% and the code in the serial event handler doesn't get executed. The instructions on the Java Comm Serial API How-To for Linux page state that I must install javacomm. Is that true ? Everything builds without it and I can send chars on rxtx just fine, but I can't receive them. Could this be the problem ? I downloaded and installed javacomm. I was not able to add "Driver=gnuio.RXTXCommDriver to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 installed in /usr/java/jre1.5.0_05. I added comm.jar to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext to the library paths. Is this OK ? Does it matter that I am receiving on /dev/ttyUSB0 ? Thanks. -- Kim Lux, Diesel Research Inc. From lunareclipse03 at web.de Sat Feb 11 09:44:46 2006 From: lunareclipse03 at web.de (lunareclipse03@web.de) Date: Sat, 11 Feb 2006 17:44:46 +0100 Subject: [Rxtx] Question about Serial I/O under Win32 Message-ID: <662084330@web.de> Hello everybody, I have a strange problem with a piece of code I made for myself. No, this is not really concerning rxtx, but nevertheless I post this to the list, hoping that some of you can help me. I've written two libraries, one for linux and one for win32. The linux port works quite well, I can send / receive faxes and / or replay voice messages over the telephone line using a voice modem. But the win32 port of the library causes some trouble. If, for example, I send out a fax with a certain modem under linux, it works well. The fax is complete when it comes out of the fax machine. If I then use the same modem to send out a fax under win32, the fax coming out of the fax machine gets "stuck" halfways, but the sending modem thinks that transmission was ok and drops the connection. The answering fax machine then gives me "error while receiving." The "upper layer" java code MUST be right, because if I do the same thing under linux (using the linux library), everything is alright. Now I have to ask: Can somebody please help me out with this??!? Could it be the case that some kind of flow control or COMMTIMEOUTS setting causes this behaviour? I set flow control to RTS/CTS before sending out a fax. How can I DISABLE flow control? Or what do you think? Can something else cause this problems? Thank you all for your time and PLEASE write back soon. Regards, --Sven Ahlemann Am Waldrand 31 45721 Haltern am See Germany ______________________________________________________________ Verschicken Sie romantische, coole und witzige Bilder per SMS! Jetzt bei WEB.DE FreeMail: http://f.web.de/?mc=021193 From lux at diesel-research.com Sat Feb 11 10:06:52 2006 From: lux at diesel-research.com (Kim Lux) Date: Sat, 11 Feb 2006 10:06:52 -0700 Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: <1139631780.23882.10.camel@zd7280> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> <1139631780.23882.10.camel@zd7280> Message-ID: <1139677612.3431.5.camel@zd7280> More on this problem. I copied and pasted simpleRead into a console based Eclipse project and I've got the same result, except that cpu usage doesn't go to 100%. I'm beginning to think there is an issue in rxtx. My imports for simpleRead are: ============================ import gnu.io.*; import java.util.*; //import javax.comm.*; import java.io.*; =========================== Any ideas ? I am trying to read from /dev/ttyUSB0 using a serial to USB adapter which has worked well with minicom and gtkterm. Thanks. On Fri, 2006-02-10 at 21:23 -0700, Kim Lux wrote: > I've got a problem receiving chars with my version of serialRead, > written in an SWT GUI. > > I had a Java pro have a good look at my code and he can't see anything > wrong with it. > > I can send chars fine. When I receive a char the cpu usage for the app > goes to 100% and the code in the serial event handler doesn't get > executed. > > The instructions on the Java Comm Serial API How-To for Linux page state > that I must install javacomm. Is that true ? Everything builds without > it and I can send chars on rxtx just fine, but I can't receive them. > Could this be the problem ? > > I downloaded and installed javacomm. I was not able to add > "Driver=gnuio.RXTXCommDriver > to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not > have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 > installed in /usr/java/jre1.5.0_05. I added comm.jar > to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext > to the library paths. Is this OK ? > > Does it matter that I am receiving on /dev/ttyUSB0 ? > > Thanks. > -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Sun Feb 12 21:01:33 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:01:33 -0700 (MST) Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: <1139677612.3431.5.camel@zd7280> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> <1139631780.23882.10.camel@zd7280> <1139677612.3431.5.camel@zd7280> Message-ID: I suspect what is happening is the select() is breaking out in the native code but the driver does not have support for notifying there are X bytes available. On some traditional Unix based systems, the only way you know data is available is the fd status changes and do an FIORDCHK ioctl. Or perhaps the only thing you can know is the fd status changed. It would take reading through the kernel driver code to know for sure. So on USB, depending upon the driver, the same may need to be done or the driver improved a bit if possible to support. Polling reads will also work but don't use the event driven model of CommAPI which isnt acceptable in the long run. The 100% cpu usage can then be explained because select no longer blocks until the data is read; the eventLoop spins loose. You can put a well placed sleep but rxtx only expects those are needed when it knows data is available. This may not be a super simple thing to understand and fix. I do have ideas to get you started. I'm going to be short on time the next couple weeks. I expect to put some good time in and answer some other questions I saw around the 25th. For now, I'd look at the following and go from there with the hints I've given. JNIEXPORT jint JNICALL RXTXPort(nativeavailable)( JNIEnv *env, jobject jobj ) { int fd = get_java_var( env, jobj,"fd","I" ); int result; /* char message[80]; ENTER( "RXTXPort:nativeavailable" ); On SCO OpenServer FIONREAD always fails for serial devices, so try ioctl FIORDCHK instead; will only tell us whether bytes are available, not how many, but better than nothing. This turns out to be true on Solaris also. taj. */ #ifdef FIORDCHK /* __unixware__ __sun__ probably others */ result = ioctl(fd, FIORDCHK, 0); #else if( ioctl( fd, FIONREAD, &result ) < 0 ) { goto fail; } #endif /* FIORDCHK */ On Sat, 11 Feb 2006, Kim Lux wrote: > > More on this problem. I copied and pasted simpleRead into a console > based Eclipse project and I've got the same result, except that cpu > usage doesn't go to 100%. I'm beginning to think there is an issue in > rxtx. > > My imports for simpleRead are: > > ============================ > import gnu.io.*; > import java.util.*; > //import javax.comm.*; > import java.io.*; > =========================== > > Any ideas ? I am trying to read from /dev/ttyUSB0 using a serial to > USB adapter which has worked well with minicom and gtkterm. > > Thanks. > > > > On Fri, 2006-02-10 at 21:23 -0700, Kim Lux wrote: >> I've got a problem receiving chars with my version of serialRead, >> written in an SWT GUI. >> >> I had a Java pro have a good look at my code and he can't see anything >> wrong with it. >> >> I can send chars fine. When I receive a char the cpu usage for the app >> goes to 100% and the code in the serial event handler doesn't get >> executed. >> >> The instructions on the Java Comm Serial API How-To for Linux page state >> that I must install javacomm. Is that true ? Everything builds without >> it and I can send chars on rxtx just fine, but I can't receive them. >> Could this be the problem ? >> >> I downloaded and installed javacomm. I was not able to add >> "Driver=gnuio.RXTXCommDriver >> to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not >> have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 >> installed in /usr/java/jre1.5.0_05. I added comm.jar >> to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext >> to the library paths. Is this OK ? >> >> Does it matter that I am receiving on /dev/ttyUSB0 ? >> >> Thanks. >> > From tjarvi at qbang.org Sun Feb 12 21:03:30 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:03:30 -0700 (MST) Subject: [Rxtx] One serial port object for both sending and receiving ? In-Reply-To: <1139610545.18177.4.camel@zd7280> References: <1139610545.18177.4.camel@zd7280> Message-ID: On Fri, 10 Feb 2006, Kim Lux wrote: > > Is it OK to use one SerialPort ojbect (ex Serial Port serialPort;) and > use it for both sending and receiving ? > > For example: > > ======================================================================== > static SerialPort serialPort = null; > static OutputStream serialOut = null; > static InputStream serialIn = null; > > > > > // assign it to an outputStream for use > try{ > serialOut = serialPort.getOutputStream(); > System.out.println("Serial output stream has been assigned."); > }//try > catch(IOException e) > { > System.out.println("Error: Couldn't assign output stream to serial > port."); > }//catch > > > //assign it to an inputStream for use > try{ > serialIn = serialPort.getInputStream(); > System.out.println("Serial input stream has been assigned."); > }//try > catch(IOException e) > { > System.out.println("Error: Couldn't assign input stream to serial > port."); > }//catch This should be fine. In fact trying to do it another way will probably not work as you will run into lockfile issues. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun Feb 12 21:13:13 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:13:13 -0700 (MST) Subject: [Rxtx] Question about Serial I/O under Win32 In-Reply-To: <662084330@web.de> References: <662084330@web.de> Message-ID: On Sat, 11 Feb 2006 lunareclipse03 at web.de wrote: > Hello everybody, > > I have a strange problem with a piece of code I made for myself. No, > this is not really concerning rxtx, but nevertheless I post this to the > list, hoping that some of you can help me. I've written two libraries, > one for linux and one for win32. The linux port works quite well, I can > send / receive faxes and / or replay voice messages over the telephone > line using a voice modem. But the win32 port of the library causes some > trouble. If, for example, I send out a fax with a certain modem under > linux, it works well. The fax is complete when it comes out of the fax > machine. If I then use the same modem to send out a fax under win32, the > fax coming out of the fax machine gets "stuck" halfways, but the sending > modem thinks that transmission was ok and drops the connection. The > answering fax machine then gives me "error while receiving." The "upper > layer" java code MUST be right, because if I do the same thing under > linux (using the linux library), everything is alright. Now I have to > ask: Can somebody please help me out with this??!? Could it be the case > that some kind of flow control or COMMTIMEOUTS setting causes this > behaviour? I set flow control to RTS/CTS before sending out a fax. How > can I DISABLE flow control? Or what do you think? Can something else > cause this problems? Thank you all for your time and PLEASE write back > soon. > Hi Sven I'm not too willing to talk about flow control at the low level until I confirm some things with test equipment later. It is not clear if you are using rxtx or writing your own native code. So I'm not sure how to answer much of this :) If you are wondering how to change the flow control using rxtx from java, The BlackBox example from Sun flips this back and forth. SerialPort.java in rxtx 2.1 uses the following: SerialPort.java: public static final int FLOWCONTROL_NONE =0; SerialPort.java: public static final int FLOWCONTROL_RTSCTS_IN =1; SerialPort.java: public static final int FLOWCONTROL_RTSCTS_OUT =2; SerialPort.java: public static final int FLOWCONTROL_XONXOFF_IN =4; SerialPort.java: public static final int FLOWCONTROL_XONXOFF_OUT=8; So if you set flowcontrol to RTSCTS, you can set it to NONE to turn it off. If you are looking for how to do it in native code, the rxtx Source is SerialImp.c (unix/linux/mac os x/w32) and termios.c (w32 only with SerialImp.c) You can track the code: SerialImp.c:JNIEXPORT void JNICALL RXTXPort(setflowcontrol)( JNIEnv *env, jobject jobj, jint flowmode ) termios.c:int tcgetattr( int fd, struct termios *s_termios ) termios.c:int tcsetattr( int fd, int when, struct termios *s_termios ) There may be a problem in the rxtx flow control code though. Rather than guess, I want to test this with a gold standard. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Feb 6 00:00:16 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 00:00:16 -0700 (MST) Subject: [Rxtx] wiki delay until tomorrow night. In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: On Sun, 5 Feb 2006, Trent Jarvi wrote: > On Sun, 5 Feb 2006, Kim Lux wrote: > >> usb ? Tell me more... I need that too. > > usb is a very proper design. Thats all it is. > Maybe rxtx could help usb. But it would start with helping bring back the community that was already there. It's not something I'd love to do but maybe its the right thing to do. It would probably take 2 years to do right. But maybe thats better than what we have now. I honestly don't know what IBM is doing which could just run over everything. Just some thoughts after some fine german wine. -- Trent Jarvi tjarvi at qbang.org From gadelavega at yahoo.com.ar Mon Feb 6 02:17:05 2006 From: gadelavega at yahoo.com.ar (Gonzalo A. de la Vega) Date: Mon, 06 Feb 2006 10:17:05 +0100 Subject: [Rxtx] Serial port ownership question In-Reply-To: References: <20060205113618.30274.qmail@web53501.mail.yahoo.com> <1139157422.4553.9.camel@zd7280> <1139158698.4936.9.camel@zd7280> Message-ID: <43E71411.4050402@yahoo.com.ar> On my Fedora Core 4: ls -l /dev/ttyS* crw-rw---- 1 root uucp 4, 64 Feb 6 2006 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Feb 6 2006 /dev/ttyS1 ... and: grep "ttyUSB" /etc/udev/rules.d/50-udev.rules KERNEL=="ttyUSB*", GROUP="uucp", MODE="0660" So anyone in the "uucp" group can use serial ports. On Gentoo the group is "tty". Trent Jarvi escribi?: > > > On Sun, 5 Feb 2006, Dr. Douglas Lyon wrote: > >> I can confirm that this is the case (only root ownership of >> serial ports, under fedora 4). >> Wow, what were they thinking?! >> - DL >> >>> I've found that the newer kernels have the serial ports owned by root. >>> For example, >>> >>> $ls -al /dev/tty* >>> crw-rw-rw- 1 root root 5, 0 Feb 5 02:06 /dev/tty >>> crw-rw---- 1 root root 4, 0 Feb 5 02:06 /dev/tty0 >>> crw------- 1 root root 4, 1 Feb 5 09:07 /dev/tty1 >>> crw-rw---- 1 root tty 4, 10 Feb 5 02:06 /dev/tty10 >>> crw-rw---- 1 root tty 4, 11 Feb 5 02:06 /dev/tty11 >>> ... > > > This is just not a problem jcp or such are going to solve. Its a > platform spitwad fight. But do look at pam. In fact thats what Sun > is doing too. Maybe Linux followed their lead.. I'm not a pam guy. > I've spent 16 hours trying to understand it but your users wont :) > > Solution? I have no clue. Its two tangent mentalities from my > perspective. > > -- > Trent Jarvi > tjarvi at qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mtnvega at yahoo.com.br Mon Feb 6 05:35:43 2006 From: mtnvega at yahoo.com.br (Luiz Jr) Date: Mon, 6 Feb 2006 12:35:43 +0000 (GMT) Subject: [Rxtx] Documentation Wiki In-Reply-To: <1139157422.4553.9.camel@zd7280> Message-ID: <20060206123543.57256.qmail@web53515.mail.yahoo.com> Hello, Thank you for you answer, but so the usage of the API is pretty much like the Java Communications Api? If yes, what version of the Java Comm Api? Thank you, Luiz A. Brandao Jr Kim Lux escreveu: On Sun, 2006-02-05 at 08:36 -0300, Luiz Jr wrote: > Hello, > > I want to start using the RXTX libraries, but I would to know how, > since I can not access the documentation wiki page I just started using them yesterday. Below is how I installed the libraries, if that helps. I used snippets of code from the SimpleWrite application here to get me going. http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html Instead of "import javax.comm.*;", use "import gnu.io.*;" which is gotten from RXTXcomm.jar, which you will need to include in your project references. I am working in Eclipse. BTW: there is no way to open a port without going through the port list and finding it. Maybe sometime in the future someone (me ?) will write a method called openSerialPort that allows the user to give a port identifier, such as "/dev/tty1" and return a port ready to use. It wouldn't take much to write that and it would save users a lot of code. Hope this helps. ======================================================================= 1) Figure out which java you are running, incase there is more than one installed. $ java -version java version "1.5.0_05" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_05-b05) Java HotSpot(TM) Client VM (build 1.5.0_05-b05, mixed mode, sharing) 2) Find all the jre directories and the one from which you are currently running. kfind (jre) 3) cd to that directory plus /lib/i386 cd /usr/java/jre1.5.0_05/lib/i386 4) Copy the library files (*.so) to that directory. cp /home/krlux/Desktop/'Java Controls'/rxtx-linux/bin/* . 5) Check that the copy was successful ls librxtx* librxtxI2C.so librxtxRaw.so librxtxSerial.so librxtxParallel.so librxtxRS485.so 6) cd to the /lib/ext directory for your java. cd /usr/java/jre1.5.0_05/lib/ext 7) Copy the Jar files there cp /home/krlux/Desktop/'Java Controls'/rxtx-linux/lib/ext/* . 8) Check that it was successful ls RXTX* RXTXcomm.jar Rxtx is now installed on your machine ready to use. =================================================================== -- Kim Lux, Diesel Research Inc. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx --------------------------------- Yahoo! Acesso Gr?tis - Internet r?pida e gr?tis. Instale o discador agora! -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/544aa403/attachment-0024.html From lyon at docjava.com Mon Feb 6 05:49:34 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 06 Feb 2006 07:49:34 -0500 Subject: [Rxtx] wiki delay until tomorrow night. In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: Hi All, I have often thought about USB drivers being needed. For example, the ironman watch will not interface to a mac (windows only). It is USB. My dymo label writer has no Java driver (native only). Etc. Most cheap web cameras are USB (and Java drivers go through JAI, if it supports the camera at all). The JAI code shows how sun did the USB drivers. You have to be a member of the jai project to download the source code. https://jai.dev.java.net has the jai distro. And then you are not allowed to redistribute it. However, we can all learn from it (if so inclined). Basically: cvs -d :pserver:lyon at cvs.dev.java.net:/cvs login cvs -d :pserver:lyon at cvs.dev.java.net:/cvs checkout jai-core You will need to user your own uid and pw to get in. The ant build has over 100 warnings from sun deprecations of its own code. You might say that they were hoisted on their own Picard ;) One interesting thing is that they support several platforms: linux-amd64 64-bit Linux-AMD64 linux-i586 32-bit Linux-x86 solaris-amd64 64-bit Solaris-AMD64 solaris-i586 32-bit Solaris-x86 solaris-sparc 32-bit Solaris-SPARC solaris-sparcv9 64-bit Solaris-SPARC windows-i586 32-bit Windows-x86 Thus, ant is used to provide a multi-platform native method distro. Neat. How do they do it? check this out: And: The core download does not contain any C source code (it was all pre-built). Basically, they are just copying .so and .dll files into build directories. I would love to see the C code for this...but Sun does not post it on the https://jai.dev.java.net site. I don't know why...Perhaps I missed it. - Doug >On Sun, 5 Feb 2006, Trent Jarvi wrote: > >>On Sun, 5 Feb 2006, Kim Lux wrote: >> >>>usb ? Tell me more... I need that too. >> >>usb is a very proper design. Thats all it is. >> > >Maybe rxtx could help usb. But it would start with helping bring >back the community that was already there. > >It's not something I'd love to do but maybe its the right thing to do. > >It would probably take 2 years to do right. But maybe thats better >than what we have now. > >I honestly don't know what IBM is doing which could just run over everything. > >Just some thoughts after some fine german wine. > >-- >Trent Jarvi >tjarvi at qbang.org > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tdelenik at gmail.com Mon Feb 6 05:56:32 2006 From: tdelenik at gmail.com (Thanasis Delenikas) Date: Mon, 6 Feb 2006 14:56:32 +0200 Subject: Fwd: [Rxtx] Documentation Wiki In-Reply-To: <1139157422.4553.9.camel@zd7280> References: <20060205113618.30274.qmail@web53501.mail.yahoo.com> <1139157422.4553.9.camel@zd7280> Message-ID: <310a1a930602060456t129f1dc6p5f2b908f13ab5a0b@mail.gmail.com> Hello all, Kim, this is a snippet from the code I use. The closest to directly opening a specific port without enumeration. << ... portId = CommPortIdentifier.getPortIdentifier(getPort()); serialPort = (SerialPort) portId.open("jSMSEngine", 1971); ... >> where getPort() return the string identifier of the port, i.e. "/dev/ttyS0" or "COM1" or whatever. Thanasis. ---------- Forwarded message ---------- From: Kim Lux Date: Feb 5, 2006 6:37 PM Subject: Re: [Rxtx] Documentation Wiki To: RXTX Developers and Users BTW: there is no way to open a port without going through the port list and finding it. Maybe sometime in the future someone (me ?) will write a method called openSerialPort that allows the user to give a port identifier, such as "/dev/tty1" and return a port ready to use. It wouldn't take much to write that and it would save users a lot of code. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/182ab5b8/attachment-0024.html From tjarvi at qbang.org Mon Feb 6 11:53:57 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 11:53:57 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: On Mon, 6 Feb 2006, Dr. Douglas Lyon wrote: > Hi All, > I have often thought about USB drivers being needed. > For example, the ironman watch will not interface > to a mac (windows only). It is USB. > My dymo label writer has no Java driver (native only). > Etc. > Most cheap web cameras are USB (and Java drivers go > through JAI, if it supports the camera at all). > The JAI code shows how sun did the USB drivers. > You have to be a member of the jai project to download > the source code. > https://jai.dev.java.net has the jai distro. > And then you are not allowed to redistribute it. However, > we can all learn from it (if so inclined). Basically: > cvs -d :pserver:lyon at cvs.dev.java.net:/cvs login > cvs -d :pserver:lyon at cvs.dev.java.net:/cvs checkout jai-core > You will need to user your own uid and pw to get in. > The ant build has over 100 warnings from sun deprecations > of its own code. > > You might say that they were hoisted on their own Picard ;) > > One interesting thing is that they support several platforms: > linux-amd64 64-bit Linux-AMD64 > linux-i586 32-bit Linux-x86 > solaris-amd64 64-bit Solaris-AMD64 > solaris-i586 32-bit Solaris-x86 > solaris-sparc 32-bit Solaris-SPARC > solaris-sparcv9 64-bit Solaris-SPARC > windows-i586 32-bit Windows-x86 > Thus, ant is used to provide a multi-platform native method distro. > Neat. > How do they do it? > check this out: > > > > > > > > > > > > > And: > > > > > > > > > > The core download does not contain any C source code (it was all pre-built). > Basically, they are just copying .so and .dll files into build directories. > > I would love to see the C code for this...but Sun does not post it on the > https://jai.dev.java.net site. > > I don't know why...Perhaps I missed it. > > - Doug > > I've looked at moving rxtx to Ant builds. I think that would help IDEs a great deal. I requested a evalutation desk copy the O'Reilly Ant book for some j2ee material I was teaching. http://www.oreilly.com/catalog/anttdg/ It has a one sentence mention of JNI. So there was not luck there. I saw that there is another Ant book that does mention JNI more. I can't find it now. Ant must be able to support it with extensions. http://ant.apache.org/manual/OptionalTasks/javah.html What the auto(break :) tools do in the rxtx build is 4 things really. 1) gcc compile flags 2) ld compile flags 3) config.h 4) compile flags for customizing rxtx (lockfiles, ...) See 1 All of this information except 4 can be static once obtained. So I'm not attached to the auto tools. If I could find an example of Ant being used for JNI code, I'd be one of the first to start moving that direction. Maybe someone saw an example someplace. The other thing we have not completed discussing is the directory structure. There is interest in making rxtx more IDE friendly. I get more mail about that off the list than how to install rxtx. And I see we have Ken Thompson in da house :) He is our trusted CVS maintainer and the guy that purchased the rxtx.org domain. Old community. We will need Ken for changing the directory structure of source. I would like to open up discussion about both of these as it is more than time. The problem is I have little experience with Ant and even less with IDEs. It would be nice if we could work with Eclipse and NetBeans. http://www.netbeans.org/ (sun and some community) http://www.eclipes.org (ibm,rhat,... perhaps more community) http://maven.apache.org/what-is-maven.html (apache. It is community) borland should sortof be here too but I think thats covered in eclipse. >From what I understand so far, we should morph rxtx to support those three maybe trusting apaches lead with maven. But I use vi. I have little to no clues beyond what people have fed me. Can we agree that thats the right direction to go? -- Trent Jarvi tjarvi at qbang.org From brian at mbari.org Mon Feb 6 14:57:50 2006 From: brian at mbari.org (Brian Schlining) Date: Mon, 6 Feb 2006 13:57:50 -0800 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> > The other thing we have not completed discussing is the directory > structure. There is interest in making rxtx more IDE friendly. I > get more mail about that off the list than how to install rxtx. > > And I see we have Ken Thompson in da house :) He is our trusted > CVS maintainer and the guy that purchased the rxtx.org domain. Old > community. We will need Ken for changing the directory structure of > source. > > I would like to open up discussion about both of these as it is > more than time. The problem is I have little experience with Ant > and even less with IDEs. It would be nice if we could work with > Eclipse and NetBeans. > > http://www.netbeans.org/ (sun and some community) > http://www.eclipes.org (ibm,rhat,... perhaps more community) > http://maven.apache.org/what-is-maven.html (apache. It is community) > borland should sortof be here too but I think thats covered in > eclipse. > >> From what I understand so far, we should morph rxtx to support >> those three > maybe trusting apaches lead with maven. But I use vi. I have > little to no clues beyond what people have fed me. > Maven likes the directory structure below for Java code. (From http:// maven.apache.org/guides/getting-started/index.html) This structure works fine with ant, netbeans, and eclipse. rxtx_root_directory `-- src |-- main | `-- java | `-- gnu | `-- io `-- test `-- java `-- gnu `-- io Brian Schlining Software Engineer http://www.mbari.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/d9451eba/attachment-0024.html From tjarvi at qbang.org Mon Feb 6 15:11:45 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 15:11:45 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: > rxtx_root_directory > `-- src > |-- main > | `-- java > | `-- gnu > | `-- io > `-- test > `-- java > `-- gnu > `-- io > >From what I understand this will just be good. For me it makes no difference. So lets do the rxtx thing. Let if fester for two weeks and if nobody objects, we will do it. I'm not doing this because I care. I'm doing this to eliminate much of my inbox. But test... man is rxtx lacking there in the community aspect. It is covered but not right. _maybe_ I can change that this year. -- Trent Jarvi tjarvi at qbang.org (cat hurding since 1997) From lux at diesel-research.com Mon Feb 6 21:38:49 2006 From: lux at diesel-research.com (Kim Lux) Date: Mon, 06 Feb 2006 21:38:49 -0700 Subject: [Rxtx] How can I use Lock Files with rxtx (in FC4) ? Message-ID: <1139287129.17031.3.camel@zd7280> I am now running an rxtx application on FC4. I am getting: ========================================================= check_group_uucp(): error testing lock file creation Error details: Permission denied check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL ========================================================= $ ls -al /var/lock total 32 drwxrwxr-x 4 root lock 4096 Feb 6 16:04 . drwxr-xr-x 24 root root 4096 Nov 14 01:19 .. drwx------ 2 root root 4096 Apr 27 2005 lvm drwxr-xr-x 2 root root 4096 Feb 6 16:04 subsys How do I fix this for regulator users ? -- Kim Lux, Diesel Research Inc. From dmarkman at mac.com Mon Feb 6 22:24:44 2006 From: dmarkman at mac.com (Dmitry Markman) Date: Tue, 7 Feb 2006 00:24:44 -0500 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: if I understands the issue right in order to be able to use ant for c/c++ compilation you have to install ant's cc task http://ant-contrib.sourceforge.net/cc.html it looks like it should work on mac os x (authors claim, that it's platform independent) but I never tested so all you have to do it's providing right command line for the gcc compiler On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: >> rxtx_root_directory >> `-- src >> |-- main >> | `-- java >> | `-- gnu >> | `-- io >> `-- test >> `-- java >> `-- gnu >> `-- io >> > > >> From what I understand this will just be good. > > For me it makes no difference. So lets do the rxtx thing. Let if > fester for two weeks and if nobody objects, we will do it. > > I'm not doing this because I care. I'm doing this to eliminate > much of my inbox. > > But test... man is rxtx lacking there in the community aspect. It > is covered but not right. _maybe_ I can change that this year. > > -- > Trent Jarvi > tjarvi at qbang.org > (cat hurding since 1997) > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx Dmitry Markman From lux at diesel-research.com Mon Feb 6 23:20:15 2006 From: lux at diesel-research.com (Kim Lux) Date: Mon, 06 Feb 2006 23:20:15 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? Message-ID: <1139293215.3689.4.camel@zd7280> I'm running the code below. portlist.hasMoreElements() is false. /dev has ports in it as listed below. What am I doing wrong ? ========================================================== // Step through the list of ports until we find one that matches // the one we are looking for. portList = CommPortIdentifier.getPortIdentifiers(); while(portList.hasMoreElements()) { portID = (CommPortIdentifier) portList.nextElement(); // if (portID.getName().equals("/dev/ttyUSB0")) { myTA.append("Serial port ttyUSB0 has been found\n"); break; }// if portID equals... }// End of while... ========================================================== ls -al /dev/tty* crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 ... crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 -- Kim Lux, Diesel Research Inc. From david.garnier at trusted-logic.com Tue Feb 7 00:46:30 2006 From: david.garnier at trusted-logic.com (David Garnier) Date: Tue, 07 Feb 2006 08:46:30 +0100 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: <43E85056.2090608@trusted-logic.com> Hello, I think that the make-based build process is fine as it is, apart from the location of the Java source files. It is true that putting the Java source in a directory structure that map 1-to-1 to the Java package structure is the norm and should make it easier for everyone to modify the Java source, with or without an IDE. Ant is a good tool, but in the RXTX case I fail to see the advantage of using it compared to the current make-based process. As Trent said, they are more pressing issues, like testing. Regards, David Dmitry Markman wrote: > if I understands the issue right > in order to be able to use ant for c/c++ compilation > you have to install ant's cc task > http://ant-contrib.sourceforge.net/cc.html > > it looks like it should work on mac os x > (authors claim, that it's platform independent) > but I never tested > > so all you have to do it's providing right command line > for the gcc compiler > > > > > On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: > >>> rxtx_root_directory >>> `-- src >>> |-- main >>> | `-- java >>> | `-- gnu >>> | `-- io >>> `-- test >>> `-- java >>> `-- gnu >>> `-- io >>> >> >> >>> From what I understand this will just be good. >> >> For me it makes no difference. So lets do the rxtx thing. Let if >> fester for two weeks and if nobody objects, we will do it. >> >> I'm not doing this because I care. I'm doing this to eliminate much >> of my inbox. >> >> But test... man is rxtx lacking there in the community aspect. It is >> covered but not right. _maybe_ I can change that this year. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> (cat hurding since 1997) From tjarvi at qbang.org Tue Feb 7 01:11:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 01:11:31 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <43E85056.2090608@trusted-logic.com> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: On Tue, 7 Feb 2006, David Garnier wrote: > Hello, > > I think that the make-based build process is fine as it is, apart from the location of the Java > source files. It is true that putting the Java source in a directory structure that map 1-to-1 to > the Java package structure is the norm and should make it easier for everyone to modify the Java > source, with or without an IDE. > > Ant is a good tool, but in the RXTX case I fail to see the advantage of using it compared to the > current make-based process. As Trent said, they are more pressing issues, like testing. > Hi David I have more experience with testing rxtx than I can talk about. But let it be known, rxtx has gone trough 100's of hours of testing. We are hobby folks interested in toys but there is more. rxtx has had some of the best guidance in the industry there. This is not an easy thing. I may be able to come back in a month from the other side of the corperate fence and help. I suspect the tests could just be made public but they are in a very unusual environment that just wont work in a wider sense. This is something I'll be trying to change. At one point it was agreed we could just make the results public so this isnt just noise.. There is interest and I think its safe to mention that much. The big problem with testing in the past is most of it is done with a loopback connection. So we *still* have major questions regarding things like flow control. rxtx talks to itself over a loopback and it works. regardless of right or wrong. This requires more thought to be done right. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Feb 7 02:46:34 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 02:46:34 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: > The big problem with testing in the past is most of it is done with a > loopback connection. So we *still* have major questions regarding things > like flow control. rxtx talks to itself over a loopback and it works. > regardless of right or wrong. With serial communication there are gold standards. ckermit is probably a definitive 'standard.' Maybe its possible to do ping/pong tests with ckermit? Is it scriptable? There are known issues in rxtx. Probably the worst is some threading issues regarding some JREs with multiple JNI threads setting java variables. Man did I get schooled there. Just switch the c functions to returning variables and things go away. Sometimes they work fine, sometimes they blow up. Without understanding everything, somehow rhat got it right and debian (and especially gentoo) grabbed kernel patches causing all sort of harm. Its not hard to fix once you understand whats going on but nearly impossible to track with a debugger. So I have a good idea what 2.1-8 will have outside of the IDE modifications. rxtx 2.1-7 is a release for everyone to sync with. Its not even as stable as -pre17 as far as I know - I ran no test suites. I'll be chasing it too. We just had so many contributions that it was time. It seriously broke internal scheduals but thats a great thing :) The other thing I want to do in 2.1-8 is automagic baud rates. It turns out lots of shops are doing really funky baud rates for things like automobile test equipment. It is possible but it requires a fair amount of change in the native code. Is anyone looking at this? -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Feb 7 02:57:21 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 07 Feb 2006 04:57:21 -0500 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <43E85056.2090608@trusted-logic.com> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: Hi All, I agree, testing is very important. The problem I have been trying to address is related to cross-platform testing and the robust nature of the installs. Typically, I visit 3 platforms to deploy my product, windows, linux and mac. A build is performed on each platform. The idea that you can build for many platforms from one copy the source code seems attractive. This should enable synchronized deployments of identical code. The question of how to achieve this goal remains open. As Trent mentioned, this is hard. Perhaps Ant will help here (but perhaps not). Ant does seem to help with running unit tests. However, it does not help with multi-platform tests. For that you need many machines and different operating environments. Toward that end, I have created a multi-platform test that can be run from web start, located at: http://show.docjava.com:8086/book/cgij/code/jnlp/serialPort.PortTest.jnlp This is interesting because many people in the community can run the test and we can improve the test, as time permits. No, it is not a perfect solution, however, the idea does help with multi-platform tests using many machines and different operating environments. If the group has a good test for a general serial port set-ups, i would be happy to deploy it, for general evaluation using web start. And as for ANT, it is just an idea. Not all my ideas are good ones! - Doug >Hello, > >I think that the make-based build process is fine as it is, apart >from the location of the Java >source files. It is true that putting the Java source in a directory >structure that map 1-to-1 to >the Java package structure is the norm and should make it easier for >everyone to modify the Java >source, with or without an IDE. > >Ant is a good tool, but in the RXTX case I fail to see the advantage >of using it compared to the >current make-based process. As Trent said, they are more pressing >issues, like testing. > >Regards, >David > >Dmitry Markman wrote: >> if I understands the issue right >> in order to be able to use ant for c/c++ compilation >> you have to install ant's cc task >> http://ant-contrib.sourceforge.net/cc.html >> >> it looks like it should work on mac os x >> (authors claim, that it's platform independent) >> but I never tested >> >> so all you have to do it's providing right command line >> for the gcc compiler >> >> >> >> >> On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: >> >>>> rxtx_root_directory >>>> `-- src >>>> |-- main >>>> | `-- java >>>> | `-- gnu >>>> | `-- io >>>> `-- test >>>> `-- java >>>> `-- gnu >>>> `-- io >>>> >>> >>> >>>> From what I understand this will just be good. >>> >>> For me it makes no difference. So lets do the rxtx thing. Let if >>> fester for two weeks and if nobody objects, we will do it. >>> >>> I'm not doing this because I care. I'm doing this to eliminate much >>> of my inbox. >>> >>> But test... man is rxtx lacking there in the community aspect. It is >>> covered but not right. _maybe_ I can change that this year. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> (cat hurding since 1997) > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From matt.higgins at gmail.com Tue Feb 7 08:28:34 2006 From: matt.higgins at gmail.com (Matt Higgins) Date: Tue, 7 Feb 2006 10:28:34 -0500 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final Message-ID: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? import java.io.*; import java.util.*; import gnu.io.*; public class MySimpleRead implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; public static void main(String[] args) { boolean portFound = false; String defaultPort = "COM1"; if (args.length > 0) { defaultPort = args[0]; } portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; MySimpleRead reader = new MySimpleRead(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } } public MySimpleRead() { try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) { e.printStackTrace(); } try { inputStream = serialPort.getInputStream(); } catch (IOException e) { e.printStackTrace(); } try { serialPort.addEventListener(this); } catch (TooManyListenersException e) { e.printStackTrace(); } try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { e.printStackTrace(); } System.out.println("Baud is " + serialPort.getBaudRate()); System.out.println("Bits is " + serialPort.getDataBits()); System.out.println("Stop is " + serialPort.getStopBits()); System.out.println("Par is " + serialPort.getParity()); serialPort.notifyOnDataAvailable(true); readThread = new Thread(this); readThread.start(); } public void run() { // Thread.sleep(20000); //} catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { System.out.println("An event occurred " + event.getEventType()); switch (event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: byte[] readBuffer = new byte[20]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } System.out.print(new String(readBuffer)); } catch (IOException e) {} break; } } } --------------- Result on windows ------------------------------ Stable Library ============================================================== Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port:: COM1 Baud is 9600 Bits is 8 Stop is 1 Par is 0 ----------------- End Results ----------------------------------------- ------------------ Result on Linux ----------------------------------- Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 Found port: /dev/ttyS0 Baud is 9600 Bits is 8 Stop is 1 Par is 0 An event occurred 1 043100066224 ------------------ End Results --------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/a1431630/attachment-0024.html From brian at mbari.org Tue Feb 7 09:48:37 2006 From: brian at mbari.org (Brian Schlining) Date: Tue, 7 Feb 2006 08:48:37 -0800 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> Message-ID: <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> Hi Matt > The following code works fine on Linux but I never see any data > when run on Windows. This is a cut and paste from the SimpleRead > example. > I am attempting to read data from a bar code scanner. I can fire > up HyperTermianl on windows and see that the device is working > properly as I see the barcodes are scanned and echoed back to the > terminal. However when I run the app I don't see any data. It is > however associating with the com port as the informational bits > print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. Cheers Brian Schlining Software Engineer http://www.mbari.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/16d07f37/attachment-0024.html From lux at diesel-research.com Tue Feb 7 11:59:58 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 11:59:58 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139293215.3689.4.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> Message-ID: <1139338798.8145.4.camel@zd7280> Any ideas on this ? Any reason why portList.hasMoreElements() should be false even though there are devices in /dev ? On Mon, 2006-02-06 at 23:20 -0700, Kim Lux wrote: > I'm running the code below. > > portlist.hasMoreElements() is false. > > /dev has ports in it as listed below. > > What am I doing wrong ? > > > ========================================================== > // Step through the list of ports until we find one that matches > // the one we are looking for. > > portList = CommPortIdentifier.getPortIdentifiers(); > > while(portList.hasMoreElements()) > { > portID = (CommPortIdentifier) portList.nextElement(); // > if (portID.getName().equals("/dev/ttyUSB0")) > { > myTA.append("Serial port ttyUSB0 has been found\n"); > break; > }// if portID equals... > }// End of while... > ========================================================== > > ls -al /dev/tty* > crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty > crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 > crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 > crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 > crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 > ... > crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 > crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 > crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 > > > -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 12:20:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 12:20:25 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139338798.8145.4.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> Message-ID: On Tue, 7 Feb 2006, Kim Lux wrote: > > Any ideas on this ? Any reason why portList.hasMoreElements() should be > false even though there are devices in /dev ? > > > On Mon, 2006-02-06 at 23:20 -0700, Kim Lux wrote: >> I'm running the code below. >> >> portlist.hasMoreElements() is false. >> >> /dev has ports in it as listed below. >> >> What am I doing wrong ? >> >> >> ========================================================== >> // Step through the list of ports until we find one that matches >> // the one we are looking for. >> >> portList = CommPortIdentifier.getPortIdentifiers(); >> >> while(portList.hasMoreElements()) >> { >> portID = (CommPortIdentifier) portList.nextElement(); // >> if (portID.getName().equals("/dev/ttyUSB0")) >> { >> myTA.append("Serial port ttyUSB0 has been found\n"); >> break; >> }// if portID equals... >> }// End of while... >> ========================================================== >> >> ls -al /dev/tty* >> crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty >> crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 >> crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 >> crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 >> crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 >> ... >> crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 >> crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 >> crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 >> >> >> > Hi Kim What rxtx does is try to open the port and do a timed out read. If the kernel/... do not complain it's enumarted. I suspect you could do a crude test by doing something like cat /dev/ttyS0 > /dev/null If that barfs then rxtx wont enumerate the port. hmm looking at your question again, I suspect it's a lockfile problem. This is documented in INSTALL with the source. Its easy enough to test this too.. touch /var/lock/testingrxtxlockfiles && rm -f /var/lock/testingrxtxlockfiles If you are not in the right group it will bail. Root will work regardless. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 12:37:56 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 12:37:56 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> Message-ID: <1139341076.8145.11.camel@zd7280> Exactly which ports does rxtx attempt to put into the list ? /dev/* or /dev/tty* or /dev/tty[0-9[0-9] ? or /dev/ttyS* ? For the record, only /dev/ttyUSB0 is a valid port on the machine I am presently on. Will this be a problem ? On Tue, 2006-02-07 at 12:20 -0700, Trent Jarvi wrote: > This is documented in INSTALL with the source. > I was wondering where that file was. I will download source and dig it up. Thanks. -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 12:51:09 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 12:51:09 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139341076.8145.11.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: On Tue, 7 Feb 2006, Kim Lux wrote: > > Exactly which ports does rxtx attempt to put into the list ? /dev/* > or /dev/tty* or /dev/tty[0-9[0-9] ? or /dev/ttyS* ? > > For the record, only /dev/ttyUSB0 is a valid port on the machine I am > presently on. Will this be a problem ? > > > On Tue, 2006-02-07 at 12:20 -0700, Trent Jarvi wrote: >> This is documented in INSTALL with the source. >> > I was wondering where that file was. I will download source and dig it > up. > > Thanks. > Hmm I'm looking at pre17 so this may have changed. (its just what I have on this machine) if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA" // for the IPAQs }; CandidatePortPrefixes=Temp; } So you may need to add "ttyUSB" to that list. RXTX used to enumerate _everything_ see if(osName.equals("Linux-all-ports") But it became less than practical. This is all in RXTXCommDriver.java hmm I just did a cvs update. if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have to get your fingers into the code. We aim for sane defaults. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 13:06:45 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 13:06:45 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139342805.8145.22.camel@zd7280> On Tue, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > Hmm I'm looking at pre17 so this may have changed. (its just what I have > on this machine) > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA" // for the IPAQs > }; > CandidatePortPrefixes=Temp; > } > > > So you may need to add "ttyUSB" to that list. RXTX used to enumerate > _everything_ see if(osName.equals("Linux-all-ports") But it became less > than practical. > > This is all in RXTXCommDriver.java > > hmm I just did a cvs update. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have > to get your fingers into the code. We aim for sane defaults. Excellent. Thanks for taking the time. -- Kim Lux, Diesel Research Inc. From ideiglenes1 at freemail.hu Tue Feb 7 13:53:39 2006 From: ideiglenes1 at freemail.hu (--) Date: Tue, 07 Feb 2006 21:53:39 +0100 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139345619.22534.2.camel@localhost> Hi! I use this code to get all the extra Linux devices. :) if ("Linux".equals(System.getProperty("os.name"))) { System.setProperty("os.name","Linux-all-ports"); } driver = new RXTXCommDriver(); On k, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > On Tue, 7 Feb 2006, Kim Lux wrote: > > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have > to get your fingers into the code. We aim for sane defaults. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From matt.higgins at gmail.com Tue Feb 7 13:45:54 2006 From: matt.higgins at gmail.com (Matt Higgins) Date: Tue, 7 Feb 2006 15:45:54 -0500 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> Message-ID: <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> Sweet this is exactly what I needed. I was searching the archives through marc.theamisgroup they only have archives back to 1/3/05. Should have hit the mailman archive! Thanks a lot! On 2/7/06, Brian Schlining wrote: > > Hi Matt > > The following code works fine on Linux but I never see any data when run > on Windows. This is a cut and paste from the SimpleRead example. > I am attempting to read data from a bar code scanner. I can fire up > HyperTermianl on windows and see that the device is working properly as I > see the barcodes are scanned and echoed back to the terminal. However when I > run the app I don't see any data. It is however associating with the com > port as the informational bits print fine? > > > You're not the only one whose had this problem, I don't know if Trent has > addressed this is the latest release of RXTX but there is a workaround. > Here's the recent thread from the RXTX mailing list regarding this issues: > > Thanasis Delenikas tdelenik at gmail.com > Wed Jan 18 13:56:23 MST 2006 > > * Previous message: [Rxtx] Re: More close() performance fixes > * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] > > Hi all. > (I've subscribed again from my other email account). > > Trent, > > You are right. Linux *always* works, no matter what flow control you set. > Windows *works only* with hardware flow control (I haven't tested what > happens with software XON/XOFF flow control). > > I assume (but I am not certain) that even with no flow control at all, all > platforms should work. Without flow control, you have the risk of bumping > into overflow or framing errors, but that's your (the end programmer, I > mean) problem. > > >From my side, I shouldn't be working without flow control. That was a bug > too... It was some code forgotten from the old times, when I used to work > with phone emulation drivers which didn't support flow control. The > correct > way is to have some flow control enabled and that's why I suppose this is > a > low-severity bug for RxTx. > > I have no idea which platform shows the correct behaviour, since > my knowledge about Linux and the inner workings of these low-level i/o > operations is limited. > > Regards, > Thanasis Delenikas. > > > > > Message: 2 > > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > > From: Trent Jarvi > > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > > To: RXTX Developers and Users > > Message-ID: > > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > > > Hi all, > > > > > > Trent, I have found something. > > > I read your comment about flow control, so I experimented a bit. > > > > > > If you remember, in my sample program I've used no flow control at all > ( > > i.e. > > > Java constant FLOWCONTROL_NONE). > > > > > > Now, during testing, I've switch to hardware inbound flow control (i.e > . > > Java > > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > > beautifully! > > > > > > I think I will switch to H/W flow control and test things for a while, > > but > > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > > > > > Hi Thanasis, > > > > I'm fairly sure you have identified a bug. I would not worry too much > > about what Sun CommAPI w32 defaults are. I think they did more or less > > whatever the port opened with. Just a guess. Linux tries to stomp on > > ports so they are all the same. > > > > So this started out with Linux worked, Windows XP/.. did not as I > recall. > > Something is wrong in rxtx. Do I understand this right? > > > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > > > Perhaps there is something Wayne or I did not understand when we wrote > > that code. I wasnt programming back in the BBS days so modems are not > my > > thing. I have a few questions. > > > > Is the above matrix confirmed by observation? > > Linux just always worked? > > Which one _should_ work? I'm guessing modems work with hardware flow > > control. I'll have to dig around. > > > > The windows flow control changes a couple things with hardware flow > > control. Following the w32 API documentation is confusing sometimes. > > But it looks like Linux could have a bug too. > > Cheers > > Brian Schlining > Software Engineer > http://www.mbari.org > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/9c989144/attachment-0024.html From tjarvi at qbang.org Tue Feb 7 14:06:14 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 14:06:14 -0700 (MST) Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> Message-ID: >> >> You're not the only one whose had this problem, I don't know if Trent has >> addressed this is the latest release of RXTX but there is a workaround. >> Here's the recent thread from the RXTX mailing list regarding this issues: >> I have not. I expect to have access to some test equipment next month and I'll go through all of this. I really don't know whats going on and I need a gold standard. I thought maybe linux was autodetecting the flow control. Your observations would certainly be welcome. I need to talk to Russell King and see what he is doing. Until then I'd just be toying around over a loopback as usual. This is very high on the list though. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 17:25:05 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 17:25:05 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139358305.17994.2.camel@zd7280> My application now works. I installed the libraries and jar from 2.1-7 (Final). portlist.hasMoreElements is no longer false. The application finds the port for /dev/ttyUSB0. Thanks for your help, Trent (et al) Sorry I bothered you with this. Next time I will look in the source first. I didn't think it was an rxtx issue, I thought it was a Linux setup issue . On Tue, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > Hmm I'm looking at pre17 so this may have changed. (its just what I > have > on this machine) > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux > Serial Ports > "ttySA" // for the > IPAQs > }; > > CandidatePortPrefixes=Temp; > } > > > So you may need to add "ttyUSB" to that list. RXTX used to enumerate > _everything_ see if(osName.equals("Linux-all-ports") But it became > less > than practical. > > This is all in RXTXCommDriver.java > > hmm I just did a cvs update. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux > Serial Ports > "ttySA", // for the > IPAQs > "ttyUSB" // for USB > frobs > }; > > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you > have > to get your fingers into the code. We aim for sane defaults. -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 19:21:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 19:21:54 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139358305.17994.2.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> <1139358305.17994.2.camel@zd7280> Message-ID: >Sorry I bothered you with this. Next time I will look in the source >first. I didn't think it was an rxtx issue, I thought it was a Linux >setup issue . Why would you be sorry? I would have done the same. I'm glad it's working :) -- Trent Jarvi tjarvi at qbang.org From tma at mail.island.net Wed Feb 8 13:39:35 2006 From: tma at mail.island.net (Tom Alldread) Date: Wed, 08 Feb 2006 12:39:35 -0800 Subject: [Rxtx] Win32/Linux Serial Port Data Dropouts In-Reply-To: <200602060702.k167255O007882@www.qbang.org> References: <200602060702.k167255O007882@www.qbang.org> Message-ID: <43EA5707.4020200@mail.island.net> Greetings Folks at RXTX: During the last couple of months I have been alternately testing with javax.comm 2 and RXTX 2.1 under Windows XP and CommApi 3 and RXTX 2.1 under Suse 10.0 Linux. In the process I have learned a little about java multi-threading under NetBeans 5 with Profiler. My java (jdk 1.5_06) application is used for data acquisition and provides a graphical display of A-D conversion data received from a 56KBaud serial port. The actual data throughput is about 10KBaud thus it is well below the speed of the port. I use hardware RTS/CTS flow control which can stall the data acquisition sample rate if necessary. This ensures the display computer has the ability to slow the data acquisition rate should it become too busy to accept the regular data flow. Both the serial port buffer and the java read buffer are set at 16KB. Usually the data transfers into the java read buffer are less than 100 bytes unless the data acquisition is recovering from a stall. The data flow normally hesitates after each 5 KB block as a continue command is needed from the display computer to start the drawing of a new graphics display line. Separate threads have been provided for the serial port event monitoring and data processing. The serial port event thread has been given the maximum priority and data processing thread the minimum priority provided by java. Thread yield statements have been placed within all data processing while/for loops as an effort to ensure quick access to CPU cycles for the serial port event thread. I have found that short data transmissions are essentially error free but occasional dropouts occur with continuous data flow especially under Windows XP. ....................................................................................................................................................................................... Linux results: I am happy to report that RXTX 2.1 appears to work very well under Linux although I did notice some errors when the screen savers were running with my dual monitors. I believe this is a local problem associated with my dual graphics which needs further attention. The recent CommApi 3 Linux release from Sun did not work at all with my program. It seemed to send commands out OK but did not receive any data. Although the serial port event triggered the ISR, the input stream appeared filled with nulls and thus did not contain any data. As my understanding is that CommApi 3 was tested with a Red Hat distribution of Linux I wonder if this problem is distro dependent? Although somewhat off topic here I wonder if anyone reading this has had similar experience? .................................................................................................................................................................................. Windows XP results: There are problems with occasional data dropouts which become more frequent as the sampling rate is increased or if the computer becomes busy with other duties. The dropouts typically consist of a half dozen byte block of lost data. It appears the lost bytes never get added to the java input stream. There has not been any indication of garbled data, overruns or framing errors which suggests the UART communications remains solid. Using javax.comm 2 I found that the setting of SerialPort 'enableReceiveThreshold' to 40 and 'enableReceiveTimeout' of 100mS reduced the dropouts error rate significantly. I found that I could not get RXTX 2.1 to function with the aforementioned threshold and timeout settings. The javax.comm 2 interface is consequently performing better for me under Windows than RXTX 2.1. I wonder if anyone here has any suggestions as to what I might try to improve RXTX 2.1? Although my settings are the same as under Suse 10.0, RXTX 2.1 performs much better for me under Linux than any of the alternatives that I have tried under Windows XP . ............................................................................................................................................................................... I would like to establish, based on the experience of others, if I have reached the normally expected performance limit of java serial port communications? Should I expect to achieve virtually error free serial port data input from a continuous stream under Windows XP java software? I am considering changing my protocol to packets with error checking if necessary but would like to know if the dropout problems I am experiencing are typical or not before I take this rather work intensive plunge. Many thanks in advance for any help! Best Regards, Tom Alldread -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.375 / Virus Database: 267.15.2/253 - Release Date: 2006-02-07 From jlaxson at mac.com Wed Feb 8 23:56:48 2006 From: jlaxson at mac.com (John Laxson) Date: Thu, 9 Feb 2006 00:56:48 -0600 Subject: [Rxtx] PortInUseException: Unknown Application on OSX Message-ID: Hi, I've been trying to get RXTX 2.1.7 going on Mac OS X for a while here, and am running up into a wall here. I've tried with pre- compiled and the source version and get the same problem, a gnu.io.PortInUseException: Unknown Application. I have run the fixperms script included with the source distribution, and id shows me as a member of the uucp group, and permissions on /var/spool/uucp are 775 root:uucp. Running a test program (included at the bottom for clarity) lets me enumerate all the serial ports correctly, but trying to open any of them gives the PortInUseException. If it helps, when I try to open a port that's set to make an outgoing bluetooth connection, there is no delay and no connection attempt at all. Thanks, John Laxson PS: The documentation wiki on qbang.org shows 404, and has for a few days now. My test code: public static void main(String[] args) { SerialPort serialPort; try { Enumeration e = CommPortIdentifier.getPortIdentifiers(); CommPortIdentifier ident; while (e.hasMoreElements()) { ident = (CommPortIdentifier)e.nextElement(); System.out.println(ident.getName()); } ident = CommPortIdentifier.getPortIdentifier("/dev/cu.modem"); serialPort = (SerialPort) ident.open("Me", 5000); } catch (Exception e) { e.printStackTrace(); } } From rajesh.invincible at gmail.com Thu Feb 9 03:39:38 2006 From: rajesh.invincible at gmail.com (Rajesh N) Date: Thu, 9 Feb 2006 16:09:38 +0530 Subject: [Rxtx] Re: Move .java Files in gnu.io filesystem hierarchy - Maven (2) In-Reply-To: <43DF21D2.7090200@ngi.it> References: <43DF21D2.7090200@ngi.it> Message-ID: <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Can anybody tell me how to overcome these EXCEPTIONS I AM WORKING ON SERIAL COMMN IN JAVA ON LINUX. 1. " NOT ALL PARAMETERS SUPPORTED BY THE KERNEL" This i came across the following statement inmy prog. SerialP is A SerialPort object SerialP.setSerialPortParams(9600(BAUDRATE),DATABITS_8,STOPBITS_1,PARITY_NONE) 2. NullPointer Exception at Event Dispatch Now i have checked all my object references for a null reference but i found none i have put up my entire code in try catch blocks but still I AM UNABLE TO CATCH THIS EXCEPTION AND HENCE MY APPLICATION CLOSES HOW DOES THESE GO? PLEASE HELP ME IT IS URGENTTTTTTTTTTTTTTTT yours sincerely RAJESH On 1/31/06, Fabio Frumento wrote: > Hi Xavier, > > I don't know maven at all but the directory hierarchy listed buy Trent > is fine for me... > > I'll take a look to maven, it seems an interesting project > > Regards > > Fabio Frumento > > Trent Jarvi wrote: > > On Tue, 31 Jan 2006, Xavier Frisaye wrote: > > > >> Hi all, > >> > >> If you are going to rearrange the src folder, i will propose to use > >> maven 2 and follow its directory structure > >> > (http://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html). > >> > >> Maven 2 simplify java project and give a standard way to make projects > >> (http://maven.apache.org/). > >> We are using it for internal projects and we are very satisfied. > >> > >> Is anybody interested? > >> > >> I'm not an expert in maven 2 (yet) but i'm agree to help using it if > >> you choose to make so. > >> > > > > so this would be: > > > > rxtx-devel/src/main/java/gnu.io > > rxtx-devel/src/test/java/ManIwish.java > > > > I don't use IDEs very much so I'll let others comment. But I don't see > > a problem with that. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Thu Feb 9 09:50:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 9 Feb 2006 09:50:31 -0700 (MST) Subject: [Rxtx] Re: Move .java Files in gnu.io filesystem hierarchy - Maven (2) In-Reply-To: <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Message-ID: On Thu, 9 Feb 2006, Rajesh N wrote: > Can anybody tell me how to overcome these EXCEPTIONS > I AM WORKING ON SERIAL COMMN IN JAVA ON LINUX. > > 1. " NOT ALL PARAMETERS SUPPORTED BY THE KERNEL" > > This i came across the following statement inmy prog. > SerialP is A SerialPort object > SerialP.setSerialPortParams(9600(BAUDRATE),DATABITS_8,STOPBITS_1,PARITY_NONE) > Strange. The parameters you use are the same the port should open with by default. Could you paste the actual exception you are getting? I don't see that in the rxtx source. Also it would help to know the rxtx version. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Fri Feb 10 15:29:05 2006 From: lux at diesel-research.com (Kim Lux) Date: Fri, 10 Feb 2006 15:29:05 -0700 Subject: [Rxtx] One serial port object for both sending and receiving ? Message-ID: <1139610545.18177.4.camel@zd7280> Is it OK to use one SerialPort ojbect (ex Serial Port serialPort;) and use it for both sending and receiving ? For example: ======================================================================== static SerialPort serialPort = null; static OutputStream serialOut = null; static InputStream serialIn = null; // assign it to an outputStream for use try{ serialOut = serialPort.getOutputStream(); System.out.println("Serial output stream has been assigned."); }//try catch(IOException e) { System.out.println("Error: Couldn't assign output stream to serial port."); }//catch //assign it to an inputStream for use try{ serialIn = serialPort.getInputStream(); System.out.println("Serial input stream has been assigned."); }//try catch(IOException e) { System.out.println("Error: Couldn't assign input stream to serial port."); }//catch ======================================================================== -- Kim Lux, Diesel Research Inc. From lux at diesel-research.com Fri Feb 10 21:23:00 2006 From: lux at diesel-research.com (Kim Lux) Date: Fri, 10 Feb 2006 21:23:00 -0700 Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Message-ID: <1139631780.23882.10.camel@zd7280> I've got a problem receiving chars with my version of serialRead, written in an SWT GUI. I had a Java pro have a good look at my code and he can't see anything wrong with it. I can send chars fine. When I receive a char the cpu usage for the app goes to 100% and the code in the serial event handler doesn't get executed. The instructions on the Java Comm Serial API How-To for Linux page state that I must install javacomm. Is that true ? Everything builds without it and I can send chars on rxtx just fine, but I can't receive them. Could this be the problem ? I downloaded and installed javacomm. I was not able to add "Driver=gnuio.RXTXCommDriver to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 installed in /usr/java/jre1.5.0_05. I added comm.jar to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext to the library paths. Is this OK ? Does it matter that I am receiving on /dev/ttyUSB0 ? Thanks. -- Kim Lux, Diesel Research Inc. From lunareclipse03 at web.de Sat Feb 11 09:44:46 2006 From: lunareclipse03 at web.de (lunareclipse03@web.de) Date: Sat, 11 Feb 2006 17:44:46 +0100 Subject: [Rxtx] Question about Serial I/O under Win32 Message-ID: <662084330@web.de> Hello everybody, I have a strange problem with a piece of code I made for myself. No, this is not really concerning rxtx, but nevertheless I post this to the list, hoping that some of you can help me. I've written two libraries, one for linux and one for win32. The linux port works quite well, I can send / receive faxes and / or replay voice messages over the telephone line using a voice modem. But the win32 port of the library causes some trouble. If, for example, I send out a fax with a certain modem under linux, it works well. The fax is complete when it comes out of the fax machine. If I then use the same modem to send out a fax under win32, the fax coming out of the fax machine gets "stuck" halfways, but the sending modem thinks that transmission was ok and drops the connection. The answering fax machine then gives me "error while receiving." The "upper layer" java code MUST be right, because if I do the same thing under linux (using the linux library), everything is alright. Now I have to ask: Can somebody please help me out with this??!? Could it be the case that some kind of flow control or COMMTIMEOUTS setting causes this behaviour? I set flow control to RTS/CTS before sending out a fax. How can I DISABLE flow control? Or what do you think? Can something else cause this problems? Thank you all for your time and PLEASE write back soon. Regards, --Sven Ahlemann Am Waldrand 31 45721 Haltern am See Germany ______________________________________________________________ Verschicken Sie romantische, coole und witzige Bilder per SMS! Jetzt bei WEB.DE FreeMail: http://f.web.de/?mc=021193 From lux at diesel-research.com Sat Feb 11 10:06:52 2006 From: lux at diesel-research.com (Kim Lux) Date: Sat, 11 Feb 2006 10:06:52 -0700 Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: <1139631780.23882.10.camel@zd7280> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> <1139631780.23882.10.camel@zd7280> Message-ID: <1139677612.3431.5.camel@zd7280> More on this problem. I copied and pasted simpleRead into a console based Eclipse project and I've got the same result, except that cpu usage doesn't go to 100%. I'm beginning to think there is an issue in rxtx. My imports for simpleRead are: ============================ import gnu.io.*; import java.util.*; //import javax.comm.*; import java.io.*; =========================== Any ideas ? I am trying to read from /dev/ttyUSB0 using a serial to USB adapter which has worked well with minicom and gtkterm. Thanks. On Fri, 2006-02-10 at 21:23 -0700, Kim Lux wrote: > I've got a problem receiving chars with my version of serialRead, > written in an SWT GUI. > > I had a Java pro have a good look at my code and he can't see anything > wrong with it. > > I can send chars fine. When I receive a char the cpu usage for the app > goes to 100% and the code in the serial event handler doesn't get > executed. > > The instructions on the Java Comm Serial API How-To for Linux page state > that I must install javacomm. Is that true ? Everything builds without > it and I can send chars on rxtx just fine, but I can't receive them. > Could this be the problem ? > > I downloaded and installed javacomm. I was not able to add > "Driver=gnuio.RXTXCommDriver > to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not > have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 > installed in /usr/java/jre1.5.0_05. I added comm.jar > to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext > to the library paths. Is this OK ? > > Does it matter that I am receiving on /dev/ttyUSB0 ? > > Thanks. > -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Sun Feb 12 21:01:33 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:01:33 -0700 (MST) Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: <1139677612.3431.5.camel@zd7280> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> <1139631780.23882.10.camel@zd7280> <1139677612.3431.5.camel@zd7280> Message-ID: I suspect what is happening is the select() is breaking out in the native code but the driver does not have support for notifying there are X bytes available. On some traditional Unix based systems, the only way you know data is available is the fd status changes and do an FIORDCHK ioctl. Or perhaps the only thing you can know is the fd status changed. It would take reading through the kernel driver code to know for sure. So on USB, depending upon the driver, the same may need to be done or the driver improved a bit if possible to support. Polling reads will also work but don't use the event driven model of CommAPI which isnt acceptable in the long run. The 100% cpu usage can then be explained because select no longer blocks until the data is read; the eventLoop spins loose. You can put a well placed sleep but rxtx only expects those are needed when it knows data is available. This may not be a super simple thing to understand and fix. I do have ideas to get you started. I'm going to be short on time the next couple weeks. I expect to put some good time in and answer some other questions I saw around the 25th. For now, I'd look at the following and go from there with the hints I've given. JNIEXPORT jint JNICALL RXTXPort(nativeavailable)( JNIEnv *env, jobject jobj ) { int fd = get_java_var( env, jobj,"fd","I" ); int result; /* char message[80]; ENTER( "RXTXPort:nativeavailable" ); On SCO OpenServer FIONREAD always fails for serial devices, so try ioctl FIORDCHK instead; will only tell us whether bytes are available, not how many, but better than nothing. This turns out to be true on Solaris also. taj. */ #ifdef FIORDCHK /* __unixware__ __sun__ probably others */ result = ioctl(fd, FIORDCHK, 0); #else if( ioctl( fd, FIONREAD, &result ) < 0 ) { goto fail; } #endif /* FIORDCHK */ On Sat, 11 Feb 2006, Kim Lux wrote: > > More on this problem. I copied and pasted simpleRead into a console > based Eclipse project and I've got the same result, except that cpu > usage doesn't go to 100%. I'm beginning to think there is an issue in > rxtx. > > My imports for simpleRead are: > > ============================ > import gnu.io.*; > import java.util.*; > //import javax.comm.*; > import java.io.*; > =========================== > > Any ideas ? I am trying to read from /dev/ttyUSB0 using a serial to > USB adapter which has worked well with minicom and gtkterm. > > Thanks. > > > > On Fri, 2006-02-10 at 21:23 -0700, Kim Lux wrote: >> I've got a problem receiving chars with my version of serialRead, >> written in an SWT GUI. >> >> I had a Java pro have a good look at my code and he can't see anything >> wrong with it. >> >> I can send chars fine. When I receive a char the cpu usage for the app >> goes to 100% and the code in the serial event handler doesn't get >> executed. >> >> The instructions on the Java Comm Serial API How-To for Linux page state >> that I must install javacomm. Is that true ? Everything builds without >> it and I can send chars on rxtx just fine, but I can't receive them. >> Could this be the problem ? >> >> I downloaded and installed javacomm. I was not able to add >> "Driver=gnuio.RXTXCommDriver >> to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not >> have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 >> installed in /usr/java/jre1.5.0_05. I added comm.jar >> to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext >> to the library paths. Is this OK ? >> >> Does it matter that I am receiving on /dev/ttyUSB0 ? >> >> Thanks. >> > From tjarvi at qbang.org Sun Feb 12 21:03:30 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:03:30 -0700 (MST) Subject: [Rxtx] One serial port object for both sending and receiving ? In-Reply-To: <1139610545.18177.4.camel@zd7280> References: <1139610545.18177.4.camel@zd7280> Message-ID: On Fri, 10 Feb 2006, Kim Lux wrote: > > Is it OK to use one SerialPort ojbect (ex Serial Port serialPort;) and > use it for both sending and receiving ? > > For example: > > ======================================================================== > static SerialPort serialPort = null; > static OutputStream serialOut = null; > static InputStream serialIn = null; > > > > > // assign it to an outputStream for use > try{ > serialOut = serialPort.getOutputStream(); > System.out.println("Serial output stream has been assigned."); > }//try > catch(IOException e) > { > System.out.println("Error: Couldn't assign output stream to serial > port."); > }//catch > > > //assign it to an inputStream for use > try{ > serialIn = serialPort.getInputStream(); > System.out.println("Serial input stream has been assigned."); > }//try > catch(IOException e) > { > System.out.println("Error: Couldn't assign input stream to serial > port."); > }//catch This should be fine. In fact trying to do it another way will probably not work as you will run into lockfile issues. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun Feb 12 21:13:13 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:13:13 -0700 (MST) Subject: [Rxtx] Question about Serial I/O under Win32 In-Reply-To: <662084330@web.de> References: <662084330@web.de> Message-ID: On Sat, 11 Feb 2006 lunareclipse03 at web.de wrote: > Hello everybody, > > I have a strange problem with a piece of code I made for myself. No, > this is not really concerning rxtx, but nevertheless I post this to the > list, hoping that some of you can help me. I've written two libraries, > one for linux and one for win32. The linux port works quite well, I can > send / receive faxes and / or replay voice messages over the telephone > line using a voice modem. But the win32 port of the library causes some > trouble. If, for example, I send out a fax with a certain modem under > linux, it works well. The fax is complete when it comes out of the fax > machine. If I then use the same modem to send out a fax under win32, the > fax coming out of the fax machine gets "stuck" halfways, but the sending > modem thinks that transmission was ok and drops the connection. The > answering fax machine then gives me "error while receiving." The "upper > layer" java code MUST be right, because if I do the same thing under > linux (using the linux library), everything is alright. Now I have to > ask: Can somebody please help me out with this??!? Could it be the case > that some kind of flow control or COMMTIMEOUTS setting causes this > behaviour? I set flow control to RTS/CTS before sending out a fax. How > can I DISABLE flow control? Or what do you think? Can something else > cause this problems? Thank you all for your time and PLEASE write back > soon. > Hi Sven I'm not too willing to talk about flow control at the low level until I confirm some things with test equipment later. It is not clear if you are using rxtx or writing your own native code. So I'm not sure how to answer much of this :) If you are wondering how to change the flow control using rxtx from java, The BlackBox example from Sun flips this back and forth. SerialPort.java in rxtx 2.1 uses the following: SerialPort.java: public static final int FLOWCONTROL_NONE =0; SerialPort.java: public static final int FLOWCONTROL_RTSCTS_IN =1; SerialPort.java: public static final int FLOWCONTROL_RTSCTS_OUT =2; SerialPort.java: public static final int FLOWCONTROL_XONXOFF_IN =4; SerialPort.java: public static final int FLOWCONTROL_XONXOFF_OUT=8; So if you set flowcontrol to RTSCTS, you can set it to NONE to turn it off. If you are looking for how to do it in native code, the rxtx Source is SerialImp.c (unix/linux/mac os x/w32) and termios.c (w32 only with SerialImp.c) You can track the code: SerialImp.c:JNIEXPORT void JNICALL RXTXPort(setflowcontrol)( JNIEnv *env, jobject jobj, jint flowmode ) termios.c:int tcgetattr( int fd, struct termios *s_termios ) termios.c:int tcsetattr( int fd, int when, struct termios *s_termios ) There may be a problem in the rxtx flow control code though. Rather than guess, I want to test this with a gold standard. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Feb 6 00:00:16 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 00:00:16 -0700 (MST) Subject: [Rxtx] wiki delay until tomorrow night. In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: On Sun, 5 Feb 2006, Trent Jarvi wrote: > On Sun, 5 Feb 2006, Kim Lux wrote: > >> usb ? Tell me more... I need that too. > > usb is a very proper design. Thats all it is. > Maybe rxtx could help usb. But it would start with helping bring back the community that was already there. It's not something I'd love to do but maybe its the right thing to do. It would probably take 2 years to do right. But maybe thats better than what we have now. I honestly don't know what IBM is doing which could just run over everything. Just some thoughts after some fine german wine. -- Trent Jarvi tjarvi at qbang.org From gadelavega at yahoo.com.ar Mon Feb 6 02:17:05 2006 From: gadelavega at yahoo.com.ar (Gonzalo A. de la Vega) Date: Mon, 06 Feb 2006 10:17:05 +0100 Subject: [Rxtx] Serial port ownership question In-Reply-To: References: <20060205113618.30274.qmail@web53501.mail.yahoo.com> <1139157422.4553.9.camel@zd7280> <1139158698.4936.9.camel@zd7280> Message-ID: <43E71411.4050402@yahoo.com.ar> On my Fedora Core 4: ls -l /dev/ttyS* crw-rw---- 1 root uucp 4, 64 Feb 6 2006 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Feb 6 2006 /dev/ttyS1 ... and: grep "ttyUSB" /etc/udev/rules.d/50-udev.rules KERNEL=="ttyUSB*", GROUP="uucp", MODE="0660" So anyone in the "uucp" group can use serial ports. On Gentoo the group is "tty". Trent Jarvi escribi?: > > > On Sun, 5 Feb 2006, Dr. Douglas Lyon wrote: > >> I can confirm that this is the case (only root ownership of >> serial ports, under fedora 4). >> Wow, what were they thinking?! >> - DL >> >>> I've found that the newer kernels have the serial ports owned by root. >>> For example, >>> >>> $ls -al /dev/tty* >>> crw-rw-rw- 1 root root 5, 0 Feb 5 02:06 /dev/tty >>> crw-rw---- 1 root root 4, 0 Feb 5 02:06 /dev/tty0 >>> crw------- 1 root root 4, 1 Feb 5 09:07 /dev/tty1 >>> crw-rw---- 1 root tty 4, 10 Feb 5 02:06 /dev/tty10 >>> crw-rw---- 1 root tty 4, 11 Feb 5 02:06 /dev/tty11 >>> ... > > > This is just not a problem jcp or such are going to solve. Its a > platform spitwad fight. But do look at pam. In fact thats what Sun > is doing too. Maybe Linux followed their lead.. I'm not a pam guy. > I've spent 16 hours trying to understand it but your users wont :) > > Solution? I have no clue. Its two tangent mentalities from my > perspective. > > -- > Trent Jarvi > tjarvi at qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mtnvega at yahoo.com.br Mon Feb 6 05:35:43 2006 From: mtnvega at yahoo.com.br (Luiz Jr) Date: Mon, 6 Feb 2006 12:35:43 +0000 (GMT) Subject: [Rxtx] Documentation Wiki In-Reply-To: <1139157422.4553.9.camel@zd7280> Message-ID: <20060206123543.57256.qmail@web53515.mail.yahoo.com> Hello, Thank you for you answer, but so the usage of the API is pretty much like the Java Communications Api? If yes, what version of the Java Comm Api? Thank you, Luiz A. Brandao Jr Kim Lux escreveu: On Sun, 2006-02-05 at 08:36 -0300, Luiz Jr wrote: > Hello, > > I want to start using the RXTX libraries, but I would to know how, > since I can not access the documentation wiki page I just started using them yesterday. Below is how I installed the libraries, if that helps. I used snippets of code from the SimpleWrite application here to get me going. http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html Instead of "import javax.comm.*;", use "import gnu.io.*;" which is gotten from RXTXcomm.jar, which you will need to include in your project references. I am working in Eclipse. BTW: there is no way to open a port without going through the port list and finding it. Maybe sometime in the future someone (me ?) will write a method called openSerialPort that allows the user to give a port identifier, such as "/dev/tty1" and return a port ready to use. It wouldn't take much to write that and it would save users a lot of code. Hope this helps. ======================================================================= 1) Figure out which java you are running, incase there is more than one installed. $ java -version java version "1.5.0_05" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_05-b05) Java HotSpot(TM) Client VM (build 1.5.0_05-b05, mixed mode, sharing) 2) Find all the jre directories and the one from which you are currently running. kfind (jre) 3) cd to that directory plus /lib/i386 cd /usr/java/jre1.5.0_05/lib/i386 4) Copy the library files (*.so) to that directory. cp /home/krlux/Desktop/'Java Controls'/rxtx-linux/bin/* . 5) Check that the copy was successful ls librxtx* librxtxI2C.so librxtxRaw.so librxtxSerial.so librxtxParallel.so librxtxRS485.so 6) cd to the /lib/ext directory for your java. cd /usr/java/jre1.5.0_05/lib/ext 7) Copy the Jar files there cp /home/krlux/Desktop/'Java Controls'/rxtx-linux/lib/ext/* . 8) Check that it was successful ls RXTX* RXTXcomm.jar Rxtx is now installed on your machine ready to use. =================================================================== -- Kim Lux, Diesel Research Inc. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx --------------------------------- Yahoo! Acesso Gr?tis - Internet r?pida e gr?tis. Instale o discador agora! -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/544aa403/attachment-0025.html From lyon at docjava.com Mon Feb 6 05:49:34 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 06 Feb 2006 07:49:34 -0500 Subject: [Rxtx] wiki delay until tomorrow night. In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: Hi All, I have often thought about USB drivers being needed. For example, the ironman watch will not interface to a mac (windows only). It is USB. My dymo label writer has no Java driver (native only). Etc. Most cheap web cameras are USB (and Java drivers go through JAI, if it supports the camera at all). The JAI code shows how sun did the USB drivers. You have to be a member of the jai project to download the source code. https://jai.dev.java.net has the jai distro. And then you are not allowed to redistribute it. However, we can all learn from it (if so inclined). Basically: cvs -d :pserver:lyon at cvs.dev.java.net:/cvs login cvs -d :pserver:lyon at cvs.dev.java.net:/cvs checkout jai-core You will need to user your own uid and pw to get in. The ant build has over 100 warnings from sun deprecations of its own code. You might say that they were hoisted on their own Picard ;) One interesting thing is that they support several platforms: linux-amd64 64-bit Linux-AMD64 linux-i586 32-bit Linux-x86 solaris-amd64 64-bit Solaris-AMD64 solaris-i586 32-bit Solaris-x86 solaris-sparc 32-bit Solaris-SPARC solaris-sparcv9 64-bit Solaris-SPARC windows-i586 32-bit Windows-x86 Thus, ant is used to provide a multi-platform native method distro. Neat. How do they do it? check this out: And: The core download does not contain any C source code (it was all pre-built). Basically, they are just copying .so and .dll files into build directories. I would love to see the C code for this...but Sun does not post it on the https://jai.dev.java.net site. I don't know why...Perhaps I missed it. - Doug >On Sun, 5 Feb 2006, Trent Jarvi wrote: > >>On Sun, 5 Feb 2006, Kim Lux wrote: >> >>>usb ? Tell me more... I need that too. >> >>usb is a very proper design. Thats all it is. >> > >Maybe rxtx could help usb. But it would start with helping bring >back the community that was already there. > >It's not something I'd love to do but maybe its the right thing to do. > >It would probably take 2 years to do right. But maybe thats better >than what we have now. > >I honestly don't know what IBM is doing which could just run over everything. > >Just some thoughts after some fine german wine. > >-- >Trent Jarvi >tjarvi at qbang.org > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tdelenik at gmail.com Mon Feb 6 05:56:32 2006 From: tdelenik at gmail.com (Thanasis Delenikas) Date: Mon, 6 Feb 2006 14:56:32 +0200 Subject: Fwd: [Rxtx] Documentation Wiki In-Reply-To: <1139157422.4553.9.camel@zd7280> References: <20060205113618.30274.qmail@web53501.mail.yahoo.com> <1139157422.4553.9.camel@zd7280> Message-ID: <310a1a930602060456t129f1dc6p5f2b908f13ab5a0b@mail.gmail.com> Hello all, Kim, this is a snippet from the code I use. The closest to directly opening a specific port without enumeration. << ... portId = CommPortIdentifier.getPortIdentifier(getPort()); serialPort = (SerialPort) portId.open("jSMSEngine", 1971); ... >> where getPort() return the string identifier of the port, i.e. "/dev/ttyS0" or "COM1" or whatever. Thanasis. ---------- Forwarded message ---------- From: Kim Lux Date: Feb 5, 2006 6:37 PM Subject: Re: [Rxtx] Documentation Wiki To: RXTX Developers and Users BTW: there is no way to open a port without going through the port list and finding it. Maybe sometime in the future someone (me ?) will write a method called openSerialPort that allows the user to give a port identifier, such as "/dev/tty1" and return a port ready to use. It wouldn't take much to write that and it would save users a lot of code. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/182ab5b8/attachment-0025.html From tjarvi at qbang.org Mon Feb 6 11:53:57 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 11:53:57 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: On Mon, 6 Feb 2006, Dr. Douglas Lyon wrote: > Hi All, > I have often thought about USB drivers being needed. > For example, the ironman watch will not interface > to a mac (windows only). It is USB. > My dymo label writer has no Java driver (native only). > Etc. > Most cheap web cameras are USB (and Java drivers go > through JAI, if it supports the camera at all). > The JAI code shows how sun did the USB drivers. > You have to be a member of the jai project to download > the source code. > https://jai.dev.java.net has the jai distro. > And then you are not allowed to redistribute it. However, > we can all learn from it (if so inclined). Basically: > cvs -d :pserver:lyon at cvs.dev.java.net:/cvs login > cvs -d :pserver:lyon at cvs.dev.java.net:/cvs checkout jai-core > You will need to user your own uid and pw to get in. > The ant build has over 100 warnings from sun deprecations > of its own code. > > You might say that they were hoisted on their own Picard ;) > > One interesting thing is that they support several platforms: > linux-amd64 64-bit Linux-AMD64 > linux-i586 32-bit Linux-x86 > solaris-amd64 64-bit Solaris-AMD64 > solaris-i586 32-bit Solaris-x86 > solaris-sparc 32-bit Solaris-SPARC > solaris-sparcv9 64-bit Solaris-SPARC > windows-i586 32-bit Windows-x86 > Thus, ant is used to provide a multi-platform native method distro. > Neat. > How do they do it? > check this out: > > > > > > > > > > > > > And: > > > > > > > > > > The core download does not contain any C source code (it was all pre-built). > Basically, they are just copying .so and .dll files into build directories. > > I would love to see the C code for this...but Sun does not post it on the > https://jai.dev.java.net site. > > I don't know why...Perhaps I missed it. > > - Doug > > I've looked at moving rxtx to Ant builds. I think that would help IDEs a great deal. I requested a evalutation desk copy the O'Reilly Ant book for some j2ee material I was teaching. http://www.oreilly.com/catalog/anttdg/ It has a one sentence mention of JNI. So there was not luck there. I saw that there is another Ant book that does mention JNI more. I can't find it now. Ant must be able to support it with extensions. http://ant.apache.org/manual/OptionalTasks/javah.html What the auto(break :) tools do in the rxtx build is 4 things really. 1) gcc compile flags 2) ld compile flags 3) config.h 4) compile flags for customizing rxtx (lockfiles, ...) See 1 All of this information except 4 can be static once obtained. So I'm not attached to the auto tools. If I could find an example of Ant being used for JNI code, I'd be one of the first to start moving that direction. Maybe someone saw an example someplace. The other thing we have not completed discussing is the directory structure. There is interest in making rxtx more IDE friendly. I get more mail about that off the list than how to install rxtx. And I see we have Ken Thompson in da house :) He is our trusted CVS maintainer and the guy that purchased the rxtx.org domain. Old community. We will need Ken for changing the directory structure of source. I would like to open up discussion about both of these as it is more than time. The problem is I have little experience with Ant and even less with IDEs. It would be nice if we could work with Eclipse and NetBeans. http://www.netbeans.org/ (sun and some community) http://www.eclipes.org (ibm,rhat,... perhaps more community) http://maven.apache.org/what-is-maven.html (apache. It is community) borland should sortof be here too but I think thats covered in eclipse. >From what I understand so far, we should morph rxtx to support those three maybe trusting apaches lead with maven. But I use vi. I have little to no clues beyond what people have fed me. Can we agree that thats the right direction to go? -- Trent Jarvi tjarvi at qbang.org From brian at mbari.org Mon Feb 6 14:57:50 2006 From: brian at mbari.org (Brian Schlining) Date: Mon, 6 Feb 2006 13:57:50 -0800 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> > The other thing we have not completed discussing is the directory > structure. There is interest in making rxtx more IDE friendly. I > get more mail about that off the list than how to install rxtx. > > And I see we have Ken Thompson in da house :) He is our trusted > CVS maintainer and the guy that purchased the rxtx.org domain. Old > community. We will need Ken for changing the directory structure of > source. > > I would like to open up discussion about both of these as it is > more than time. The problem is I have little experience with Ant > and even less with IDEs. It would be nice if we could work with > Eclipse and NetBeans. > > http://www.netbeans.org/ (sun and some community) > http://www.eclipes.org (ibm,rhat,... perhaps more community) > http://maven.apache.org/what-is-maven.html (apache. It is community) > borland should sortof be here too but I think thats covered in > eclipse. > >> From what I understand so far, we should morph rxtx to support >> those three > maybe trusting apaches lead with maven. But I use vi. I have > little to no clues beyond what people have fed me. > Maven likes the directory structure below for Java code. (From http:// maven.apache.org/guides/getting-started/index.html) This structure works fine with ant, netbeans, and eclipse. rxtx_root_directory `-- src |-- main | `-- java | `-- gnu | `-- io `-- test `-- java `-- gnu `-- io Brian Schlining Software Engineer http://www.mbari.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/d9451eba/attachment-0025.html From tjarvi at qbang.org Mon Feb 6 15:11:45 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 15:11:45 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: > rxtx_root_directory > `-- src > |-- main > | `-- java > | `-- gnu > | `-- io > `-- test > `-- java > `-- gnu > `-- io > >From what I understand this will just be good. For me it makes no difference. So lets do the rxtx thing. Let if fester for two weeks and if nobody objects, we will do it. I'm not doing this because I care. I'm doing this to eliminate much of my inbox. But test... man is rxtx lacking there in the community aspect. It is covered but not right. _maybe_ I can change that this year. -- Trent Jarvi tjarvi at qbang.org (cat hurding since 1997) From lux at diesel-research.com Mon Feb 6 21:38:49 2006 From: lux at diesel-research.com (Kim Lux) Date: Mon, 06 Feb 2006 21:38:49 -0700 Subject: [Rxtx] How can I use Lock Files with rxtx (in FC4) ? Message-ID: <1139287129.17031.3.camel@zd7280> I am now running an rxtx application on FC4. I am getting: ========================================================= check_group_uucp(): error testing lock file creation Error details: Permission denied check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL ========================================================= $ ls -al /var/lock total 32 drwxrwxr-x 4 root lock 4096 Feb 6 16:04 . drwxr-xr-x 24 root root 4096 Nov 14 01:19 .. drwx------ 2 root root 4096 Apr 27 2005 lvm drwxr-xr-x 2 root root 4096 Feb 6 16:04 subsys How do I fix this for regulator users ? -- Kim Lux, Diesel Research Inc. From dmarkman at mac.com Mon Feb 6 22:24:44 2006 From: dmarkman at mac.com (Dmitry Markman) Date: Tue, 7 Feb 2006 00:24:44 -0500 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: if I understands the issue right in order to be able to use ant for c/c++ compilation you have to install ant's cc task http://ant-contrib.sourceforge.net/cc.html it looks like it should work on mac os x (authors claim, that it's platform independent) but I never tested so all you have to do it's providing right command line for the gcc compiler On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: >> rxtx_root_directory >> `-- src >> |-- main >> | `-- java >> | `-- gnu >> | `-- io >> `-- test >> `-- java >> `-- gnu >> `-- io >> > > >> From what I understand this will just be good. > > For me it makes no difference. So lets do the rxtx thing. Let if > fester for two weeks and if nobody objects, we will do it. > > I'm not doing this because I care. I'm doing this to eliminate > much of my inbox. > > But test... man is rxtx lacking there in the community aspect. It > is covered but not right. _maybe_ I can change that this year. > > -- > Trent Jarvi > tjarvi at qbang.org > (cat hurding since 1997) > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx Dmitry Markman From lux at diesel-research.com Mon Feb 6 23:20:15 2006 From: lux at diesel-research.com (Kim Lux) Date: Mon, 06 Feb 2006 23:20:15 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? Message-ID: <1139293215.3689.4.camel@zd7280> I'm running the code below. portlist.hasMoreElements() is false. /dev has ports in it as listed below. What am I doing wrong ? ========================================================== // Step through the list of ports until we find one that matches // the one we are looking for. portList = CommPortIdentifier.getPortIdentifiers(); while(portList.hasMoreElements()) { portID = (CommPortIdentifier) portList.nextElement(); // if (portID.getName().equals("/dev/ttyUSB0")) { myTA.append("Serial port ttyUSB0 has been found\n"); break; }// if portID equals... }// End of while... ========================================================== ls -al /dev/tty* crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 ... crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 -- Kim Lux, Diesel Research Inc. From david.garnier at trusted-logic.com Tue Feb 7 00:46:30 2006 From: david.garnier at trusted-logic.com (David Garnier) Date: Tue, 07 Feb 2006 08:46:30 +0100 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: <43E85056.2090608@trusted-logic.com> Hello, I think that the make-based build process is fine as it is, apart from the location of the Java source files. It is true that putting the Java source in a directory structure that map 1-to-1 to the Java package structure is the norm and should make it easier for everyone to modify the Java source, with or without an IDE. Ant is a good tool, but in the RXTX case I fail to see the advantage of using it compared to the current make-based process. As Trent said, they are more pressing issues, like testing. Regards, David Dmitry Markman wrote: > if I understands the issue right > in order to be able to use ant for c/c++ compilation > you have to install ant's cc task > http://ant-contrib.sourceforge.net/cc.html > > it looks like it should work on mac os x > (authors claim, that it's platform independent) > but I never tested > > so all you have to do it's providing right command line > for the gcc compiler > > > > > On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: > >>> rxtx_root_directory >>> `-- src >>> |-- main >>> | `-- java >>> | `-- gnu >>> | `-- io >>> `-- test >>> `-- java >>> `-- gnu >>> `-- io >>> >> >> >>> From what I understand this will just be good. >> >> For me it makes no difference. So lets do the rxtx thing. Let if >> fester for two weeks and if nobody objects, we will do it. >> >> I'm not doing this because I care. I'm doing this to eliminate much >> of my inbox. >> >> But test... man is rxtx lacking there in the community aspect. It is >> covered but not right. _maybe_ I can change that this year. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> (cat hurding since 1997) From tjarvi at qbang.org Tue Feb 7 01:11:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 01:11:31 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <43E85056.2090608@trusted-logic.com> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: On Tue, 7 Feb 2006, David Garnier wrote: > Hello, > > I think that the make-based build process is fine as it is, apart from the location of the Java > source files. It is true that putting the Java source in a directory structure that map 1-to-1 to > the Java package structure is the norm and should make it easier for everyone to modify the Java > source, with or without an IDE. > > Ant is a good tool, but in the RXTX case I fail to see the advantage of using it compared to the > current make-based process. As Trent said, they are more pressing issues, like testing. > Hi David I have more experience with testing rxtx than I can talk about. But let it be known, rxtx has gone trough 100's of hours of testing. We are hobby folks interested in toys but there is more. rxtx has had some of the best guidance in the industry there. This is not an easy thing. I may be able to come back in a month from the other side of the corperate fence and help. I suspect the tests could just be made public but they are in a very unusual environment that just wont work in a wider sense. This is something I'll be trying to change. At one point it was agreed we could just make the results public so this isnt just noise.. There is interest and I think its safe to mention that much. The big problem with testing in the past is most of it is done with a loopback connection. So we *still* have major questions regarding things like flow control. rxtx talks to itself over a loopback and it works. regardless of right or wrong. This requires more thought to be done right. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Feb 7 02:46:34 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 02:46:34 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: > The big problem with testing in the past is most of it is done with a > loopback connection. So we *still* have major questions regarding things > like flow control. rxtx talks to itself over a loopback and it works. > regardless of right or wrong. With serial communication there are gold standards. ckermit is probably a definitive 'standard.' Maybe its possible to do ping/pong tests with ckermit? Is it scriptable? There are known issues in rxtx. Probably the worst is some threading issues regarding some JREs with multiple JNI threads setting java variables. Man did I get schooled there. Just switch the c functions to returning variables and things go away. Sometimes they work fine, sometimes they blow up. Without understanding everything, somehow rhat got it right and debian (and especially gentoo) grabbed kernel patches causing all sort of harm. Its not hard to fix once you understand whats going on but nearly impossible to track with a debugger. So I have a good idea what 2.1-8 will have outside of the IDE modifications. rxtx 2.1-7 is a release for everyone to sync with. Its not even as stable as -pre17 as far as I know - I ran no test suites. I'll be chasing it too. We just had so many contributions that it was time. It seriously broke internal scheduals but thats a great thing :) The other thing I want to do in 2.1-8 is automagic baud rates. It turns out lots of shops are doing really funky baud rates for things like automobile test equipment. It is possible but it requires a fair amount of change in the native code. Is anyone looking at this? -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Feb 7 02:57:21 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 07 Feb 2006 04:57:21 -0500 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <43E85056.2090608@trusted-logic.com> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: Hi All, I agree, testing is very important. The problem I have been trying to address is related to cross-platform testing and the robust nature of the installs. Typically, I visit 3 platforms to deploy my product, windows, linux and mac. A build is performed on each platform. The idea that you can build for many platforms from one copy the source code seems attractive. This should enable synchronized deployments of identical code. The question of how to achieve this goal remains open. As Trent mentioned, this is hard. Perhaps Ant will help here (but perhaps not). Ant does seem to help with running unit tests. However, it does not help with multi-platform tests. For that you need many machines and different operating environments. Toward that end, I have created a multi-platform test that can be run from web start, located at: http://show.docjava.com:8086/book/cgij/code/jnlp/serialPort.PortTest.jnlp This is interesting because many people in the community can run the test and we can improve the test, as time permits. No, it is not a perfect solution, however, the idea does help with multi-platform tests using many machines and different operating environments. If the group has a good test for a general serial port set-ups, i would be happy to deploy it, for general evaluation using web start. And as for ANT, it is just an idea. Not all my ideas are good ones! - Doug >Hello, > >I think that the make-based build process is fine as it is, apart >from the location of the Java >source files. It is true that putting the Java source in a directory >structure that map 1-to-1 to >the Java package structure is the norm and should make it easier for >everyone to modify the Java >source, with or without an IDE. > >Ant is a good tool, but in the RXTX case I fail to see the advantage >of using it compared to the >current make-based process. As Trent said, they are more pressing >issues, like testing. > >Regards, >David > >Dmitry Markman wrote: >> if I understands the issue right >> in order to be able to use ant for c/c++ compilation >> you have to install ant's cc task >> http://ant-contrib.sourceforge.net/cc.html >> >> it looks like it should work on mac os x >> (authors claim, that it's platform independent) >> but I never tested >> >> so all you have to do it's providing right command line >> for the gcc compiler >> >> >> >> >> On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: >> >>>> rxtx_root_directory >>>> `-- src >>>> |-- main >>>> | `-- java >>>> | `-- gnu >>>> | `-- io >>>> `-- test >>>> `-- java >>>> `-- gnu >>>> `-- io >>>> >>> >>> >>>> From what I understand this will just be good. >>> >>> For me it makes no difference. So lets do the rxtx thing. Let if >>> fester for two weeks and if nobody objects, we will do it. >>> >>> I'm not doing this because I care. I'm doing this to eliminate much >>> of my inbox. >>> >>> But test... man is rxtx lacking there in the community aspect. It is >>> covered but not right. _maybe_ I can change that this year. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> (cat hurding since 1997) > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From matt.higgins at gmail.com Tue Feb 7 08:28:34 2006 From: matt.higgins at gmail.com (Matt Higgins) Date: Tue, 7 Feb 2006 10:28:34 -0500 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final Message-ID: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? import java.io.*; import java.util.*; import gnu.io.*; public class MySimpleRead implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; public static void main(String[] args) { boolean portFound = false; String defaultPort = "COM1"; if (args.length > 0) { defaultPort = args[0]; } portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; MySimpleRead reader = new MySimpleRead(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } } public MySimpleRead() { try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) { e.printStackTrace(); } try { inputStream = serialPort.getInputStream(); } catch (IOException e) { e.printStackTrace(); } try { serialPort.addEventListener(this); } catch (TooManyListenersException e) { e.printStackTrace(); } try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { e.printStackTrace(); } System.out.println("Baud is " + serialPort.getBaudRate()); System.out.println("Bits is " + serialPort.getDataBits()); System.out.println("Stop is " + serialPort.getStopBits()); System.out.println("Par is " + serialPort.getParity()); serialPort.notifyOnDataAvailable(true); readThread = new Thread(this); readThread.start(); } public void run() { // Thread.sleep(20000); //} catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { System.out.println("An event occurred " + event.getEventType()); switch (event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: byte[] readBuffer = new byte[20]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } System.out.print(new String(readBuffer)); } catch (IOException e) {} break; } } } --------------- Result on windows ------------------------------ Stable Library ============================================================== Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port:: COM1 Baud is 9600 Bits is 8 Stop is 1 Par is 0 ----------------- End Results ----------------------------------------- ------------------ Result on Linux ----------------------------------- Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 Found port: /dev/ttyS0 Baud is 9600 Bits is 8 Stop is 1 Par is 0 An event occurred 1 043100066224 ------------------ End Results --------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/a1431630/attachment-0025.html From brian at mbari.org Tue Feb 7 09:48:37 2006 From: brian at mbari.org (Brian Schlining) Date: Tue, 7 Feb 2006 08:48:37 -0800 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> Message-ID: <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> Hi Matt > The following code works fine on Linux but I never see any data > when run on Windows. This is a cut and paste from the SimpleRead > example. > I am attempting to read data from a bar code scanner. I can fire > up HyperTermianl on windows and see that the device is working > properly as I see the barcodes are scanned and echoed back to the > terminal. However when I run the app I don't see any data. It is > however associating with the com port as the informational bits > print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. Cheers Brian Schlining Software Engineer http://www.mbari.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/16d07f37/attachment-0025.html From lux at diesel-research.com Tue Feb 7 11:59:58 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 11:59:58 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139293215.3689.4.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> Message-ID: <1139338798.8145.4.camel@zd7280> Any ideas on this ? Any reason why portList.hasMoreElements() should be false even though there are devices in /dev ? On Mon, 2006-02-06 at 23:20 -0700, Kim Lux wrote: > I'm running the code below. > > portlist.hasMoreElements() is false. > > /dev has ports in it as listed below. > > What am I doing wrong ? > > > ========================================================== > // Step through the list of ports until we find one that matches > // the one we are looking for. > > portList = CommPortIdentifier.getPortIdentifiers(); > > while(portList.hasMoreElements()) > { > portID = (CommPortIdentifier) portList.nextElement(); // > if (portID.getName().equals("/dev/ttyUSB0")) > { > myTA.append("Serial port ttyUSB0 has been found\n"); > break; > }// if portID equals... > }// End of while... > ========================================================== > > ls -al /dev/tty* > crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty > crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 > crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 > crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 > crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 > ... > crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 > crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 > crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 > > > -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 12:20:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 12:20:25 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139338798.8145.4.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> Message-ID: On Tue, 7 Feb 2006, Kim Lux wrote: > > Any ideas on this ? Any reason why portList.hasMoreElements() should be > false even though there are devices in /dev ? > > > On Mon, 2006-02-06 at 23:20 -0700, Kim Lux wrote: >> I'm running the code below. >> >> portlist.hasMoreElements() is false. >> >> /dev has ports in it as listed below. >> >> What am I doing wrong ? >> >> >> ========================================================== >> // Step through the list of ports until we find one that matches >> // the one we are looking for. >> >> portList = CommPortIdentifier.getPortIdentifiers(); >> >> while(portList.hasMoreElements()) >> { >> portID = (CommPortIdentifier) portList.nextElement(); // >> if (portID.getName().equals("/dev/ttyUSB0")) >> { >> myTA.append("Serial port ttyUSB0 has been found\n"); >> break; >> }// if portID equals... >> }// End of while... >> ========================================================== >> >> ls -al /dev/tty* >> crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty >> crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 >> crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 >> crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 >> crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 >> ... >> crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 >> crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 >> crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 >> >> >> > Hi Kim What rxtx does is try to open the port and do a timed out read. If the kernel/... do not complain it's enumarted. I suspect you could do a crude test by doing something like cat /dev/ttyS0 > /dev/null If that barfs then rxtx wont enumerate the port. hmm looking at your question again, I suspect it's a lockfile problem. This is documented in INSTALL with the source. Its easy enough to test this too.. touch /var/lock/testingrxtxlockfiles && rm -f /var/lock/testingrxtxlockfiles If you are not in the right group it will bail. Root will work regardless. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 12:37:56 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 12:37:56 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> Message-ID: <1139341076.8145.11.camel@zd7280> Exactly which ports does rxtx attempt to put into the list ? /dev/* or /dev/tty* or /dev/tty[0-9[0-9] ? or /dev/ttyS* ? For the record, only /dev/ttyUSB0 is a valid port on the machine I am presently on. Will this be a problem ? On Tue, 2006-02-07 at 12:20 -0700, Trent Jarvi wrote: > This is documented in INSTALL with the source. > I was wondering where that file was. I will download source and dig it up. Thanks. -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 12:51:09 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 12:51:09 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139341076.8145.11.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: On Tue, 7 Feb 2006, Kim Lux wrote: > > Exactly which ports does rxtx attempt to put into the list ? /dev/* > or /dev/tty* or /dev/tty[0-9[0-9] ? or /dev/ttyS* ? > > For the record, only /dev/ttyUSB0 is a valid port on the machine I am > presently on. Will this be a problem ? > > > On Tue, 2006-02-07 at 12:20 -0700, Trent Jarvi wrote: >> This is documented in INSTALL with the source. >> > I was wondering where that file was. I will download source and dig it > up. > > Thanks. > Hmm I'm looking at pre17 so this may have changed. (its just what I have on this machine) if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA" // for the IPAQs }; CandidatePortPrefixes=Temp; } So you may need to add "ttyUSB" to that list. RXTX used to enumerate _everything_ see if(osName.equals("Linux-all-ports") But it became less than practical. This is all in RXTXCommDriver.java hmm I just did a cvs update. if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have to get your fingers into the code. We aim for sane defaults. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 13:06:45 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 13:06:45 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139342805.8145.22.camel@zd7280> On Tue, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > Hmm I'm looking at pre17 so this may have changed. (its just what I have > on this machine) > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA" // for the IPAQs > }; > CandidatePortPrefixes=Temp; > } > > > So you may need to add "ttyUSB" to that list. RXTX used to enumerate > _everything_ see if(osName.equals("Linux-all-ports") But it became less > than practical. > > This is all in RXTXCommDriver.java > > hmm I just did a cvs update. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have > to get your fingers into the code. We aim for sane defaults. Excellent. Thanks for taking the time. -- Kim Lux, Diesel Research Inc. From ideiglenes1 at freemail.hu Tue Feb 7 13:53:39 2006 From: ideiglenes1 at freemail.hu (--) Date: Tue, 07 Feb 2006 21:53:39 +0100 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139345619.22534.2.camel@localhost> Hi! I use this code to get all the extra Linux devices. :) if ("Linux".equals(System.getProperty("os.name"))) { System.setProperty("os.name","Linux-all-ports"); } driver = new RXTXCommDriver(); On k, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > On Tue, 7 Feb 2006, Kim Lux wrote: > > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have > to get your fingers into the code. We aim for sane defaults. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From matt.higgins at gmail.com Tue Feb 7 13:45:54 2006 From: matt.higgins at gmail.com (Matt Higgins) Date: Tue, 7 Feb 2006 15:45:54 -0500 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> Message-ID: <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> Sweet this is exactly what I needed. I was searching the archives through marc.theamisgroup they only have archives back to 1/3/05. Should have hit the mailman archive! Thanks a lot! On 2/7/06, Brian Schlining wrote: > > Hi Matt > > The following code works fine on Linux but I never see any data when run > on Windows. This is a cut and paste from the SimpleRead example. > I am attempting to read data from a bar code scanner. I can fire up > HyperTermianl on windows and see that the device is working properly as I > see the barcodes are scanned and echoed back to the terminal. However when I > run the app I don't see any data. It is however associating with the com > port as the informational bits print fine? > > > You're not the only one whose had this problem, I don't know if Trent has > addressed this is the latest release of RXTX but there is a workaround. > Here's the recent thread from the RXTX mailing list regarding this issues: > > Thanasis Delenikas tdelenik at gmail.com > Wed Jan 18 13:56:23 MST 2006 > > * Previous message: [Rxtx] Re: More close() performance fixes > * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] > > Hi all. > (I've subscribed again from my other email account). > > Trent, > > You are right. Linux *always* works, no matter what flow control you set. > Windows *works only* with hardware flow control (I haven't tested what > happens with software XON/XOFF flow control). > > I assume (but I am not certain) that even with no flow control at all, all > platforms should work. Without flow control, you have the risk of bumping > into overflow or framing errors, but that's your (the end programmer, I > mean) problem. > > >From my side, I shouldn't be working without flow control. That was a bug > too... It was some code forgotten from the old times, when I used to work > with phone emulation drivers which didn't support flow control. The > correct > way is to have some flow control enabled and that's why I suppose this is > a > low-severity bug for RxTx. > > I have no idea which platform shows the correct behaviour, since > my knowledge about Linux and the inner workings of these low-level i/o > operations is limited. > > Regards, > Thanasis Delenikas. > > > > > Message: 2 > > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > > From: Trent Jarvi > > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > > To: RXTX Developers and Users > > Message-ID: > > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > > > Hi all, > > > > > > Trent, I have found something. > > > I read your comment about flow control, so I experimented a bit. > > > > > > If you remember, in my sample program I've used no flow control at all > ( > > i.e. > > > Java constant FLOWCONTROL_NONE). > > > > > > Now, during testing, I've switch to hardware inbound flow control (i.e > . > > Java > > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > > beautifully! > > > > > > I think I will switch to H/W flow control and test things for a while, > > but > > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > > > > > Hi Thanasis, > > > > I'm fairly sure you have identified a bug. I would not worry too much > > about what Sun CommAPI w32 defaults are. I think they did more or less > > whatever the port opened with. Just a guess. Linux tries to stomp on > > ports so they are all the same. > > > > So this started out with Linux worked, Windows XP/.. did not as I > recall. > > Something is wrong in rxtx. Do I understand this right? > > > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > > > Perhaps there is something Wayne or I did not understand when we wrote > > that code. I wasnt programming back in the BBS days so modems are not > my > > thing. I have a few questions. > > > > Is the above matrix confirmed by observation? > > Linux just always worked? > > Which one _should_ work? I'm guessing modems work with hardware flow > > control. I'll have to dig around. > > > > The windows flow control changes a couple things with hardware flow > > control. Following the w32 API documentation is confusing sometimes. > > But it looks like Linux could have a bug too. > > Cheers > > Brian Schlining > Software Engineer > http://www.mbari.org > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/9c989144/attachment-0025.html From tjarvi at qbang.org Tue Feb 7 14:06:14 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 14:06:14 -0700 (MST) Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> Message-ID: >> >> You're not the only one whose had this problem, I don't know if Trent has >> addressed this is the latest release of RXTX but there is a workaround. >> Here's the recent thread from the RXTX mailing list regarding this issues: >> I have not. I expect to have access to some test equipment next month and I'll go through all of this. I really don't know whats going on and I need a gold standard. I thought maybe linux was autodetecting the flow control. Your observations would certainly be welcome. I need to talk to Russell King and see what he is doing. Until then I'd just be toying around over a loopback as usual. This is very high on the list though. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 17:25:05 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 17:25:05 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139358305.17994.2.camel@zd7280> My application now works. I installed the libraries and jar from 2.1-7 (Final). portlist.hasMoreElements is no longer false. The application finds the port for /dev/ttyUSB0. Thanks for your help, Trent (et al) Sorry I bothered you with this. Next time I will look in the source first. I didn't think it was an rxtx issue, I thought it was a Linux setup issue . On Tue, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > Hmm I'm looking at pre17 so this may have changed. (its just what I > have > on this machine) > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux > Serial Ports > "ttySA" // for the > IPAQs > }; > > CandidatePortPrefixes=Temp; > } > > > So you may need to add "ttyUSB" to that list. RXTX used to enumerate > _everything_ see if(osName.equals("Linux-all-ports") But it became > less > than practical. > > This is all in RXTXCommDriver.java > > hmm I just did a cvs update. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux > Serial Ports > "ttySA", // for the > IPAQs > "ttyUSB" // for USB > frobs > }; > > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you > have > to get your fingers into the code. We aim for sane defaults. -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 19:21:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 19:21:54 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139358305.17994.2.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> <1139358305.17994.2.camel@zd7280> Message-ID: >Sorry I bothered you with this. Next time I will look in the source >first. I didn't think it was an rxtx issue, I thought it was a Linux >setup issue . Why would you be sorry? I would have done the same. I'm glad it's working :) -- Trent Jarvi tjarvi at qbang.org From tma at mail.island.net Wed Feb 8 13:39:35 2006 From: tma at mail.island.net (Tom Alldread) Date: Wed, 08 Feb 2006 12:39:35 -0800 Subject: [Rxtx] Win32/Linux Serial Port Data Dropouts In-Reply-To: <200602060702.k167255O007882@www.qbang.org> References: <200602060702.k167255O007882@www.qbang.org> Message-ID: <43EA5707.4020200@mail.island.net> Greetings Folks at RXTX: During the last couple of months I have been alternately testing with javax.comm 2 and RXTX 2.1 under Windows XP and CommApi 3 and RXTX 2.1 under Suse 10.0 Linux. In the process I have learned a little about java multi-threading under NetBeans 5 with Profiler. My java (jdk 1.5_06) application is used for data acquisition and provides a graphical display of A-D conversion data received from a 56KBaud serial port. The actual data throughput is about 10KBaud thus it is well below the speed of the port. I use hardware RTS/CTS flow control which can stall the data acquisition sample rate if necessary. This ensures the display computer has the ability to slow the data acquisition rate should it become too busy to accept the regular data flow. Both the serial port buffer and the java read buffer are set at 16KB. Usually the data transfers into the java read buffer are less than 100 bytes unless the data acquisition is recovering from a stall. The data flow normally hesitates after each 5 KB block as a continue command is needed from the display computer to start the drawing of a new graphics display line. Separate threads have been provided for the serial port event monitoring and data processing. The serial port event thread has been given the maximum priority and data processing thread the minimum priority provided by java. Thread yield statements have been placed within all data processing while/for loops as an effort to ensure quick access to CPU cycles for the serial port event thread. I have found that short data transmissions are essentially error free but occasional dropouts occur with continuous data flow especially under Windows XP. ....................................................................................................................................................................................... Linux results: I am happy to report that RXTX 2.1 appears to work very well under Linux although I did notice some errors when the screen savers were running with my dual monitors. I believe this is a local problem associated with my dual graphics which needs further attention. The recent CommApi 3 Linux release from Sun did not work at all with my program. It seemed to send commands out OK but did not receive any data. Although the serial port event triggered the ISR, the input stream appeared filled with nulls and thus did not contain any data. As my understanding is that CommApi 3 was tested with a Red Hat distribution of Linux I wonder if this problem is distro dependent? Although somewhat off topic here I wonder if anyone reading this has had similar experience? .................................................................................................................................................................................. Windows XP results: There are problems with occasional data dropouts which become more frequent as the sampling rate is increased or if the computer becomes busy with other duties. The dropouts typically consist of a half dozen byte block of lost data. It appears the lost bytes never get added to the java input stream. There has not been any indication of garbled data, overruns or framing errors which suggests the UART communications remains solid. Using javax.comm 2 I found that the setting of SerialPort 'enableReceiveThreshold' to 40 and 'enableReceiveTimeout' of 100mS reduced the dropouts error rate significantly. I found that I could not get RXTX 2.1 to function with the aforementioned threshold and timeout settings. The javax.comm 2 interface is consequently performing better for me under Windows than RXTX 2.1. I wonder if anyone here has any suggestions as to what I might try to improve RXTX 2.1? Although my settings are the same as under Suse 10.0, RXTX 2.1 performs much better for me under Linux than any of the alternatives that I have tried under Windows XP . ............................................................................................................................................................................... I would like to establish, based on the experience of others, if I have reached the normally expected performance limit of java serial port communications? Should I expect to achieve virtually error free serial port data input from a continuous stream under Windows XP java software? I am considering changing my protocol to packets with error checking if necessary but would like to know if the dropout problems I am experiencing are typical or not before I take this rather work intensive plunge. Many thanks in advance for any help! Best Regards, Tom Alldread -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.375 / Virus Database: 267.15.2/253 - Release Date: 2006-02-07 From jlaxson at mac.com Wed Feb 8 23:56:48 2006 From: jlaxson at mac.com (John Laxson) Date: Thu, 9 Feb 2006 00:56:48 -0600 Subject: [Rxtx] PortInUseException: Unknown Application on OSX Message-ID: Hi, I've been trying to get RXTX 2.1.7 going on Mac OS X for a while here, and am running up into a wall here. I've tried with pre- compiled and the source version and get the same problem, a gnu.io.PortInUseException: Unknown Application. I have run the fixperms script included with the source distribution, and id shows me as a member of the uucp group, and permissions on /var/spool/uucp are 775 root:uucp. Running a test program (included at the bottom for clarity) lets me enumerate all the serial ports correctly, but trying to open any of them gives the PortInUseException. If it helps, when I try to open a port that's set to make an outgoing bluetooth connection, there is no delay and no connection attempt at all. Thanks, John Laxson PS: The documentation wiki on qbang.org shows 404, and has for a few days now. My test code: public static void main(String[] args) { SerialPort serialPort; try { Enumeration e = CommPortIdentifier.getPortIdentifiers(); CommPortIdentifier ident; while (e.hasMoreElements()) { ident = (CommPortIdentifier)e.nextElement(); System.out.println(ident.getName()); } ident = CommPortIdentifier.getPortIdentifier("/dev/cu.modem"); serialPort = (SerialPort) ident.open("Me", 5000); } catch (Exception e) { e.printStackTrace(); } } From rajesh.invincible at gmail.com Thu Feb 9 03:39:38 2006 From: rajesh.invincible at gmail.com (Rajesh N) Date: Thu, 9 Feb 2006 16:09:38 +0530 Subject: [Rxtx] Re: Move .java Files in gnu.io filesystem hierarchy - Maven (2) In-Reply-To: <43DF21D2.7090200@ngi.it> References: <43DF21D2.7090200@ngi.it> Message-ID: <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Can anybody tell me how to overcome these EXCEPTIONS I AM WORKING ON SERIAL COMMN IN JAVA ON LINUX. 1. " NOT ALL PARAMETERS SUPPORTED BY THE KERNEL" This i came across the following statement inmy prog. SerialP is A SerialPort object SerialP.setSerialPortParams(9600(BAUDRATE),DATABITS_8,STOPBITS_1,PARITY_NONE) 2. NullPointer Exception at Event Dispatch Now i have checked all my object references for a null reference but i found none i have put up my entire code in try catch blocks but still I AM UNABLE TO CATCH THIS EXCEPTION AND HENCE MY APPLICATION CLOSES HOW DOES THESE GO? PLEASE HELP ME IT IS URGENTTTTTTTTTTTTTTTT yours sincerely RAJESH On 1/31/06, Fabio Frumento wrote: > Hi Xavier, > > I don't know maven at all but the directory hierarchy listed buy Trent > is fine for me... > > I'll take a look to maven, it seems an interesting project > > Regards > > Fabio Frumento > > Trent Jarvi wrote: > > On Tue, 31 Jan 2006, Xavier Frisaye wrote: > > > >> Hi all, > >> > >> If you are going to rearrange the src folder, i will propose to use > >> maven 2 and follow its directory structure > >> > (http://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html). > >> > >> Maven 2 simplify java project and give a standard way to make projects > >> (http://maven.apache.org/). > >> We are using it for internal projects and we are very satisfied. > >> > >> Is anybody interested? > >> > >> I'm not an expert in maven 2 (yet) but i'm agree to help using it if > >> you choose to make so. > >> > > > > so this would be: > > > > rxtx-devel/src/main/java/gnu.io > > rxtx-devel/src/test/java/ManIwish.java > > > > I don't use IDEs very much so I'll let others comment. But I don't see > > a problem with that. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Thu Feb 9 09:50:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 9 Feb 2006 09:50:31 -0700 (MST) Subject: [Rxtx] Re: Move .java Files in gnu.io filesystem hierarchy - Maven (2) In-Reply-To: <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Message-ID: On Thu, 9 Feb 2006, Rajesh N wrote: > Can anybody tell me how to overcome these EXCEPTIONS > I AM WORKING ON SERIAL COMMN IN JAVA ON LINUX. > > 1. " NOT ALL PARAMETERS SUPPORTED BY THE KERNEL" > > This i came across the following statement inmy prog. > SerialP is A SerialPort object > SerialP.setSerialPortParams(9600(BAUDRATE),DATABITS_8,STOPBITS_1,PARITY_NONE) > Strange. The parameters you use are the same the port should open with by default. Could you paste the actual exception you are getting? I don't see that in the rxtx source. Also it would help to know the rxtx version. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Fri Feb 10 15:29:05 2006 From: lux at diesel-research.com (Kim Lux) Date: Fri, 10 Feb 2006 15:29:05 -0700 Subject: [Rxtx] One serial port object for both sending and receiving ? Message-ID: <1139610545.18177.4.camel@zd7280> Is it OK to use one SerialPort ojbect (ex Serial Port serialPort;) and use it for both sending and receiving ? For example: ======================================================================== static SerialPort serialPort = null; static OutputStream serialOut = null; static InputStream serialIn = null; // assign it to an outputStream for use try{ serialOut = serialPort.getOutputStream(); System.out.println("Serial output stream has been assigned."); }//try catch(IOException e) { System.out.println("Error: Couldn't assign output stream to serial port."); }//catch //assign it to an inputStream for use try{ serialIn = serialPort.getInputStream(); System.out.println("Serial input stream has been assigned."); }//try catch(IOException e) { System.out.println("Error: Couldn't assign input stream to serial port."); }//catch ======================================================================== -- Kim Lux, Diesel Research Inc. From lux at diesel-research.com Fri Feb 10 21:23:00 2006 From: lux at diesel-research.com (Kim Lux) Date: Fri, 10 Feb 2006 21:23:00 -0700 Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Message-ID: <1139631780.23882.10.camel@zd7280> I've got a problem receiving chars with my version of serialRead, written in an SWT GUI. I had a Java pro have a good look at my code and he can't see anything wrong with it. I can send chars fine. When I receive a char the cpu usage for the app goes to 100% and the code in the serial event handler doesn't get executed. The instructions on the Java Comm Serial API How-To for Linux page state that I must install javacomm. Is that true ? Everything builds without it and I can send chars on rxtx just fine, but I can't receive them. Could this be the problem ? I downloaded and installed javacomm. I was not able to add "Driver=gnuio.RXTXCommDriver to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 installed in /usr/java/jre1.5.0_05. I added comm.jar to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext to the library paths. Is this OK ? Does it matter that I am receiving on /dev/ttyUSB0 ? Thanks. -- Kim Lux, Diesel Research Inc. From lunareclipse03 at web.de Sat Feb 11 09:44:46 2006 From: lunareclipse03 at web.de (lunareclipse03@web.de) Date: Sat, 11 Feb 2006 17:44:46 +0100 Subject: [Rxtx] Question about Serial I/O under Win32 Message-ID: <662084330@web.de> Hello everybody, I have a strange problem with a piece of code I made for myself. No, this is not really concerning rxtx, but nevertheless I post this to the list, hoping that some of you can help me. I've written two libraries, one for linux and one for win32. The linux port works quite well, I can send / receive faxes and / or replay voice messages over the telephone line using a voice modem. But the win32 port of the library causes some trouble. If, for example, I send out a fax with a certain modem under linux, it works well. The fax is complete when it comes out of the fax machine. If I then use the same modem to send out a fax under win32, the fax coming out of the fax machine gets "stuck" halfways, but the sending modem thinks that transmission was ok and drops the connection. The answering fax machine then gives me "error while receiving." The "upper layer" java code MUST be right, because if I do the same thing under linux (using the linux library), everything is alright. Now I have to ask: Can somebody please help me out with this??!? Could it be the case that some kind of flow control or COMMTIMEOUTS setting causes this behaviour? I set flow control to RTS/CTS before sending out a fax. How can I DISABLE flow control? Or what do you think? Can something else cause this problems? Thank you all for your time and PLEASE write back soon. Regards, --Sven Ahlemann Am Waldrand 31 45721 Haltern am See Germany ______________________________________________________________ Verschicken Sie romantische, coole und witzige Bilder per SMS! Jetzt bei WEB.DE FreeMail: http://f.web.de/?mc=021193 From lux at diesel-research.com Sat Feb 11 10:06:52 2006 From: lux at diesel-research.com (Kim Lux) Date: Sat, 11 Feb 2006 10:06:52 -0700 Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: <1139631780.23882.10.camel@zd7280> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> <1139631780.23882.10.camel@zd7280> Message-ID: <1139677612.3431.5.camel@zd7280> More on this problem. I copied and pasted simpleRead into a console based Eclipse project and I've got the same result, except that cpu usage doesn't go to 100%. I'm beginning to think there is an issue in rxtx. My imports for simpleRead are: ============================ import gnu.io.*; import java.util.*; //import javax.comm.*; import java.io.*; =========================== Any ideas ? I am trying to read from /dev/ttyUSB0 using a serial to USB adapter which has worked well with minicom and gtkterm. Thanks. On Fri, 2006-02-10 at 21:23 -0700, Kim Lux wrote: > I've got a problem receiving chars with my version of serialRead, > written in an SWT GUI. > > I had a Java pro have a good look at my code and he can't see anything > wrong with it. > > I can send chars fine. When I receive a char the cpu usage for the app > goes to 100% and the code in the serial event handler doesn't get > executed. > > The instructions on the Java Comm Serial API How-To for Linux page state > that I must install javacomm. Is that true ? Everything builds without > it and I can send chars on rxtx just fine, but I can't receive them. > Could this be the problem ? > > I downloaded and installed javacomm. I was not able to add > "Driver=gnuio.RXTXCommDriver > to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not > have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 > installed in /usr/java/jre1.5.0_05. I added comm.jar > to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext > to the library paths. Is this OK ? > > Does it matter that I am receiving on /dev/ttyUSB0 ? > > Thanks. > -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Sun Feb 12 21:01:33 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:01:33 -0700 (MST) Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: <1139677612.3431.5.camel@zd7280> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> <1139631780.23882.10.camel@zd7280> <1139677612.3431.5.camel@zd7280> Message-ID: I suspect what is happening is the select() is breaking out in the native code but the driver does not have support for notifying there are X bytes available. On some traditional Unix based systems, the only way you know data is available is the fd status changes and do an FIORDCHK ioctl. Or perhaps the only thing you can know is the fd status changed. It would take reading through the kernel driver code to know for sure. So on USB, depending upon the driver, the same may need to be done or the driver improved a bit if possible to support. Polling reads will also work but don't use the event driven model of CommAPI which isnt acceptable in the long run. The 100% cpu usage can then be explained because select no longer blocks until the data is read; the eventLoop spins loose. You can put a well placed sleep but rxtx only expects those are needed when it knows data is available. This may not be a super simple thing to understand and fix. I do have ideas to get you started. I'm going to be short on time the next couple weeks. I expect to put some good time in and answer some other questions I saw around the 25th. For now, I'd look at the following and go from there with the hints I've given. JNIEXPORT jint JNICALL RXTXPort(nativeavailable)( JNIEnv *env, jobject jobj ) { int fd = get_java_var( env, jobj,"fd","I" ); int result; /* char message[80]; ENTER( "RXTXPort:nativeavailable" ); On SCO OpenServer FIONREAD always fails for serial devices, so try ioctl FIORDCHK instead; will only tell us whether bytes are available, not how many, but better than nothing. This turns out to be true on Solaris also. taj. */ #ifdef FIORDCHK /* __unixware__ __sun__ probably others */ result = ioctl(fd, FIORDCHK, 0); #else if( ioctl( fd, FIONREAD, &result ) < 0 ) { goto fail; } #endif /* FIORDCHK */ On Sat, 11 Feb 2006, Kim Lux wrote: > > More on this problem. I copied and pasted simpleRead into a console > based Eclipse project and I've got the same result, except that cpu > usage doesn't go to 100%. I'm beginning to think there is an issue in > rxtx. > > My imports for simpleRead are: > > ============================ > import gnu.io.*; > import java.util.*; > //import javax.comm.*; > import java.io.*; > =========================== > > Any ideas ? I am trying to read from /dev/ttyUSB0 using a serial to > USB adapter which has worked well with minicom and gtkterm. > > Thanks. > > > > On Fri, 2006-02-10 at 21:23 -0700, Kim Lux wrote: >> I've got a problem receiving chars with my version of serialRead, >> written in an SWT GUI. >> >> I had a Java pro have a good look at my code and he can't see anything >> wrong with it. >> >> I can send chars fine. When I receive a char the cpu usage for the app >> goes to 100% and the code in the serial event handler doesn't get >> executed. >> >> The instructions on the Java Comm Serial API How-To for Linux page state >> that I must install javacomm. Is that true ? Everything builds without >> it and I can send chars on rxtx just fine, but I can't receive them. >> Could this be the problem ? >> >> I downloaded and installed javacomm. I was not able to add >> "Driver=gnuio.RXTXCommDriver >> to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not >> have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 >> installed in /usr/java/jre1.5.0_05. I added comm.jar >> to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext >> to the library paths. Is this OK ? >> >> Does it matter that I am receiving on /dev/ttyUSB0 ? >> >> Thanks. >> > From tjarvi at qbang.org Sun Feb 12 21:03:30 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:03:30 -0700 (MST) Subject: [Rxtx] One serial port object for both sending and receiving ? In-Reply-To: <1139610545.18177.4.camel@zd7280> References: <1139610545.18177.4.camel@zd7280> Message-ID: On Fri, 10 Feb 2006, Kim Lux wrote: > > Is it OK to use one SerialPort ojbect (ex Serial Port serialPort;) and > use it for both sending and receiving ? > > For example: > > ======================================================================== > static SerialPort serialPort = null; > static OutputStream serialOut = null; > static InputStream serialIn = null; > > > > > // assign it to an outputStream for use > try{ > serialOut = serialPort.getOutputStream(); > System.out.println("Serial output stream has been assigned."); > }//try > catch(IOException e) > { > System.out.println("Error: Couldn't assign output stream to serial > port."); > }//catch > > > //assign it to an inputStream for use > try{ > serialIn = serialPort.getInputStream(); > System.out.println("Serial input stream has been assigned."); > }//try > catch(IOException e) > { > System.out.println("Error: Couldn't assign input stream to serial > port."); > }//catch This should be fine. In fact trying to do it another way will probably not work as you will run into lockfile issues. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun Feb 12 21:13:13 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:13:13 -0700 (MST) Subject: [Rxtx] Question about Serial I/O under Win32 In-Reply-To: <662084330@web.de> References: <662084330@web.de> Message-ID: On Sat, 11 Feb 2006 lunareclipse03 at web.de wrote: > Hello everybody, > > I have a strange problem with a piece of code I made for myself. No, > this is not really concerning rxtx, but nevertheless I post this to the > list, hoping that some of you can help me. I've written two libraries, > one for linux and one for win32. The linux port works quite well, I can > send / receive faxes and / or replay voice messages over the telephone > line using a voice modem. But the win32 port of the library causes some > trouble. If, for example, I send out a fax with a certain modem under > linux, it works well. The fax is complete when it comes out of the fax > machine. If I then use the same modem to send out a fax under win32, the > fax coming out of the fax machine gets "stuck" halfways, but the sending > modem thinks that transmission was ok and drops the connection. The > answering fax machine then gives me "error while receiving." The "upper > layer" java code MUST be right, because if I do the same thing under > linux (using the linux library), everything is alright. Now I have to > ask: Can somebody please help me out with this??!? Could it be the case > that some kind of flow control or COMMTIMEOUTS setting causes this > behaviour? I set flow control to RTS/CTS before sending out a fax. How > can I DISABLE flow control? Or what do you think? Can something else > cause this problems? Thank you all for your time and PLEASE write back > soon. > Hi Sven I'm not too willing to talk about flow control at the low level until I confirm some things with test equipment later. It is not clear if you are using rxtx or writing your own native code. So I'm not sure how to answer much of this :) If you are wondering how to change the flow control using rxtx from java, The BlackBox example from Sun flips this back and forth. SerialPort.java in rxtx 2.1 uses the following: SerialPort.java: public static final int FLOWCONTROL_NONE =0; SerialPort.java: public static final int FLOWCONTROL_RTSCTS_IN =1; SerialPort.java: public static final int FLOWCONTROL_RTSCTS_OUT =2; SerialPort.java: public static final int FLOWCONTROL_XONXOFF_IN =4; SerialPort.java: public static final int FLOWCONTROL_XONXOFF_OUT=8; So if you set flowcontrol to RTSCTS, you can set it to NONE to turn it off. If you are looking for how to do it in native code, the rxtx Source is SerialImp.c (unix/linux/mac os x/w32) and termios.c (w32 only with SerialImp.c) You can track the code: SerialImp.c:JNIEXPORT void JNICALL RXTXPort(setflowcontrol)( JNIEnv *env, jobject jobj, jint flowmode ) termios.c:int tcgetattr( int fd, struct termios *s_termios ) termios.c:int tcsetattr( int fd, int when, struct termios *s_termios ) There may be a problem in the rxtx flow control code though. Rather than guess, I want to test this with a gold standard. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Feb 6 00:00:16 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 00:00:16 -0700 (MST) Subject: [Rxtx] wiki delay until tomorrow night. In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: On Sun, 5 Feb 2006, Trent Jarvi wrote: > On Sun, 5 Feb 2006, Kim Lux wrote: > >> usb ? Tell me more... I need that too. > > usb is a very proper design. Thats all it is. > Maybe rxtx could help usb. But it would start with helping bring back the community that was already there. It's not something I'd love to do but maybe its the right thing to do. It would probably take 2 years to do right. But maybe thats better than what we have now. I honestly don't know what IBM is doing which could just run over everything. Just some thoughts after some fine german wine. -- Trent Jarvi tjarvi at qbang.org From gadelavega at yahoo.com.ar Mon Feb 6 02:17:05 2006 From: gadelavega at yahoo.com.ar (Gonzalo A. de la Vega) Date: Mon, 06 Feb 2006 10:17:05 +0100 Subject: [Rxtx] Serial port ownership question In-Reply-To: References: <20060205113618.30274.qmail@web53501.mail.yahoo.com> <1139157422.4553.9.camel@zd7280> <1139158698.4936.9.camel@zd7280> Message-ID: <43E71411.4050402@yahoo.com.ar> On my Fedora Core 4: ls -l /dev/ttyS* crw-rw---- 1 root uucp 4, 64 Feb 6 2006 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Feb 6 2006 /dev/ttyS1 ... and: grep "ttyUSB" /etc/udev/rules.d/50-udev.rules KERNEL=="ttyUSB*", GROUP="uucp", MODE="0660" So anyone in the "uucp" group can use serial ports. On Gentoo the group is "tty". Trent Jarvi escribi?: > > > On Sun, 5 Feb 2006, Dr. Douglas Lyon wrote: > >> I can confirm that this is the case (only root ownership of >> serial ports, under fedora 4). >> Wow, what were they thinking?! >> - DL >> >>> I've found that the newer kernels have the serial ports owned by root. >>> For example, >>> >>> $ls -al /dev/tty* >>> crw-rw-rw- 1 root root 5, 0 Feb 5 02:06 /dev/tty >>> crw-rw---- 1 root root 4, 0 Feb 5 02:06 /dev/tty0 >>> crw------- 1 root root 4, 1 Feb 5 09:07 /dev/tty1 >>> crw-rw---- 1 root tty 4, 10 Feb 5 02:06 /dev/tty10 >>> crw-rw---- 1 root tty 4, 11 Feb 5 02:06 /dev/tty11 >>> ... > > > This is just not a problem jcp or such are going to solve. Its a > platform spitwad fight. But do look at pam. In fact thats what Sun > is doing too. Maybe Linux followed their lead.. I'm not a pam guy. > I've spent 16 hours trying to understand it but your users wont :) > > Solution? I have no clue. Its two tangent mentalities from my > perspective. > > -- > Trent Jarvi > tjarvi at qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mtnvega at yahoo.com.br Mon Feb 6 05:35:43 2006 From: mtnvega at yahoo.com.br (Luiz Jr) Date: Mon, 6 Feb 2006 12:35:43 +0000 (GMT) Subject: [Rxtx] Documentation Wiki In-Reply-To: <1139157422.4553.9.camel@zd7280> Message-ID: <20060206123543.57256.qmail@web53515.mail.yahoo.com> Hello, Thank you for you answer, but so the usage of the API is pretty much like the Java Communications Api? If yes, what version of the Java Comm Api? Thank you, Luiz A. Brandao Jr Kim Lux escreveu: On Sun, 2006-02-05 at 08:36 -0300, Luiz Jr wrote: > Hello, > > I want to start using the RXTX libraries, but I would to know how, > since I can not access the documentation wiki page I just started using them yesterday. Below is how I installed the libraries, if that helps. I used snippets of code from the SimpleWrite application here to get me going. http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html Instead of "import javax.comm.*;", use "import gnu.io.*;" which is gotten from RXTXcomm.jar, which you will need to include in your project references. I am working in Eclipse. BTW: there is no way to open a port without going through the port list and finding it. Maybe sometime in the future someone (me ?) will write a method called openSerialPort that allows the user to give a port identifier, such as "/dev/tty1" and return a port ready to use. It wouldn't take much to write that and it would save users a lot of code. Hope this helps. ======================================================================= 1) Figure out which java you are running, incase there is more than one installed. $ java -version java version "1.5.0_05" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_05-b05) Java HotSpot(TM) Client VM (build 1.5.0_05-b05, mixed mode, sharing) 2) Find all the jre directories and the one from which you are currently running. kfind (jre) 3) cd to that directory plus /lib/i386 cd /usr/java/jre1.5.0_05/lib/i386 4) Copy the library files (*.so) to that directory. cp /home/krlux/Desktop/'Java Controls'/rxtx-linux/bin/* . 5) Check that the copy was successful ls librxtx* librxtxI2C.so librxtxRaw.so librxtxSerial.so librxtxParallel.so librxtxRS485.so 6) cd to the /lib/ext directory for your java. cd /usr/java/jre1.5.0_05/lib/ext 7) Copy the Jar files there cp /home/krlux/Desktop/'Java Controls'/rxtx-linux/lib/ext/* . 8) Check that it was successful ls RXTX* RXTXcomm.jar Rxtx is now installed on your machine ready to use. =================================================================== -- Kim Lux, Diesel Research Inc. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx --------------------------------- Yahoo! Acesso Gr?tis - Internet r?pida e gr?tis. Instale o discador agora! -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/544aa403/attachment-0026.html From lyon at docjava.com Mon Feb 6 05:49:34 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 06 Feb 2006 07:49:34 -0500 Subject: [Rxtx] wiki delay until tomorrow night. In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: Hi All, I have often thought about USB drivers being needed. For example, the ironman watch will not interface to a mac (windows only). It is USB. My dymo label writer has no Java driver (native only). Etc. Most cheap web cameras are USB (and Java drivers go through JAI, if it supports the camera at all). The JAI code shows how sun did the USB drivers. You have to be a member of the jai project to download the source code. https://jai.dev.java.net has the jai distro. And then you are not allowed to redistribute it. However, we can all learn from it (if so inclined). Basically: cvs -d :pserver:lyon at cvs.dev.java.net:/cvs login cvs -d :pserver:lyon at cvs.dev.java.net:/cvs checkout jai-core You will need to user your own uid and pw to get in. The ant build has over 100 warnings from sun deprecations of its own code. You might say that they were hoisted on their own Picard ;) One interesting thing is that they support several platforms: linux-amd64 64-bit Linux-AMD64 linux-i586 32-bit Linux-x86 solaris-amd64 64-bit Solaris-AMD64 solaris-i586 32-bit Solaris-x86 solaris-sparc 32-bit Solaris-SPARC solaris-sparcv9 64-bit Solaris-SPARC windows-i586 32-bit Windows-x86 Thus, ant is used to provide a multi-platform native method distro. Neat. How do they do it? check this out: And: The core download does not contain any C source code (it was all pre-built). Basically, they are just copying .so and .dll files into build directories. I would love to see the C code for this...but Sun does not post it on the https://jai.dev.java.net site. I don't know why...Perhaps I missed it. - Doug >On Sun, 5 Feb 2006, Trent Jarvi wrote: > >>On Sun, 5 Feb 2006, Kim Lux wrote: >> >>>usb ? Tell me more... I need that too. >> >>usb is a very proper design. Thats all it is. >> > >Maybe rxtx could help usb. But it would start with helping bring >back the community that was already there. > >It's not something I'd love to do but maybe its the right thing to do. > >It would probably take 2 years to do right. But maybe thats better >than what we have now. > >I honestly don't know what IBM is doing which could just run over everything. > >Just some thoughts after some fine german wine. > >-- >Trent Jarvi >tjarvi at qbang.org > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tdelenik at gmail.com Mon Feb 6 05:56:32 2006 From: tdelenik at gmail.com (Thanasis Delenikas) Date: Mon, 6 Feb 2006 14:56:32 +0200 Subject: Fwd: [Rxtx] Documentation Wiki In-Reply-To: <1139157422.4553.9.camel@zd7280> References: <20060205113618.30274.qmail@web53501.mail.yahoo.com> <1139157422.4553.9.camel@zd7280> Message-ID: <310a1a930602060456t129f1dc6p5f2b908f13ab5a0b@mail.gmail.com> Hello all, Kim, this is a snippet from the code I use. The closest to directly opening a specific port without enumeration. << ... portId = CommPortIdentifier.getPortIdentifier(getPort()); serialPort = (SerialPort) portId.open("jSMSEngine", 1971); ... >> where getPort() return the string identifier of the port, i.e. "/dev/ttyS0" or "COM1" or whatever. Thanasis. ---------- Forwarded message ---------- From: Kim Lux Date: Feb 5, 2006 6:37 PM Subject: Re: [Rxtx] Documentation Wiki To: RXTX Developers and Users BTW: there is no way to open a port without going through the port list and finding it. Maybe sometime in the future someone (me ?) will write a method called openSerialPort that allows the user to give a port identifier, such as "/dev/tty1" and return a port ready to use. It wouldn't take much to write that and it would save users a lot of code. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/182ab5b8/attachment-0026.html From tjarvi at qbang.org Mon Feb 6 11:53:57 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 11:53:57 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: On Mon, 6 Feb 2006, Dr. Douglas Lyon wrote: > Hi All, > I have often thought about USB drivers being needed. > For example, the ironman watch will not interface > to a mac (windows only). It is USB. > My dymo label writer has no Java driver (native only). > Etc. > Most cheap web cameras are USB (and Java drivers go > through JAI, if it supports the camera at all). > The JAI code shows how sun did the USB drivers. > You have to be a member of the jai project to download > the source code. > https://jai.dev.java.net has the jai distro. > And then you are not allowed to redistribute it. However, > we can all learn from it (if so inclined). Basically: > cvs -d :pserver:lyon at cvs.dev.java.net:/cvs login > cvs -d :pserver:lyon at cvs.dev.java.net:/cvs checkout jai-core > You will need to user your own uid and pw to get in. > The ant build has over 100 warnings from sun deprecations > of its own code. > > You might say that they were hoisted on their own Picard ;) > > One interesting thing is that they support several platforms: > linux-amd64 64-bit Linux-AMD64 > linux-i586 32-bit Linux-x86 > solaris-amd64 64-bit Solaris-AMD64 > solaris-i586 32-bit Solaris-x86 > solaris-sparc 32-bit Solaris-SPARC > solaris-sparcv9 64-bit Solaris-SPARC > windows-i586 32-bit Windows-x86 > Thus, ant is used to provide a multi-platform native method distro. > Neat. > How do they do it? > check this out: > > > > > > > > > > > > > And: > > > > > > > > > > The core download does not contain any C source code (it was all pre-built). > Basically, they are just copying .so and .dll files into build directories. > > I would love to see the C code for this...but Sun does not post it on the > https://jai.dev.java.net site. > > I don't know why...Perhaps I missed it. > > - Doug > > I've looked at moving rxtx to Ant builds. I think that would help IDEs a great deal. I requested a evalutation desk copy the O'Reilly Ant book for some j2ee material I was teaching. http://www.oreilly.com/catalog/anttdg/ It has a one sentence mention of JNI. So there was not luck there. I saw that there is another Ant book that does mention JNI more. I can't find it now. Ant must be able to support it with extensions. http://ant.apache.org/manual/OptionalTasks/javah.html What the auto(break :) tools do in the rxtx build is 4 things really. 1) gcc compile flags 2) ld compile flags 3) config.h 4) compile flags for customizing rxtx (lockfiles, ...) See 1 All of this information except 4 can be static once obtained. So I'm not attached to the auto tools. If I could find an example of Ant being used for JNI code, I'd be one of the first to start moving that direction. Maybe someone saw an example someplace. The other thing we have not completed discussing is the directory structure. There is interest in making rxtx more IDE friendly. I get more mail about that off the list than how to install rxtx. And I see we have Ken Thompson in da house :) He is our trusted CVS maintainer and the guy that purchased the rxtx.org domain. Old community. We will need Ken for changing the directory structure of source. I would like to open up discussion about both of these as it is more than time. The problem is I have little experience with Ant and even less with IDEs. It would be nice if we could work with Eclipse and NetBeans. http://www.netbeans.org/ (sun and some community) http://www.eclipes.org (ibm,rhat,... perhaps more community) http://maven.apache.org/what-is-maven.html (apache. It is community) borland should sortof be here too but I think thats covered in eclipse. >From what I understand so far, we should morph rxtx to support those three maybe trusting apaches lead with maven. But I use vi. I have little to no clues beyond what people have fed me. Can we agree that thats the right direction to go? -- Trent Jarvi tjarvi at qbang.org From brian at mbari.org Mon Feb 6 14:57:50 2006 From: brian at mbari.org (Brian Schlining) Date: Mon, 6 Feb 2006 13:57:50 -0800 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> > The other thing we have not completed discussing is the directory > structure. There is interest in making rxtx more IDE friendly. I > get more mail about that off the list than how to install rxtx. > > And I see we have Ken Thompson in da house :) He is our trusted > CVS maintainer and the guy that purchased the rxtx.org domain. Old > community. We will need Ken for changing the directory structure of > source. > > I would like to open up discussion about both of these as it is > more than time. The problem is I have little experience with Ant > and even less with IDEs. It would be nice if we could work with > Eclipse and NetBeans. > > http://www.netbeans.org/ (sun and some community) > http://www.eclipes.org (ibm,rhat,... perhaps more community) > http://maven.apache.org/what-is-maven.html (apache. It is community) > borland should sortof be here too but I think thats covered in > eclipse. > >> From what I understand so far, we should morph rxtx to support >> those three > maybe trusting apaches lead with maven. But I use vi. I have > little to no clues beyond what people have fed me. > Maven likes the directory structure below for Java code. (From http:// maven.apache.org/guides/getting-started/index.html) This structure works fine with ant, netbeans, and eclipse. rxtx_root_directory `-- src |-- main | `-- java | `-- gnu | `-- io `-- test `-- java `-- gnu `-- io Brian Schlining Software Engineer http://www.mbari.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/d9451eba/attachment-0026.html From tjarvi at qbang.org Mon Feb 6 15:11:45 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 15:11:45 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: > rxtx_root_directory > `-- src > |-- main > | `-- java > | `-- gnu > | `-- io > `-- test > `-- java > `-- gnu > `-- io > >From what I understand this will just be good. For me it makes no difference. So lets do the rxtx thing. Let if fester for two weeks and if nobody objects, we will do it. I'm not doing this because I care. I'm doing this to eliminate much of my inbox. But test... man is rxtx lacking there in the community aspect. It is covered but not right. _maybe_ I can change that this year. -- Trent Jarvi tjarvi at qbang.org (cat hurding since 1997) From lux at diesel-research.com Mon Feb 6 21:38:49 2006 From: lux at diesel-research.com (Kim Lux) Date: Mon, 06 Feb 2006 21:38:49 -0700 Subject: [Rxtx] How can I use Lock Files with rxtx (in FC4) ? Message-ID: <1139287129.17031.3.camel@zd7280> I am now running an rxtx application on FC4. I am getting: ========================================================= check_group_uucp(): error testing lock file creation Error details: Permission denied check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL ========================================================= $ ls -al /var/lock total 32 drwxrwxr-x 4 root lock 4096 Feb 6 16:04 . drwxr-xr-x 24 root root 4096 Nov 14 01:19 .. drwx------ 2 root root 4096 Apr 27 2005 lvm drwxr-xr-x 2 root root 4096 Feb 6 16:04 subsys How do I fix this for regulator users ? -- Kim Lux, Diesel Research Inc. From dmarkman at mac.com Mon Feb 6 22:24:44 2006 From: dmarkman at mac.com (Dmitry Markman) Date: Tue, 7 Feb 2006 00:24:44 -0500 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: if I understands the issue right in order to be able to use ant for c/c++ compilation you have to install ant's cc task http://ant-contrib.sourceforge.net/cc.html it looks like it should work on mac os x (authors claim, that it's platform independent) but I never tested so all you have to do it's providing right command line for the gcc compiler On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: >> rxtx_root_directory >> `-- src >> |-- main >> | `-- java >> | `-- gnu >> | `-- io >> `-- test >> `-- java >> `-- gnu >> `-- io >> > > >> From what I understand this will just be good. > > For me it makes no difference. So lets do the rxtx thing. Let if > fester for two weeks and if nobody objects, we will do it. > > I'm not doing this because I care. I'm doing this to eliminate > much of my inbox. > > But test... man is rxtx lacking there in the community aspect. It > is covered but not right. _maybe_ I can change that this year. > > -- > Trent Jarvi > tjarvi at qbang.org > (cat hurding since 1997) > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx Dmitry Markman From lux at diesel-research.com Mon Feb 6 23:20:15 2006 From: lux at diesel-research.com (Kim Lux) Date: Mon, 06 Feb 2006 23:20:15 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? Message-ID: <1139293215.3689.4.camel@zd7280> I'm running the code below. portlist.hasMoreElements() is false. /dev has ports in it as listed below. What am I doing wrong ? ========================================================== // Step through the list of ports until we find one that matches // the one we are looking for. portList = CommPortIdentifier.getPortIdentifiers(); while(portList.hasMoreElements()) { portID = (CommPortIdentifier) portList.nextElement(); // if (portID.getName().equals("/dev/ttyUSB0")) { myTA.append("Serial port ttyUSB0 has been found\n"); break; }// if portID equals... }// End of while... ========================================================== ls -al /dev/tty* crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 ... crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 -- Kim Lux, Diesel Research Inc. From david.garnier at trusted-logic.com Tue Feb 7 00:46:30 2006 From: david.garnier at trusted-logic.com (David Garnier) Date: Tue, 07 Feb 2006 08:46:30 +0100 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: <43E85056.2090608@trusted-logic.com> Hello, I think that the make-based build process is fine as it is, apart from the location of the Java source files. It is true that putting the Java source in a directory structure that map 1-to-1 to the Java package structure is the norm and should make it easier for everyone to modify the Java source, with or without an IDE. Ant is a good tool, but in the RXTX case I fail to see the advantage of using it compared to the current make-based process. As Trent said, they are more pressing issues, like testing. Regards, David Dmitry Markman wrote: > if I understands the issue right > in order to be able to use ant for c/c++ compilation > you have to install ant's cc task > http://ant-contrib.sourceforge.net/cc.html > > it looks like it should work on mac os x > (authors claim, that it's platform independent) > but I never tested > > so all you have to do it's providing right command line > for the gcc compiler > > > > > On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: > >>> rxtx_root_directory >>> `-- src >>> |-- main >>> | `-- java >>> | `-- gnu >>> | `-- io >>> `-- test >>> `-- java >>> `-- gnu >>> `-- io >>> >> >> >>> From what I understand this will just be good. >> >> For me it makes no difference. So lets do the rxtx thing. Let if >> fester for two weeks and if nobody objects, we will do it. >> >> I'm not doing this because I care. I'm doing this to eliminate much >> of my inbox. >> >> But test... man is rxtx lacking there in the community aspect. It is >> covered but not right. _maybe_ I can change that this year. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> (cat hurding since 1997) From tjarvi at qbang.org Tue Feb 7 01:11:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 01:11:31 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <43E85056.2090608@trusted-logic.com> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: On Tue, 7 Feb 2006, David Garnier wrote: > Hello, > > I think that the make-based build process is fine as it is, apart from the location of the Java > source files. It is true that putting the Java source in a directory structure that map 1-to-1 to > the Java package structure is the norm and should make it easier for everyone to modify the Java > source, with or without an IDE. > > Ant is a good tool, but in the RXTX case I fail to see the advantage of using it compared to the > current make-based process. As Trent said, they are more pressing issues, like testing. > Hi David I have more experience with testing rxtx than I can talk about. But let it be known, rxtx has gone trough 100's of hours of testing. We are hobby folks interested in toys but there is more. rxtx has had some of the best guidance in the industry there. This is not an easy thing. I may be able to come back in a month from the other side of the corperate fence and help. I suspect the tests could just be made public but they are in a very unusual environment that just wont work in a wider sense. This is something I'll be trying to change. At one point it was agreed we could just make the results public so this isnt just noise.. There is interest and I think its safe to mention that much. The big problem with testing in the past is most of it is done with a loopback connection. So we *still* have major questions regarding things like flow control. rxtx talks to itself over a loopback and it works. regardless of right or wrong. This requires more thought to be done right. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Feb 7 02:46:34 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 02:46:34 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: > The big problem with testing in the past is most of it is done with a > loopback connection. So we *still* have major questions regarding things > like flow control. rxtx talks to itself over a loopback and it works. > regardless of right or wrong. With serial communication there are gold standards. ckermit is probably a definitive 'standard.' Maybe its possible to do ping/pong tests with ckermit? Is it scriptable? There are known issues in rxtx. Probably the worst is some threading issues regarding some JREs with multiple JNI threads setting java variables. Man did I get schooled there. Just switch the c functions to returning variables and things go away. Sometimes they work fine, sometimes they blow up. Without understanding everything, somehow rhat got it right and debian (and especially gentoo) grabbed kernel patches causing all sort of harm. Its not hard to fix once you understand whats going on but nearly impossible to track with a debugger. So I have a good idea what 2.1-8 will have outside of the IDE modifications. rxtx 2.1-7 is a release for everyone to sync with. Its not even as stable as -pre17 as far as I know - I ran no test suites. I'll be chasing it too. We just had so many contributions that it was time. It seriously broke internal scheduals but thats a great thing :) The other thing I want to do in 2.1-8 is automagic baud rates. It turns out lots of shops are doing really funky baud rates for things like automobile test equipment. It is possible but it requires a fair amount of change in the native code. Is anyone looking at this? -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Feb 7 02:57:21 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 07 Feb 2006 04:57:21 -0500 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <43E85056.2090608@trusted-logic.com> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: Hi All, I agree, testing is very important. The problem I have been trying to address is related to cross-platform testing and the robust nature of the installs. Typically, I visit 3 platforms to deploy my product, windows, linux and mac. A build is performed on each platform. The idea that you can build for many platforms from one copy the source code seems attractive. This should enable synchronized deployments of identical code. The question of how to achieve this goal remains open. As Trent mentioned, this is hard. Perhaps Ant will help here (but perhaps not). Ant does seem to help with running unit tests. However, it does not help with multi-platform tests. For that you need many machines and different operating environments. Toward that end, I have created a multi-platform test that can be run from web start, located at: http://show.docjava.com:8086/book/cgij/code/jnlp/serialPort.PortTest.jnlp This is interesting because many people in the community can run the test and we can improve the test, as time permits. No, it is not a perfect solution, however, the idea does help with multi-platform tests using many machines and different operating environments. If the group has a good test for a general serial port set-ups, i would be happy to deploy it, for general evaluation using web start. And as for ANT, it is just an idea. Not all my ideas are good ones! - Doug >Hello, > >I think that the make-based build process is fine as it is, apart >from the location of the Java >source files. It is true that putting the Java source in a directory >structure that map 1-to-1 to >the Java package structure is the norm and should make it easier for >everyone to modify the Java >source, with or without an IDE. > >Ant is a good tool, but in the RXTX case I fail to see the advantage >of using it compared to the >current make-based process. As Trent said, they are more pressing >issues, like testing. > >Regards, >David > >Dmitry Markman wrote: >> if I understands the issue right >> in order to be able to use ant for c/c++ compilation >> you have to install ant's cc task >> http://ant-contrib.sourceforge.net/cc.html >> >> it looks like it should work on mac os x >> (authors claim, that it's platform independent) >> but I never tested >> >> so all you have to do it's providing right command line >> for the gcc compiler >> >> >> >> >> On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: >> >>>> rxtx_root_directory >>>> `-- src >>>> |-- main >>>> | `-- java >>>> | `-- gnu >>>> | `-- io >>>> `-- test >>>> `-- java >>>> `-- gnu >>>> `-- io >>>> >>> >>> >>>> From what I understand this will just be good. >>> >>> For me it makes no difference. So lets do the rxtx thing. Let if >>> fester for two weeks and if nobody objects, we will do it. >>> >>> I'm not doing this because I care. I'm doing this to eliminate much >>> of my inbox. >>> >>> But test... man is rxtx lacking there in the community aspect. It is >>> covered but not right. _maybe_ I can change that this year. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> (cat hurding since 1997) > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From matt.higgins at gmail.com Tue Feb 7 08:28:34 2006 From: matt.higgins at gmail.com (Matt Higgins) Date: Tue, 7 Feb 2006 10:28:34 -0500 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final Message-ID: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? import java.io.*; import java.util.*; import gnu.io.*; public class MySimpleRead implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; public static void main(String[] args) { boolean portFound = false; String defaultPort = "COM1"; if (args.length > 0) { defaultPort = args[0]; } portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; MySimpleRead reader = new MySimpleRead(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } } public MySimpleRead() { try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) { e.printStackTrace(); } try { inputStream = serialPort.getInputStream(); } catch (IOException e) { e.printStackTrace(); } try { serialPort.addEventListener(this); } catch (TooManyListenersException e) { e.printStackTrace(); } try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { e.printStackTrace(); } System.out.println("Baud is " + serialPort.getBaudRate()); System.out.println("Bits is " + serialPort.getDataBits()); System.out.println("Stop is " + serialPort.getStopBits()); System.out.println("Par is " + serialPort.getParity()); serialPort.notifyOnDataAvailable(true); readThread = new Thread(this); readThread.start(); } public void run() { // Thread.sleep(20000); //} catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { System.out.println("An event occurred " + event.getEventType()); switch (event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: byte[] readBuffer = new byte[20]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } System.out.print(new String(readBuffer)); } catch (IOException e) {} break; } } } --------------- Result on windows ------------------------------ Stable Library ============================================================== Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port:: COM1 Baud is 9600 Bits is 8 Stop is 1 Par is 0 ----------------- End Results ----------------------------------------- ------------------ Result on Linux ----------------------------------- Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 Found port: /dev/ttyS0 Baud is 9600 Bits is 8 Stop is 1 Par is 0 An event occurred 1 043100066224 ------------------ End Results --------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/a1431630/attachment-0026.html From brian at mbari.org Tue Feb 7 09:48:37 2006 From: brian at mbari.org (Brian Schlining) Date: Tue, 7 Feb 2006 08:48:37 -0800 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> Message-ID: <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> Hi Matt > The following code works fine on Linux but I never see any data > when run on Windows. This is a cut and paste from the SimpleRead > example. > I am attempting to read data from a bar code scanner. I can fire > up HyperTermianl on windows and see that the device is working > properly as I see the barcodes are scanned and echoed back to the > terminal. However when I run the app I don't see any data. It is > however associating with the com port as the informational bits > print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. Cheers Brian Schlining Software Engineer http://www.mbari.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/16d07f37/attachment-0026.html From lux at diesel-research.com Tue Feb 7 11:59:58 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 11:59:58 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139293215.3689.4.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> Message-ID: <1139338798.8145.4.camel@zd7280> Any ideas on this ? Any reason why portList.hasMoreElements() should be false even though there are devices in /dev ? On Mon, 2006-02-06 at 23:20 -0700, Kim Lux wrote: > I'm running the code below. > > portlist.hasMoreElements() is false. > > /dev has ports in it as listed below. > > What am I doing wrong ? > > > ========================================================== > // Step through the list of ports until we find one that matches > // the one we are looking for. > > portList = CommPortIdentifier.getPortIdentifiers(); > > while(portList.hasMoreElements()) > { > portID = (CommPortIdentifier) portList.nextElement(); // > if (portID.getName().equals("/dev/ttyUSB0")) > { > myTA.append("Serial port ttyUSB0 has been found\n"); > break; > }// if portID equals... > }// End of while... > ========================================================== > > ls -al /dev/tty* > crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty > crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 > crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 > crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 > crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 > ... > crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 > crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 > crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 > > > -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 12:20:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 12:20:25 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139338798.8145.4.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> Message-ID: On Tue, 7 Feb 2006, Kim Lux wrote: > > Any ideas on this ? Any reason why portList.hasMoreElements() should be > false even though there are devices in /dev ? > > > On Mon, 2006-02-06 at 23:20 -0700, Kim Lux wrote: >> I'm running the code below. >> >> portlist.hasMoreElements() is false. >> >> /dev has ports in it as listed below. >> >> What am I doing wrong ? >> >> >> ========================================================== >> // Step through the list of ports until we find one that matches >> // the one we are looking for. >> >> portList = CommPortIdentifier.getPortIdentifiers(); >> >> while(portList.hasMoreElements()) >> { >> portID = (CommPortIdentifier) portList.nextElement(); // >> if (portID.getName().equals("/dev/ttyUSB0")) >> { >> myTA.append("Serial port ttyUSB0 has been found\n"); >> break; >> }// if portID equals... >> }// End of while... >> ========================================================== >> >> ls -al /dev/tty* >> crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty >> crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 >> crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 >> crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 >> crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 >> ... >> crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 >> crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 >> crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 >> >> >> > Hi Kim What rxtx does is try to open the port and do a timed out read. If the kernel/... do not complain it's enumarted. I suspect you could do a crude test by doing something like cat /dev/ttyS0 > /dev/null If that barfs then rxtx wont enumerate the port. hmm looking at your question again, I suspect it's a lockfile problem. This is documented in INSTALL with the source. Its easy enough to test this too.. touch /var/lock/testingrxtxlockfiles && rm -f /var/lock/testingrxtxlockfiles If you are not in the right group it will bail. Root will work regardless. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 12:37:56 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 12:37:56 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> Message-ID: <1139341076.8145.11.camel@zd7280> Exactly which ports does rxtx attempt to put into the list ? /dev/* or /dev/tty* or /dev/tty[0-9[0-9] ? or /dev/ttyS* ? For the record, only /dev/ttyUSB0 is a valid port on the machine I am presently on. Will this be a problem ? On Tue, 2006-02-07 at 12:20 -0700, Trent Jarvi wrote: > This is documented in INSTALL with the source. > I was wondering where that file was. I will download source and dig it up. Thanks. -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 12:51:09 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 12:51:09 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139341076.8145.11.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: On Tue, 7 Feb 2006, Kim Lux wrote: > > Exactly which ports does rxtx attempt to put into the list ? /dev/* > or /dev/tty* or /dev/tty[0-9[0-9] ? or /dev/ttyS* ? > > For the record, only /dev/ttyUSB0 is a valid port on the machine I am > presently on. Will this be a problem ? > > > On Tue, 2006-02-07 at 12:20 -0700, Trent Jarvi wrote: >> This is documented in INSTALL with the source. >> > I was wondering where that file was. I will download source and dig it > up. > > Thanks. > Hmm I'm looking at pre17 so this may have changed. (its just what I have on this machine) if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA" // for the IPAQs }; CandidatePortPrefixes=Temp; } So you may need to add "ttyUSB" to that list. RXTX used to enumerate _everything_ see if(osName.equals("Linux-all-ports") But it became less than practical. This is all in RXTXCommDriver.java hmm I just did a cvs update. if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have to get your fingers into the code. We aim for sane defaults. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 13:06:45 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 13:06:45 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139342805.8145.22.camel@zd7280> On Tue, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > Hmm I'm looking at pre17 so this may have changed. (its just what I have > on this machine) > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA" // for the IPAQs > }; > CandidatePortPrefixes=Temp; > } > > > So you may need to add "ttyUSB" to that list. RXTX used to enumerate > _everything_ see if(osName.equals("Linux-all-ports") But it became less > than practical. > > This is all in RXTXCommDriver.java > > hmm I just did a cvs update. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have > to get your fingers into the code. We aim for sane defaults. Excellent. Thanks for taking the time. -- Kim Lux, Diesel Research Inc. From ideiglenes1 at freemail.hu Tue Feb 7 13:53:39 2006 From: ideiglenes1 at freemail.hu (--) Date: Tue, 07 Feb 2006 21:53:39 +0100 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139345619.22534.2.camel@localhost> Hi! I use this code to get all the extra Linux devices. :) if ("Linux".equals(System.getProperty("os.name"))) { System.setProperty("os.name","Linux-all-ports"); } driver = new RXTXCommDriver(); On k, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > On Tue, 7 Feb 2006, Kim Lux wrote: > > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have > to get your fingers into the code. We aim for sane defaults. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From matt.higgins at gmail.com Tue Feb 7 13:45:54 2006 From: matt.higgins at gmail.com (Matt Higgins) Date: Tue, 7 Feb 2006 15:45:54 -0500 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> Message-ID: <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> Sweet this is exactly what I needed. I was searching the archives through marc.theamisgroup they only have archives back to 1/3/05. Should have hit the mailman archive! Thanks a lot! On 2/7/06, Brian Schlining wrote: > > Hi Matt > > The following code works fine on Linux but I never see any data when run > on Windows. This is a cut and paste from the SimpleRead example. > I am attempting to read data from a bar code scanner. I can fire up > HyperTermianl on windows and see that the device is working properly as I > see the barcodes are scanned and echoed back to the terminal. However when I > run the app I don't see any data. It is however associating with the com > port as the informational bits print fine? > > > You're not the only one whose had this problem, I don't know if Trent has > addressed this is the latest release of RXTX but there is a workaround. > Here's the recent thread from the RXTX mailing list regarding this issues: > > Thanasis Delenikas tdelenik at gmail.com > Wed Jan 18 13:56:23 MST 2006 > > * Previous message: [Rxtx] Re: More close() performance fixes > * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] > > Hi all. > (I've subscribed again from my other email account). > > Trent, > > You are right. Linux *always* works, no matter what flow control you set. > Windows *works only* with hardware flow control (I haven't tested what > happens with software XON/XOFF flow control). > > I assume (but I am not certain) that even with no flow control at all, all > platforms should work. Without flow control, you have the risk of bumping > into overflow or framing errors, but that's your (the end programmer, I > mean) problem. > > >From my side, I shouldn't be working without flow control. That was a bug > too... It was some code forgotten from the old times, when I used to work > with phone emulation drivers which didn't support flow control. The > correct > way is to have some flow control enabled and that's why I suppose this is > a > low-severity bug for RxTx. > > I have no idea which platform shows the correct behaviour, since > my knowledge about Linux and the inner workings of these low-level i/o > operations is limited. > > Regards, > Thanasis Delenikas. > > > > > Message: 2 > > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > > From: Trent Jarvi > > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > > To: RXTX Developers and Users > > Message-ID: > > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > > > Hi all, > > > > > > Trent, I have found something. > > > I read your comment about flow control, so I experimented a bit. > > > > > > If you remember, in my sample program I've used no flow control at all > ( > > i.e. > > > Java constant FLOWCONTROL_NONE). > > > > > > Now, during testing, I've switch to hardware inbound flow control (i.e > . > > Java > > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > > beautifully! > > > > > > I think I will switch to H/W flow control and test things for a while, > > but > > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > > > > > Hi Thanasis, > > > > I'm fairly sure you have identified a bug. I would not worry too much > > about what Sun CommAPI w32 defaults are. I think they did more or less > > whatever the port opened with. Just a guess. Linux tries to stomp on > > ports so they are all the same. > > > > So this started out with Linux worked, Windows XP/.. did not as I > recall. > > Something is wrong in rxtx. Do I understand this right? > > > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > > > Perhaps there is something Wayne or I did not understand when we wrote > > that code. I wasnt programming back in the BBS days so modems are not > my > > thing. I have a few questions. > > > > Is the above matrix confirmed by observation? > > Linux just always worked? > > Which one _should_ work? I'm guessing modems work with hardware flow > > control. I'll have to dig around. > > > > The windows flow control changes a couple things with hardware flow > > control. Following the w32 API documentation is confusing sometimes. > > But it looks like Linux could have a bug too. > > Cheers > > Brian Schlining > Software Engineer > http://www.mbari.org > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/9c989144/attachment-0026.html From tjarvi at qbang.org Tue Feb 7 14:06:14 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 14:06:14 -0700 (MST) Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> Message-ID: >> >> You're not the only one whose had this problem, I don't know if Trent has >> addressed this is the latest release of RXTX but there is a workaround. >> Here's the recent thread from the RXTX mailing list regarding this issues: >> I have not. I expect to have access to some test equipment next month and I'll go through all of this. I really don't know whats going on and I need a gold standard. I thought maybe linux was autodetecting the flow control. Your observations would certainly be welcome. I need to talk to Russell King and see what he is doing. Until then I'd just be toying around over a loopback as usual. This is very high on the list though. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 17:25:05 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 17:25:05 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139358305.17994.2.camel@zd7280> My application now works. I installed the libraries and jar from 2.1-7 (Final). portlist.hasMoreElements is no longer false. The application finds the port for /dev/ttyUSB0. Thanks for your help, Trent (et al) Sorry I bothered you with this. Next time I will look in the source first. I didn't think it was an rxtx issue, I thought it was a Linux setup issue . On Tue, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > Hmm I'm looking at pre17 so this may have changed. (its just what I > have > on this machine) > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux > Serial Ports > "ttySA" // for the > IPAQs > }; > > CandidatePortPrefixes=Temp; > } > > > So you may need to add "ttyUSB" to that list. RXTX used to enumerate > _everything_ see if(osName.equals("Linux-all-ports") But it became > less > than practical. > > This is all in RXTXCommDriver.java > > hmm I just did a cvs update. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux > Serial Ports > "ttySA", // for the > IPAQs > "ttyUSB" // for USB > frobs > }; > > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you > have > to get your fingers into the code. We aim for sane defaults. -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 19:21:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 19:21:54 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139358305.17994.2.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> <1139358305.17994.2.camel@zd7280> Message-ID: >Sorry I bothered you with this. Next time I will look in the source >first. I didn't think it was an rxtx issue, I thought it was a Linux >setup issue . Why would you be sorry? I would have done the same. I'm glad it's working :) -- Trent Jarvi tjarvi at qbang.org From tma at mail.island.net Wed Feb 8 13:39:35 2006 From: tma at mail.island.net (Tom Alldread) Date: Wed, 08 Feb 2006 12:39:35 -0800 Subject: [Rxtx] Win32/Linux Serial Port Data Dropouts In-Reply-To: <200602060702.k167255O007882@www.qbang.org> References: <200602060702.k167255O007882@www.qbang.org> Message-ID: <43EA5707.4020200@mail.island.net> Greetings Folks at RXTX: During the last couple of months I have been alternately testing with javax.comm 2 and RXTX 2.1 under Windows XP and CommApi 3 and RXTX 2.1 under Suse 10.0 Linux. In the process I have learned a little about java multi-threading under NetBeans 5 with Profiler. My java (jdk 1.5_06) application is used for data acquisition and provides a graphical display of A-D conversion data received from a 56KBaud serial port. The actual data throughput is about 10KBaud thus it is well below the speed of the port. I use hardware RTS/CTS flow control which can stall the data acquisition sample rate if necessary. This ensures the display computer has the ability to slow the data acquisition rate should it become too busy to accept the regular data flow. Both the serial port buffer and the java read buffer are set at 16KB. Usually the data transfers into the java read buffer are less than 100 bytes unless the data acquisition is recovering from a stall. The data flow normally hesitates after each 5 KB block as a continue command is needed from the display computer to start the drawing of a new graphics display line. Separate threads have been provided for the serial port event monitoring and data processing. The serial port event thread has been given the maximum priority and data processing thread the minimum priority provided by java. Thread yield statements have been placed within all data processing while/for loops as an effort to ensure quick access to CPU cycles for the serial port event thread. I have found that short data transmissions are essentially error free but occasional dropouts occur with continuous data flow especially under Windows XP. ....................................................................................................................................................................................... Linux results: I am happy to report that RXTX 2.1 appears to work very well under Linux although I did notice some errors when the screen savers were running with my dual monitors. I believe this is a local problem associated with my dual graphics which needs further attention. The recent CommApi 3 Linux release from Sun did not work at all with my program. It seemed to send commands out OK but did not receive any data. Although the serial port event triggered the ISR, the input stream appeared filled with nulls and thus did not contain any data. As my understanding is that CommApi 3 was tested with a Red Hat distribution of Linux I wonder if this problem is distro dependent? Although somewhat off topic here I wonder if anyone reading this has had similar experience? .................................................................................................................................................................................. Windows XP results: There are problems with occasional data dropouts which become more frequent as the sampling rate is increased or if the computer becomes busy with other duties. The dropouts typically consist of a half dozen byte block of lost data. It appears the lost bytes never get added to the java input stream. There has not been any indication of garbled data, overruns or framing errors which suggests the UART communications remains solid. Using javax.comm 2 I found that the setting of SerialPort 'enableReceiveThreshold' to 40 and 'enableReceiveTimeout' of 100mS reduced the dropouts error rate significantly. I found that I could not get RXTX 2.1 to function with the aforementioned threshold and timeout settings. The javax.comm 2 interface is consequently performing better for me under Windows than RXTX 2.1. I wonder if anyone here has any suggestions as to what I might try to improve RXTX 2.1? Although my settings are the same as under Suse 10.0, RXTX 2.1 performs much better for me under Linux than any of the alternatives that I have tried under Windows XP . ............................................................................................................................................................................... I would like to establish, based on the experience of others, if I have reached the normally expected performance limit of java serial port communications? Should I expect to achieve virtually error free serial port data input from a continuous stream under Windows XP java software? I am considering changing my protocol to packets with error checking if necessary but would like to know if the dropout problems I am experiencing are typical or not before I take this rather work intensive plunge. Many thanks in advance for any help! Best Regards, Tom Alldread -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.375 / Virus Database: 267.15.2/253 - Release Date: 2006-02-07 From jlaxson at mac.com Wed Feb 8 23:56:48 2006 From: jlaxson at mac.com (John Laxson) Date: Thu, 9 Feb 2006 00:56:48 -0600 Subject: [Rxtx] PortInUseException: Unknown Application on OSX Message-ID: Hi, I've been trying to get RXTX 2.1.7 going on Mac OS X for a while here, and am running up into a wall here. I've tried with pre- compiled and the source version and get the same problem, a gnu.io.PortInUseException: Unknown Application. I have run the fixperms script included with the source distribution, and id shows me as a member of the uucp group, and permissions on /var/spool/uucp are 775 root:uucp. Running a test program (included at the bottom for clarity) lets me enumerate all the serial ports correctly, but trying to open any of them gives the PortInUseException. If it helps, when I try to open a port that's set to make an outgoing bluetooth connection, there is no delay and no connection attempt at all. Thanks, John Laxson PS: The documentation wiki on qbang.org shows 404, and has for a few days now. My test code: public static void main(String[] args) { SerialPort serialPort; try { Enumeration e = CommPortIdentifier.getPortIdentifiers(); CommPortIdentifier ident; while (e.hasMoreElements()) { ident = (CommPortIdentifier)e.nextElement(); System.out.println(ident.getName()); } ident = CommPortIdentifier.getPortIdentifier("/dev/cu.modem"); serialPort = (SerialPort) ident.open("Me", 5000); } catch (Exception e) { e.printStackTrace(); } } From rajesh.invincible at gmail.com Thu Feb 9 03:39:38 2006 From: rajesh.invincible at gmail.com (Rajesh N) Date: Thu, 9 Feb 2006 16:09:38 +0530 Subject: [Rxtx] Re: Move .java Files in gnu.io filesystem hierarchy - Maven (2) In-Reply-To: <43DF21D2.7090200@ngi.it> References: <43DF21D2.7090200@ngi.it> Message-ID: <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Can anybody tell me how to overcome these EXCEPTIONS I AM WORKING ON SERIAL COMMN IN JAVA ON LINUX. 1. " NOT ALL PARAMETERS SUPPORTED BY THE KERNEL" This i came across the following statement inmy prog. SerialP is A SerialPort object SerialP.setSerialPortParams(9600(BAUDRATE),DATABITS_8,STOPBITS_1,PARITY_NONE) 2. NullPointer Exception at Event Dispatch Now i have checked all my object references for a null reference but i found none i have put up my entire code in try catch blocks but still I AM UNABLE TO CATCH THIS EXCEPTION AND HENCE MY APPLICATION CLOSES HOW DOES THESE GO? PLEASE HELP ME IT IS URGENTTTTTTTTTTTTTTTT yours sincerely RAJESH On 1/31/06, Fabio Frumento wrote: > Hi Xavier, > > I don't know maven at all but the directory hierarchy listed buy Trent > is fine for me... > > I'll take a look to maven, it seems an interesting project > > Regards > > Fabio Frumento > > Trent Jarvi wrote: > > On Tue, 31 Jan 2006, Xavier Frisaye wrote: > > > >> Hi all, > >> > >> If you are going to rearrange the src folder, i will propose to use > >> maven 2 and follow its directory structure > >> > (http://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html). > >> > >> Maven 2 simplify java project and give a standard way to make projects > >> (http://maven.apache.org/). > >> We are using it for internal projects and we are very satisfied. > >> > >> Is anybody interested? > >> > >> I'm not an expert in maven 2 (yet) but i'm agree to help using it if > >> you choose to make so. > >> > > > > so this would be: > > > > rxtx-devel/src/main/java/gnu.io > > rxtx-devel/src/test/java/ManIwish.java > > > > I don't use IDEs very much so I'll let others comment. But I don't see > > a problem with that. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Thu Feb 9 09:50:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 9 Feb 2006 09:50:31 -0700 (MST) Subject: [Rxtx] Re: Move .java Files in gnu.io filesystem hierarchy - Maven (2) In-Reply-To: <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Message-ID: On Thu, 9 Feb 2006, Rajesh N wrote: > Can anybody tell me how to overcome these EXCEPTIONS > I AM WORKING ON SERIAL COMMN IN JAVA ON LINUX. > > 1. " NOT ALL PARAMETERS SUPPORTED BY THE KERNEL" > > This i came across the following statement inmy prog. > SerialP is A SerialPort object > SerialP.setSerialPortParams(9600(BAUDRATE),DATABITS_8,STOPBITS_1,PARITY_NONE) > Strange. The parameters you use are the same the port should open with by default. Could you paste the actual exception you are getting? I don't see that in the rxtx source. Also it would help to know the rxtx version. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Fri Feb 10 15:29:05 2006 From: lux at diesel-research.com (Kim Lux) Date: Fri, 10 Feb 2006 15:29:05 -0700 Subject: [Rxtx] One serial port object for both sending and receiving ? Message-ID: <1139610545.18177.4.camel@zd7280> Is it OK to use one SerialPort ojbect (ex Serial Port serialPort;) and use it for both sending and receiving ? For example: ======================================================================== static SerialPort serialPort = null; static OutputStream serialOut = null; static InputStream serialIn = null; // assign it to an outputStream for use try{ serialOut = serialPort.getOutputStream(); System.out.println("Serial output stream has been assigned."); }//try catch(IOException e) { System.out.println("Error: Couldn't assign output stream to serial port."); }//catch //assign it to an inputStream for use try{ serialIn = serialPort.getInputStream(); System.out.println("Serial input stream has been assigned."); }//try catch(IOException e) { System.out.println("Error: Couldn't assign input stream to serial port."); }//catch ======================================================================== -- Kim Lux, Diesel Research Inc. From lux at diesel-research.com Fri Feb 10 21:23:00 2006 From: lux at diesel-research.com (Kim Lux) Date: Fri, 10 Feb 2006 21:23:00 -0700 Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Message-ID: <1139631780.23882.10.camel@zd7280> I've got a problem receiving chars with my version of serialRead, written in an SWT GUI. I had a Java pro have a good look at my code and he can't see anything wrong with it. I can send chars fine. When I receive a char the cpu usage for the app goes to 100% and the code in the serial event handler doesn't get executed. The instructions on the Java Comm Serial API How-To for Linux page state that I must install javacomm. Is that true ? Everything builds without it and I can send chars on rxtx just fine, but I can't receive them. Could this be the problem ? I downloaded and installed javacomm. I was not able to add "Driver=gnuio.RXTXCommDriver to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 installed in /usr/java/jre1.5.0_05. I added comm.jar to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext to the library paths. Is this OK ? Does it matter that I am receiving on /dev/ttyUSB0 ? Thanks. -- Kim Lux, Diesel Research Inc. From lunareclipse03 at web.de Sat Feb 11 09:44:46 2006 From: lunareclipse03 at web.de (lunareclipse03@web.de) Date: Sat, 11 Feb 2006 17:44:46 +0100 Subject: [Rxtx] Question about Serial I/O under Win32 Message-ID: <662084330@web.de> Hello everybody, I have a strange problem with a piece of code I made for myself. No, this is not really concerning rxtx, but nevertheless I post this to the list, hoping that some of you can help me. I've written two libraries, one for linux and one for win32. The linux port works quite well, I can send / receive faxes and / or replay voice messages over the telephone line using a voice modem. But the win32 port of the library causes some trouble. If, for example, I send out a fax with a certain modem under linux, it works well. The fax is complete when it comes out of the fax machine. If I then use the same modem to send out a fax under win32, the fax coming out of the fax machine gets "stuck" halfways, but the sending modem thinks that transmission was ok and drops the connection. The answering fax machine then gives me "error while receiving." The "upper layer" java code MUST be right, because if I do the same thing under linux (using the linux library), everything is alright. Now I have to ask: Can somebody please help me out with this??!? Could it be the case that some kind of flow control or COMMTIMEOUTS setting causes this behaviour? I set flow control to RTS/CTS before sending out a fax. How can I DISABLE flow control? Or what do you think? Can something else cause this problems? Thank you all for your time and PLEASE write back soon. Regards, --Sven Ahlemann Am Waldrand 31 45721 Haltern am See Germany ______________________________________________________________ Verschicken Sie romantische, coole und witzige Bilder per SMS! Jetzt bei WEB.DE FreeMail: http://f.web.de/?mc=021193 From lux at diesel-research.com Sat Feb 11 10:06:52 2006 From: lux at diesel-research.com (Kim Lux) Date: Sat, 11 Feb 2006 10:06:52 -0700 Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: <1139631780.23882.10.camel@zd7280> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> <1139631780.23882.10.camel@zd7280> Message-ID: <1139677612.3431.5.camel@zd7280> More on this problem. I copied and pasted simpleRead into a console based Eclipse project and I've got the same result, except that cpu usage doesn't go to 100%. I'm beginning to think there is an issue in rxtx. My imports for simpleRead are: ============================ import gnu.io.*; import java.util.*; //import javax.comm.*; import java.io.*; =========================== Any ideas ? I am trying to read from /dev/ttyUSB0 using a serial to USB adapter which has worked well with minicom and gtkterm. Thanks. On Fri, 2006-02-10 at 21:23 -0700, Kim Lux wrote: > I've got a problem receiving chars with my version of serialRead, > written in an SWT GUI. > > I had a Java pro have a good look at my code and he can't see anything > wrong with it. > > I can send chars fine. When I receive a char the cpu usage for the app > goes to 100% and the code in the serial event handler doesn't get > executed. > > The instructions on the Java Comm Serial API How-To for Linux page state > that I must install javacomm. Is that true ? Everything builds without > it and I can send chars on rxtx just fine, but I can't receive them. > Could this be the problem ? > > I downloaded and installed javacomm. I was not able to add > "Driver=gnuio.RXTXCommDriver > to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not > have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 > installed in /usr/java/jre1.5.0_05. I added comm.jar > to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext > to the library paths. Is this OK ? > > Does it matter that I am receiving on /dev/ttyUSB0 ? > > Thanks. > -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Sun Feb 12 21:01:33 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:01:33 -0700 (MST) Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: <1139677612.3431.5.camel@zd7280> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> <1139631780.23882.10.camel@zd7280> <1139677612.3431.5.camel@zd7280> Message-ID: I suspect what is happening is the select() is breaking out in the native code but the driver does not have support for notifying there are X bytes available. On some traditional Unix based systems, the only way you know data is available is the fd status changes and do an FIORDCHK ioctl. Or perhaps the only thing you can know is the fd status changed. It would take reading through the kernel driver code to know for sure. So on USB, depending upon the driver, the same may need to be done or the driver improved a bit if possible to support. Polling reads will also work but don't use the event driven model of CommAPI which isnt acceptable in the long run. The 100% cpu usage can then be explained because select no longer blocks until the data is read; the eventLoop spins loose. You can put a well placed sleep but rxtx only expects those are needed when it knows data is available. This may not be a super simple thing to understand and fix. I do have ideas to get you started. I'm going to be short on time the next couple weeks. I expect to put some good time in and answer some other questions I saw around the 25th. For now, I'd look at the following and go from there with the hints I've given. JNIEXPORT jint JNICALL RXTXPort(nativeavailable)( JNIEnv *env, jobject jobj ) { int fd = get_java_var( env, jobj,"fd","I" ); int result; /* char message[80]; ENTER( "RXTXPort:nativeavailable" ); On SCO OpenServer FIONREAD always fails for serial devices, so try ioctl FIORDCHK instead; will only tell us whether bytes are available, not how many, but better than nothing. This turns out to be true on Solaris also. taj. */ #ifdef FIORDCHK /* __unixware__ __sun__ probably others */ result = ioctl(fd, FIORDCHK, 0); #else if( ioctl( fd, FIONREAD, &result ) < 0 ) { goto fail; } #endif /* FIORDCHK */ On Sat, 11 Feb 2006, Kim Lux wrote: > > More on this problem. I copied and pasted simpleRead into a console > based Eclipse project and I've got the same result, except that cpu > usage doesn't go to 100%. I'm beginning to think there is an issue in > rxtx. > > My imports for simpleRead are: > > ============================ > import gnu.io.*; > import java.util.*; > //import javax.comm.*; > import java.io.*; > =========================== > > Any ideas ? I am trying to read from /dev/ttyUSB0 using a serial to > USB adapter which has worked well with minicom and gtkterm. > > Thanks. > > > > On Fri, 2006-02-10 at 21:23 -0700, Kim Lux wrote: >> I've got a problem receiving chars with my version of serialRead, >> written in an SWT GUI. >> >> I had a Java pro have a good look at my code and he can't see anything >> wrong with it. >> >> I can send chars fine. When I receive a char the cpu usage for the app >> goes to 100% and the code in the serial event handler doesn't get >> executed. >> >> The instructions on the Java Comm Serial API How-To for Linux page state >> that I must install javacomm. Is that true ? Everything builds without >> it and I can send chars on rxtx just fine, but I can't receive them. >> Could this be the problem ? >> >> I downloaded and installed javacomm. I was not able to add >> "Driver=gnuio.RXTXCommDriver >> to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not >> have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 >> installed in /usr/java/jre1.5.0_05. I added comm.jar >> to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext >> to the library paths. Is this OK ? >> >> Does it matter that I am receiving on /dev/ttyUSB0 ? >> >> Thanks. >> > From tjarvi at qbang.org Sun Feb 12 21:03:30 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:03:30 -0700 (MST) Subject: [Rxtx] One serial port object for both sending and receiving ? In-Reply-To: <1139610545.18177.4.camel@zd7280> References: <1139610545.18177.4.camel@zd7280> Message-ID: On Fri, 10 Feb 2006, Kim Lux wrote: > > Is it OK to use one SerialPort ojbect (ex Serial Port serialPort;) and > use it for both sending and receiving ? > > For example: > > ======================================================================== > static SerialPort serialPort = null; > static OutputStream serialOut = null; > static InputStream serialIn = null; > > > > > // assign it to an outputStream for use > try{ > serialOut = serialPort.getOutputStream(); > System.out.println("Serial output stream has been assigned."); > }//try > catch(IOException e) > { > System.out.println("Error: Couldn't assign output stream to serial > port."); > }//catch > > > //assign it to an inputStream for use > try{ > serialIn = serialPort.getInputStream(); > System.out.println("Serial input stream has been assigned."); > }//try > catch(IOException e) > { > System.out.println("Error: Couldn't assign input stream to serial > port."); > }//catch This should be fine. In fact trying to do it another way will probably not work as you will run into lockfile issues. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun Feb 12 21:13:13 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:13:13 -0700 (MST) Subject: [Rxtx] Question about Serial I/O under Win32 In-Reply-To: <662084330@web.de> References: <662084330@web.de> Message-ID: On Sat, 11 Feb 2006 lunareclipse03 at web.de wrote: > Hello everybody, > > I have a strange problem with a piece of code I made for myself. No, > this is not really concerning rxtx, but nevertheless I post this to the > list, hoping that some of you can help me. I've written two libraries, > one for linux and one for win32. The linux port works quite well, I can > send / receive faxes and / or replay voice messages over the telephone > line using a voice modem. But the win32 port of the library causes some > trouble. If, for example, I send out a fax with a certain modem under > linux, it works well. The fax is complete when it comes out of the fax > machine. If I then use the same modem to send out a fax under win32, the > fax coming out of the fax machine gets "stuck" halfways, but the sending > modem thinks that transmission was ok and drops the connection. The > answering fax machine then gives me "error while receiving." The "upper > layer" java code MUST be right, because if I do the same thing under > linux (using the linux library), everything is alright. Now I have to > ask: Can somebody please help me out with this??!? Could it be the case > that some kind of flow control or COMMTIMEOUTS setting causes this > behaviour? I set flow control to RTS/CTS before sending out a fax. How > can I DISABLE flow control? Or what do you think? Can something else > cause this problems? Thank you all for your time and PLEASE write back > soon. > Hi Sven I'm not too willing to talk about flow control at the low level until I confirm some things with test equipment later. It is not clear if you are using rxtx or writing your own native code. So I'm not sure how to answer much of this :) If you are wondering how to change the flow control using rxtx from java, The BlackBox example from Sun flips this back and forth. SerialPort.java in rxtx 2.1 uses the following: SerialPort.java: public static final int FLOWCONTROL_NONE =0; SerialPort.java: public static final int FLOWCONTROL_RTSCTS_IN =1; SerialPort.java: public static final int FLOWCONTROL_RTSCTS_OUT =2; SerialPort.java: public static final int FLOWCONTROL_XONXOFF_IN =4; SerialPort.java: public static final int FLOWCONTROL_XONXOFF_OUT=8; So if you set flowcontrol to RTSCTS, you can set it to NONE to turn it off. If you are looking for how to do it in native code, the rxtx Source is SerialImp.c (unix/linux/mac os x/w32) and termios.c (w32 only with SerialImp.c) You can track the code: SerialImp.c:JNIEXPORT void JNICALL RXTXPort(setflowcontrol)( JNIEnv *env, jobject jobj, jint flowmode ) termios.c:int tcgetattr( int fd, struct termios *s_termios ) termios.c:int tcsetattr( int fd, int when, struct termios *s_termios ) There may be a problem in the rxtx flow control code though. Rather than guess, I want to test this with a gold standard. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Feb 6 00:00:16 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 00:00:16 -0700 (MST) Subject: [Rxtx] wiki delay until tomorrow night. In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: On Sun, 5 Feb 2006, Trent Jarvi wrote: > On Sun, 5 Feb 2006, Kim Lux wrote: > >> usb ? Tell me more... I need that too. > > usb is a very proper design. Thats all it is. > Maybe rxtx could help usb. But it would start with helping bring back the community that was already there. It's not something I'd love to do but maybe its the right thing to do. It would probably take 2 years to do right. But maybe thats better than what we have now. I honestly don't know what IBM is doing which could just run over everything. Just some thoughts after some fine german wine. -- Trent Jarvi tjarvi at qbang.org From gadelavega at yahoo.com.ar Mon Feb 6 02:17:05 2006 From: gadelavega at yahoo.com.ar (Gonzalo A. de la Vega) Date: Mon, 06 Feb 2006 10:17:05 +0100 Subject: [Rxtx] Serial port ownership question In-Reply-To: References: <20060205113618.30274.qmail@web53501.mail.yahoo.com> <1139157422.4553.9.camel@zd7280> <1139158698.4936.9.camel@zd7280> Message-ID: <43E71411.4050402@yahoo.com.ar> On my Fedora Core 4: ls -l /dev/ttyS* crw-rw---- 1 root uucp 4, 64 Feb 6 2006 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Feb 6 2006 /dev/ttyS1 ... and: grep "ttyUSB" /etc/udev/rules.d/50-udev.rules KERNEL=="ttyUSB*", GROUP="uucp", MODE="0660" So anyone in the "uucp" group can use serial ports. On Gentoo the group is "tty". Trent Jarvi escribi?: > > > On Sun, 5 Feb 2006, Dr. Douglas Lyon wrote: > >> I can confirm that this is the case (only root ownership of >> serial ports, under fedora 4). >> Wow, what were they thinking?! >> - DL >> >>> I've found that the newer kernels have the serial ports owned by root. >>> For example, >>> >>> $ls -al /dev/tty* >>> crw-rw-rw- 1 root root 5, 0 Feb 5 02:06 /dev/tty >>> crw-rw---- 1 root root 4, 0 Feb 5 02:06 /dev/tty0 >>> crw------- 1 root root 4, 1 Feb 5 09:07 /dev/tty1 >>> crw-rw---- 1 root tty 4, 10 Feb 5 02:06 /dev/tty10 >>> crw-rw---- 1 root tty 4, 11 Feb 5 02:06 /dev/tty11 >>> ... > > > This is just not a problem jcp or such are going to solve. Its a > platform spitwad fight. But do look at pam. In fact thats what Sun > is doing too. Maybe Linux followed their lead.. I'm not a pam guy. > I've spent 16 hours trying to understand it but your users wont :) > > Solution? I have no clue. Its two tangent mentalities from my > perspective. > > -- > Trent Jarvi > tjarvi at qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mtnvega at yahoo.com.br Mon Feb 6 05:35:43 2006 From: mtnvega at yahoo.com.br (Luiz Jr) Date: Mon, 6 Feb 2006 12:35:43 +0000 (GMT) Subject: [Rxtx] Documentation Wiki In-Reply-To: <1139157422.4553.9.camel@zd7280> Message-ID: <20060206123543.57256.qmail@web53515.mail.yahoo.com> Hello, Thank you for you answer, but so the usage of the API is pretty much like the Java Communications Api? If yes, what version of the Java Comm Api? Thank you, Luiz A. Brandao Jr Kim Lux escreveu: On Sun, 2006-02-05 at 08:36 -0300, Luiz Jr wrote: > Hello, > > I want to start using the RXTX libraries, but I would to know how, > since I can not access the documentation wiki page I just started using them yesterday. Below is how I installed the libraries, if that helps. I used snippets of code from the SimpleWrite application here to get me going. http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html Instead of "import javax.comm.*;", use "import gnu.io.*;" which is gotten from RXTXcomm.jar, which you will need to include in your project references. I am working in Eclipse. BTW: there is no way to open a port without going through the port list and finding it. Maybe sometime in the future someone (me ?) will write a method called openSerialPort that allows the user to give a port identifier, such as "/dev/tty1" and return a port ready to use. It wouldn't take much to write that and it would save users a lot of code. Hope this helps. ======================================================================= 1) Figure out which java you are running, incase there is more than one installed. $ java -version java version "1.5.0_05" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_05-b05) Java HotSpot(TM) Client VM (build 1.5.0_05-b05, mixed mode, sharing) 2) Find all the jre directories and the one from which you are currently running. kfind (jre) 3) cd to that directory plus /lib/i386 cd /usr/java/jre1.5.0_05/lib/i386 4) Copy the library files (*.so) to that directory. cp /home/krlux/Desktop/'Java Controls'/rxtx-linux/bin/* . 5) Check that the copy was successful ls librxtx* librxtxI2C.so librxtxRaw.so librxtxSerial.so librxtxParallel.so librxtxRS485.so 6) cd to the /lib/ext directory for your java. cd /usr/java/jre1.5.0_05/lib/ext 7) Copy the Jar files there cp /home/krlux/Desktop/'Java Controls'/rxtx-linux/lib/ext/* . 8) Check that it was successful ls RXTX* RXTXcomm.jar Rxtx is now installed on your machine ready to use. =================================================================== -- Kim Lux, Diesel Research Inc. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx --------------------------------- Yahoo! Acesso Gr?tis - Internet r?pida e gr?tis. Instale o discador agora! -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/544aa403/attachment-0027.html From lyon at docjava.com Mon Feb 6 05:49:34 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 06 Feb 2006 07:49:34 -0500 Subject: [Rxtx] wiki delay until tomorrow night. In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: Hi All, I have often thought about USB drivers being needed. For example, the ironman watch will not interface to a mac (windows only). It is USB. My dymo label writer has no Java driver (native only). Etc. Most cheap web cameras are USB (and Java drivers go through JAI, if it supports the camera at all). The JAI code shows how sun did the USB drivers. You have to be a member of the jai project to download the source code. https://jai.dev.java.net has the jai distro. And then you are not allowed to redistribute it. However, we can all learn from it (if so inclined). Basically: cvs -d :pserver:lyon at cvs.dev.java.net:/cvs login cvs -d :pserver:lyon at cvs.dev.java.net:/cvs checkout jai-core You will need to user your own uid and pw to get in. The ant build has over 100 warnings from sun deprecations of its own code. You might say that they were hoisted on their own Picard ;) One interesting thing is that they support several platforms: linux-amd64 64-bit Linux-AMD64 linux-i586 32-bit Linux-x86 solaris-amd64 64-bit Solaris-AMD64 solaris-i586 32-bit Solaris-x86 solaris-sparc 32-bit Solaris-SPARC solaris-sparcv9 64-bit Solaris-SPARC windows-i586 32-bit Windows-x86 Thus, ant is used to provide a multi-platform native method distro. Neat. How do they do it? check this out: And: The core download does not contain any C source code (it was all pre-built). Basically, they are just copying .so and .dll files into build directories. I would love to see the C code for this...but Sun does not post it on the https://jai.dev.java.net site. I don't know why...Perhaps I missed it. - Doug >On Sun, 5 Feb 2006, Trent Jarvi wrote: > >>On Sun, 5 Feb 2006, Kim Lux wrote: >> >>>usb ? Tell me more... I need that too. >> >>usb is a very proper design. Thats all it is. >> > >Maybe rxtx could help usb. But it would start with helping bring >back the community that was already there. > >It's not something I'd love to do but maybe its the right thing to do. > >It would probably take 2 years to do right. But maybe thats better >than what we have now. > >I honestly don't know what IBM is doing which could just run over everything. > >Just some thoughts after some fine german wine. > >-- >Trent Jarvi >tjarvi at qbang.org > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tdelenik at gmail.com Mon Feb 6 05:56:32 2006 From: tdelenik at gmail.com (Thanasis Delenikas) Date: Mon, 6 Feb 2006 14:56:32 +0200 Subject: Fwd: [Rxtx] Documentation Wiki In-Reply-To: <1139157422.4553.9.camel@zd7280> References: <20060205113618.30274.qmail@web53501.mail.yahoo.com> <1139157422.4553.9.camel@zd7280> Message-ID: <310a1a930602060456t129f1dc6p5f2b908f13ab5a0b@mail.gmail.com> Hello all, Kim, this is a snippet from the code I use. The closest to directly opening a specific port without enumeration. << ... portId = CommPortIdentifier.getPortIdentifier(getPort()); serialPort = (SerialPort) portId.open("jSMSEngine", 1971); ... >> where getPort() return the string identifier of the port, i.e. "/dev/ttyS0" or "COM1" or whatever. Thanasis. ---------- Forwarded message ---------- From: Kim Lux Date: Feb 5, 2006 6:37 PM Subject: Re: [Rxtx] Documentation Wiki To: RXTX Developers and Users BTW: there is no way to open a port without going through the port list and finding it. Maybe sometime in the future someone (me ?) will write a method called openSerialPort that allows the user to give a port identifier, such as "/dev/tty1" and return a port ready to use. It wouldn't take much to write that and it would save users a lot of code. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/182ab5b8/attachment-0027.html From tjarvi at qbang.org Mon Feb 6 11:53:57 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 11:53:57 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: On Mon, 6 Feb 2006, Dr. Douglas Lyon wrote: > Hi All, > I have often thought about USB drivers being needed. > For example, the ironman watch will not interface > to a mac (windows only). It is USB. > My dymo label writer has no Java driver (native only). > Etc. > Most cheap web cameras are USB (and Java drivers go > through JAI, if it supports the camera at all). > The JAI code shows how sun did the USB drivers. > You have to be a member of the jai project to download > the source code. > https://jai.dev.java.net has the jai distro. > And then you are not allowed to redistribute it. However, > we can all learn from it (if so inclined). Basically: > cvs -d :pserver:lyon at cvs.dev.java.net:/cvs login > cvs -d :pserver:lyon at cvs.dev.java.net:/cvs checkout jai-core > You will need to user your own uid and pw to get in. > The ant build has over 100 warnings from sun deprecations > of its own code. > > You might say that they were hoisted on their own Picard ;) > > One interesting thing is that they support several platforms: > linux-amd64 64-bit Linux-AMD64 > linux-i586 32-bit Linux-x86 > solaris-amd64 64-bit Solaris-AMD64 > solaris-i586 32-bit Solaris-x86 > solaris-sparc 32-bit Solaris-SPARC > solaris-sparcv9 64-bit Solaris-SPARC > windows-i586 32-bit Windows-x86 > Thus, ant is used to provide a multi-platform native method distro. > Neat. > How do they do it? > check this out: > > > > > > > > > > > > > And: > > > > > > > > > > The core download does not contain any C source code (it was all pre-built). > Basically, they are just copying .so and .dll files into build directories. > > I would love to see the C code for this...but Sun does not post it on the > https://jai.dev.java.net site. > > I don't know why...Perhaps I missed it. > > - Doug > > I've looked at moving rxtx to Ant builds. I think that would help IDEs a great deal. I requested a evalutation desk copy the O'Reilly Ant book for some j2ee material I was teaching. http://www.oreilly.com/catalog/anttdg/ It has a one sentence mention of JNI. So there was not luck there. I saw that there is another Ant book that does mention JNI more. I can't find it now. Ant must be able to support it with extensions. http://ant.apache.org/manual/OptionalTasks/javah.html What the auto(break :) tools do in the rxtx build is 4 things really. 1) gcc compile flags 2) ld compile flags 3) config.h 4) compile flags for customizing rxtx (lockfiles, ...) See 1 All of this information except 4 can be static once obtained. So I'm not attached to the auto tools. If I could find an example of Ant being used for JNI code, I'd be one of the first to start moving that direction. Maybe someone saw an example someplace. The other thing we have not completed discussing is the directory structure. There is interest in making rxtx more IDE friendly. I get more mail about that off the list than how to install rxtx. And I see we have Ken Thompson in da house :) He is our trusted CVS maintainer and the guy that purchased the rxtx.org domain. Old community. We will need Ken for changing the directory structure of source. I would like to open up discussion about both of these as it is more than time. The problem is I have little experience with Ant and even less with IDEs. It would be nice if we could work with Eclipse and NetBeans. http://www.netbeans.org/ (sun and some community) http://www.eclipes.org (ibm,rhat,... perhaps more community) http://maven.apache.org/what-is-maven.html (apache. It is community) borland should sortof be here too but I think thats covered in eclipse. >From what I understand so far, we should morph rxtx to support those three maybe trusting apaches lead with maven. But I use vi. I have little to no clues beyond what people have fed me. Can we agree that thats the right direction to go? -- Trent Jarvi tjarvi at qbang.org From brian at mbari.org Mon Feb 6 14:57:50 2006 From: brian at mbari.org (Brian Schlining) Date: Mon, 6 Feb 2006 13:57:50 -0800 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> > The other thing we have not completed discussing is the directory > structure. There is interest in making rxtx more IDE friendly. I > get more mail about that off the list than how to install rxtx. > > And I see we have Ken Thompson in da house :) He is our trusted > CVS maintainer and the guy that purchased the rxtx.org domain. Old > community. We will need Ken for changing the directory structure of > source. > > I would like to open up discussion about both of these as it is > more than time. The problem is I have little experience with Ant > and even less with IDEs. It would be nice if we could work with > Eclipse and NetBeans. > > http://www.netbeans.org/ (sun and some community) > http://www.eclipes.org (ibm,rhat,... perhaps more community) > http://maven.apache.org/what-is-maven.html (apache. It is community) > borland should sortof be here too but I think thats covered in > eclipse. > >> From what I understand so far, we should morph rxtx to support >> those three > maybe trusting apaches lead with maven. But I use vi. I have > little to no clues beyond what people have fed me. > Maven likes the directory structure below for Java code. (From http:// maven.apache.org/guides/getting-started/index.html) This structure works fine with ant, netbeans, and eclipse. rxtx_root_directory `-- src |-- main | `-- java | `-- gnu | `-- io `-- test `-- java `-- gnu `-- io Brian Schlining Software Engineer http://www.mbari.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/d9451eba/attachment-0027.html From tjarvi at qbang.org Mon Feb 6 15:11:45 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 15:11:45 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: > rxtx_root_directory > `-- src > |-- main > | `-- java > | `-- gnu > | `-- io > `-- test > `-- java > `-- gnu > `-- io > >From what I understand this will just be good. For me it makes no difference. So lets do the rxtx thing. Let if fester for two weeks and if nobody objects, we will do it. I'm not doing this because I care. I'm doing this to eliminate much of my inbox. But test... man is rxtx lacking there in the community aspect. It is covered but not right. _maybe_ I can change that this year. -- Trent Jarvi tjarvi at qbang.org (cat hurding since 1997) From lux at diesel-research.com Mon Feb 6 21:38:49 2006 From: lux at diesel-research.com (Kim Lux) Date: Mon, 06 Feb 2006 21:38:49 -0700 Subject: [Rxtx] How can I use Lock Files with rxtx (in FC4) ? Message-ID: <1139287129.17031.3.camel@zd7280> I am now running an rxtx application on FC4. I am getting: ========================================================= check_group_uucp(): error testing lock file creation Error details: Permission denied check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL ========================================================= $ ls -al /var/lock total 32 drwxrwxr-x 4 root lock 4096 Feb 6 16:04 . drwxr-xr-x 24 root root 4096 Nov 14 01:19 .. drwx------ 2 root root 4096 Apr 27 2005 lvm drwxr-xr-x 2 root root 4096 Feb 6 16:04 subsys How do I fix this for regulator users ? -- Kim Lux, Diesel Research Inc. From dmarkman at mac.com Mon Feb 6 22:24:44 2006 From: dmarkman at mac.com (Dmitry Markman) Date: Tue, 7 Feb 2006 00:24:44 -0500 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: if I understands the issue right in order to be able to use ant for c/c++ compilation you have to install ant's cc task http://ant-contrib.sourceforge.net/cc.html it looks like it should work on mac os x (authors claim, that it's platform independent) but I never tested so all you have to do it's providing right command line for the gcc compiler On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: >> rxtx_root_directory >> `-- src >> |-- main >> | `-- java >> | `-- gnu >> | `-- io >> `-- test >> `-- java >> `-- gnu >> `-- io >> > > >> From what I understand this will just be good. > > For me it makes no difference. So lets do the rxtx thing. Let if > fester for two weeks and if nobody objects, we will do it. > > I'm not doing this because I care. I'm doing this to eliminate > much of my inbox. > > But test... man is rxtx lacking there in the community aspect. It > is covered but not right. _maybe_ I can change that this year. > > -- > Trent Jarvi > tjarvi at qbang.org > (cat hurding since 1997) > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx Dmitry Markman From lux at diesel-research.com Mon Feb 6 23:20:15 2006 From: lux at diesel-research.com (Kim Lux) Date: Mon, 06 Feb 2006 23:20:15 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? Message-ID: <1139293215.3689.4.camel@zd7280> I'm running the code below. portlist.hasMoreElements() is false. /dev has ports in it as listed below. What am I doing wrong ? ========================================================== // Step through the list of ports until we find one that matches // the one we are looking for. portList = CommPortIdentifier.getPortIdentifiers(); while(portList.hasMoreElements()) { portID = (CommPortIdentifier) portList.nextElement(); // if (portID.getName().equals("/dev/ttyUSB0")) { myTA.append("Serial port ttyUSB0 has been found\n"); break; }// if portID equals... }// End of while... ========================================================== ls -al /dev/tty* crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 ... crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 -- Kim Lux, Diesel Research Inc. From david.garnier at trusted-logic.com Tue Feb 7 00:46:30 2006 From: david.garnier at trusted-logic.com (David Garnier) Date: Tue, 07 Feb 2006 08:46:30 +0100 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: <43E85056.2090608@trusted-logic.com> Hello, I think that the make-based build process is fine as it is, apart from the location of the Java source files. It is true that putting the Java source in a directory structure that map 1-to-1 to the Java package structure is the norm and should make it easier for everyone to modify the Java source, with or without an IDE. Ant is a good tool, but in the RXTX case I fail to see the advantage of using it compared to the current make-based process. As Trent said, they are more pressing issues, like testing. Regards, David Dmitry Markman wrote: > if I understands the issue right > in order to be able to use ant for c/c++ compilation > you have to install ant's cc task > http://ant-contrib.sourceforge.net/cc.html > > it looks like it should work on mac os x > (authors claim, that it's platform independent) > but I never tested > > so all you have to do it's providing right command line > for the gcc compiler > > > > > On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: > >>> rxtx_root_directory >>> `-- src >>> |-- main >>> | `-- java >>> | `-- gnu >>> | `-- io >>> `-- test >>> `-- java >>> `-- gnu >>> `-- io >>> >> >> >>> From what I understand this will just be good. >> >> For me it makes no difference. So lets do the rxtx thing. Let if >> fester for two weeks and if nobody objects, we will do it. >> >> I'm not doing this because I care. I'm doing this to eliminate much >> of my inbox. >> >> But test... man is rxtx lacking there in the community aspect. It is >> covered but not right. _maybe_ I can change that this year. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> (cat hurding since 1997) From tjarvi at qbang.org Tue Feb 7 01:11:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 01:11:31 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <43E85056.2090608@trusted-logic.com> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: On Tue, 7 Feb 2006, David Garnier wrote: > Hello, > > I think that the make-based build process is fine as it is, apart from the location of the Java > source files. It is true that putting the Java source in a directory structure that map 1-to-1 to > the Java package structure is the norm and should make it easier for everyone to modify the Java > source, with or without an IDE. > > Ant is a good tool, but in the RXTX case I fail to see the advantage of using it compared to the > current make-based process. As Trent said, they are more pressing issues, like testing. > Hi David I have more experience with testing rxtx than I can talk about. But let it be known, rxtx has gone trough 100's of hours of testing. We are hobby folks interested in toys but there is more. rxtx has had some of the best guidance in the industry there. This is not an easy thing. I may be able to come back in a month from the other side of the corperate fence and help. I suspect the tests could just be made public but they are in a very unusual environment that just wont work in a wider sense. This is something I'll be trying to change. At one point it was agreed we could just make the results public so this isnt just noise.. There is interest and I think its safe to mention that much. The big problem with testing in the past is most of it is done with a loopback connection. So we *still* have major questions regarding things like flow control. rxtx talks to itself over a loopback and it works. regardless of right or wrong. This requires more thought to be done right. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Feb 7 02:46:34 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 02:46:34 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: > The big problem with testing in the past is most of it is done with a > loopback connection. So we *still* have major questions regarding things > like flow control. rxtx talks to itself over a loopback and it works. > regardless of right or wrong. With serial communication there are gold standards. ckermit is probably a definitive 'standard.' Maybe its possible to do ping/pong tests with ckermit? Is it scriptable? There are known issues in rxtx. Probably the worst is some threading issues regarding some JREs with multiple JNI threads setting java variables. Man did I get schooled there. Just switch the c functions to returning variables and things go away. Sometimes they work fine, sometimes they blow up. Without understanding everything, somehow rhat got it right and debian (and especially gentoo) grabbed kernel patches causing all sort of harm. Its not hard to fix once you understand whats going on but nearly impossible to track with a debugger. So I have a good idea what 2.1-8 will have outside of the IDE modifications. rxtx 2.1-7 is a release for everyone to sync with. Its not even as stable as -pre17 as far as I know - I ran no test suites. I'll be chasing it too. We just had so many contributions that it was time. It seriously broke internal scheduals but thats a great thing :) The other thing I want to do in 2.1-8 is automagic baud rates. It turns out lots of shops are doing really funky baud rates for things like automobile test equipment. It is possible but it requires a fair amount of change in the native code. Is anyone looking at this? -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Feb 7 02:57:21 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 07 Feb 2006 04:57:21 -0500 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <43E85056.2090608@trusted-logic.com> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: Hi All, I agree, testing is very important. The problem I have been trying to address is related to cross-platform testing and the robust nature of the installs. Typically, I visit 3 platforms to deploy my product, windows, linux and mac. A build is performed on each platform. The idea that you can build for many platforms from one copy the source code seems attractive. This should enable synchronized deployments of identical code. The question of how to achieve this goal remains open. As Trent mentioned, this is hard. Perhaps Ant will help here (but perhaps not). Ant does seem to help with running unit tests. However, it does not help with multi-platform tests. For that you need many machines and different operating environments. Toward that end, I have created a multi-platform test that can be run from web start, located at: http://show.docjava.com:8086/book/cgij/code/jnlp/serialPort.PortTest.jnlp This is interesting because many people in the community can run the test and we can improve the test, as time permits. No, it is not a perfect solution, however, the idea does help with multi-platform tests using many machines and different operating environments. If the group has a good test for a general serial port set-ups, i would be happy to deploy it, for general evaluation using web start. And as for ANT, it is just an idea. Not all my ideas are good ones! - Doug >Hello, > >I think that the make-based build process is fine as it is, apart >from the location of the Java >source files. It is true that putting the Java source in a directory >structure that map 1-to-1 to >the Java package structure is the norm and should make it easier for >everyone to modify the Java >source, with or without an IDE. > >Ant is a good tool, but in the RXTX case I fail to see the advantage >of using it compared to the >current make-based process. As Trent said, they are more pressing >issues, like testing. > >Regards, >David > >Dmitry Markman wrote: >> if I understands the issue right >> in order to be able to use ant for c/c++ compilation >> you have to install ant's cc task >> http://ant-contrib.sourceforge.net/cc.html >> >> it looks like it should work on mac os x >> (authors claim, that it's platform independent) >> but I never tested >> >> so all you have to do it's providing right command line >> for the gcc compiler >> >> >> >> >> On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: >> >>>> rxtx_root_directory >>>> `-- src >>>> |-- main >>>> | `-- java >>>> | `-- gnu >>>> | `-- io >>>> `-- test >>>> `-- java >>>> `-- gnu >>>> `-- io >>>> >>> >>> >>>> From what I understand this will just be good. >>> >>> For me it makes no difference. So lets do the rxtx thing. Let if >>> fester for two weeks and if nobody objects, we will do it. >>> >>> I'm not doing this because I care. I'm doing this to eliminate much >>> of my inbox. >>> >>> But test... man is rxtx lacking there in the community aspect. It is >>> covered but not right. _maybe_ I can change that this year. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> (cat hurding since 1997) > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From matt.higgins at gmail.com Tue Feb 7 08:28:34 2006 From: matt.higgins at gmail.com (Matt Higgins) Date: Tue, 7 Feb 2006 10:28:34 -0500 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final Message-ID: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? import java.io.*; import java.util.*; import gnu.io.*; public class MySimpleRead implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; public static void main(String[] args) { boolean portFound = false; String defaultPort = "COM1"; if (args.length > 0) { defaultPort = args[0]; } portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; MySimpleRead reader = new MySimpleRead(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } } public MySimpleRead() { try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) { e.printStackTrace(); } try { inputStream = serialPort.getInputStream(); } catch (IOException e) { e.printStackTrace(); } try { serialPort.addEventListener(this); } catch (TooManyListenersException e) { e.printStackTrace(); } try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { e.printStackTrace(); } System.out.println("Baud is " + serialPort.getBaudRate()); System.out.println("Bits is " + serialPort.getDataBits()); System.out.println("Stop is " + serialPort.getStopBits()); System.out.println("Par is " + serialPort.getParity()); serialPort.notifyOnDataAvailable(true); readThread = new Thread(this); readThread.start(); } public void run() { // Thread.sleep(20000); //} catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { System.out.println("An event occurred " + event.getEventType()); switch (event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: byte[] readBuffer = new byte[20]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } System.out.print(new String(readBuffer)); } catch (IOException e) {} break; } } } --------------- Result on windows ------------------------------ Stable Library ============================================================== Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port:: COM1 Baud is 9600 Bits is 8 Stop is 1 Par is 0 ----------------- End Results ----------------------------------------- ------------------ Result on Linux ----------------------------------- Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 Found port: /dev/ttyS0 Baud is 9600 Bits is 8 Stop is 1 Par is 0 An event occurred 1 043100066224 ------------------ End Results --------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/a1431630/attachment-0027.html From brian at mbari.org Tue Feb 7 09:48:37 2006 From: brian at mbari.org (Brian Schlining) Date: Tue, 7 Feb 2006 08:48:37 -0800 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> Message-ID: <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> Hi Matt > The following code works fine on Linux but I never see any data > when run on Windows. This is a cut and paste from the SimpleRead > example. > I am attempting to read data from a bar code scanner. I can fire > up HyperTermianl on windows and see that the device is working > properly as I see the barcodes are scanned and echoed back to the > terminal. However when I run the app I don't see any data. It is > however associating with the com port as the informational bits > print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. Cheers Brian Schlining Software Engineer http://www.mbari.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/16d07f37/attachment-0027.html From lux at diesel-research.com Tue Feb 7 11:59:58 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 11:59:58 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139293215.3689.4.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> Message-ID: <1139338798.8145.4.camel@zd7280> Any ideas on this ? Any reason why portList.hasMoreElements() should be false even though there are devices in /dev ? On Mon, 2006-02-06 at 23:20 -0700, Kim Lux wrote: > I'm running the code below. > > portlist.hasMoreElements() is false. > > /dev has ports in it as listed below. > > What am I doing wrong ? > > > ========================================================== > // Step through the list of ports until we find one that matches > // the one we are looking for. > > portList = CommPortIdentifier.getPortIdentifiers(); > > while(portList.hasMoreElements()) > { > portID = (CommPortIdentifier) portList.nextElement(); // > if (portID.getName().equals("/dev/ttyUSB0")) > { > myTA.append("Serial port ttyUSB0 has been found\n"); > break; > }// if portID equals... > }// End of while... > ========================================================== > > ls -al /dev/tty* > crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty > crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 > crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 > crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 > crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 > ... > crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 > crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 > crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 > > > -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 12:20:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 12:20:25 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139338798.8145.4.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> Message-ID: On Tue, 7 Feb 2006, Kim Lux wrote: > > Any ideas on this ? Any reason why portList.hasMoreElements() should be > false even though there are devices in /dev ? > > > On Mon, 2006-02-06 at 23:20 -0700, Kim Lux wrote: >> I'm running the code below. >> >> portlist.hasMoreElements() is false. >> >> /dev has ports in it as listed below. >> >> What am I doing wrong ? >> >> >> ========================================================== >> // Step through the list of ports until we find one that matches >> // the one we are looking for. >> >> portList = CommPortIdentifier.getPortIdentifiers(); >> >> while(portList.hasMoreElements()) >> { >> portID = (CommPortIdentifier) portList.nextElement(); // >> if (portID.getName().equals("/dev/ttyUSB0")) >> { >> myTA.append("Serial port ttyUSB0 has been found\n"); >> break; >> }// if portID equals... >> }// End of while... >> ========================================================== >> >> ls -al /dev/tty* >> crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty >> crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 >> crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 >> crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 >> crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 >> ... >> crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 >> crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 >> crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 >> >> >> > Hi Kim What rxtx does is try to open the port and do a timed out read. If the kernel/... do not complain it's enumarted. I suspect you could do a crude test by doing something like cat /dev/ttyS0 > /dev/null If that barfs then rxtx wont enumerate the port. hmm looking at your question again, I suspect it's a lockfile problem. This is documented in INSTALL with the source. Its easy enough to test this too.. touch /var/lock/testingrxtxlockfiles && rm -f /var/lock/testingrxtxlockfiles If you are not in the right group it will bail. Root will work regardless. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 12:37:56 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 12:37:56 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> Message-ID: <1139341076.8145.11.camel@zd7280> Exactly which ports does rxtx attempt to put into the list ? /dev/* or /dev/tty* or /dev/tty[0-9[0-9] ? or /dev/ttyS* ? For the record, only /dev/ttyUSB0 is a valid port on the machine I am presently on. Will this be a problem ? On Tue, 2006-02-07 at 12:20 -0700, Trent Jarvi wrote: > This is documented in INSTALL with the source. > I was wondering where that file was. I will download source and dig it up. Thanks. -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 12:51:09 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 12:51:09 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139341076.8145.11.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: On Tue, 7 Feb 2006, Kim Lux wrote: > > Exactly which ports does rxtx attempt to put into the list ? /dev/* > or /dev/tty* or /dev/tty[0-9[0-9] ? or /dev/ttyS* ? > > For the record, only /dev/ttyUSB0 is a valid port on the machine I am > presently on. Will this be a problem ? > > > On Tue, 2006-02-07 at 12:20 -0700, Trent Jarvi wrote: >> This is documented in INSTALL with the source. >> > I was wondering where that file was. I will download source and dig it > up. > > Thanks. > Hmm I'm looking at pre17 so this may have changed. (its just what I have on this machine) if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA" // for the IPAQs }; CandidatePortPrefixes=Temp; } So you may need to add "ttyUSB" to that list. RXTX used to enumerate _everything_ see if(osName.equals("Linux-all-ports") But it became less than practical. This is all in RXTXCommDriver.java hmm I just did a cvs update. if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have to get your fingers into the code. We aim for sane defaults. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 13:06:45 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 13:06:45 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139342805.8145.22.camel@zd7280> On Tue, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > Hmm I'm looking at pre17 so this may have changed. (its just what I have > on this machine) > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA" // for the IPAQs > }; > CandidatePortPrefixes=Temp; > } > > > So you may need to add "ttyUSB" to that list. RXTX used to enumerate > _everything_ see if(osName.equals("Linux-all-ports") But it became less > than practical. > > This is all in RXTXCommDriver.java > > hmm I just did a cvs update. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have > to get your fingers into the code. We aim for sane defaults. Excellent. Thanks for taking the time. -- Kim Lux, Diesel Research Inc. From ideiglenes1 at freemail.hu Tue Feb 7 13:53:39 2006 From: ideiglenes1 at freemail.hu (--) Date: Tue, 07 Feb 2006 21:53:39 +0100 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139345619.22534.2.camel@localhost> Hi! I use this code to get all the extra Linux devices. :) if ("Linux".equals(System.getProperty("os.name"))) { System.setProperty("os.name","Linux-all-ports"); } driver = new RXTXCommDriver(); On k, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > On Tue, 7 Feb 2006, Kim Lux wrote: > > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have > to get your fingers into the code. We aim for sane defaults. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From matt.higgins at gmail.com Tue Feb 7 13:45:54 2006 From: matt.higgins at gmail.com (Matt Higgins) Date: Tue, 7 Feb 2006 15:45:54 -0500 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> Message-ID: <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> Sweet this is exactly what I needed. I was searching the archives through marc.theamisgroup they only have archives back to 1/3/05. Should have hit the mailman archive! Thanks a lot! On 2/7/06, Brian Schlining wrote: > > Hi Matt > > The following code works fine on Linux but I never see any data when run > on Windows. This is a cut and paste from the SimpleRead example. > I am attempting to read data from a bar code scanner. I can fire up > HyperTermianl on windows and see that the device is working properly as I > see the barcodes are scanned and echoed back to the terminal. However when I > run the app I don't see any data. It is however associating with the com > port as the informational bits print fine? > > > You're not the only one whose had this problem, I don't know if Trent has > addressed this is the latest release of RXTX but there is a workaround. > Here's the recent thread from the RXTX mailing list regarding this issues: > > Thanasis Delenikas tdelenik at gmail.com > Wed Jan 18 13:56:23 MST 2006 > > * Previous message: [Rxtx] Re: More close() performance fixes > * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] > > Hi all. > (I've subscribed again from my other email account). > > Trent, > > You are right. Linux *always* works, no matter what flow control you set. > Windows *works only* with hardware flow control (I haven't tested what > happens with software XON/XOFF flow control). > > I assume (but I am not certain) that even with no flow control at all, all > platforms should work. Without flow control, you have the risk of bumping > into overflow or framing errors, but that's your (the end programmer, I > mean) problem. > > >From my side, I shouldn't be working without flow control. That was a bug > too... It was some code forgotten from the old times, when I used to work > with phone emulation drivers which didn't support flow control. The > correct > way is to have some flow control enabled and that's why I suppose this is > a > low-severity bug for RxTx. > > I have no idea which platform shows the correct behaviour, since > my knowledge about Linux and the inner workings of these low-level i/o > operations is limited. > > Regards, > Thanasis Delenikas. > > > > > Message: 2 > > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > > From: Trent Jarvi > > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > > To: RXTX Developers and Users > > Message-ID: > > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > > > Hi all, > > > > > > Trent, I have found something. > > > I read your comment about flow control, so I experimented a bit. > > > > > > If you remember, in my sample program I've used no flow control at all > ( > > i.e. > > > Java constant FLOWCONTROL_NONE). > > > > > > Now, during testing, I've switch to hardware inbound flow control (i.e > . > > Java > > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > > beautifully! > > > > > > I think I will switch to H/W flow control and test things for a while, > > but > > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > > > > > Hi Thanasis, > > > > I'm fairly sure you have identified a bug. I would not worry too much > > about what Sun CommAPI w32 defaults are. I think they did more or less > > whatever the port opened with. Just a guess. Linux tries to stomp on > > ports so they are all the same. > > > > So this started out with Linux worked, Windows XP/.. did not as I > recall. > > Something is wrong in rxtx. Do I understand this right? > > > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > > > Perhaps there is something Wayne or I did not understand when we wrote > > that code. I wasnt programming back in the BBS days so modems are not > my > > thing. I have a few questions. > > > > Is the above matrix confirmed by observation? > > Linux just always worked? > > Which one _should_ work? I'm guessing modems work with hardware flow > > control. I'll have to dig around. > > > > The windows flow control changes a couple things with hardware flow > > control. Following the w32 API documentation is confusing sometimes. > > But it looks like Linux could have a bug too. > > Cheers > > Brian Schlining > Software Engineer > http://www.mbari.org > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/9c989144/attachment-0027.html From tjarvi at qbang.org Tue Feb 7 14:06:14 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 14:06:14 -0700 (MST) Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> Message-ID: >> >> You're not the only one whose had this problem, I don't know if Trent has >> addressed this is the latest release of RXTX but there is a workaround. >> Here's the recent thread from the RXTX mailing list regarding this issues: >> I have not. I expect to have access to some test equipment next month and I'll go through all of this. I really don't know whats going on and I need a gold standard. I thought maybe linux was autodetecting the flow control. Your observations would certainly be welcome. I need to talk to Russell King and see what he is doing. Until then I'd just be toying around over a loopback as usual. This is very high on the list though. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 17:25:05 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 17:25:05 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139358305.17994.2.camel@zd7280> My application now works. I installed the libraries and jar from 2.1-7 (Final). portlist.hasMoreElements is no longer false. The application finds the port for /dev/ttyUSB0. Thanks for your help, Trent (et al) Sorry I bothered you with this. Next time I will look in the source first. I didn't think it was an rxtx issue, I thought it was a Linux setup issue . On Tue, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > Hmm I'm looking at pre17 so this may have changed. (its just what I > have > on this machine) > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux > Serial Ports > "ttySA" // for the > IPAQs > }; > > CandidatePortPrefixes=Temp; > } > > > So you may need to add "ttyUSB" to that list. RXTX used to enumerate > _everything_ see if(osName.equals("Linux-all-ports") But it became > less > than practical. > > This is all in RXTXCommDriver.java > > hmm I just did a cvs update. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux > Serial Ports > "ttySA", // for the > IPAQs > "ttyUSB" // for USB > frobs > }; > > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you > have > to get your fingers into the code. We aim for sane defaults. -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 19:21:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 19:21:54 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139358305.17994.2.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> <1139358305.17994.2.camel@zd7280> Message-ID: >Sorry I bothered you with this. Next time I will look in the source >first. I didn't think it was an rxtx issue, I thought it was a Linux >setup issue . Why would you be sorry? I would have done the same. I'm glad it's working :) -- Trent Jarvi tjarvi at qbang.org From tma at mail.island.net Wed Feb 8 13:39:35 2006 From: tma at mail.island.net (Tom Alldread) Date: Wed, 08 Feb 2006 12:39:35 -0800 Subject: [Rxtx] Win32/Linux Serial Port Data Dropouts In-Reply-To: <200602060702.k167255O007882@www.qbang.org> References: <200602060702.k167255O007882@www.qbang.org> Message-ID: <43EA5707.4020200@mail.island.net> Greetings Folks at RXTX: During the last couple of months I have been alternately testing with javax.comm 2 and RXTX 2.1 under Windows XP and CommApi 3 and RXTX 2.1 under Suse 10.0 Linux. In the process I have learned a little about java multi-threading under NetBeans 5 with Profiler. My java (jdk 1.5_06) application is used for data acquisition and provides a graphical display of A-D conversion data received from a 56KBaud serial port. The actual data throughput is about 10KBaud thus it is well below the speed of the port. I use hardware RTS/CTS flow control which can stall the data acquisition sample rate if necessary. This ensures the display computer has the ability to slow the data acquisition rate should it become too busy to accept the regular data flow. Both the serial port buffer and the java read buffer are set at 16KB. Usually the data transfers into the java read buffer are less than 100 bytes unless the data acquisition is recovering from a stall. The data flow normally hesitates after each 5 KB block as a continue command is needed from the display computer to start the drawing of a new graphics display line. Separate threads have been provided for the serial port event monitoring and data processing. The serial port event thread has been given the maximum priority and data processing thread the minimum priority provided by java. Thread yield statements have been placed within all data processing while/for loops as an effort to ensure quick access to CPU cycles for the serial port event thread. I have found that short data transmissions are essentially error free but occasional dropouts occur with continuous data flow especially under Windows XP. ....................................................................................................................................................................................... Linux results: I am happy to report that RXTX 2.1 appears to work very well under Linux although I did notice some errors when the screen savers were running with my dual monitors. I believe this is a local problem associated with my dual graphics which needs further attention. The recent CommApi 3 Linux release from Sun did not work at all with my program. It seemed to send commands out OK but did not receive any data. Although the serial port event triggered the ISR, the input stream appeared filled with nulls and thus did not contain any data. As my understanding is that CommApi 3 was tested with a Red Hat distribution of Linux I wonder if this problem is distro dependent? Although somewhat off topic here I wonder if anyone reading this has had similar experience? .................................................................................................................................................................................. Windows XP results: There are problems with occasional data dropouts which become more frequent as the sampling rate is increased or if the computer becomes busy with other duties. The dropouts typically consist of a half dozen byte block of lost data. It appears the lost bytes never get added to the java input stream. There has not been any indication of garbled data, overruns or framing errors which suggests the UART communications remains solid. Using javax.comm 2 I found that the setting of SerialPort 'enableReceiveThreshold' to 40 and 'enableReceiveTimeout' of 100mS reduced the dropouts error rate significantly. I found that I could not get RXTX 2.1 to function with the aforementioned threshold and timeout settings. The javax.comm 2 interface is consequently performing better for me under Windows than RXTX 2.1. I wonder if anyone here has any suggestions as to what I might try to improve RXTX 2.1? Although my settings are the same as under Suse 10.0, RXTX 2.1 performs much better for me under Linux than any of the alternatives that I have tried under Windows XP . ............................................................................................................................................................................... I would like to establish, based on the experience of others, if I have reached the normally expected performance limit of java serial port communications? Should I expect to achieve virtually error free serial port data input from a continuous stream under Windows XP java software? I am considering changing my protocol to packets with error checking if necessary but would like to know if the dropout problems I am experiencing are typical or not before I take this rather work intensive plunge. Many thanks in advance for any help! Best Regards, Tom Alldread -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.375 / Virus Database: 267.15.2/253 - Release Date: 2006-02-07 From jlaxson at mac.com Wed Feb 8 23:56:48 2006 From: jlaxson at mac.com (John Laxson) Date: Thu, 9 Feb 2006 00:56:48 -0600 Subject: [Rxtx] PortInUseException: Unknown Application on OSX Message-ID: Hi, I've been trying to get RXTX 2.1.7 going on Mac OS X for a while here, and am running up into a wall here. I've tried with pre- compiled and the source version and get the same problem, a gnu.io.PortInUseException: Unknown Application. I have run the fixperms script included with the source distribution, and id shows me as a member of the uucp group, and permissions on /var/spool/uucp are 775 root:uucp. Running a test program (included at the bottom for clarity) lets me enumerate all the serial ports correctly, but trying to open any of them gives the PortInUseException. If it helps, when I try to open a port that's set to make an outgoing bluetooth connection, there is no delay and no connection attempt at all. Thanks, John Laxson PS: The documentation wiki on qbang.org shows 404, and has for a few days now. My test code: public static void main(String[] args) { SerialPort serialPort; try { Enumeration e = CommPortIdentifier.getPortIdentifiers(); CommPortIdentifier ident; while (e.hasMoreElements()) { ident = (CommPortIdentifier)e.nextElement(); System.out.println(ident.getName()); } ident = CommPortIdentifier.getPortIdentifier("/dev/cu.modem"); serialPort = (SerialPort) ident.open("Me", 5000); } catch (Exception e) { e.printStackTrace(); } } From rajesh.invincible at gmail.com Thu Feb 9 03:39:38 2006 From: rajesh.invincible at gmail.com (Rajesh N) Date: Thu, 9 Feb 2006 16:09:38 +0530 Subject: [Rxtx] Re: Move .java Files in gnu.io filesystem hierarchy - Maven (2) In-Reply-To: <43DF21D2.7090200@ngi.it> References: <43DF21D2.7090200@ngi.it> Message-ID: <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Can anybody tell me how to overcome these EXCEPTIONS I AM WORKING ON SERIAL COMMN IN JAVA ON LINUX. 1. " NOT ALL PARAMETERS SUPPORTED BY THE KERNEL" This i came across the following statement inmy prog. SerialP is A SerialPort object SerialP.setSerialPortParams(9600(BAUDRATE),DATABITS_8,STOPBITS_1,PARITY_NONE) 2. NullPointer Exception at Event Dispatch Now i have checked all my object references for a null reference but i found none i have put up my entire code in try catch blocks but still I AM UNABLE TO CATCH THIS EXCEPTION AND HENCE MY APPLICATION CLOSES HOW DOES THESE GO? PLEASE HELP ME IT IS URGENTTTTTTTTTTTTTTTT yours sincerely RAJESH On 1/31/06, Fabio Frumento wrote: > Hi Xavier, > > I don't know maven at all but the directory hierarchy listed buy Trent > is fine for me... > > I'll take a look to maven, it seems an interesting project > > Regards > > Fabio Frumento > > Trent Jarvi wrote: > > On Tue, 31 Jan 2006, Xavier Frisaye wrote: > > > >> Hi all, > >> > >> If you are going to rearrange the src folder, i will propose to use > >> maven 2 and follow its directory structure > >> > (http://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html). > >> > >> Maven 2 simplify java project and give a standard way to make projects > >> (http://maven.apache.org/). > >> We are using it for internal projects and we are very satisfied. > >> > >> Is anybody interested? > >> > >> I'm not an expert in maven 2 (yet) but i'm agree to help using it if > >> you choose to make so. > >> > > > > so this would be: > > > > rxtx-devel/src/main/java/gnu.io > > rxtx-devel/src/test/java/ManIwish.java > > > > I don't use IDEs very much so I'll let others comment. But I don't see > > a problem with that. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Thu Feb 9 09:50:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 9 Feb 2006 09:50:31 -0700 (MST) Subject: [Rxtx] Re: Move .java Files in gnu.io filesystem hierarchy - Maven (2) In-Reply-To: <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Message-ID: On Thu, 9 Feb 2006, Rajesh N wrote: > Can anybody tell me how to overcome these EXCEPTIONS > I AM WORKING ON SERIAL COMMN IN JAVA ON LINUX. > > 1. " NOT ALL PARAMETERS SUPPORTED BY THE KERNEL" > > This i came across the following statement inmy prog. > SerialP is A SerialPort object > SerialP.setSerialPortParams(9600(BAUDRATE),DATABITS_8,STOPBITS_1,PARITY_NONE) > Strange. The parameters you use are the same the port should open with by default. Could you paste the actual exception you are getting? I don't see that in the rxtx source. Also it would help to know the rxtx version. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Fri Feb 10 15:29:05 2006 From: lux at diesel-research.com (Kim Lux) Date: Fri, 10 Feb 2006 15:29:05 -0700 Subject: [Rxtx] One serial port object for both sending and receiving ? Message-ID: <1139610545.18177.4.camel@zd7280> Is it OK to use one SerialPort ojbect (ex Serial Port serialPort;) and use it for both sending and receiving ? For example: ======================================================================== static SerialPort serialPort = null; static OutputStream serialOut = null; static InputStream serialIn = null; // assign it to an outputStream for use try{ serialOut = serialPort.getOutputStream(); System.out.println("Serial output stream has been assigned."); }//try catch(IOException e) { System.out.println("Error: Couldn't assign output stream to serial port."); }//catch //assign it to an inputStream for use try{ serialIn = serialPort.getInputStream(); System.out.println("Serial input stream has been assigned."); }//try catch(IOException e) { System.out.println("Error: Couldn't assign input stream to serial port."); }//catch ======================================================================== -- Kim Lux, Diesel Research Inc. From lux at diesel-research.com Fri Feb 10 21:23:00 2006 From: lux at diesel-research.com (Kim Lux) Date: Fri, 10 Feb 2006 21:23:00 -0700 Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Message-ID: <1139631780.23882.10.camel@zd7280> I've got a problem receiving chars with my version of serialRead, written in an SWT GUI. I had a Java pro have a good look at my code and he can't see anything wrong with it. I can send chars fine. When I receive a char the cpu usage for the app goes to 100% and the code in the serial event handler doesn't get executed. The instructions on the Java Comm Serial API How-To for Linux page state that I must install javacomm. Is that true ? Everything builds without it and I can send chars on rxtx just fine, but I can't receive them. Could this be the problem ? I downloaded and installed javacomm. I was not able to add "Driver=gnuio.RXTXCommDriver to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 installed in /usr/java/jre1.5.0_05. I added comm.jar to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext to the library paths. Is this OK ? Does it matter that I am receiving on /dev/ttyUSB0 ? Thanks. -- Kim Lux, Diesel Research Inc. From lunareclipse03 at web.de Sat Feb 11 09:44:46 2006 From: lunareclipse03 at web.de (lunareclipse03@web.de) Date: Sat, 11 Feb 2006 17:44:46 +0100 Subject: [Rxtx] Question about Serial I/O under Win32 Message-ID: <662084330@web.de> Hello everybody, I have a strange problem with a piece of code I made for myself. No, this is not really concerning rxtx, but nevertheless I post this to the list, hoping that some of you can help me. I've written two libraries, one for linux and one for win32. The linux port works quite well, I can send / receive faxes and / or replay voice messages over the telephone line using a voice modem. But the win32 port of the library causes some trouble. If, for example, I send out a fax with a certain modem under linux, it works well. The fax is complete when it comes out of the fax machine. If I then use the same modem to send out a fax under win32, the fax coming out of the fax machine gets "stuck" halfways, but the sending modem thinks that transmission was ok and drops the connection. The answering fax machine then gives me "error while receiving." The "upper layer" java code MUST be right, because if I do the same thing under linux (using the linux library), everything is alright. Now I have to ask: Can somebody please help me out with this??!? Could it be the case that some kind of flow control or COMMTIMEOUTS setting causes this behaviour? I set flow control to RTS/CTS before sending out a fax. How can I DISABLE flow control? Or what do you think? Can something else cause this problems? Thank you all for your time and PLEASE write back soon. Regards, --Sven Ahlemann Am Waldrand 31 45721 Haltern am See Germany ______________________________________________________________ Verschicken Sie romantische, coole und witzige Bilder per SMS! Jetzt bei WEB.DE FreeMail: http://f.web.de/?mc=021193 From lux at diesel-research.com Sat Feb 11 10:06:52 2006 From: lux at diesel-research.com (Kim Lux) Date: Sat, 11 Feb 2006 10:06:52 -0700 Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: <1139631780.23882.10.camel@zd7280> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> <1139631780.23882.10.camel@zd7280> Message-ID: <1139677612.3431.5.camel@zd7280> More on this problem. I copied and pasted simpleRead into a console based Eclipse project and I've got the same result, except that cpu usage doesn't go to 100%. I'm beginning to think there is an issue in rxtx. My imports for simpleRead are: ============================ import gnu.io.*; import java.util.*; //import javax.comm.*; import java.io.*; =========================== Any ideas ? I am trying to read from /dev/ttyUSB0 using a serial to USB adapter which has worked well with minicom and gtkterm. Thanks. On Fri, 2006-02-10 at 21:23 -0700, Kim Lux wrote: > I've got a problem receiving chars with my version of serialRead, > written in an SWT GUI. > > I had a Java pro have a good look at my code and he can't see anything > wrong with it. > > I can send chars fine. When I receive a char the cpu usage for the app > goes to 100% and the code in the serial event handler doesn't get > executed. > > The instructions on the Java Comm Serial API How-To for Linux page state > that I must install javacomm. Is that true ? Everything builds without > it and I can send chars on rxtx just fine, but I can't receive them. > Could this be the problem ? > > I downloaded and installed javacomm. I was not able to add > "Driver=gnuio.RXTXCommDriver > to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not > have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 > installed in /usr/java/jre1.5.0_05. I added comm.jar > to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext > to the library paths. Is this OK ? > > Does it matter that I am receiving on /dev/ttyUSB0 ? > > Thanks. > -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Sun Feb 12 21:01:33 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:01:33 -0700 (MST) Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: <1139677612.3431.5.camel@zd7280> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> <1139631780.23882.10.camel@zd7280> <1139677612.3431.5.camel@zd7280> Message-ID: I suspect what is happening is the select() is breaking out in the native code but the driver does not have support for notifying there are X bytes available. On some traditional Unix based systems, the only way you know data is available is the fd status changes and do an FIORDCHK ioctl. Or perhaps the only thing you can know is the fd status changed. It would take reading through the kernel driver code to know for sure. So on USB, depending upon the driver, the same may need to be done or the driver improved a bit if possible to support. Polling reads will also work but don't use the event driven model of CommAPI which isnt acceptable in the long run. The 100% cpu usage can then be explained because select no longer blocks until the data is read; the eventLoop spins loose. You can put a well placed sleep but rxtx only expects those are needed when it knows data is available. This may not be a super simple thing to understand and fix. I do have ideas to get you started. I'm going to be short on time the next couple weeks. I expect to put some good time in and answer some other questions I saw around the 25th. For now, I'd look at the following and go from there with the hints I've given. JNIEXPORT jint JNICALL RXTXPort(nativeavailable)( JNIEnv *env, jobject jobj ) { int fd = get_java_var( env, jobj,"fd","I" ); int result; /* char message[80]; ENTER( "RXTXPort:nativeavailable" ); On SCO OpenServer FIONREAD always fails for serial devices, so try ioctl FIORDCHK instead; will only tell us whether bytes are available, not how many, but better than nothing. This turns out to be true on Solaris also. taj. */ #ifdef FIORDCHK /* __unixware__ __sun__ probably others */ result = ioctl(fd, FIORDCHK, 0); #else if( ioctl( fd, FIONREAD, &result ) < 0 ) { goto fail; } #endif /* FIORDCHK */ On Sat, 11 Feb 2006, Kim Lux wrote: > > More on this problem. I copied and pasted simpleRead into a console > based Eclipse project and I've got the same result, except that cpu > usage doesn't go to 100%. I'm beginning to think there is an issue in > rxtx. > > My imports for simpleRead are: > > ============================ > import gnu.io.*; > import java.util.*; > //import javax.comm.*; > import java.io.*; > =========================== > > Any ideas ? I am trying to read from /dev/ttyUSB0 using a serial to > USB adapter which has worked well with minicom and gtkterm. > > Thanks. > > > > On Fri, 2006-02-10 at 21:23 -0700, Kim Lux wrote: >> I've got a problem receiving chars with my version of serialRead, >> written in an SWT GUI. >> >> I had a Java pro have a good look at my code and he can't see anything >> wrong with it. >> >> I can send chars fine. When I receive a char the cpu usage for the app >> goes to 100% and the code in the serial event handler doesn't get >> executed. >> >> The instructions on the Java Comm Serial API How-To for Linux page state >> that I must install javacomm. Is that true ? Everything builds without >> it and I can send chars on rxtx just fine, but I can't receive them. >> Could this be the problem ? >> >> I downloaded and installed javacomm. I was not able to add >> "Driver=gnuio.RXTXCommDriver >> to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not >> have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 >> installed in /usr/java/jre1.5.0_05. I added comm.jar >> to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext >> to the library paths. Is this OK ? >> >> Does it matter that I am receiving on /dev/ttyUSB0 ? >> >> Thanks. >> > From tjarvi at qbang.org Sun Feb 12 21:03:30 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:03:30 -0700 (MST) Subject: [Rxtx] One serial port object for both sending and receiving ? In-Reply-To: <1139610545.18177.4.camel@zd7280> References: <1139610545.18177.4.camel@zd7280> Message-ID: On Fri, 10 Feb 2006, Kim Lux wrote: > > Is it OK to use one SerialPort ojbect (ex Serial Port serialPort;) and > use it for both sending and receiving ? > > For example: > > ======================================================================== > static SerialPort serialPort = null; > static OutputStream serialOut = null; > static InputStream serialIn = null; > > > > > // assign it to an outputStream for use > try{ > serialOut = serialPort.getOutputStream(); > System.out.println("Serial output stream has been assigned."); > }//try > catch(IOException e) > { > System.out.println("Error: Couldn't assign output stream to serial > port."); > }//catch > > > //assign it to an inputStream for use > try{ > serialIn = serialPort.getInputStream(); > System.out.println("Serial input stream has been assigned."); > }//try > catch(IOException e) > { > System.out.println("Error: Couldn't assign input stream to serial > port."); > }//catch This should be fine. In fact trying to do it another way will probably not work as you will run into lockfile issues. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun Feb 12 21:13:13 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:13:13 -0700 (MST) Subject: [Rxtx] Question about Serial I/O under Win32 In-Reply-To: <662084330@web.de> References: <662084330@web.de> Message-ID: On Sat, 11 Feb 2006 lunareclipse03 at web.de wrote: > Hello everybody, > > I have a strange problem with a piece of code I made for myself. No, > this is not really concerning rxtx, but nevertheless I post this to the > list, hoping that some of you can help me. I've written two libraries, > one for linux and one for win32. The linux port works quite well, I can > send / receive faxes and / or replay voice messages over the telephone > line using a voice modem. But the win32 port of the library causes some > trouble. If, for example, I send out a fax with a certain modem under > linux, it works well. The fax is complete when it comes out of the fax > machine. If I then use the same modem to send out a fax under win32, the > fax coming out of the fax machine gets "stuck" halfways, but the sending > modem thinks that transmission was ok and drops the connection. The > answering fax machine then gives me "error while receiving." The "upper > layer" java code MUST be right, because if I do the same thing under > linux (using the linux library), everything is alright. Now I have to > ask: Can somebody please help me out with this??!? Could it be the case > that some kind of flow control or COMMTIMEOUTS setting causes this > behaviour? I set flow control to RTS/CTS before sending out a fax. How > can I DISABLE flow control? Or what do you think? Can something else > cause this problems? Thank you all for your time and PLEASE write back > soon. > Hi Sven I'm not too willing to talk about flow control at the low level until I confirm some things with test equipment later. It is not clear if you are using rxtx or writing your own native code. So I'm not sure how to answer much of this :) If you are wondering how to change the flow control using rxtx from java, The BlackBox example from Sun flips this back and forth. SerialPort.java in rxtx 2.1 uses the following: SerialPort.java: public static final int FLOWCONTROL_NONE =0; SerialPort.java: public static final int FLOWCONTROL_RTSCTS_IN =1; SerialPort.java: public static final int FLOWCONTROL_RTSCTS_OUT =2; SerialPort.java: public static final int FLOWCONTROL_XONXOFF_IN =4; SerialPort.java: public static final int FLOWCONTROL_XONXOFF_OUT=8; So if you set flowcontrol to RTSCTS, you can set it to NONE to turn it off. If you are looking for how to do it in native code, the rxtx Source is SerialImp.c (unix/linux/mac os x/w32) and termios.c (w32 only with SerialImp.c) You can track the code: SerialImp.c:JNIEXPORT void JNICALL RXTXPort(setflowcontrol)( JNIEnv *env, jobject jobj, jint flowmode ) termios.c:int tcgetattr( int fd, struct termios *s_termios ) termios.c:int tcsetattr( int fd, int when, struct termios *s_termios ) There may be a problem in the rxtx flow control code though. Rather than guess, I want to test this with a gold standard. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Feb 6 00:00:16 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 00:00:16 -0700 (MST) Subject: [Rxtx] wiki delay until tomorrow night. In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: On Sun, 5 Feb 2006, Trent Jarvi wrote: > On Sun, 5 Feb 2006, Kim Lux wrote: > >> usb ? Tell me more... I need that too. > > usb is a very proper design. Thats all it is. > Maybe rxtx could help usb. But it would start with helping bring back the community that was already there. It's not something I'd love to do but maybe its the right thing to do. It would probably take 2 years to do right. But maybe thats better than what we have now. I honestly don't know what IBM is doing which could just run over everything. Just some thoughts after some fine german wine. -- Trent Jarvi tjarvi at qbang.org From gadelavega at yahoo.com.ar Mon Feb 6 02:17:05 2006 From: gadelavega at yahoo.com.ar (Gonzalo A. de la Vega) Date: Mon, 06 Feb 2006 10:17:05 +0100 Subject: [Rxtx] Serial port ownership question In-Reply-To: References: <20060205113618.30274.qmail@web53501.mail.yahoo.com> <1139157422.4553.9.camel@zd7280> <1139158698.4936.9.camel@zd7280> Message-ID: <43E71411.4050402@yahoo.com.ar> On my Fedora Core 4: ls -l /dev/ttyS* crw-rw---- 1 root uucp 4, 64 Feb 6 2006 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Feb 6 2006 /dev/ttyS1 ... and: grep "ttyUSB" /etc/udev/rules.d/50-udev.rules KERNEL=="ttyUSB*", GROUP="uucp", MODE="0660" So anyone in the "uucp" group can use serial ports. On Gentoo the group is "tty". Trent Jarvi escribi?: > > > On Sun, 5 Feb 2006, Dr. Douglas Lyon wrote: > >> I can confirm that this is the case (only root ownership of >> serial ports, under fedora 4). >> Wow, what were they thinking?! >> - DL >> >>> I've found that the newer kernels have the serial ports owned by root. >>> For example, >>> >>> $ls -al /dev/tty* >>> crw-rw-rw- 1 root root 5, 0 Feb 5 02:06 /dev/tty >>> crw-rw---- 1 root root 4, 0 Feb 5 02:06 /dev/tty0 >>> crw------- 1 root root 4, 1 Feb 5 09:07 /dev/tty1 >>> crw-rw---- 1 root tty 4, 10 Feb 5 02:06 /dev/tty10 >>> crw-rw---- 1 root tty 4, 11 Feb 5 02:06 /dev/tty11 >>> ... > > > This is just not a problem jcp or such are going to solve. Its a > platform spitwad fight. But do look at pam. In fact thats what Sun > is doing too. Maybe Linux followed their lead.. I'm not a pam guy. > I've spent 16 hours trying to understand it but your users wont :) > > Solution? I have no clue. Its two tangent mentalities from my > perspective. > > -- > Trent Jarvi > tjarvi at qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mtnvega at yahoo.com.br Mon Feb 6 05:35:43 2006 From: mtnvega at yahoo.com.br (Luiz Jr) Date: Mon, 6 Feb 2006 12:35:43 +0000 (GMT) Subject: [Rxtx] Documentation Wiki In-Reply-To: <1139157422.4553.9.camel@zd7280> Message-ID: <20060206123543.57256.qmail@web53515.mail.yahoo.com> Hello, Thank you for you answer, but so the usage of the API is pretty much like the Java Communications Api? If yes, what version of the Java Comm Api? Thank you, Luiz A. Brandao Jr Kim Lux escreveu: On Sun, 2006-02-05 at 08:36 -0300, Luiz Jr wrote: > Hello, > > I want to start using the RXTX libraries, but I would to know how, > since I can not access the documentation wiki page I just started using them yesterday. Below is how I installed the libraries, if that helps. I used snippets of code from the SimpleWrite application here to get me going. http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html Instead of "import javax.comm.*;", use "import gnu.io.*;" which is gotten from RXTXcomm.jar, which you will need to include in your project references. I am working in Eclipse. BTW: there is no way to open a port without going through the port list and finding it. Maybe sometime in the future someone (me ?) will write a method called openSerialPort that allows the user to give a port identifier, such as "/dev/tty1" and return a port ready to use. It wouldn't take much to write that and it would save users a lot of code. Hope this helps. ======================================================================= 1) Figure out which java you are running, incase there is more than one installed. $ java -version java version "1.5.0_05" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_05-b05) Java HotSpot(TM) Client VM (build 1.5.0_05-b05, mixed mode, sharing) 2) Find all the jre directories and the one from which you are currently running. kfind (jre) 3) cd to that directory plus /lib/i386 cd /usr/java/jre1.5.0_05/lib/i386 4) Copy the library files (*.so) to that directory. cp /home/krlux/Desktop/'Java Controls'/rxtx-linux/bin/* . 5) Check that the copy was successful ls librxtx* librxtxI2C.so librxtxRaw.so librxtxSerial.so librxtxParallel.so librxtxRS485.so 6) cd to the /lib/ext directory for your java. cd /usr/java/jre1.5.0_05/lib/ext 7) Copy the Jar files there cp /home/krlux/Desktop/'Java Controls'/rxtx-linux/lib/ext/* . 8) Check that it was successful ls RXTX* RXTXcomm.jar Rxtx is now installed on your machine ready to use. =================================================================== -- Kim Lux, Diesel Research Inc. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx --------------------------------- Yahoo! Acesso Gr?tis - Internet r?pida e gr?tis. Instale o discador agora! -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/544aa403/attachment-0028.html From lyon at docjava.com Mon Feb 6 05:49:34 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 06 Feb 2006 07:49:34 -0500 Subject: [Rxtx] wiki delay until tomorrow night. In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: Hi All, I have often thought about USB drivers being needed. For example, the ironman watch will not interface to a mac (windows only). It is USB. My dymo label writer has no Java driver (native only). Etc. Most cheap web cameras are USB (and Java drivers go through JAI, if it supports the camera at all). The JAI code shows how sun did the USB drivers. You have to be a member of the jai project to download the source code. https://jai.dev.java.net has the jai distro. And then you are not allowed to redistribute it. However, we can all learn from it (if so inclined). Basically: cvs -d :pserver:lyon at cvs.dev.java.net:/cvs login cvs -d :pserver:lyon at cvs.dev.java.net:/cvs checkout jai-core You will need to user your own uid and pw to get in. The ant build has over 100 warnings from sun deprecations of its own code. You might say that they were hoisted on their own Picard ;) One interesting thing is that they support several platforms: linux-amd64 64-bit Linux-AMD64 linux-i586 32-bit Linux-x86 solaris-amd64 64-bit Solaris-AMD64 solaris-i586 32-bit Solaris-x86 solaris-sparc 32-bit Solaris-SPARC solaris-sparcv9 64-bit Solaris-SPARC windows-i586 32-bit Windows-x86 Thus, ant is used to provide a multi-platform native method distro. Neat. How do they do it? check this out: And: The core download does not contain any C source code (it was all pre-built). Basically, they are just copying .so and .dll files into build directories. I would love to see the C code for this...but Sun does not post it on the https://jai.dev.java.net site. I don't know why...Perhaps I missed it. - Doug >On Sun, 5 Feb 2006, Trent Jarvi wrote: > >>On Sun, 5 Feb 2006, Kim Lux wrote: >> >>>usb ? Tell me more... I need that too. >> >>usb is a very proper design. Thats all it is. >> > >Maybe rxtx could help usb. But it would start with helping bring >back the community that was already there. > >It's not something I'd love to do but maybe its the right thing to do. > >It would probably take 2 years to do right. But maybe thats better >than what we have now. > >I honestly don't know what IBM is doing which could just run over everything. > >Just some thoughts after some fine german wine. > >-- >Trent Jarvi >tjarvi at qbang.org > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tdelenik at gmail.com Mon Feb 6 05:56:32 2006 From: tdelenik at gmail.com (Thanasis Delenikas) Date: Mon, 6 Feb 2006 14:56:32 +0200 Subject: Fwd: [Rxtx] Documentation Wiki In-Reply-To: <1139157422.4553.9.camel@zd7280> References: <20060205113618.30274.qmail@web53501.mail.yahoo.com> <1139157422.4553.9.camel@zd7280> Message-ID: <310a1a930602060456t129f1dc6p5f2b908f13ab5a0b@mail.gmail.com> Hello all, Kim, this is a snippet from the code I use. The closest to directly opening a specific port without enumeration. << ... portId = CommPortIdentifier.getPortIdentifier(getPort()); serialPort = (SerialPort) portId.open("jSMSEngine", 1971); ... >> where getPort() return the string identifier of the port, i.e. "/dev/ttyS0" or "COM1" or whatever. Thanasis. ---------- Forwarded message ---------- From: Kim Lux Date: Feb 5, 2006 6:37 PM Subject: Re: [Rxtx] Documentation Wiki To: RXTX Developers and Users BTW: there is no way to open a port without going through the port list and finding it. Maybe sometime in the future someone (me ?) will write a method called openSerialPort that allows the user to give a port identifier, such as "/dev/tty1" and return a port ready to use. It wouldn't take much to write that and it would save users a lot of code. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/182ab5b8/attachment-0028.html From tjarvi at qbang.org Mon Feb 6 11:53:57 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 11:53:57 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: On Mon, 6 Feb 2006, Dr. Douglas Lyon wrote: > Hi All, > I have often thought about USB drivers being needed. > For example, the ironman watch will not interface > to a mac (windows only). It is USB. > My dymo label writer has no Java driver (native only). > Etc. > Most cheap web cameras are USB (and Java drivers go > through JAI, if it supports the camera at all). > The JAI code shows how sun did the USB drivers. > You have to be a member of the jai project to download > the source code. > https://jai.dev.java.net has the jai distro. > And then you are not allowed to redistribute it. However, > we can all learn from it (if so inclined). Basically: > cvs -d :pserver:lyon at cvs.dev.java.net:/cvs login > cvs -d :pserver:lyon at cvs.dev.java.net:/cvs checkout jai-core > You will need to user your own uid and pw to get in. > The ant build has over 100 warnings from sun deprecations > of its own code. > > You might say that they were hoisted on their own Picard ;) > > One interesting thing is that they support several platforms: > linux-amd64 64-bit Linux-AMD64 > linux-i586 32-bit Linux-x86 > solaris-amd64 64-bit Solaris-AMD64 > solaris-i586 32-bit Solaris-x86 > solaris-sparc 32-bit Solaris-SPARC > solaris-sparcv9 64-bit Solaris-SPARC > windows-i586 32-bit Windows-x86 > Thus, ant is used to provide a multi-platform native method distro. > Neat. > How do they do it? > check this out: > > > > > > > > > > > > > And: > > > > > > > > > > The core download does not contain any C source code (it was all pre-built). > Basically, they are just copying .so and .dll files into build directories. > > I would love to see the C code for this...but Sun does not post it on the > https://jai.dev.java.net site. > > I don't know why...Perhaps I missed it. > > - Doug > > I've looked at moving rxtx to Ant builds. I think that would help IDEs a great deal. I requested a evalutation desk copy the O'Reilly Ant book for some j2ee material I was teaching. http://www.oreilly.com/catalog/anttdg/ It has a one sentence mention of JNI. So there was not luck there. I saw that there is another Ant book that does mention JNI more. I can't find it now. Ant must be able to support it with extensions. http://ant.apache.org/manual/OptionalTasks/javah.html What the auto(break :) tools do in the rxtx build is 4 things really. 1) gcc compile flags 2) ld compile flags 3) config.h 4) compile flags for customizing rxtx (lockfiles, ...) See 1 All of this information except 4 can be static once obtained. So I'm not attached to the auto tools. If I could find an example of Ant being used for JNI code, I'd be one of the first to start moving that direction. Maybe someone saw an example someplace. The other thing we have not completed discussing is the directory structure. There is interest in making rxtx more IDE friendly. I get more mail about that off the list than how to install rxtx. And I see we have Ken Thompson in da house :) He is our trusted CVS maintainer and the guy that purchased the rxtx.org domain. Old community. We will need Ken for changing the directory structure of source. I would like to open up discussion about both of these as it is more than time. The problem is I have little experience with Ant and even less with IDEs. It would be nice if we could work with Eclipse and NetBeans. http://www.netbeans.org/ (sun and some community) http://www.eclipes.org (ibm,rhat,... perhaps more community) http://maven.apache.org/what-is-maven.html (apache. It is community) borland should sortof be here too but I think thats covered in eclipse. >From what I understand so far, we should morph rxtx to support those three maybe trusting apaches lead with maven. But I use vi. I have little to no clues beyond what people have fed me. Can we agree that thats the right direction to go? -- Trent Jarvi tjarvi at qbang.org From brian at mbari.org Mon Feb 6 14:57:50 2006 From: brian at mbari.org (Brian Schlining) Date: Mon, 6 Feb 2006 13:57:50 -0800 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> > The other thing we have not completed discussing is the directory > structure. There is interest in making rxtx more IDE friendly. I > get more mail about that off the list than how to install rxtx. > > And I see we have Ken Thompson in da house :) He is our trusted > CVS maintainer and the guy that purchased the rxtx.org domain. Old > community. We will need Ken for changing the directory structure of > source. > > I would like to open up discussion about both of these as it is > more than time. The problem is I have little experience with Ant > and even less with IDEs. It would be nice if we could work with > Eclipse and NetBeans. > > http://www.netbeans.org/ (sun and some community) > http://www.eclipes.org (ibm,rhat,... perhaps more community) > http://maven.apache.org/what-is-maven.html (apache. It is community) > borland should sortof be here too but I think thats covered in > eclipse. > >> From what I understand so far, we should morph rxtx to support >> those three > maybe trusting apaches lead with maven. But I use vi. I have > little to no clues beyond what people have fed me. > Maven likes the directory structure below for Java code. (From http:// maven.apache.org/guides/getting-started/index.html) This structure works fine with ant, netbeans, and eclipse. rxtx_root_directory `-- src |-- main | `-- java | `-- gnu | `-- io `-- test `-- java `-- gnu `-- io Brian Schlining Software Engineer http://www.mbari.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/d9451eba/attachment-0028.html From tjarvi at qbang.org Mon Feb 6 15:11:45 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 15:11:45 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: > rxtx_root_directory > `-- src > |-- main > | `-- java > | `-- gnu > | `-- io > `-- test > `-- java > `-- gnu > `-- io > >From what I understand this will just be good. For me it makes no difference. So lets do the rxtx thing. Let if fester for two weeks and if nobody objects, we will do it. I'm not doing this because I care. I'm doing this to eliminate much of my inbox. But test... man is rxtx lacking there in the community aspect. It is covered but not right. _maybe_ I can change that this year. -- Trent Jarvi tjarvi at qbang.org (cat hurding since 1997) From lux at diesel-research.com Mon Feb 6 21:38:49 2006 From: lux at diesel-research.com (Kim Lux) Date: Mon, 06 Feb 2006 21:38:49 -0700 Subject: [Rxtx] How can I use Lock Files with rxtx (in FC4) ? Message-ID: <1139287129.17031.3.camel@zd7280> I am now running an rxtx application on FC4. I am getting: ========================================================= check_group_uucp(): error testing lock file creation Error details: Permission denied check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL ========================================================= $ ls -al /var/lock total 32 drwxrwxr-x 4 root lock 4096 Feb 6 16:04 . drwxr-xr-x 24 root root 4096 Nov 14 01:19 .. drwx------ 2 root root 4096 Apr 27 2005 lvm drwxr-xr-x 2 root root 4096 Feb 6 16:04 subsys How do I fix this for regulator users ? -- Kim Lux, Diesel Research Inc. From dmarkman at mac.com Mon Feb 6 22:24:44 2006 From: dmarkman at mac.com (Dmitry Markman) Date: Tue, 7 Feb 2006 00:24:44 -0500 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: if I understands the issue right in order to be able to use ant for c/c++ compilation you have to install ant's cc task http://ant-contrib.sourceforge.net/cc.html it looks like it should work on mac os x (authors claim, that it's platform independent) but I never tested so all you have to do it's providing right command line for the gcc compiler On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: >> rxtx_root_directory >> `-- src >> |-- main >> | `-- java >> | `-- gnu >> | `-- io >> `-- test >> `-- java >> `-- gnu >> `-- io >> > > >> From what I understand this will just be good. > > For me it makes no difference. So lets do the rxtx thing. Let if > fester for two weeks and if nobody objects, we will do it. > > I'm not doing this because I care. I'm doing this to eliminate > much of my inbox. > > But test... man is rxtx lacking there in the community aspect. It > is covered but not right. _maybe_ I can change that this year. > > -- > Trent Jarvi > tjarvi at qbang.org > (cat hurding since 1997) > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx Dmitry Markman From lux at diesel-research.com Mon Feb 6 23:20:15 2006 From: lux at diesel-research.com (Kim Lux) Date: Mon, 06 Feb 2006 23:20:15 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? Message-ID: <1139293215.3689.4.camel@zd7280> I'm running the code below. portlist.hasMoreElements() is false. /dev has ports in it as listed below. What am I doing wrong ? ========================================================== // Step through the list of ports until we find one that matches // the one we are looking for. portList = CommPortIdentifier.getPortIdentifiers(); while(portList.hasMoreElements()) { portID = (CommPortIdentifier) portList.nextElement(); // if (portID.getName().equals("/dev/ttyUSB0")) { myTA.append("Serial port ttyUSB0 has been found\n"); break; }// if portID equals... }// End of while... ========================================================== ls -al /dev/tty* crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 ... crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 -- Kim Lux, Diesel Research Inc. From david.garnier at trusted-logic.com Tue Feb 7 00:46:30 2006 From: david.garnier at trusted-logic.com (David Garnier) Date: Tue, 07 Feb 2006 08:46:30 +0100 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: <43E85056.2090608@trusted-logic.com> Hello, I think that the make-based build process is fine as it is, apart from the location of the Java source files. It is true that putting the Java source in a directory structure that map 1-to-1 to the Java package structure is the norm and should make it easier for everyone to modify the Java source, with or without an IDE. Ant is a good tool, but in the RXTX case I fail to see the advantage of using it compared to the current make-based process. As Trent said, they are more pressing issues, like testing. Regards, David Dmitry Markman wrote: > if I understands the issue right > in order to be able to use ant for c/c++ compilation > you have to install ant's cc task > http://ant-contrib.sourceforge.net/cc.html > > it looks like it should work on mac os x > (authors claim, that it's platform independent) > but I never tested > > so all you have to do it's providing right command line > for the gcc compiler > > > > > On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: > >>> rxtx_root_directory >>> `-- src >>> |-- main >>> | `-- java >>> | `-- gnu >>> | `-- io >>> `-- test >>> `-- java >>> `-- gnu >>> `-- io >>> >> >> >>> From what I understand this will just be good. >> >> For me it makes no difference. So lets do the rxtx thing. Let if >> fester for two weeks and if nobody objects, we will do it. >> >> I'm not doing this because I care. I'm doing this to eliminate much >> of my inbox. >> >> But test... man is rxtx lacking there in the community aspect. It is >> covered but not right. _maybe_ I can change that this year. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> (cat hurding since 1997) From tjarvi at qbang.org Tue Feb 7 01:11:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 01:11:31 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <43E85056.2090608@trusted-logic.com> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: On Tue, 7 Feb 2006, David Garnier wrote: > Hello, > > I think that the make-based build process is fine as it is, apart from the location of the Java > source files. It is true that putting the Java source in a directory structure that map 1-to-1 to > the Java package structure is the norm and should make it easier for everyone to modify the Java > source, with or without an IDE. > > Ant is a good tool, but in the RXTX case I fail to see the advantage of using it compared to the > current make-based process. As Trent said, they are more pressing issues, like testing. > Hi David I have more experience with testing rxtx than I can talk about. But let it be known, rxtx has gone trough 100's of hours of testing. We are hobby folks interested in toys but there is more. rxtx has had some of the best guidance in the industry there. This is not an easy thing. I may be able to come back in a month from the other side of the corperate fence and help. I suspect the tests could just be made public but they are in a very unusual environment that just wont work in a wider sense. This is something I'll be trying to change. At one point it was agreed we could just make the results public so this isnt just noise.. There is interest and I think its safe to mention that much. The big problem with testing in the past is most of it is done with a loopback connection. So we *still* have major questions regarding things like flow control. rxtx talks to itself over a loopback and it works. regardless of right or wrong. This requires more thought to be done right. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Feb 7 02:46:34 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 02:46:34 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: > The big problem with testing in the past is most of it is done with a > loopback connection. So we *still* have major questions regarding things > like flow control. rxtx talks to itself over a loopback and it works. > regardless of right or wrong. With serial communication there are gold standards. ckermit is probably a definitive 'standard.' Maybe its possible to do ping/pong tests with ckermit? Is it scriptable? There are known issues in rxtx. Probably the worst is some threading issues regarding some JREs with multiple JNI threads setting java variables. Man did I get schooled there. Just switch the c functions to returning variables and things go away. Sometimes they work fine, sometimes they blow up. Without understanding everything, somehow rhat got it right and debian (and especially gentoo) grabbed kernel patches causing all sort of harm. Its not hard to fix once you understand whats going on but nearly impossible to track with a debugger. So I have a good idea what 2.1-8 will have outside of the IDE modifications. rxtx 2.1-7 is a release for everyone to sync with. Its not even as stable as -pre17 as far as I know - I ran no test suites. I'll be chasing it too. We just had so many contributions that it was time. It seriously broke internal scheduals but thats a great thing :) The other thing I want to do in 2.1-8 is automagic baud rates. It turns out lots of shops are doing really funky baud rates for things like automobile test equipment. It is possible but it requires a fair amount of change in the native code. Is anyone looking at this? -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Feb 7 02:57:21 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 07 Feb 2006 04:57:21 -0500 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <43E85056.2090608@trusted-logic.com> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: Hi All, I agree, testing is very important. The problem I have been trying to address is related to cross-platform testing and the robust nature of the installs. Typically, I visit 3 platforms to deploy my product, windows, linux and mac. A build is performed on each platform. The idea that you can build for many platforms from one copy the source code seems attractive. This should enable synchronized deployments of identical code. The question of how to achieve this goal remains open. As Trent mentioned, this is hard. Perhaps Ant will help here (but perhaps not). Ant does seem to help with running unit tests. However, it does not help with multi-platform tests. For that you need many machines and different operating environments. Toward that end, I have created a multi-platform test that can be run from web start, located at: http://show.docjava.com:8086/book/cgij/code/jnlp/serialPort.PortTest.jnlp This is interesting because many people in the community can run the test and we can improve the test, as time permits. No, it is not a perfect solution, however, the idea does help with multi-platform tests using many machines and different operating environments. If the group has a good test for a general serial port set-ups, i would be happy to deploy it, for general evaluation using web start. And as for ANT, it is just an idea. Not all my ideas are good ones! - Doug >Hello, > >I think that the make-based build process is fine as it is, apart >from the location of the Java >source files. It is true that putting the Java source in a directory >structure that map 1-to-1 to >the Java package structure is the norm and should make it easier for >everyone to modify the Java >source, with or without an IDE. > >Ant is a good tool, but in the RXTX case I fail to see the advantage >of using it compared to the >current make-based process. As Trent said, they are more pressing >issues, like testing. > >Regards, >David > >Dmitry Markman wrote: >> if I understands the issue right >> in order to be able to use ant for c/c++ compilation >> you have to install ant's cc task >> http://ant-contrib.sourceforge.net/cc.html >> >> it looks like it should work on mac os x >> (authors claim, that it's platform independent) >> but I never tested >> >> so all you have to do it's providing right command line >> for the gcc compiler >> >> >> >> >> On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: >> >>>> rxtx_root_directory >>>> `-- src >>>> |-- main >>>> | `-- java >>>> | `-- gnu >>>> | `-- io >>>> `-- test >>>> `-- java >>>> `-- gnu >>>> `-- io >>>> >>> >>> >>>> From what I understand this will just be good. >>> >>> For me it makes no difference. So lets do the rxtx thing. Let if >>> fester for two weeks and if nobody objects, we will do it. >>> >>> I'm not doing this because I care. I'm doing this to eliminate much >>> of my inbox. >>> >>> But test... man is rxtx lacking there in the community aspect. It is >>> covered but not right. _maybe_ I can change that this year. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> (cat hurding since 1997) > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From matt.higgins at gmail.com Tue Feb 7 08:28:34 2006 From: matt.higgins at gmail.com (Matt Higgins) Date: Tue, 7 Feb 2006 10:28:34 -0500 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final Message-ID: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? import java.io.*; import java.util.*; import gnu.io.*; public class MySimpleRead implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; public static void main(String[] args) { boolean portFound = false; String defaultPort = "COM1"; if (args.length > 0) { defaultPort = args[0]; } portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; MySimpleRead reader = new MySimpleRead(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } } public MySimpleRead() { try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) { e.printStackTrace(); } try { inputStream = serialPort.getInputStream(); } catch (IOException e) { e.printStackTrace(); } try { serialPort.addEventListener(this); } catch (TooManyListenersException e) { e.printStackTrace(); } try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { e.printStackTrace(); } System.out.println("Baud is " + serialPort.getBaudRate()); System.out.println("Bits is " + serialPort.getDataBits()); System.out.println("Stop is " + serialPort.getStopBits()); System.out.println("Par is " + serialPort.getParity()); serialPort.notifyOnDataAvailable(true); readThread = new Thread(this); readThread.start(); } public void run() { // Thread.sleep(20000); //} catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { System.out.println("An event occurred " + event.getEventType()); switch (event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: byte[] readBuffer = new byte[20]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } System.out.print(new String(readBuffer)); } catch (IOException e) {} break; } } } --------------- Result on windows ------------------------------ Stable Library ============================================================== Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port:: COM1 Baud is 9600 Bits is 8 Stop is 1 Par is 0 ----------------- End Results ----------------------------------------- ------------------ Result on Linux ----------------------------------- Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 Found port: /dev/ttyS0 Baud is 9600 Bits is 8 Stop is 1 Par is 0 An event occurred 1 043100066224 ------------------ End Results --------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/a1431630/attachment-0028.html From brian at mbari.org Tue Feb 7 09:48:37 2006 From: brian at mbari.org (Brian Schlining) Date: Tue, 7 Feb 2006 08:48:37 -0800 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> Message-ID: <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> Hi Matt > The following code works fine on Linux but I never see any data > when run on Windows. This is a cut and paste from the SimpleRead > example. > I am attempting to read data from a bar code scanner. I can fire > up HyperTermianl on windows and see that the device is working > properly as I see the barcodes are scanned and echoed back to the > terminal. However when I run the app I don't see any data. It is > however associating with the com port as the informational bits > print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. Cheers Brian Schlining Software Engineer http://www.mbari.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/16d07f37/attachment-0028.html From lux at diesel-research.com Tue Feb 7 11:59:58 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 11:59:58 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139293215.3689.4.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> Message-ID: <1139338798.8145.4.camel@zd7280> Any ideas on this ? Any reason why portList.hasMoreElements() should be false even though there are devices in /dev ? On Mon, 2006-02-06 at 23:20 -0700, Kim Lux wrote: > I'm running the code below. > > portlist.hasMoreElements() is false. > > /dev has ports in it as listed below. > > What am I doing wrong ? > > > ========================================================== > // Step through the list of ports until we find one that matches > // the one we are looking for. > > portList = CommPortIdentifier.getPortIdentifiers(); > > while(portList.hasMoreElements()) > { > portID = (CommPortIdentifier) portList.nextElement(); // > if (portID.getName().equals("/dev/ttyUSB0")) > { > myTA.append("Serial port ttyUSB0 has been found\n"); > break; > }// if portID equals... > }// End of while... > ========================================================== > > ls -al /dev/tty* > crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty > crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 > crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 > crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 > crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 > ... > crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 > crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 > crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 > > > -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 12:20:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 12:20:25 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139338798.8145.4.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> Message-ID: On Tue, 7 Feb 2006, Kim Lux wrote: > > Any ideas on this ? Any reason why portList.hasMoreElements() should be > false even though there are devices in /dev ? > > > On Mon, 2006-02-06 at 23:20 -0700, Kim Lux wrote: >> I'm running the code below. >> >> portlist.hasMoreElements() is false. >> >> /dev has ports in it as listed below. >> >> What am I doing wrong ? >> >> >> ========================================================== >> // Step through the list of ports until we find one that matches >> // the one we are looking for. >> >> portList = CommPortIdentifier.getPortIdentifiers(); >> >> while(portList.hasMoreElements()) >> { >> portID = (CommPortIdentifier) portList.nextElement(); // >> if (portID.getName().equals("/dev/ttyUSB0")) >> { >> myTA.append("Serial port ttyUSB0 has been found\n"); >> break; >> }// if portID equals... >> }// End of while... >> ========================================================== >> >> ls -al /dev/tty* >> crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty >> crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 >> crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 >> crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 >> crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 >> ... >> crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 >> crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 >> crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 >> >> >> > Hi Kim What rxtx does is try to open the port and do a timed out read. If the kernel/... do not complain it's enumarted. I suspect you could do a crude test by doing something like cat /dev/ttyS0 > /dev/null If that barfs then rxtx wont enumerate the port. hmm looking at your question again, I suspect it's a lockfile problem. This is documented in INSTALL with the source. Its easy enough to test this too.. touch /var/lock/testingrxtxlockfiles && rm -f /var/lock/testingrxtxlockfiles If you are not in the right group it will bail. Root will work regardless. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 12:37:56 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 12:37:56 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> Message-ID: <1139341076.8145.11.camel@zd7280> Exactly which ports does rxtx attempt to put into the list ? /dev/* or /dev/tty* or /dev/tty[0-9[0-9] ? or /dev/ttyS* ? For the record, only /dev/ttyUSB0 is a valid port on the machine I am presently on. Will this be a problem ? On Tue, 2006-02-07 at 12:20 -0700, Trent Jarvi wrote: > This is documented in INSTALL with the source. > I was wondering where that file was. I will download source and dig it up. Thanks. -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 12:51:09 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 12:51:09 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139341076.8145.11.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: On Tue, 7 Feb 2006, Kim Lux wrote: > > Exactly which ports does rxtx attempt to put into the list ? /dev/* > or /dev/tty* or /dev/tty[0-9[0-9] ? or /dev/ttyS* ? > > For the record, only /dev/ttyUSB0 is a valid port on the machine I am > presently on. Will this be a problem ? > > > On Tue, 2006-02-07 at 12:20 -0700, Trent Jarvi wrote: >> This is documented in INSTALL with the source. >> > I was wondering where that file was. I will download source and dig it > up. > > Thanks. > Hmm I'm looking at pre17 so this may have changed. (its just what I have on this machine) if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA" // for the IPAQs }; CandidatePortPrefixes=Temp; } So you may need to add "ttyUSB" to that list. RXTX used to enumerate _everything_ see if(osName.equals("Linux-all-ports") But it became less than practical. This is all in RXTXCommDriver.java hmm I just did a cvs update. if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have to get your fingers into the code. We aim for sane defaults. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 13:06:45 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 13:06:45 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139342805.8145.22.camel@zd7280> On Tue, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > Hmm I'm looking at pre17 so this may have changed. (its just what I have > on this machine) > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA" // for the IPAQs > }; > CandidatePortPrefixes=Temp; > } > > > So you may need to add "ttyUSB" to that list. RXTX used to enumerate > _everything_ see if(osName.equals("Linux-all-ports") But it became less > than practical. > > This is all in RXTXCommDriver.java > > hmm I just did a cvs update. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have > to get your fingers into the code. We aim for sane defaults. Excellent. Thanks for taking the time. -- Kim Lux, Diesel Research Inc. From ideiglenes1 at freemail.hu Tue Feb 7 13:53:39 2006 From: ideiglenes1 at freemail.hu (--) Date: Tue, 07 Feb 2006 21:53:39 +0100 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139345619.22534.2.camel@localhost> Hi! I use this code to get all the extra Linux devices. :) if ("Linux".equals(System.getProperty("os.name"))) { System.setProperty("os.name","Linux-all-ports"); } driver = new RXTXCommDriver(); On k, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > On Tue, 7 Feb 2006, Kim Lux wrote: > > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have > to get your fingers into the code. We aim for sane defaults. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From matt.higgins at gmail.com Tue Feb 7 13:45:54 2006 From: matt.higgins at gmail.com (Matt Higgins) Date: Tue, 7 Feb 2006 15:45:54 -0500 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> Message-ID: <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> Sweet this is exactly what I needed. I was searching the archives through marc.theamisgroup they only have archives back to 1/3/05. Should have hit the mailman archive! Thanks a lot! On 2/7/06, Brian Schlining wrote: > > Hi Matt > > The following code works fine on Linux but I never see any data when run > on Windows. This is a cut and paste from the SimpleRead example. > I am attempting to read data from a bar code scanner. I can fire up > HyperTermianl on windows and see that the device is working properly as I > see the barcodes are scanned and echoed back to the terminal. However when I > run the app I don't see any data. It is however associating with the com > port as the informational bits print fine? > > > You're not the only one whose had this problem, I don't know if Trent has > addressed this is the latest release of RXTX but there is a workaround. > Here's the recent thread from the RXTX mailing list regarding this issues: > > Thanasis Delenikas tdelenik at gmail.com > Wed Jan 18 13:56:23 MST 2006 > > * Previous message: [Rxtx] Re: More close() performance fixes > * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] > > Hi all. > (I've subscribed again from my other email account). > > Trent, > > You are right. Linux *always* works, no matter what flow control you set. > Windows *works only* with hardware flow control (I haven't tested what > happens with software XON/XOFF flow control). > > I assume (but I am not certain) that even with no flow control at all, all > platforms should work. Without flow control, you have the risk of bumping > into overflow or framing errors, but that's your (the end programmer, I > mean) problem. > > >From my side, I shouldn't be working without flow control. That was a bug > too... It was some code forgotten from the old times, when I used to work > with phone emulation drivers which didn't support flow control. The > correct > way is to have some flow control enabled and that's why I suppose this is > a > low-severity bug for RxTx. > > I have no idea which platform shows the correct behaviour, since > my knowledge about Linux and the inner workings of these low-level i/o > operations is limited. > > Regards, > Thanasis Delenikas. > > > > > Message: 2 > > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > > From: Trent Jarvi > > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > > To: RXTX Developers and Users > > Message-ID: > > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > > > Hi all, > > > > > > Trent, I have found something. > > > I read your comment about flow control, so I experimented a bit. > > > > > > If you remember, in my sample program I've used no flow control at all > ( > > i.e. > > > Java constant FLOWCONTROL_NONE). > > > > > > Now, during testing, I've switch to hardware inbound flow control (i.e > . > > Java > > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > > beautifully! > > > > > > I think I will switch to H/W flow control and test things for a while, > > but > > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > > > > > Hi Thanasis, > > > > I'm fairly sure you have identified a bug. I would not worry too much > > about what Sun CommAPI w32 defaults are. I think they did more or less > > whatever the port opened with. Just a guess. Linux tries to stomp on > > ports so they are all the same. > > > > So this started out with Linux worked, Windows XP/.. did not as I > recall. > > Something is wrong in rxtx. Do I understand this right? > > > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > > > Perhaps there is something Wayne or I did not understand when we wrote > > that code. I wasnt programming back in the BBS days so modems are not > my > > thing. I have a few questions. > > > > Is the above matrix confirmed by observation? > > Linux just always worked? > > Which one _should_ work? I'm guessing modems work with hardware flow > > control. I'll have to dig around. > > > > The windows flow control changes a couple things with hardware flow > > control. Following the w32 API documentation is confusing sometimes. > > But it looks like Linux could have a bug too. > > Cheers > > Brian Schlining > Software Engineer > http://www.mbari.org > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/9c989144/attachment-0028.html From tjarvi at qbang.org Tue Feb 7 14:06:14 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 14:06:14 -0700 (MST) Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> Message-ID: >> >> You're not the only one whose had this problem, I don't know if Trent has >> addressed this is the latest release of RXTX but there is a workaround. >> Here's the recent thread from the RXTX mailing list regarding this issues: >> I have not. I expect to have access to some test equipment next month and I'll go through all of this. I really don't know whats going on and I need a gold standard. I thought maybe linux was autodetecting the flow control. Your observations would certainly be welcome. I need to talk to Russell King and see what he is doing. Until then I'd just be toying around over a loopback as usual. This is very high on the list though. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 17:25:05 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 17:25:05 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139358305.17994.2.camel@zd7280> My application now works. I installed the libraries and jar from 2.1-7 (Final). portlist.hasMoreElements is no longer false. The application finds the port for /dev/ttyUSB0. Thanks for your help, Trent (et al) Sorry I bothered you with this. Next time I will look in the source first. I didn't think it was an rxtx issue, I thought it was a Linux setup issue . On Tue, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > Hmm I'm looking at pre17 so this may have changed. (its just what I > have > on this machine) > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux > Serial Ports > "ttySA" // for the > IPAQs > }; > > CandidatePortPrefixes=Temp; > } > > > So you may need to add "ttyUSB" to that list. RXTX used to enumerate > _everything_ see if(osName.equals("Linux-all-ports") But it became > less > than practical. > > This is all in RXTXCommDriver.java > > hmm I just did a cvs update. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux > Serial Ports > "ttySA", // for the > IPAQs > "ttyUSB" // for USB > frobs > }; > > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you > have > to get your fingers into the code. We aim for sane defaults. -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 19:21:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 19:21:54 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139358305.17994.2.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> <1139358305.17994.2.camel@zd7280> Message-ID: >Sorry I bothered you with this. Next time I will look in the source >first. I didn't think it was an rxtx issue, I thought it was a Linux >setup issue . Why would you be sorry? I would have done the same. I'm glad it's working :) -- Trent Jarvi tjarvi at qbang.org From tma at mail.island.net Wed Feb 8 13:39:35 2006 From: tma at mail.island.net (Tom Alldread) Date: Wed, 08 Feb 2006 12:39:35 -0800 Subject: [Rxtx] Win32/Linux Serial Port Data Dropouts In-Reply-To: <200602060702.k167255O007882@www.qbang.org> References: <200602060702.k167255O007882@www.qbang.org> Message-ID: <43EA5707.4020200@mail.island.net> Greetings Folks at RXTX: During the last couple of months I have been alternately testing with javax.comm 2 and RXTX 2.1 under Windows XP and CommApi 3 and RXTX 2.1 under Suse 10.0 Linux. In the process I have learned a little about java multi-threading under NetBeans 5 with Profiler. My java (jdk 1.5_06) application is used for data acquisition and provides a graphical display of A-D conversion data received from a 56KBaud serial port. The actual data throughput is about 10KBaud thus it is well below the speed of the port. I use hardware RTS/CTS flow control which can stall the data acquisition sample rate if necessary. This ensures the display computer has the ability to slow the data acquisition rate should it become too busy to accept the regular data flow. Both the serial port buffer and the java read buffer are set at 16KB. Usually the data transfers into the java read buffer are less than 100 bytes unless the data acquisition is recovering from a stall. The data flow normally hesitates after each 5 KB block as a continue command is needed from the display computer to start the drawing of a new graphics display line. Separate threads have been provided for the serial port event monitoring and data processing. The serial port event thread has been given the maximum priority and data processing thread the minimum priority provided by java. Thread yield statements have been placed within all data processing while/for loops as an effort to ensure quick access to CPU cycles for the serial port event thread. I have found that short data transmissions are essentially error free but occasional dropouts occur with continuous data flow especially under Windows XP. ....................................................................................................................................................................................... Linux results: I am happy to report that RXTX 2.1 appears to work very well under Linux although I did notice some errors when the screen savers were running with my dual monitors. I believe this is a local problem associated with my dual graphics which needs further attention. The recent CommApi 3 Linux release from Sun did not work at all with my program. It seemed to send commands out OK but did not receive any data. Although the serial port event triggered the ISR, the input stream appeared filled with nulls and thus did not contain any data. As my understanding is that CommApi 3 was tested with a Red Hat distribution of Linux I wonder if this problem is distro dependent? Although somewhat off topic here I wonder if anyone reading this has had similar experience? .................................................................................................................................................................................. Windows XP results: There are problems with occasional data dropouts which become more frequent as the sampling rate is increased or if the computer becomes busy with other duties. The dropouts typically consist of a half dozen byte block of lost data. It appears the lost bytes never get added to the java input stream. There has not been any indication of garbled data, overruns or framing errors which suggests the UART communications remains solid. Using javax.comm 2 I found that the setting of SerialPort 'enableReceiveThreshold' to 40 and 'enableReceiveTimeout' of 100mS reduced the dropouts error rate significantly. I found that I could not get RXTX 2.1 to function with the aforementioned threshold and timeout settings. The javax.comm 2 interface is consequently performing better for me under Windows than RXTX 2.1. I wonder if anyone here has any suggestions as to what I might try to improve RXTX 2.1? Although my settings are the same as under Suse 10.0, RXTX 2.1 performs much better for me under Linux than any of the alternatives that I have tried under Windows XP . ............................................................................................................................................................................... I would like to establish, based on the experience of others, if I have reached the normally expected performance limit of java serial port communications? Should I expect to achieve virtually error free serial port data input from a continuous stream under Windows XP java software? I am considering changing my protocol to packets with error checking if necessary but would like to know if the dropout problems I am experiencing are typical or not before I take this rather work intensive plunge. Many thanks in advance for any help! Best Regards, Tom Alldread -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.375 / Virus Database: 267.15.2/253 - Release Date: 2006-02-07 From jlaxson at mac.com Wed Feb 8 23:56:48 2006 From: jlaxson at mac.com (John Laxson) Date: Thu, 9 Feb 2006 00:56:48 -0600 Subject: [Rxtx] PortInUseException: Unknown Application on OSX Message-ID: Hi, I've been trying to get RXTX 2.1.7 going on Mac OS X for a while here, and am running up into a wall here. I've tried with pre- compiled and the source version and get the same problem, a gnu.io.PortInUseException: Unknown Application. I have run the fixperms script included with the source distribution, and id shows me as a member of the uucp group, and permissions on /var/spool/uucp are 775 root:uucp. Running a test program (included at the bottom for clarity) lets me enumerate all the serial ports correctly, but trying to open any of them gives the PortInUseException. If it helps, when I try to open a port that's set to make an outgoing bluetooth connection, there is no delay and no connection attempt at all. Thanks, John Laxson PS: The documentation wiki on qbang.org shows 404, and has for a few days now. My test code: public static void main(String[] args) { SerialPort serialPort; try { Enumeration e = CommPortIdentifier.getPortIdentifiers(); CommPortIdentifier ident; while (e.hasMoreElements()) { ident = (CommPortIdentifier)e.nextElement(); System.out.println(ident.getName()); } ident = CommPortIdentifier.getPortIdentifier("/dev/cu.modem"); serialPort = (SerialPort) ident.open("Me", 5000); } catch (Exception e) { e.printStackTrace(); } } From rajesh.invincible at gmail.com Thu Feb 9 03:39:38 2006 From: rajesh.invincible at gmail.com (Rajesh N) Date: Thu, 9 Feb 2006 16:09:38 +0530 Subject: [Rxtx] Re: Move .java Files in gnu.io filesystem hierarchy - Maven (2) In-Reply-To: <43DF21D2.7090200@ngi.it> References: <43DF21D2.7090200@ngi.it> Message-ID: <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Can anybody tell me how to overcome these EXCEPTIONS I AM WORKING ON SERIAL COMMN IN JAVA ON LINUX. 1. " NOT ALL PARAMETERS SUPPORTED BY THE KERNEL" This i came across the following statement inmy prog. SerialP is A SerialPort object SerialP.setSerialPortParams(9600(BAUDRATE),DATABITS_8,STOPBITS_1,PARITY_NONE) 2. NullPointer Exception at Event Dispatch Now i have checked all my object references for a null reference but i found none i have put up my entire code in try catch blocks but still I AM UNABLE TO CATCH THIS EXCEPTION AND HENCE MY APPLICATION CLOSES HOW DOES THESE GO? PLEASE HELP ME IT IS URGENTTTTTTTTTTTTTTTT yours sincerely RAJESH On 1/31/06, Fabio Frumento wrote: > Hi Xavier, > > I don't know maven at all but the directory hierarchy listed buy Trent > is fine for me... > > I'll take a look to maven, it seems an interesting project > > Regards > > Fabio Frumento > > Trent Jarvi wrote: > > On Tue, 31 Jan 2006, Xavier Frisaye wrote: > > > >> Hi all, > >> > >> If you are going to rearrange the src folder, i will propose to use > >> maven 2 and follow its directory structure > >> > (http://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html). > >> > >> Maven 2 simplify java project and give a standard way to make projects > >> (http://maven.apache.org/). > >> We are using it for internal projects and we are very satisfied. > >> > >> Is anybody interested? > >> > >> I'm not an expert in maven 2 (yet) but i'm agree to help using it if > >> you choose to make so. > >> > > > > so this would be: > > > > rxtx-devel/src/main/java/gnu.io > > rxtx-devel/src/test/java/ManIwish.java > > > > I don't use IDEs very much so I'll let others comment. But I don't see > > a problem with that. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Thu Feb 9 09:50:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 9 Feb 2006 09:50:31 -0700 (MST) Subject: [Rxtx] Re: Move .java Files in gnu.io filesystem hierarchy - Maven (2) In-Reply-To: <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Message-ID: On Thu, 9 Feb 2006, Rajesh N wrote: > Can anybody tell me how to overcome these EXCEPTIONS > I AM WORKING ON SERIAL COMMN IN JAVA ON LINUX. > > 1. " NOT ALL PARAMETERS SUPPORTED BY THE KERNEL" > > This i came across the following statement inmy prog. > SerialP is A SerialPort object > SerialP.setSerialPortParams(9600(BAUDRATE),DATABITS_8,STOPBITS_1,PARITY_NONE) > Strange. The parameters you use are the same the port should open with by default. Could you paste the actual exception you are getting? I don't see that in the rxtx source. Also it would help to know the rxtx version. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Fri Feb 10 15:29:05 2006 From: lux at diesel-research.com (Kim Lux) Date: Fri, 10 Feb 2006 15:29:05 -0700 Subject: [Rxtx] One serial port object for both sending and receiving ? Message-ID: <1139610545.18177.4.camel@zd7280> Is it OK to use one SerialPort ojbect (ex Serial Port serialPort;) and use it for both sending and receiving ? For example: ======================================================================== static SerialPort serialPort = null; static OutputStream serialOut = null; static InputStream serialIn = null; // assign it to an outputStream for use try{ serialOut = serialPort.getOutputStream(); System.out.println("Serial output stream has been assigned."); }//try catch(IOException e) { System.out.println("Error: Couldn't assign output stream to serial port."); }//catch //assign it to an inputStream for use try{ serialIn = serialPort.getInputStream(); System.out.println("Serial input stream has been assigned."); }//try catch(IOException e) { System.out.println("Error: Couldn't assign input stream to serial port."); }//catch ======================================================================== -- Kim Lux, Diesel Research Inc. From lux at diesel-research.com Fri Feb 10 21:23:00 2006 From: lux at diesel-research.com (Kim Lux) Date: Fri, 10 Feb 2006 21:23:00 -0700 Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Message-ID: <1139631780.23882.10.camel@zd7280> I've got a problem receiving chars with my version of serialRead, written in an SWT GUI. I had a Java pro have a good look at my code and he can't see anything wrong with it. I can send chars fine. When I receive a char the cpu usage for the app goes to 100% and the code in the serial event handler doesn't get executed. The instructions on the Java Comm Serial API How-To for Linux page state that I must install javacomm. Is that true ? Everything builds without it and I can send chars on rxtx just fine, but I can't receive them. Could this be the problem ? I downloaded and installed javacomm. I was not able to add "Driver=gnuio.RXTXCommDriver to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 installed in /usr/java/jre1.5.0_05. I added comm.jar to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext to the library paths. Is this OK ? Does it matter that I am receiving on /dev/ttyUSB0 ? Thanks. -- Kim Lux, Diesel Research Inc. From lunareclipse03 at web.de Sat Feb 11 09:44:46 2006 From: lunareclipse03 at web.de (lunareclipse03@web.de) Date: Sat, 11 Feb 2006 17:44:46 +0100 Subject: [Rxtx] Question about Serial I/O under Win32 Message-ID: <662084330@web.de> Hello everybody, I have a strange problem with a piece of code I made for myself. No, this is not really concerning rxtx, but nevertheless I post this to the list, hoping that some of you can help me. I've written two libraries, one for linux and one for win32. The linux port works quite well, I can send / receive faxes and / or replay voice messages over the telephone line using a voice modem. But the win32 port of the library causes some trouble. If, for example, I send out a fax with a certain modem under linux, it works well. The fax is complete when it comes out of the fax machine. If I then use the same modem to send out a fax under win32, the fax coming out of the fax machine gets "stuck" halfways, but the sending modem thinks that transmission was ok and drops the connection. The answering fax machine then gives me "error while receiving." The "upper layer" java code MUST be right, because if I do the same thing under linux (using the linux library), everything is alright. Now I have to ask: Can somebody please help me out with this??!? Could it be the case that some kind of flow control or COMMTIMEOUTS setting causes this behaviour? I set flow control to RTS/CTS before sending out a fax. How can I DISABLE flow control? Or what do you think? Can something else cause this problems? Thank you all for your time and PLEASE write back soon. Regards, --Sven Ahlemann Am Waldrand 31 45721 Haltern am See Germany ______________________________________________________________ Verschicken Sie romantische, coole und witzige Bilder per SMS! Jetzt bei WEB.DE FreeMail: http://f.web.de/?mc=021193 From lux at diesel-research.com Sat Feb 11 10:06:52 2006 From: lux at diesel-research.com (Kim Lux) Date: Sat, 11 Feb 2006 10:06:52 -0700 Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: <1139631780.23882.10.camel@zd7280> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> <1139631780.23882.10.camel@zd7280> Message-ID: <1139677612.3431.5.camel@zd7280> More on this problem. I copied and pasted simpleRead into a console based Eclipse project and I've got the same result, except that cpu usage doesn't go to 100%. I'm beginning to think there is an issue in rxtx. My imports for simpleRead are: ============================ import gnu.io.*; import java.util.*; //import javax.comm.*; import java.io.*; =========================== Any ideas ? I am trying to read from /dev/ttyUSB0 using a serial to USB adapter which has worked well with minicom and gtkterm. Thanks. On Fri, 2006-02-10 at 21:23 -0700, Kim Lux wrote: > I've got a problem receiving chars with my version of serialRead, > written in an SWT GUI. > > I had a Java pro have a good look at my code and he can't see anything > wrong with it. > > I can send chars fine. When I receive a char the cpu usage for the app > goes to 100% and the code in the serial event handler doesn't get > executed. > > The instructions on the Java Comm Serial API How-To for Linux page state > that I must install javacomm. Is that true ? Everything builds without > it and I can send chars on rxtx just fine, but I can't receive them. > Could this be the problem ? > > I downloaded and installed javacomm. I was not able to add > "Driver=gnuio.RXTXCommDriver > to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not > have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 > installed in /usr/java/jre1.5.0_05. I added comm.jar > to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext > to the library paths. Is this OK ? > > Does it matter that I am receiving on /dev/ttyUSB0 ? > > Thanks. > -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Sun Feb 12 21:01:33 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:01:33 -0700 (MST) Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: <1139677612.3431.5.camel@zd7280> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> <1139631780.23882.10.camel@zd7280> <1139677612.3431.5.camel@zd7280> Message-ID: I suspect what is happening is the select() is breaking out in the native code but the driver does not have support for notifying there are X bytes available. On some traditional Unix based systems, the only way you know data is available is the fd status changes and do an FIORDCHK ioctl. Or perhaps the only thing you can know is the fd status changed. It would take reading through the kernel driver code to know for sure. So on USB, depending upon the driver, the same may need to be done or the driver improved a bit if possible to support. Polling reads will also work but don't use the event driven model of CommAPI which isnt acceptable in the long run. The 100% cpu usage can then be explained because select no longer blocks until the data is read; the eventLoop spins loose. You can put a well placed sleep but rxtx only expects those are needed when it knows data is available. This may not be a super simple thing to understand and fix. I do have ideas to get you started. I'm going to be short on time the next couple weeks. I expect to put some good time in and answer some other questions I saw around the 25th. For now, I'd look at the following and go from there with the hints I've given. JNIEXPORT jint JNICALL RXTXPort(nativeavailable)( JNIEnv *env, jobject jobj ) { int fd = get_java_var( env, jobj,"fd","I" ); int result; /* char message[80]; ENTER( "RXTXPort:nativeavailable" ); On SCO OpenServer FIONREAD always fails for serial devices, so try ioctl FIORDCHK instead; will only tell us whether bytes are available, not how many, but better than nothing. This turns out to be true on Solaris also. taj. */ #ifdef FIORDCHK /* __unixware__ __sun__ probably others */ result = ioctl(fd, FIORDCHK, 0); #else if( ioctl( fd, FIONREAD, &result ) < 0 ) { goto fail; } #endif /* FIORDCHK */ On Sat, 11 Feb 2006, Kim Lux wrote: > > More on this problem. I copied and pasted simpleRead into a console > based Eclipse project and I've got the same result, except that cpu > usage doesn't go to 100%. I'm beginning to think there is an issue in > rxtx. > > My imports for simpleRead are: > > ============================ > import gnu.io.*; > import java.util.*; > //import javax.comm.*; > import java.io.*; > =========================== > > Any ideas ? I am trying to read from /dev/ttyUSB0 using a serial to > USB adapter which has worked well with minicom and gtkterm. > > Thanks. > > > > On Fri, 2006-02-10 at 21:23 -0700, Kim Lux wrote: >> I've got a problem receiving chars with my version of serialRead, >> written in an SWT GUI. >> >> I had a Java pro have a good look at my code and he can't see anything >> wrong with it. >> >> I can send chars fine. When I receive a char the cpu usage for the app >> goes to 100% and the code in the serial event handler doesn't get >> executed. >> >> The instructions on the Java Comm Serial API How-To for Linux page state >> that I must install javacomm. Is that true ? Everything builds without >> it and I can send chars on rxtx just fine, but I can't receive them. >> Could this be the problem ? >> >> I downloaded and installed javacomm. I was not able to add >> "Driver=gnuio.RXTXCommDriver >> to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not >> have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 >> installed in /usr/java/jre1.5.0_05. I added comm.jar >> to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext >> to the library paths. Is this OK ? >> >> Does it matter that I am receiving on /dev/ttyUSB0 ? >> >> Thanks. >> > From tjarvi at qbang.org Sun Feb 12 21:03:30 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:03:30 -0700 (MST) Subject: [Rxtx] One serial port object for both sending and receiving ? In-Reply-To: <1139610545.18177.4.camel@zd7280> References: <1139610545.18177.4.camel@zd7280> Message-ID: On Fri, 10 Feb 2006, Kim Lux wrote: > > Is it OK to use one SerialPort ojbect (ex Serial Port serialPort;) and > use it for both sending and receiving ? > > For example: > > ======================================================================== > static SerialPort serialPort = null; > static OutputStream serialOut = null; > static InputStream serialIn = null; > > > > > // assign it to an outputStream for use > try{ > serialOut = serialPort.getOutputStream(); > System.out.println("Serial output stream has been assigned."); > }//try > catch(IOException e) > { > System.out.println("Error: Couldn't assign output stream to serial > port."); > }//catch > > > //assign it to an inputStream for use > try{ > serialIn = serialPort.getInputStream(); > System.out.println("Serial input stream has been assigned."); > }//try > catch(IOException e) > { > System.out.println("Error: Couldn't assign input stream to serial > port."); > }//catch This should be fine. In fact trying to do it another way will probably not work as you will run into lockfile issues. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun Feb 12 21:13:13 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:13:13 -0700 (MST) Subject: [Rxtx] Question about Serial I/O under Win32 In-Reply-To: <662084330@web.de> References: <662084330@web.de> Message-ID: On Sat, 11 Feb 2006 lunareclipse03 at web.de wrote: > Hello everybody, > > I have a strange problem with a piece of code I made for myself. No, > this is not really concerning rxtx, but nevertheless I post this to the > list, hoping that some of you can help me. I've written two libraries, > one for linux and one for win32. The linux port works quite well, I can > send / receive faxes and / or replay voice messages over the telephone > line using a voice modem. But the win32 port of the library causes some > trouble. If, for example, I send out a fax with a certain modem under > linux, it works well. The fax is complete when it comes out of the fax > machine. If I then use the same modem to send out a fax under win32, the > fax coming out of the fax machine gets "stuck" halfways, but the sending > modem thinks that transmission was ok and drops the connection. The > answering fax machine then gives me "error while receiving." The "upper > layer" java code MUST be right, because if I do the same thing under > linux (using the linux library), everything is alright. Now I have to > ask: Can somebody please help me out with this??!? Could it be the case > that some kind of flow control or COMMTIMEOUTS setting causes this > behaviour? I set flow control to RTS/CTS before sending out a fax. How > can I DISABLE flow control? Or what do you think? Can something else > cause this problems? Thank you all for your time and PLEASE write back > soon. > Hi Sven I'm not too willing to talk about flow control at the low level until I confirm some things with test equipment later. It is not clear if you are using rxtx or writing your own native code. So I'm not sure how to answer much of this :) If you are wondering how to change the flow control using rxtx from java, The BlackBox example from Sun flips this back and forth. SerialPort.java in rxtx 2.1 uses the following: SerialPort.java: public static final int FLOWCONTROL_NONE =0; SerialPort.java: public static final int FLOWCONTROL_RTSCTS_IN =1; SerialPort.java: public static final int FLOWCONTROL_RTSCTS_OUT =2; SerialPort.java: public static final int FLOWCONTROL_XONXOFF_IN =4; SerialPort.java: public static final int FLOWCONTROL_XONXOFF_OUT=8; So if you set flowcontrol to RTSCTS, you can set it to NONE to turn it off. If you are looking for how to do it in native code, the rxtx Source is SerialImp.c (unix/linux/mac os x/w32) and termios.c (w32 only with SerialImp.c) You can track the code: SerialImp.c:JNIEXPORT void JNICALL RXTXPort(setflowcontrol)( JNIEnv *env, jobject jobj, jint flowmode ) termios.c:int tcgetattr( int fd, struct termios *s_termios ) termios.c:int tcsetattr( int fd, int when, struct termios *s_termios ) There may be a problem in the rxtx flow control code though. Rather than guess, I want to test this with a gold standard. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Feb 6 00:00:16 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 00:00:16 -0700 (MST) Subject: [Rxtx] wiki delay until tomorrow night. In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: On Sun, 5 Feb 2006, Trent Jarvi wrote: > On Sun, 5 Feb 2006, Kim Lux wrote: > >> usb ? Tell me more... I need that too. > > usb is a very proper design. Thats all it is. > Maybe rxtx could help usb. But it would start with helping bring back the community that was already there. It's not something I'd love to do but maybe its the right thing to do. It would probably take 2 years to do right. But maybe thats better than what we have now. I honestly don't know what IBM is doing which could just run over everything. Just some thoughts after some fine german wine. -- Trent Jarvi tjarvi at qbang.org From gadelavega at yahoo.com.ar Mon Feb 6 02:17:05 2006 From: gadelavega at yahoo.com.ar (Gonzalo A. de la Vega) Date: Mon, 06 Feb 2006 10:17:05 +0100 Subject: [Rxtx] Serial port ownership question In-Reply-To: References: <20060205113618.30274.qmail@web53501.mail.yahoo.com> <1139157422.4553.9.camel@zd7280> <1139158698.4936.9.camel@zd7280> Message-ID: <43E71411.4050402@yahoo.com.ar> On my Fedora Core 4: ls -l /dev/ttyS* crw-rw---- 1 root uucp 4, 64 Feb 6 2006 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Feb 6 2006 /dev/ttyS1 ... and: grep "ttyUSB" /etc/udev/rules.d/50-udev.rules KERNEL=="ttyUSB*", GROUP="uucp", MODE="0660" So anyone in the "uucp" group can use serial ports. On Gentoo the group is "tty". Trent Jarvi escribi?: > > > On Sun, 5 Feb 2006, Dr. Douglas Lyon wrote: > >> I can confirm that this is the case (only root ownership of >> serial ports, under fedora 4). >> Wow, what were they thinking?! >> - DL >> >>> I've found that the newer kernels have the serial ports owned by root. >>> For example, >>> >>> $ls -al /dev/tty* >>> crw-rw-rw- 1 root root 5, 0 Feb 5 02:06 /dev/tty >>> crw-rw---- 1 root root 4, 0 Feb 5 02:06 /dev/tty0 >>> crw------- 1 root root 4, 1 Feb 5 09:07 /dev/tty1 >>> crw-rw---- 1 root tty 4, 10 Feb 5 02:06 /dev/tty10 >>> crw-rw---- 1 root tty 4, 11 Feb 5 02:06 /dev/tty11 >>> ... > > > This is just not a problem jcp or such are going to solve. Its a > platform spitwad fight. But do look at pam. In fact thats what Sun > is doing too. Maybe Linux followed their lead.. I'm not a pam guy. > I've spent 16 hours trying to understand it but your users wont :) > > Solution? I have no clue. Its two tangent mentalities from my > perspective. > > -- > Trent Jarvi > tjarvi at qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mtnvega at yahoo.com.br Mon Feb 6 05:35:43 2006 From: mtnvega at yahoo.com.br (Luiz Jr) Date: Mon, 6 Feb 2006 12:35:43 +0000 (GMT) Subject: [Rxtx] Documentation Wiki In-Reply-To: <1139157422.4553.9.camel@zd7280> Message-ID: <20060206123543.57256.qmail@web53515.mail.yahoo.com> Hello, Thank you for you answer, but so the usage of the API is pretty much like the Java Communications Api? If yes, what version of the Java Comm Api? Thank you, Luiz A. Brandao Jr Kim Lux escreveu: On Sun, 2006-02-05 at 08:36 -0300, Luiz Jr wrote: > Hello, > > I want to start using the RXTX libraries, but I would to know how, > since I can not access the documentation wiki page I just started using them yesterday. Below is how I installed the libraries, if that helps. I used snippets of code from the SimpleWrite application here to get me going. http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html Instead of "import javax.comm.*;", use "import gnu.io.*;" which is gotten from RXTXcomm.jar, which you will need to include in your project references. I am working in Eclipse. BTW: there is no way to open a port without going through the port list and finding it. Maybe sometime in the future someone (me ?) will write a method called openSerialPort that allows the user to give a port identifier, such as "/dev/tty1" and return a port ready to use. It wouldn't take much to write that and it would save users a lot of code. Hope this helps. ======================================================================= 1) Figure out which java you are running, incase there is more than one installed. $ java -version java version "1.5.0_05" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_05-b05) Java HotSpot(TM) Client VM (build 1.5.0_05-b05, mixed mode, sharing) 2) Find all the jre directories and the one from which you are currently running. kfind (jre) 3) cd to that directory plus /lib/i386 cd /usr/java/jre1.5.0_05/lib/i386 4) Copy the library files (*.so) to that directory. cp /home/krlux/Desktop/'Java Controls'/rxtx-linux/bin/* . 5) Check that the copy was successful ls librxtx* librxtxI2C.so librxtxRaw.so librxtxSerial.so librxtxParallel.so librxtxRS485.so 6) cd to the /lib/ext directory for your java. cd /usr/java/jre1.5.0_05/lib/ext 7) Copy the Jar files there cp /home/krlux/Desktop/'Java Controls'/rxtx-linux/lib/ext/* . 8) Check that it was successful ls RXTX* RXTXcomm.jar Rxtx is now installed on your machine ready to use. =================================================================== -- Kim Lux, Diesel Research Inc. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx --------------------------------- Yahoo! Acesso Gr?tis - Internet r?pida e gr?tis. Instale o discador agora! -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/544aa403/attachment-0029.html From lyon at docjava.com Mon Feb 6 05:49:34 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 06 Feb 2006 07:49:34 -0500 Subject: [Rxtx] wiki delay until tomorrow night. In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: Hi All, I have often thought about USB drivers being needed. For example, the ironman watch will not interface to a mac (windows only). It is USB. My dymo label writer has no Java driver (native only). Etc. Most cheap web cameras are USB (and Java drivers go through JAI, if it supports the camera at all). The JAI code shows how sun did the USB drivers. You have to be a member of the jai project to download the source code. https://jai.dev.java.net has the jai distro. And then you are not allowed to redistribute it. However, we can all learn from it (if so inclined). Basically: cvs -d :pserver:lyon at cvs.dev.java.net:/cvs login cvs -d :pserver:lyon at cvs.dev.java.net:/cvs checkout jai-core You will need to user your own uid and pw to get in. The ant build has over 100 warnings from sun deprecations of its own code. You might say that they were hoisted on their own Picard ;) One interesting thing is that they support several platforms: linux-amd64 64-bit Linux-AMD64 linux-i586 32-bit Linux-x86 solaris-amd64 64-bit Solaris-AMD64 solaris-i586 32-bit Solaris-x86 solaris-sparc 32-bit Solaris-SPARC solaris-sparcv9 64-bit Solaris-SPARC windows-i586 32-bit Windows-x86 Thus, ant is used to provide a multi-platform native method distro. Neat. How do they do it? check this out: And: The core download does not contain any C source code (it was all pre-built). Basically, they are just copying .so and .dll files into build directories. I would love to see the C code for this...but Sun does not post it on the https://jai.dev.java.net site. I don't know why...Perhaps I missed it. - Doug >On Sun, 5 Feb 2006, Trent Jarvi wrote: > >>On Sun, 5 Feb 2006, Kim Lux wrote: >> >>>usb ? Tell me more... I need that too. >> >>usb is a very proper design. Thats all it is. >> > >Maybe rxtx could help usb. But it would start with helping bring >back the community that was already there. > >It's not something I'd love to do but maybe its the right thing to do. > >It would probably take 2 years to do right. But maybe thats better >than what we have now. > >I honestly don't know what IBM is doing which could just run over everything. > >Just some thoughts after some fine german wine. > >-- >Trent Jarvi >tjarvi at qbang.org > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tdelenik at gmail.com Mon Feb 6 05:56:32 2006 From: tdelenik at gmail.com (Thanasis Delenikas) Date: Mon, 6 Feb 2006 14:56:32 +0200 Subject: Fwd: [Rxtx] Documentation Wiki In-Reply-To: <1139157422.4553.9.camel@zd7280> References: <20060205113618.30274.qmail@web53501.mail.yahoo.com> <1139157422.4553.9.camel@zd7280> Message-ID: <310a1a930602060456t129f1dc6p5f2b908f13ab5a0b@mail.gmail.com> Hello all, Kim, this is a snippet from the code I use. The closest to directly opening a specific port without enumeration. << ... portId = CommPortIdentifier.getPortIdentifier(getPort()); serialPort = (SerialPort) portId.open("jSMSEngine", 1971); ... >> where getPort() return the string identifier of the port, i.e. "/dev/ttyS0" or "COM1" or whatever. Thanasis. ---------- Forwarded message ---------- From: Kim Lux Date: Feb 5, 2006 6:37 PM Subject: Re: [Rxtx] Documentation Wiki To: RXTX Developers and Users BTW: there is no way to open a port without going through the port list and finding it. Maybe sometime in the future someone (me ?) will write a method called openSerialPort that allows the user to give a port identifier, such as "/dev/tty1" and return a port ready to use. It wouldn't take much to write that and it would save users a lot of code. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/182ab5b8/attachment-0029.html From tjarvi at qbang.org Mon Feb 6 11:53:57 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 11:53:57 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: On Mon, 6 Feb 2006, Dr. Douglas Lyon wrote: > Hi All, > I have often thought about USB drivers being needed. > For example, the ironman watch will not interface > to a mac (windows only). It is USB. > My dymo label writer has no Java driver (native only). > Etc. > Most cheap web cameras are USB (and Java drivers go > through JAI, if it supports the camera at all). > The JAI code shows how sun did the USB drivers. > You have to be a member of the jai project to download > the source code. > https://jai.dev.java.net has the jai distro. > And then you are not allowed to redistribute it. However, > we can all learn from it (if so inclined). Basically: > cvs -d :pserver:lyon at cvs.dev.java.net:/cvs login > cvs -d :pserver:lyon at cvs.dev.java.net:/cvs checkout jai-core > You will need to user your own uid and pw to get in. > The ant build has over 100 warnings from sun deprecations > of its own code. > > You might say that they were hoisted on their own Picard ;) > > One interesting thing is that they support several platforms: > linux-amd64 64-bit Linux-AMD64 > linux-i586 32-bit Linux-x86 > solaris-amd64 64-bit Solaris-AMD64 > solaris-i586 32-bit Solaris-x86 > solaris-sparc 32-bit Solaris-SPARC > solaris-sparcv9 64-bit Solaris-SPARC > windows-i586 32-bit Windows-x86 > Thus, ant is used to provide a multi-platform native method distro. > Neat. > How do they do it? > check this out: > > > > > > > > > > > > > And: > > > > > > > > > > The core download does not contain any C source code (it was all pre-built). > Basically, they are just copying .so and .dll files into build directories. > > I would love to see the C code for this...but Sun does not post it on the > https://jai.dev.java.net site. > > I don't know why...Perhaps I missed it. > > - Doug > > I've looked at moving rxtx to Ant builds. I think that would help IDEs a great deal. I requested a evalutation desk copy the O'Reilly Ant book for some j2ee material I was teaching. http://www.oreilly.com/catalog/anttdg/ It has a one sentence mention of JNI. So there was not luck there. I saw that there is another Ant book that does mention JNI more. I can't find it now. Ant must be able to support it with extensions. http://ant.apache.org/manual/OptionalTasks/javah.html What the auto(break :) tools do in the rxtx build is 4 things really. 1) gcc compile flags 2) ld compile flags 3) config.h 4) compile flags for customizing rxtx (lockfiles, ...) See 1 All of this information except 4 can be static once obtained. So I'm not attached to the auto tools. If I could find an example of Ant being used for JNI code, I'd be one of the first to start moving that direction. Maybe someone saw an example someplace. The other thing we have not completed discussing is the directory structure. There is interest in making rxtx more IDE friendly. I get more mail about that off the list than how to install rxtx. And I see we have Ken Thompson in da house :) He is our trusted CVS maintainer and the guy that purchased the rxtx.org domain. Old community. We will need Ken for changing the directory structure of source. I would like to open up discussion about both of these as it is more than time. The problem is I have little experience with Ant and even less with IDEs. It would be nice if we could work with Eclipse and NetBeans. http://www.netbeans.org/ (sun and some community) http://www.eclipes.org (ibm,rhat,... perhaps more community) http://maven.apache.org/what-is-maven.html (apache. It is community) borland should sortof be here too but I think thats covered in eclipse. >From what I understand so far, we should morph rxtx to support those three maybe trusting apaches lead with maven. But I use vi. I have little to no clues beyond what people have fed me. Can we agree that thats the right direction to go? -- Trent Jarvi tjarvi at qbang.org From brian at mbari.org Mon Feb 6 14:57:50 2006 From: brian at mbari.org (Brian Schlining) Date: Mon, 6 Feb 2006 13:57:50 -0800 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> > The other thing we have not completed discussing is the directory > structure. There is interest in making rxtx more IDE friendly. I > get more mail about that off the list than how to install rxtx. > > And I see we have Ken Thompson in da house :) He is our trusted > CVS maintainer and the guy that purchased the rxtx.org domain. Old > community. We will need Ken for changing the directory structure of > source. > > I would like to open up discussion about both of these as it is > more than time. The problem is I have little experience with Ant > and even less with IDEs. It would be nice if we could work with > Eclipse and NetBeans. > > http://www.netbeans.org/ (sun and some community) > http://www.eclipes.org (ibm,rhat,... perhaps more community) > http://maven.apache.org/what-is-maven.html (apache. It is community) > borland should sortof be here too but I think thats covered in > eclipse. > >> From what I understand so far, we should morph rxtx to support >> those three > maybe trusting apaches lead with maven. But I use vi. I have > little to no clues beyond what people have fed me. > Maven likes the directory structure below for Java code. (From http:// maven.apache.org/guides/getting-started/index.html) This structure works fine with ant, netbeans, and eclipse. rxtx_root_directory `-- src |-- main | `-- java | `-- gnu | `-- io `-- test `-- java `-- gnu `-- io Brian Schlining Software Engineer http://www.mbari.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/d9451eba/attachment-0029.html From tjarvi at qbang.org Mon Feb 6 15:11:45 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 15:11:45 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: > rxtx_root_directory > `-- src > |-- main > | `-- java > | `-- gnu > | `-- io > `-- test > `-- java > `-- gnu > `-- io > >From what I understand this will just be good. For me it makes no difference. So lets do the rxtx thing. Let if fester for two weeks and if nobody objects, we will do it. I'm not doing this because I care. I'm doing this to eliminate much of my inbox. But test... man is rxtx lacking there in the community aspect. It is covered but not right. _maybe_ I can change that this year. -- Trent Jarvi tjarvi at qbang.org (cat hurding since 1997) From lux at diesel-research.com Mon Feb 6 21:38:49 2006 From: lux at diesel-research.com (Kim Lux) Date: Mon, 06 Feb 2006 21:38:49 -0700 Subject: [Rxtx] How can I use Lock Files with rxtx (in FC4) ? Message-ID: <1139287129.17031.3.camel@zd7280> I am now running an rxtx application on FC4. I am getting: ========================================================= check_group_uucp(): error testing lock file creation Error details: Permission denied check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL ========================================================= $ ls -al /var/lock total 32 drwxrwxr-x 4 root lock 4096 Feb 6 16:04 . drwxr-xr-x 24 root root 4096 Nov 14 01:19 .. drwx------ 2 root root 4096 Apr 27 2005 lvm drwxr-xr-x 2 root root 4096 Feb 6 16:04 subsys How do I fix this for regulator users ? -- Kim Lux, Diesel Research Inc. From dmarkman at mac.com Mon Feb 6 22:24:44 2006 From: dmarkman at mac.com (Dmitry Markman) Date: Tue, 7 Feb 2006 00:24:44 -0500 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: if I understands the issue right in order to be able to use ant for c/c++ compilation you have to install ant's cc task http://ant-contrib.sourceforge.net/cc.html it looks like it should work on mac os x (authors claim, that it's platform independent) but I never tested so all you have to do it's providing right command line for the gcc compiler On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: >> rxtx_root_directory >> `-- src >> |-- main >> | `-- java >> | `-- gnu >> | `-- io >> `-- test >> `-- java >> `-- gnu >> `-- io >> > > >> From what I understand this will just be good. > > For me it makes no difference. So lets do the rxtx thing. Let if > fester for two weeks and if nobody objects, we will do it. > > I'm not doing this because I care. I'm doing this to eliminate > much of my inbox. > > But test... man is rxtx lacking there in the community aspect. It > is covered but not right. _maybe_ I can change that this year. > > -- > Trent Jarvi > tjarvi at qbang.org > (cat hurding since 1997) > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx Dmitry Markman From lux at diesel-research.com Mon Feb 6 23:20:15 2006 From: lux at diesel-research.com (Kim Lux) Date: Mon, 06 Feb 2006 23:20:15 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? Message-ID: <1139293215.3689.4.camel@zd7280> I'm running the code below. portlist.hasMoreElements() is false. /dev has ports in it as listed below. What am I doing wrong ? ========================================================== // Step through the list of ports until we find one that matches // the one we are looking for. portList = CommPortIdentifier.getPortIdentifiers(); while(portList.hasMoreElements()) { portID = (CommPortIdentifier) portList.nextElement(); // if (portID.getName().equals("/dev/ttyUSB0")) { myTA.append("Serial port ttyUSB0 has been found\n"); break; }// if portID equals... }// End of while... ========================================================== ls -al /dev/tty* crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 ... crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 -- Kim Lux, Diesel Research Inc. From david.garnier at trusted-logic.com Tue Feb 7 00:46:30 2006 From: david.garnier at trusted-logic.com (David Garnier) Date: Tue, 07 Feb 2006 08:46:30 +0100 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: <43E85056.2090608@trusted-logic.com> Hello, I think that the make-based build process is fine as it is, apart from the location of the Java source files. It is true that putting the Java source in a directory structure that map 1-to-1 to the Java package structure is the norm and should make it easier for everyone to modify the Java source, with or without an IDE. Ant is a good tool, but in the RXTX case I fail to see the advantage of using it compared to the current make-based process. As Trent said, they are more pressing issues, like testing. Regards, David Dmitry Markman wrote: > if I understands the issue right > in order to be able to use ant for c/c++ compilation > you have to install ant's cc task > http://ant-contrib.sourceforge.net/cc.html > > it looks like it should work on mac os x > (authors claim, that it's platform independent) > but I never tested > > so all you have to do it's providing right command line > for the gcc compiler > > > > > On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: > >>> rxtx_root_directory >>> `-- src >>> |-- main >>> | `-- java >>> | `-- gnu >>> | `-- io >>> `-- test >>> `-- java >>> `-- gnu >>> `-- io >>> >> >> >>> From what I understand this will just be good. >> >> For me it makes no difference. So lets do the rxtx thing. Let if >> fester for two weeks and if nobody objects, we will do it. >> >> I'm not doing this because I care. I'm doing this to eliminate much >> of my inbox. >> >> But test... man is rxtx lacking there in the community aspect. It is >> covered but not right. _maybe_ I can change that this year. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> (cat hurding since 1997) From tjarvi at qbang.org Tue Feb 7 01:11:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 01:11:31 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <43E85056.2090608@trusted-logic.com> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: On Tue, 7 Feb 2006, David Garnier wrote: > Hello, > > I think that the make-based build process is fine as it is, apart from the location of the Java > source files. It is true that putting the Java source in a directory structure that map 1-to-1 to > the Java package structure is the norm and should make it easier for everyone to modify the Java > source, with or without an IDE. > > Ant is a good tool, but in the RXTX case I fail to see the advantage of using it compared to the > current make-based process. As Trent said, they are more pressing issues, like testing. > Hi David I have more experience with testing rxtx than I can talk about. But let it be known, rxtx has gone trough 100's of hours of testing. We are hobby folks interested in toys but there is more. rxtx has had some of the best guidance in the industry there. This is not an easy thing. I may be able to come back in a month from the other side of the corperate fence and help. I suspect the tests could just be made public but they are in a very unusual environment that just wont work in a wider sense. This is something I'll be trying to change. At one point it was agreed we could just make the results public so this isnt just noise.. There is interest and I think its safe to mention that much. The big problem with testing in the past is most of it is done with a loopback connection. So we *still* have major questions regarding things like flow control. rxtx talks to itself over a loopback and it works. regardless of right or wrong. This requires more thought to be done right. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Feb 7 02:46:34 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 02:46:34 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: > The big problem with testing in the past is most of it is done with a > loopback connection. So we *still* have major questions regarding things > like flow control. rxtx talks to itself over a loopback and it works. > regardless of right or wrong. With serial communication there are gold standards. ckermit is probably a definitive 'standard.' Maybe its possible to do ping/pong tests with ckermit? Is it scriptable? There are known issues in rxtx. Probably the worst is some threading issues regarding some JREs with multiple JNI threads setting java variables. Man did I get schooled there. Just switch the c functions to returning variables and things go away. Sometimes they work fine, sometimes they blow up. Without understanding everything, somehow rhat got it right and debian (and especially gentoo) grabbed kernel patches causing all sort of harm. Its not hard to fix once you understand whats going on but nearly impossible to track with a debugger. So I have a good idea what 2.1-8 will have outside of the IDE modifications. rxtx 2.1-7 is a release for everyone to sync with. Its not even as stable as -pre17 as far as I know - I ran no test suites. I'll be chasing it too. We just had so many contributions that it was time. It seriously broke internal scheduals but thats a great thing :) The other thing I want to do in 2.1-8 is automagic baud rates. It turns out lots of shops are doing really funky baud rates for things like automobile test equipment. It is possible but it requires a fair amount of change in the native code. Is anyone looking at this? -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Feb 7 02:57:21 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 07 Feb 2006 04:57:21 -0500 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <43E85056.2090608@trusted-logic.com> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: Hi All, I agree, testing is very important. The problem I have been trying to address is related to cross-platform testing and the robust nature of the installs. Typically, I visit 3 platforms to deploy my product, windows, linux and mac. A build is performed on each platform. The idea that you can build for many platforms from one copy the source code seems attractive. This should enable synchronized deployments of identical code. The question of how to achieve this goal remains open. As Trent mentioned, this is hard. Perhaps Ant will help here (but perhaps not). Ant does seem to help with running unit tests. However, it does not help with multi-platform tests. For that you need many machines and different operating environments. Toward that end, I have created a multi-platform test that can be run from web start, located at: http://show.docjava.com:8086/book/cgij/code/jnlp/serialPort.PortTest.jnlp This is interesting because many people in the community can run the test and we can improve the test, as time permits. No, it is not a perfect solution, however, the idea does help with multi-platform tests using many machines and different operating environments. If the group has a good test for a general serial port set-ups, i would be happy to deploy it, for general evaluation using web start. And as for ANT, it is just an idea. Not all my ideas are good ones! - Doug >Hello, > >I think that the make-based build process is fine as it is, apart >from the location of the Java >source files. It is true that putting the Java source in a directory >structure that map 1-to-1 to >the Java package structure is the norm and should make it easier for >everyone to modify the Java >source, with or without an IDE. > >Ant is a good tool, but in the RXTX case I fail to see the advantage >of using it compared to the >current make-based process. As Trent said, they are more pressing >issues, like testing. > >Regards, >David > >Dmitry Markman wrote: >> if I understands the issue right >> in order to be able to use ant for c/c++ compilation >> you have to install ant's cc task >> http://ant-contrib.sourceforge.net/cc.html >> >> it looks like it should work on mac os x >> (authors claim, that it's platform independent) >> but I never tested >> >> so all you have to do it's providing right command line >> for the gcc compiler >> >> >> >> >> On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: >> >>>> rxtx_root_directory >>>> `-- src >>>> |-- main >>>> | `-- java >>>> | `-- gnu >>>> | `-- io >>>> `-- test >>>> `-- java >>>> `-- gnu >>>> `-- io >>>> >>> >>> >>>> From what I understand this will just be good. >>> >>> For me it makes no difference. So lets do the rxtx thing. Let if >>> fester for two weeks and if nobody objects, we will do it. >>> >>> I'm not doing this because I care. I'm doing this to eliminate much >>> of my inbox. >>> >>> But test... man is rxtx lacking there in the community aspect. It is >>> covered but not right. _maybe_ I can change that this year. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> (cat hurding since 1997) > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From matt.higgins at gmail.com Tue Feb 7 08:28:34 2006 From: matt.higgins at gmail.com (Matt Higgins) Date: Tue, 7 Feb 2006 10:28:34 -0500 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final Message-ID: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? import java.io.*; import java.util.*; import gnu.io.*; public class MySimpleRead implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; public static void main(String[] args) { boolean portFound = false; String defaultPort = "COM1"; if (args.length > 0) { defaultPort = args[0]; } portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; MySimpleRead reader = new MySimpleRead(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } } public MySimpleRead() { try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) { e.printStackTrace(); } try { inputStream = serialPort.getInputStream(); } catch (IOException e) { e.printStackTrace(); } try { serialPort.addEventListener(this); } catch (TooManyListenersException e) { e.printStackTrace(); } try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { e.printStackTrace(); } System.out.println("Baud is " + serialPort.getBaudRate()); System.out.println("Bits is " + serialPort.getDataBits()); System.out.println("Stop is " + serialPort.getStopBits()); System.out.println("Par is " + serialPort.getParity()); serialPort.notifyOnDataAvailable(true); readThread = new Thread(this); readThread.start(); } public void run() { // Thread.sleep(20000); //} catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { System.out.println("An event occurred " + event.getEventType()); switch (event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: byte[] readBuffer = new byte[20]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } System.out.print(new String(readBuffer)); } catch (IOException e) {} break; } } } --------------- Result on windows ------------------------------ Stable Library ============================================================== Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port:: COM1 Baud is 9600 Bits is 8 Stop is 1 Par is 0 ----------------- End Results ----------------------------------------- ------------------ Result on Linux ----------------------------------- Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 Found port: /dev/ttyS0 Baud is 9600 Bits is 8 Stop is 1 Par is 0 An event occurred 1 043100066224 ------------------ End Results --------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/a1431630/attachment-0029.html From brian at mbari.org Tue Feb 7 09:48:37 2006 From: brian at mbari.org (Brian Schlining) Date: Tue, 7 Feb 2006 08:48:37 -0800 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> Message-ID: <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> Hi Matt > The following code works fine on Linux but I never see any data > when run on Windows. This is a cut and paste from the SimpleRead > example. > I am attempting to read data from a bar code scanner. I can fire > up HyperTermianl on windows and see that the device is working > properly as I see the barcodes are scanned and echoed back to the > terminal. However when I run the app I don't see any data. It is > however associating with the com port as the informational bits > print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. Cheers Brian Schlining Software Engineer http://www.mbari.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/16d07f37/attachment-0029.html From lux at diesel-research.com Tue Feb 7 11:59:58 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 11:59:58 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139293215.3689.4.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> Message-ID: <1139338798.8145.4.camel@zd7280> Any ideas on this ? Any reason why portList.hasMoreElements() should be false even though there are devices in /dev ? On Mon, 2006-02-06 at 23:20 -0700, Kim Lux wrote: > I'm running the code below. > > portlist.hasMoreElements() is false. > > /dev has ports in it as listed below. > > What am I doing wrong ? > > > ========================================================== > // Step through the list of ports until we find one that matches > // the one we are looking for. > > portList = CommPortIdentifier.getPortIdentifiers(); > > while(portList.hasMoreElements()) > { > portID = (CommPortIdentifier) portList.nextElement(); // > if (portID.getName().equals("/dev/ttyUSB0")) > { > myTA.append("Serial port ttyUSB0 has been found\n"); > break; > }// if portID equals... > }// End of while... > ========================================================== > > ls -al /dev/tty* > crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty > crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 > crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 > crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 > crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 > ... > crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 > crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 > crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 > > > -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 12:20:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 12:20:25 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139338798.8145.4.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> Message-ID: On Tue, 7 Feb 2006, Kim Lux wrote: > > Any ideas on this ? Any reason why portList.hasMoreElements() should be > false even though there are devices in /dev ? > > > On Mon, 2006-02-06 at 23:20 -0700, Kim Lux wrote: >> I'm running the code below. >> >> portlist.hasMoreElements() is false. >> >> /dev has ports in it as listed below. >> >> What am I doing wrong ? >> >> >> ========================================================== >> // Step through the list of ports until we find one that matches >> // the one we are looking for. >> >> portList = CommPortIdentifier.getPortIdentifiers(); >> >> while(portList.hasMoreElements()) >> { >> portID = (CommPortIdentifier) portList.nextElement(); // >> if (portID.getName().equals("/dev/ttyUSB0")) >> { >> myTA.append("Serial port ttyUSB0 has been found\n"); >> break; >> }// if portID equals... >> }// End of while... >> ========================================================== >> >> ls -al /dev/tty* >> crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty >> crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 >> crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 >> crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 >> crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 >> ... >> crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 >> crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 >> crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 >> >> >> > Hi Kim What rxtx does is try to open the port and do a timed out read. If the kernel/... do not complain it's enumarted. I suspect you could do a crude test by doing something like cat /dev/ttyS0 > /dev/null If that barfs then rxtx wont enumerate the port. hmm looking at your question again, I suspect it's a lockfile problem. This is documented in INSTALL with the source. Its easy enough to test this too.. touch /var/lock/testingrxtxlockfiles && rm -f /var/lock/testingrxtxlockfiles If you are not in the right group it will bail. Root will work regardless. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 12:37:56 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 12:37:56 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> Message-ID: <1139341076.8145.11.camel@zd7280> Exactly which ports does rxtx attempt to put into the list ? /dev/* or /dev/tty* or /dev/tty[0-9[0-9] ? or /dev/ttyS* ? For the record, only /dev/ttyUSB0 is a valid port on the machine I am presently on. Will this be a problem ? On Tue, 2006-02-07 at 12:20 -0700, Trent Jarvi wrote: > This is documented in INSTALL with the source. > I was wondering where that file was. I will download source and dig it up. Thanks. -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 12:51:09 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 12:51:09 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139341076.8145.11.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: On Tue, 7 Feb 2006, Kim Lux wrote: > > Exactly which ports does rxtx attempt to put into the list ? /dev/* > or /dev/tty* or /dev/tty[0-9[0-9] ? or /dev/ttyS* ? > > For the record, only /dev/ttyUSB0 is a valid port on the machine I am > presently on. Will this be a problem ? > > > On Tue, 2006-02-07 at 12:20 -0700, Trent Jarvi wrote: >> This is documented in INSTALL with the source. >> > I was wondering where that file was. I will download source and dig it > up. > > Thanks. > Hmm I'm looking at pre17 so this may have changed. (its just what I have on this machine) if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA" // for the IPAQs }; CandidatePortPrefixes=Temp; } So you may need to add "ttyUSB" to that list. RXTX used to enumerate _everything_ see if(osName.equals("Linux-all-ports") But it became less than practical. This is all in RXTXCommDriver.java hmm I just did a cvs update. if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have to get your fingers into the code. We aim for sane defaults. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 13:06:45 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 13:06:45 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139342805.8145.22.camel@zd7280> On Tue, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > Hmm I'm looking at pre17 so this may have changed. (its just what I have > on this machine) > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA" // for the IPAQs > }; > CandidatePortPrefixes=Temp; > } > > > So you may need to add "ttyUSB" to that list. RXTX used to enumerate > _everything_ see if(osName.equals("Linux-all-ports") But it became less > than practical. > > This is all in RXTXCommDriver.java > > hmm I just did a cvs update. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have > to get your fingers into the code. We aim for sane defaults. Excellent. Thanks for taking the time. -- Kim Lux, Diesel Research Inc. From ideiglenes1 at freemail.hu Tue Feb 7 13:53:39 2006 From: ideiglenes1 at freemail.hu (--) Date: Tue, 07 Feb 2006 21:53:39 +0100 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139345619.22534.2.camel@localhost> Hi! I use this code to get all the extra Linux devices. :) if ("Linux".equals(System.getProperty("os.name"))) { System.setProperty("os.name","Linux-all-ports"); } driver = new RXTXCommDriver(); On k, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > On Tue, 7 Feb 2006, Kim Lux wrote: > > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have > to get your fingers into the code. We aim for sane defaults. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From matt.higgins at gmail.com Tue Feb 7 13:45:54 2006 From: matt.higgins at gmail.com (Matt Higgins) Date: Tue, 7 Feb 2006 15:45:54 -0500 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> Message-ID: <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> Sweet this is exactly what I needed. I was searching the archives through marc.theamisgroup they only have archives back to 1/3/05. Should have hit the mailman archive! Thanks a lot! On 2/7/06, Brian Schlining wrote: > > Hi Matt > > The following code works fine on Linux but I never see any data when run > on Windows. This is a cut and paste from the SimpleRead example. > I am attempting to read data from a bar code scanner. I can fire up > HyperTermianl on windows and see that the device is working properly as I > see the barcodes are scanned and echoed back to the terminal. However when I > run the app I don't see any data. It is however associating with the com > port as the informational bits print fine? > > > You're not the only one whose had this problem, I don't know if Trent has > addressed this is the latest release of RXTX but there is a workaround. > Here's the recent thread from the RXTX mailing list regarding this issues: > > Thanasis Delenikas tdelenik at gmail.com > Wed Jan 18 13:56:23 MST 2006 > > * Previous message: [Rxtx] Re: More close() performance fixes > * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] > > Hi all. > (I've subscribed again from my other email account). > > Trent, > > You are right. Linux *always* works, no matter what flow control you set. > Windows *works only* with hardware flow control (I haven't tested what > happens with software XON/XOFF flow control). > > I assume (but I am not certain) that even with no flow control at all, all > platforms should work. Without flow control, you have the risk of bumping > into overflow or framing errors, but that's your (the end programmer, I > mean) problem. > > >From my side, I shouldn't be working without flow control. That was a bug > too... It was some code forgotten from the old times, when I used to work > with phone emulation drivers which didn't support flow control. The > correct > way is to have some flow control enabled and that's why I suppose this is > a > low-severity bug for RxTx. > > I have no idea which platform shows the correct behaviour, since > my knowledge about Linux and the inner workings of these low-level i/o > operations is limited. > > Regards, > Thanasis Delenikas. > > > > > Message: 2 > > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > > From: Trent Jarvi > > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > > To: RXTX Developers and Users > > Message-ID: > > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > > > Hi all, > > > > > > Trent, I have found something. > > > I read your comment about flow control, so I experimented a bit. > > > > > > If you remember, in my sample program I've used no flow control at all > ( > > i.e. > > > Java constant FLOWCONTROL_NONE). > > > > > > Now, during testing, I've switch to hardware inbound flow control (i.e > . > > Java > > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > > beautifully! > > > > > > I think I will switch to H/W flow control and test things for a while, > > but > > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > > > > > Hi Thanasis, > > > > I'm fairly sure you have identified a bug. I would not worry too much > > about what Sun CommAPI w32 defaults are. I think they did more or less > > whatever the port opened with. Just a guess. Linux tries to stomp on > > ports so they are all the same. > > > > So this started out with Linux worked, Windows XP/.. did not as I > recall. > > Something is wrong in rxtx. Do I understand this right? > > > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > > > Perhaps there is something Wayne or I did not understand when we wrote > > that code. I wasnt programming back in the BBS days so modems are not > my > > thing. I have a few questions. > > > > Is the above matrix confirmed by observation? > > Linux just always worked? > > Which one _should_ work? I'm guessing modems work with hardware flow > > control. I'll have to dig around. > > > > The windows flow control changes a couple things with hardware flow > > control. Following the w32 API documentation is confusing sometimes. > > But it looks like Linux could have a bug too. > > Cheers > > Brian Schlining > Software Engineer > http://www.mbari.org > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/9c989144/attachment-0029.html From tjarvi at qbang.org Tue Feb 7 14:06:14 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 14:06:14 -0700 (MST) Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> Message-ID: >> >> You're not the only one whose had this problem, I don't know if Trent has >> addressed this is the latest release of RXTX but there is a workaround. >> Here's the recent thread from the RXTX mailing list regarding this issues: >> I have not. I expect to have access to some test equipment next month and I'll go through all of this. I really don't know whats going on and I need a gold standard. I thought maybe linux was autodetecting the flow control. Your observations would certainly be welcome. I need to talk to Russell King and see what he is doing. Until then I'd just be toying around over a loopback as usual. This is very high on the list though. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 17:25:05 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 17:25:05 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139358305.17994.2.camel@zd7280> My application now works. I installed the libraries and jar from 2.1-7 (Final). portlist.hasMoreElements is no longer false. The application finds the port for /dev/ttyUSB0. Thanks for your help, Trent (et al) Sorry I bothered you with this. Next time I will look in the source first. I didn't think it was an rxtx issue, I thought it was a Linux setup issue . On Tue, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > Hmm I'm looking at pre17 so this may have changed. (its just what I > have > on this machine) > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux > Serial Ports > "ttySA" // for the > IPAQs > }; > > CandidatePortPrefixes=Temp; > } > > > So you may need to add "ttyUSB" to that list. RXTX used to enumerate > _everything_ see if(osName.equals("Linux-all-ports") But it became > less > than practical. > > This is all in RXTXCommDriver.java > > hmm I just did a cvs update. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux > Serial Ports > "ttySA", // for the > IPAQs > "ttyUSB" // for USB > frobs > }; > > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you > have > to get your fingers into the code. We aim for sane defaults. -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 19:21:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 19:21:54 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139358305.17994.2.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> <1139358305.17994.2.camel@zd7280> Message-ID: >Sorry I bothered you with this. Next time I will look in the source >first. I didn't think it was an rxtx issue, I thought it was a Linux >setup issue . Why would you be sorry? I would have done the same. I'm glad it's working :) -- Trent Jarvi tjarvi at qbang.org From tma at mail.island.net Wed Feb 8 13:39:35 2006 From: tma at mail.island.net (Tom Alldread) Date: Wed, 08 Feb 2006 12:39:35 -0800 Subject: [Rxtx] Win32/Linux Serial Port Data Dropouts In-Reply-To: <200602060702.k167255O007882@www.qbang.org> References: <200602060702.k167255O007882@www.qbang.org> Message-ID: <43EA5707.4020200@mail.island.net> Greetings Folks at RXTX: During the last couple of months I have been alternately testing with javax.comm 2 and RXTX 2.1 under Windows XP and CommApi 3 and RXTX 2.1 under Suse 10.0 Linux. In the process I have learned a little about java multi-threading under NetBeans 5 with Profiler. My java (jdk 1.5_06) application is used for data acquisition and provides a graphical display of A-D conversion data received from a 56KBaud serial port. The actual data throughput is about 10KBaud thus it is well below the speed of the port. I use hardware RTS/CTS flow control which can stall the data acquisition sample rate if necessary. This ensures the display computer has the ability to slow the data acquisition rate should it become too busy to accept the regular data flow. Both the serial port buffer and the java read buffer are set at 16KB. Usually the data transfers into the java read buffer are less than 100 bytes unless the data acquisition is recovering from a stall. The data flow normally hesitates after each 5 KB block as a continue command is needed from the display computer to start the drawing of a new graphics display line. Separate threads have been provided for the serial port event monitoring and data processing. The serial port event thread has been given the maximum priority and data processing thread the minimum priority provided by java. Thread yield statements have been placed within all data processing while/for loops as an effort to ensure quick access to CPU cycles for the serial port event thread. I have found that short data transmissions are essentially error free but occasional dropouts occur with continuous data flow especially under Windows XP. ....................................................................................................................................................................................... Linux results: I am happy to report that RXTX 2.1 appears to work very well under Linux although I did notice some errors when the screen savers were running with my dual monitors. I believe this is a local problem associated with my dual graphics which needs further attention. The recent CommApi 3 Linux release from Sun did not work at all with my program. It seemed to send commands out OK but did not receive any data. Although the serial port event triggered the ISR, the input stream appeared filled with nulls and thus did not contain any data. As my understanding is that CommApi 3 was tested with a Red Hat distribution of Linux I wonder if this problem is distro dependent? Although somewhat off topic here I wonder if anyone reading this has had similar experience? .................................................................................................................................................................................. Windows XP results: There are problems with occasional data dropouts which become more frequent as the sampling rate is increased or if the computer becomes busy with other duties. The dropouts typically consist of a half dozen byte block of lost data. It appears the lost bytes never get added to the java input stream. There has not been any indication of garbled data, overruns or framing errors which suggests the UART communications remains solid. Using javax.comm 2 I found that the setting of SerialPort 'enableReceiveThreshold' to 40 and 'enableReceiveTimeout' of 100mS reduced the dropouts error rate significantly. I found that I could not get RXTX 2.1 to function with the aforementioned threshold and timeout settings. The javax.comm 2 interface is consequently performing better for me under Windows than RXTX 2.1. I wonder if anyone here has any suggestions as to what I might try to improve RXTX 2.1? Although my settings are the same as under Suse 10.0, RXTX 2.1 performs much better for me under Linux than any of the alternatives that I have tried under Windows XP . ............................................................................................................................................................................... I would like to establish, based on the experience of others, if I have reached the normally expected performance limit of java serial port communications? Should I expect to achieve virtually error free serial port data input from a continuous stream under Windows XP java software? I am considering changing my protocol to packets with error checking if necessary but would like to know if the dropout problems I am experiencing are typical or not before I take this rather work intensive plunge. Many thanks in advance for any help! Best Regards, Tom Alldread -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.375 / Virus Database: 267.15.2/253 - Release Date: 2006-02-07 From jlaxson at mac.com Wed Feb 8 23:56:48 2006 From: jlaxson at mac.com (John Laxson) Date: Thu, 9 Feb 2006 00:56:48 -0600 Subject: [Rxtx] PortInUseException: Unknown Application on OSX Message-ID: Hi, I've been trying to get RXTX 2.1.7 going on Mac OS X for a while here, and am running up into a wall here. I've tried with pre- compiled and the source version and get the same problem, a gnu.io.PortInUseException: Unknown Application. I have run the fixperms script included with the source distribution, and id shows me as a member of the uucp group, and permissions on /var/spool/uucp are 775 root:uucp. Running a test program (included at the bottom for clarity) lets me enumerate all the serial ports correctly, but trying to open any of them gives the PortInUseException. If it helps, when I try to open a port that's set to make an outgoing bluetooth connection, there is no delay and no connection attempt at all. Thanks, John Laxson PS: The documentation wiki on qbang.org shows 404, and has for a few days now. My test code: public static void main(String[] args) { SerialPort serialPort; try { Enumeration e = CommPortIdentifier.getPortIdentifiers(); CommPortIdentifier ident; while (e.hasMoreElements()) { ident = (CommPortIdentifier)e.nextElement(); System.out.println(ident.getName()); } ident = CommPortIdentifier.getPortIdentifier("/dev/cu.modem"); serialPort = (SerialPort) ident.open("Me", 5000); } catch (Exception e) { e.printStackTrace(); } } From rajesh.invincible at gmail.com Thu Feb 9 03:39:38 2006 From: rajesh.invincible at gmail.com (Rajesh N) Date: Thu, 9 Feb 2006 16:09:38 +0530 Subject: [Rxtx] Re: Move .java Files in gnu.io filesystem hierarchy - Maven (2) In-Reply-To: <43DF21D2.7090200@ngi.it> References: <43DF21D2.7090200@ngi.it> Message-ID: <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Can anybody tell me how to overcome these EXCEPTIONS I AM WORKING ON SERIAL COMMN IN JAVA ON LINUX. 1. " NOT ALL PARAMETERS SUPPORTED BY THE KERNEL" This i came across the following statement inmy prog. SerialP is A SerialPort object SerialP.setSerialPortParams(9600(BAUDRATE),DATABITS_8,STOPBITS_1,PARITY_NONE) 2. NullPointer Exception at Event Dispatch Now i have checked all my object references for a null reference but i found none i have put up my entire code in try catch blocks but still I AM UNABLE TO CATCH THIS EXCEPTION AND HENCE MY APPLICATION CLOSES HOW DOES THESE GO? PLEASE HELP ME IT IS URGENTTTTTTTTTTTTTTTT yours sincerely RAJESH On 1/31/06, Fabio Frumento wrote: > Hi Xavier, > > I don't know maven at all but the directory hierarchy listed buy Trent > is fine for me... > > I'll take a look to maven, it seems an interesting project > > Regards > > Fabio Frumento > > Trent Jarvi wrote: > > On Tue, 31 Jan 2006, Xavier Frisaye wrote: > > > >> Hi all, > >> > >> If you are going to rearrange the src folder, i will propose to use > >> maven 2 and follow its directory structure > >> > (http://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html). > >> > >> Maven 2 simplify java project and give a standard way to make projects > >> (http://maven.apache.org/). > >> We are using it for internal projects and we are very satisfied. > >> > >> Is anybody interested? > >> > >> I'm not an expert in maven 2 (yet) but i'm agree to help using it if > >> you choose to make so. > >> > > > > so this would be: > > > > rxtx-devel/src/main/java/gnu.io > > rxtx-devel/src/test/java/ManIwish.java > > > > I don't use IDEs very much so I'll let others comment. But I don't see > > a problem with that. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Thu Feb 9 09:50:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 9 Feb 2006 09:50:31 -0700 (MST) Subject: [Rxtx] Re: Move .java Files in gnu.io filesystem hierarchy - Maven (2) In-Reply-To: <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Message-ID: On Thu, 9 Feb 2006, Rajesh N wrote: > Can anybody tell me how to overcome these EXCEPTIONS > I AM WORKING ON SERIAL COMMN IN JAVA ON LINUX. > > 1. " NOT ALL PARAMETERS SUPPORTED BY THE KERNEL" > > This i came across the following statement inmy prog. > SerialP is A SerialPort object > SerialP.setSerialPortParams(9600(BAUDRATE),DATABITS_8,STOPBITS_1,PARITY_NONE) > Strange. The parameters you use are the same the port should open with by default. Could you paste the actual exception you are getting? I don't see that in the rxtx source. Also it would help to know the rxtx version. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Fri Feb 10 15:29:05 2006 From: lux at diesel-research.com (Kim Lux) Date: Fri, 10 Feb 2006 15:29:05 -0700 Subject: [Rxtx] One serial port object for both sending and receiving ? Message-ID: <1139610545.18177.4.camel@zd7280> Is it OK to use one SerialPort ojbect (ex Serial Port serialPort;) and use it for both sending and receiving ? For example: ======================================================================== static SerialPort serialPort = null; static OutputStream serialOut = null; static InputStream serialIn = null; // assign it to an outputStream for use try{ serialOut = serialPort.getOutputStream(); System.out.println("Serial output stream has been assigned."); }//try catch(IOException e) { System.out.println("Error: Couldn't assign output stream to serial port."); }//catch //assign it to an inputStream for use try{ serialIn = serialPort.getInputStream(); System.out.println("Serial input stream has been assigned."); }//try catch(IOException e) { System.out.println("Error: Couldn't assign input stream to serial port."); }//catch ======================================================================== -- Kim Lux, Diesel Research Inc. From lux at diesel-research.com Fri Feb 10 21:23:00 2006 From: lux at diesel-research.com (Kim Lux) Date: Fri, 10 Feb 2006 21:23:00 -0700 Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Message-ID: <1139631780.23882.10.camel@zd7280> I've got a problem receiving chars with my version of serialRead, written in an SWT GUI. I had a Java pro have a good look at my code and he can't see anything wrong with it. I can send chars fine. When I receive a char the cpu usage for the app goes to 100% and the code in the serial event handler doesn't get executed. The instructions on the Java Comm Serial API How-To for Linux page state that I must install javacomm. Is that true ? Everything builds without it and I can send chars on rxtx just fine, but I can't receive them. Could this be the problem ? I downloaded and installed javacomm. I was not able to add "Driver=gnuio.RXTXCommDriver to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 installed in /usr/java/jre1.5.0_05. I added comm.jar to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext to the library paths. Is this OK ? Does it matter that I am receiving on /dev/ttyUSB0 ? Thanks. -- Kim Lux, Diesel Research Inc. From lunareclipse03 at web.de Sat Feb 11 09:44:46 2006 From: lunareclipse03 at web.de (lunareclipse03@web.de) Date: Sat, 11 Feb 2006 17:44:46 +0100 Subject: [Rxtx] Question about Serial I/O under Win32 Message-ID: <662084330@web.de> Hello everybody, I have a strange problem with a piece of code I made for myself. No, this is not really concerning rxtx, but nevertheless I post this to the list, hoping that some of you can help me. I've written two libraries, one for linux and one for win32. The linux port works quite well, I can send / receive faxes and / or replay voice messages over the telephone line using a voice modem. But the win32 port of the library causes some trouble. If, for example, I send out a fax with a certain modem under linux, it works well. The fax is complete when it comes out of the fax machine. If I then use the same modem to send out a fax under win32, the fax coming out of the fax machine gets "stuck" halfways, but the sending modem thinks that transmission was ok and drops the connection. The answering fax machine then gives me "error while receiving." The "upper layer" java code MUST be right, because if I do the same thing under linux (using the linux library), everything is alright. Now I have to ask: Can somebody please help me out with this??!? Could it be the case that some kind of flow control or COMMTIMEOUTS setting causes this behaviour? I set flow control to RTS/CTS before sending out a fax. How can I DISABLE flow control? Or what do you think? Can something else cause this problems? Thank you all for your time and PLEASE write back soon. Regards, --Sven Ahlemann Am Waldrand 31 45721 Haltern am See Germany ______________________________________________________________ Verschicken Sie romantische, coole und witzige Bilder per SMS! Jetzt bei WEB.DE FreeMail: http://f.web.de/?mc=021193 From lux at diesel-research.com Sat Feb 11 10:06:52 2006 From: lux at diesel-research.com (Kim Lux) Date: Sat, 11 Feb 2006 10:06:52 -0700 Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: <1139631780.23882.10.camel@zd7280> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> <1139631780.23882.10.camel@zd7280> Message-ID: <1139677612.3431.5.camel@zd7280> More on this problem. I copied and pasted simpleRead into a console based Eclipse project and I've got the same result, except that cpu usage doesn't go to 100%. I'm beginning to think there is an issue in rxtx. My imports for simpleRead are: ============================ import gnu.io.*; import java.util.*; //import javax.comm.*; import java.io.*; =========================== Any ideas ? I am trying to read from /dev/ttyUSB0 using a serial to USB adapter which has worked well with minicom and gtkterm. Thanks. On Fri, 2006-02-10 at 21:23 -0700, Kim Lux wrote: > I've got a problem receiving chars with my version of serialRead, > written in an SWT GUI. > > I had a Java pro have a good look at my code and he can't see anything > wrong with it. > > I can send chars fine. When I receive a char the cpu usage for the app > goes to 100% and the code in the serial event handler doesn't get > executed. > > The instructions on the Java Comm Serial API How-To for Linux page state > that I must install javacomm. Is that true ? Everything builds without > it and I can send chars on rxtx just fine, but I can't receive them. > Could this be the problem ? > > I downloaded and installed javacomm. I was not able to add > "Driver=gnuio.RXTXCommDriver > to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not > have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 > installed in /usr/java/jre1.5.0_05. I added comm.jar > to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext > to the library paths. Is this OK ? > > Does it matter that I am receiving on /dev/ttyUSB0 ? > > Thanks. > -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Sun Feb 12 21:01:33 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:01:33 -0700 (MST) Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: <1139677612.3431.5.camel@zd7280> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> <1139631780.23882.10.camel@zd7280> <1139677612.3431.5.camel@zd7280> Message-ID: I suspect what is happening is the select() is breaking out in the native code but the driver does not have support for notifying there are X bytes available. On some traditional Unix based systems, the only way you know data is available is the fd status changes and do an FIORDCHK ioctl. Or perhaps the only thing you can know is the fd status changed. It would take reading through the kernel driver code to know for sure. So on USB, depending upon the driver, the same may need to be done or the driver improved a bit if possible to support. Polling reads will also work but don't use the event driven model of CommAPI which isnt acceptable in the long run. The 100% cpu usage can then be explained because select no longer blocks until the data is read; the eventLoop spins loose. You can put a well placed sleep but rxtx only expects those are needed when it knows data is available. This may not be a super simple thing to understand and fix. I do have ideas to get you started. I'm going to be short on time the next couple weeks. I expect to put some good time in and answer some other questions I saw around the 25th. For now, I'd look at the following and go from there with the hints I've given. JNIEXPORT jint JNICALL RXTXPort(nativeavailable)( JNIEnv *env, jobject jobj ) { int fd = get_java_var( env, jobj,"fd","I" ); int result; /* char message[80]; ENTER( "RXTXPort:nativeavailable" ); On SCO OpenServer FIONREAD always fails for serial devices, so try ioctl FIORDCHK instead; will only tell us whether bytes are available, not how many, but better than nothing. This turns out to be true on Solaris also. taj. */ #ifdef FIORDCHK /* __unixware__ __sun__ probably others */ result = ioctl(fd, FIORDCHK, 0); #else if( ioctl( fd, FIONREAD, &result ) < 0 ) { goto fail; } #endif /* FIORDCHK */ On Sat, 11 Feb 2006, Kim Lux wrote: > > More on this problem. I copied and pasted simpleRead into a console > based Eclipse project and I've got the same result, except that cpu > usage doesn't go to 100%. I'm beginning to think there is an issue in > rxtx. > > My imports for simpleRead are: > > ============================ > import gnu.io.*; > import java.util.*; > //import javax.comm.*; > import java.io.*; > =========================== > > Any ideas ? I am trying to read from /dev/ttyUSB0 using a serial to > USB adapter which has worked well with minicom and gtkterm. > > Thanks. > > > > On Fri, 2006-02-10 at 21:23 -0700, Kim Lux wrote: >> I've got a problem receiving chars with my version of serialRead, >> written in an SWT GUI. >> >> I had a Java pro have a good look at my code and he can't see anything >> wrong with it. >> >> I can send chars fine. When I receive a char the cpu usage for the app >> goes to 100% and the code in the serial event handler doesn't get >> executed. >> >> The instructions on the Java Comm Serial API How-To for Linux page state >> that I must install javacomm. Is that true ? Everything builds without >> it and I can send chars on rxtx just fine, but I can't receive them. >> Could this be the problem ? >> >> I downloaded and installed javacomm. I was not able to add >> "Driver=gnuio.RXTXCommDriver >> to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not >> have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 >> installed in /usr/java/jre1.5.0_05. I added comm.jar >> to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext >> to the library paths. Is this OK ? >> >> Does it matter that I am receiving on /dev/ttyUSB0 ? >> >> Thanks. >> > From tjarvi at qbang.org Sun Feb 12 21:03:30 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:03:30 -0700 (MST) Subject: [Rxtx] One serial port object for both sending and receiving ? In-Reply-To: <1139610545.18177.4.camel@zd7280> References: <1139610545.18177.4.camel@zd7280> Message-ID: On Fri, 10 Feb 2006, Kim Lux wrote: > > Is it OK to use one SerialPort ojbect (ex Serial Port serialPort;) and > use it for both sending and receiving ? > > For example: > > ======================================================================== > static SerialPort serialPort = null; > static OutputStream serialOut = null; > static InputStream serialIn = null; > > > > > // assign it to an outputStream for use > try{ > serialOut = serialPort.getOutputStream(); > System.out.println("Serial output stream has been assigned."); > }//try > catch(IOException e) > { > System.out.println("Error: Couldn't assign output stream to serial > port."); > }//catch > > > //assign it to an inputStream for use > try{ > serialIn = serialPort.getInputStream(); > System.out.println("Serial input stream has been assigned."); > }//try > catch(IOException e) > { > System.out.println("Error: Couldn't assign input stream to serial > port."); > }//catch This should be fine. In fact trying to do it another way will probably not work as you will run into lockfile issues. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun Feb 12 21:13:13 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:13:13 -0700 (MST) Subject: [Rxtx] Question about Serial I/O under Win32 In-Reply-To: <662084330@web.de> References: <662084330@web.de> Message-ID: On Sat, 11 Feb 2006 lunareclipse03 at web.de wrote: > Hello everybody, > > I have a strange problem with a piece of code I made for myself. No, > this is not really concerning rxtx, but nevertheless I post this to the > list, hoping that some of you can help me. I've written two libraries, > one for linux and one for win32. The linux port works quite well, I can > send / receive faxes and / or replay voice messages over the telephone > line using a voice modem. But the win32 port of the library causes some > trouble. If, for example, I send out a fax with a certain modem under > linux, it works well. The fax is complete when it comes out of the fax > machine. If I then use the same modem to send out a fax under win32, the > fax coming out of the fax machine gets "stuck" halfways, but the sending > modem thinks that transmission was ok and drops the connection. The > answering fax machine then gives me "error while receiving." The "upper > layer" java code MUST be right, because if I do the same thing under > linux (using the linux library), everything is alright. Now I have to > ask: Can somebody please help me out with this??!? Could it be the case > that some kind of flow control or COMMTIMEOUTS setting causes this > behaviour? I set flow control to RTS/CTS before sending out a fax. How > can I DISABLE flow control? Or what do you think? Can something else > cause this problems? Thank you all for your time and PLEASE write back > soon. > Hi Sven I'm not too willing to talk about flow control at the low level until I confirm some things with test equipment later. It is not clear if you are using rxtx or writing your own native code. So I'm not sure how to answer much of this :) If you are wondering how to change the flow control using rxtx from java, The BlackBox example from Sun flips this back and forth. SerialPort.java in rxtx 2.1 uses the following: SerialPort.java: public static final int FLOWCONTROL_NONE =0; SerialPort.java: public static final int FLOWCONTROL_RTSCTS_IN =1; SerialPort.java: public static final int FLOWCONTROL_RTSCTS_OUT =2; SerialPort.java: public static final int FLOWCONTROL_XONXOFF_IN =4; SerialPort.java: public static final int FLOWCONTROL_XONXOFF_OUT=8; So if you set flowcontrol to RTSCTS, you can set it to NONE to turn it off. If you are looking for how to do it in native code, the rxtx Source is SerialImp.c (unix/linux/mac os x/w32) and termios.c (w32 only with SerialImp.c) You can track the code: SerialImp.c:JNIEXPORT void JNICALL RXTXPort(setflowcontrol)( JNIEnv *env, jobject jobj, jint flowmode ) termios.c:int tcgetattr( int fd, struct termios *s_termios ) termios.c:int tcsetattr( int fd, int when, struct termios *s_termios ) There may be a problem in the rxtx flow control code though. Rather than guess, I want to test this with a gold standard. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Feb 6 00:00:16 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 00:00:16 -0700 (MST) Subject: [Rxtx] wiki delay until tomorrow night. In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: On Sun, 5 Feb 2006, Trent Jarvi wrote: > On Sun, 5 Feb 2006, Kim Lux wrote: > >> usb ? Tell me more... I need that too. > > usb is a very proper design. Thats all it is. > Maybe rxtx could help usb. But it would start with helping bring back the community that was already there. It's not something I'd love to do but maybe its the right thing to do. It would probably take 2 years to do right. But maybe thats better than what we have now. I honestly don't know what IBM is doing which could just run over everything. Just some thoughts after some fine german wine. -- Trent Jarvi tjarvi at qbang.org From gadelavega at yahoo.com.ar Mon Feb 6 02:17:05 2006 From: gadelavega at yahoo.com.ar (Gonzalo A. de la Vega) Date: Mon, 06 Feb 2006 10:17:05 +0100 Subject: [Rxtx] Serial port ownership question In-Reply-To: References: <20060205113618.30274.qmail@web53501.mail.yahoo.com> <1139157422.4553.9.camel@zd7280> <1139158698.4936.9.camel@zd7280> Message-ID: <43E71411.4050402@yahoo.com.ar> On my Fedora Core 4: ls -l /dev/ttyS* crw-rw---- 1 root uucp 4, 64 Feb 6 2006 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Feb 6 2006 /dev/ttyS1 ... and: grep "ttyUSB" /etc/udev/rules.d/50-udev.rules KERNEL=="ttyUSB*", GROUP="uucp", MODE="0660" So anyone in the "uucp" group can use serial ports. On Gentoo the group is "tty". Trent Jarvi escribi?: > > > On Sun, 5 Feb 2006, Dr. Douglas Lyon wrote: > >> I can confirm that this is the case (only root ownership of >> serial ports, under fedora 4). >> Wow, what were they thinking?! >> - DL >> >>> I've found that the newer kernels have the serial ports owned by root. >>> For example, >>> >>> $ls -al /dev/tty* >>> crw-rw-rw- 1 root root 5, 0 Feb 5 02:06 /dev/tty >>> crw-rw---- 1 root root 4, 0 Feb 5 02:06 /dev/tty0 >>> crw------- 1 root root 4, 1 Feb 5 09:07 /dev/tty1 >>> crw-rw---- 1 root tty 4, 10 Feb 5 02:06 /dev/tty10 >>> crw-rw---- 1 root tty 4, 11 Feb 5 02:06 /dev/tty11 >>> ... > > > This is just not a problem jcp or such are going to solve. Its a > platform spitwad fight. But do look at pam. In fact thats what Sun > is doing too. Maybe Linux followed their lead.. I'm not a pam guy. > I've spent 16 hours trying to understand it but your users wont :) > > Solution? I have no clue. Its two tangent mentalities from my > perspective. > > -- > Trent Jarvi > tjarvi at qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mtnvega at yahoo.com.br Mon Feb 6 05:35:43 2006 From: mtnvega at yahoo.com.br (Luiz Jr) Date: Mon, 6 Feb 2006 12:35:43 +0000 (GMT) Subject: [Rxtx] Documentation Wiki In-Reply-To: <1139157422.4553.9.camel@zd7280> Message-ID: <20060206123543.57256.qmail@web53515.mail.yahoo.com> Hello, Thank you for you answer, but so the usage of the API is pretty much like the Java Communications Api? If yes, what version of the Java Comm Api? Thank you, Luiz A. Brandao Jr Kim Lux escreveu: On Sun, 2006-02-05 at 08:36 -0300, Luiz Jr wrote: > Hello, > > I want to start using the RXTX libraries, but I would to know how, > since I can not access the documentation wiki page I just started using them yesterday. Below is how I installed the libraries, if that helps. I used snippets of code from the SimpleWrite application here to get me going. http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html Instead of "import javax.comm.*;", use "import gnu.io.*;" which is gotten from RXTXcomm.jar, which you will need to include in your project references. I am working in Eclipse. BTW: there is no way to open a port without going through the port list and finding it. Maybe sometime in the future someone (me ?) will write a method called openSerialPort that allows the user to give a port identifier, such as "/dev/tty1" and return a port ready to use. It wouldn't take much to write that and it would save users a lot of code. Hope this helps. ======================================================================= 1) Figure out which java you are running, incase there is more than one installed. $ java -version java version "1.5.0_05" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_05-b05) Java HotSpot(TM) Client VM (build 1.5.0_05-b05, mixed mode, sharing) 2) Find all the jre directories and the one from which you are currently running. kfind (jre) 3) cd to that directory plus /lib/i386 cd /usr/java/jre1.5.0_05/lib/i386 4) Copy the library files (*.so) to that directory. cp /home/krlux/Desktop/'Java Controls'/rxtx-linux/bin/* . 5) Check that the copy was successful ls librxtx* librxtxI2C.so librxtxRaw.so librxtxSerial.so librxtxParallel.so librxtxRS485.so 6) cd to the /lib/ext directory for your java. cd /usr/java/jre1.5.0_05/lib/ext 7) Copy the Jar files there cp /home/krlux/Desktop/'Java Controls'/rxtx-linux/lib/ext/* . 8) Check that it was successful ls RXTX* RXTXcomm.jar Rxtx is now installed on your machine ready to use. =================================================================== -- Kim Lux, Diesel Research Inc. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx --------------------------------- Yahoo! Acesso Gr?tis - Internet r?pida e gr?tis. Instale o discador agora! -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/544aa403/attachment-0030.html From lyon at docjava.com Mon Feb 6 05:49:34 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 06 Feb 2006 07:49:34 -0500 Subject: [Rxtx] wiki delay until tomorrow night. In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: Hi All, I have often thought about USB drivers being needed. For example, the ironman watch will not interface to a mac (windows only). It is USB. My dymo label writer has no Java driver (native only). Etc. Most cheap web cameras are USB (and Java drivers go through JAI, if it supports the camera at all). The JAI code shows how sun did the USB drivers. You have to be a member of the jai project to download the source code. https://jai.dev.java.net has the jai distro. And then you are not allowed to redistribute it. However, we can all learn from it (if so inclined). Basically: cvs -d :pserver:lyon at cvs.dev.java.net:/cvs login cvs -d :pserver:lyon at cvs.dev.java.net:/cvs checkout jai-core You will need to user your own uid and pw to get in. The ant build has over 100 warnings from sun deprecations of its own code. You might say that they were hoisted on their own Picard ;) One interesting thing is that they support several platforms: linux-amd64 64-bit Linux-AMD64 linux-i586 32-bit Linux-x86 solaris-amd64 64-bit Solaris-AMD64 solaris-i586 32-bit Solaris-x86 solaris-sparc 32-bit Solaris-SPARC solaris-sparcv9 64-bit Solaris-SPARC windows-i586 32-bit Windows-x86 Thus, ant is used to provide a multi-platform native method distro. Neat. How do they do it? check this out: And: The core download does not contain any C source code (it was all pre-built). Basically, they are just copying .so and .dll files into build directories. I would love to see the C code for this...but Sun does not post it on the https://jai.dev.java.net site. I don't know why...Perhaps I missed it. - Doug >On Sun, 5 Feb 2006, Trent Jarvi wrote: > >>On Sun, 5 Feb 2006, Kim Lux wrote: >> >>>usb ? Tell me more... I need that too. >> >>usb is a very proper design. Thats all it is. >> > >Maybe rxtx could help usb. But it would start with helping bring >back the community that was already there. > >It's not something I'd love to do but maybe its the right thing to do. > >It would probably take 2 years to do right. But maybe thats better >than what we have now. > >I honestly don't know what IBM is doing which could just run over everything. > >Just some thoughts after some fine german wine. > >-- >Trent Jarvi >tjarvi at qbang.org > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tdelenik at gmail.com Mon Feb 6 05:56:32 2006 From: tdelenik at gmail.com (Thanasis Delenikas) Date: Mon, 6 Feb 2006 14:56:32 +0200 Subject: Fwd: [Rxtx] Documentation Wiki In-Reply-To: <1139157422.4553.9.camel@zd7280> References: <20060205113618.30274.qmail@web53501.mail.yahoo.com> <1139157422.4553.9.camel@zd7280> Message-ID: <310a1a930602060456t129f1dc6p5f2b908f13ab5a0b@mail.gmail.com> Hello all, Kim, this is a snippet from the code I use. The closest to directly opening a specific port without enumeration. << ... portId = CommPortIdentifier.getPortIdentifier(getPort()); serialPort = (SerialPort) portId.open("jSMSEngine", 1971); ... >> where getPort() return the string identifier of the port, i.e. "/dev/ttyS0" or "COM1" or whatever. Thanasis. ---------- Forwarded message ---------- From: Kim Lux Date: Feb 5, 2006 6:37 PM Subject: Re: [Rxtx] Documentation Wiki To: RXTX Developers and Users BTW: there is no way to open a port without going through the port list and finding it. Maybe sometime in the future someone (me ?) will write a method called openSerialPort that allows the user to give a port identifier, such as "/dev/tty1" and return a port ready to use. It wouldn't take much to write that and it would save users a lot of code. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/182ab5b8/attachment-0030.html From tjarvi at qbang.org Mon Feb 6 11:53:57 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 11:53:57 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: On Mon, 6 Feb 2006, Dr. Douglas Lyon wrote: > Hi All, > I have often thought about USB drivers being needed. > For example, the ironman watch will not interface > to a mac (windows only). It is USB. > My dymo label writer has no Java driver (native only). > Etc. > Most cheap web cameras are USB (and Java drivers go > through JAI, if it supports the camera at all). > The JAI code shows how sun did the USB drivers. > You have to be a member of the jai project to download > the source code. > https://jai.dev.java.net has the jai distro. > And then you are not allowed to redistribute it. However, > we can all learn from it (if so inclined). Basically: > cvs -d :pserver:lyon at cvs.dev.java.net:/cvs login > cvs -d :pserver:lyon at cvs.dev.java.net:/cvs checkout jai-core > You will need to user your own uid and pw to get in. > The ant build has over 100 warnings from sun deprecations > of its own code. > > You might say that they were hoisted on their own Picard ;) > > One interesting thing is that they support several platforms: > linux-amd64 64-bit Linux-AMD64 > linux-i586 32-bit Linux-x86 > solaris-amd64 64-bit Solaris-AMD64 > solaris-i586 32-bit Solaris-x86 > solaris-sparc 32-bit Solaris-SPARC > solaris-sparcv9 64-bit Solaris-SPARC > windows-i586 32-bit Windows-x86 > Thus, ant is used to provide a multi-platform native method distro. > Neat. > How do they do it? > check this out: > > > > > > > > > > > > > And: > > > > > > > > > > The core download does not contain any C source code (it was all pre-built). > Basically, they are just copying .so and .dll files into build directories. > > I would love to see the C code for this...but Sun does not post it on the > https://jai.dev.java.net site. > > I don't know why...Perhaps I missed it. > > - Doug > > I've looked at moving rxtx to Ant builds. I think that would help IDEs a great deal. I requested a evalutation desk copy the O'Reilly Ant book for some j2ee material I was teaching. http://www.oreilly.com/catalog/anttdg/ It has a one sentence mention of JNI. So there was not luck there. I saw that there is another Ant book that does mention JNI more. I can't find it now. Ant must be able to support it with extensions. http://ant.apache.org/manual/OptionalTasks/javah.html What the auto(break :) tools do in the rxtx build is 4 things really. 1) gcc compile flags 2) ld compile flags 3) config.h 4) compile flags for customizing rxtx (lockfiles, ...) See 1 All of this information except 4 can be static once obtained. So I'm not attached to the auto tools. If I could find an example of Ant being used for JNI code, I'd be one of the first to start moving that direction. Maybe someone saw an example someplace. The other thing we have not completed discussing is the directory structure. There is interest in making rxtx more IDE friendly. I get more mail about that off the list than how to install rxtx. And I see we have Ken Thompson in da house :) He is our trusted CVS maintainer and the guy that purchased the rxtx.org domain. Old community. We will need Ken for changing the directory structure of source. I would like to open up discussion about both of these as it is more than time. The problem is I have little experience with Ant and even less with IDEs. It would be nice if we could work with Eclipse and NetBeans. http://www.netbeans.org/ (sun and some community) http://www.eclipes.org (ibm,rhat,... perhaps more community) http://maven.apache.org/what-is-maven.html (apache. It is community) borland should sortof be here too but I think thats covered in eclipse. >From what I understand so far, we should morph rxtx to support those three maybe trusting apaches lead with maven. But I use vi. I have little to no clues beyond what people have fed me. Can we agree that thats the right direction to go? -- Trent Jarvi tjarvi at qbang.org From brian at mbari.org Mon Feb 6 14:57:50 2006 From: brian at mbari.org (Brian Schlining) Date: Mon, 6 Feb 2006 13:57:50 -0800 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> > The other thing we have not completed discussing is the directory > structure. There is interest in making rxtx more IDE friendly. I > get more mail about that off the list than how to install rxtx. > > And I see we have Ken Thompson in da house :) He is our trusted > CVS maintainer and the guy that purchased the rxtx.org domain. Old > community. We will need Ken for changing the directory structure of > source. > > I would like to open up discussion about both of these as it is > more than time. The problem is I have little experience with Ant > and even less with IDEs. It would be nice if we could work with > Eclipse and NetBeans. > > http://www.netbeans.org/ (sun and some community) > http://www.eclipes.org (ibm,rhat,... perhaps more community) > http://maven.apache.org/what-is-maven.html (apache. It is community) > borland should sortof be here too but I think thats covered in > eclipse. > >> From what I understand so far, we should morph rxtx to support >> those three > maybe trusting apaches lead with maven. But I use vi. I have > little to no clues beyond what people have fed me. > Maven likes the directory structure below for Java code. (From http:// maven.apache.org/guides/getting-started/index.html) This structure works fine with ant, netbeans, and eclipse. rxtx_root_directory `-- src |-- main | `-- java | `-- gnu | `-- io `-- test `-- java `-- gnu `-- io Brian Schlining Software Engineer http://www.mbari.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/d9451eba/attachment-0030.html From tjarvi at qbang.org Mon Feb 6 15:11:45 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 15:11:45 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: > rxtx_root_directory > `-- src > |-- main > | `-- java > | `-- gnu > | `-- io > `-- test > `-- java > `-- gnu > `-- io > >From what I understand this will just be good. For me it makes no difference. So lets do the rxtx thing. Let if fester for two weeks and if nobody objects, we will do it. I'm not doing this because I care. I'm doing this to eliminate much of my inbox. But test... man is rxtx lacking there in the community aspect. It is covered but not right. _maybe_ I can change that this year. -- Trent Jarvi tjarvi at qbang.org (cat hurding since 1997) From lux at diesel-research.com Mon Feb 6 21:38:49 2006 From: lux at diesel-research.com (Kim Lux) Date: Mon, 06 Feb 2006 21:38:49 -0700 Subject: [Rxtx] How can I use Lock Files with rxtx (in FC4) ? Message-ID: <1139287129.17031.3.camel@zd7280> I am now running an rxtx application on FC4. I am getting: ========================================================= check_group_uucp(): error testing lock file creation Error details: Permission denied check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL ========================================================= $ ls -al /var/lock total 32 drwxrwxr-x 4 root lock 4096 Feb 6 16:04 . drwxr-xr-x 24 root root 4096 Nov 14 01:19 .. drwx------ 2 root root 4096 Apr 27 2005 lvm drwxr-xr-x 2 root root 4096 Feb 6 16:04 subsys How do I fix this for regulator users ? -- Kim Lux, Diesel Research Inc. From dmarkman at mac.com Mon Feb 6 22:24:44 2006 From: dmarkman at mac.com (Dmitry Markman) Date: Tue, 7 Feb 2006 00:24:44 -0500 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: if I understands the issue right in order to be able to use ant for c/c++ compilation you have to install ant's cc task http://ant-contrib.sourceforge.net/cc.html it looks like it should work on mac os x (authors claim, that it's platform independent) but I never tested so all you have to do it's providing right command line for the gcc compiler On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: >> rxtx_root_directory >> `-- src >> |-- main >> | `-- java >> | `-- gnu >> | `-- io >> `-- test >> `-- java >> `-- gnu >> `-- io >> > > >> From what I understand this will just be good. > > For me it makes no difference. So lets do the rxtx thing. Let if > fester for two weeks and if nobody objects, we will do it. > > I'm not doing this because I care. I'm doing this to eliminate > much of my inbox. > > But test... man is rxtx lacking there in the community aspect. It > is covered but not right. _maybe_ I can change that this year. > > -- > Trent Jarvi > tjarvi at qbang.org > (cat hurding since 1997) > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx Dmitry Markman From lux at diesel-research.com Mon Feb 6 23:20:15 2006 From: lux at diesel-research.com (Kim Lux) Date: Mon, 06 Feb 2006 23:20:15 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? Message-ID: <1139293215.3689.4.camel@zd7280> I'm running the code below. portlist.hasMoreElements() is false. /dev has ports in it as listed below. What am I doing wrong ? ========================================================== // Step through the list of ports until we find one that matches // the one we are looking for. portList = CommPortIdentifier.getPortIdentifiers(); while(portList.hasMoreElements()) { portID = (CommPortIdentifier) portList.nextElement(); // if (portID.getName().equals("/dev/ttyUSB0")) { myTA.append("Serial port ttyUSB0 has been found\n"); break; }// if portID equals... }// End of while... ========================================================== ls -al /dev/tty* crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 ... crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 -- Kim Lux, Diesel Research Inc. From david.garnier at trusted-logic.com Tue Feb 7 00:46:30 2006 From: david.garnier at trusted-logic.com (David Garnier) Date: Tue, 07 Feb 2006 08:46:30 +0100 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: <43E85056.2090608@trusted-logic.com> Hello, I think that the make-based build process is fine as it is, apart from the location of the Java source files. It is true that putting the Java source in a directory structure that map 1-to-1 to the Java package structure is the norm and should make it easier for everyone to modify the Java source, with or without an IDE. Ant is a good tool, but in the RXTX case I fail to see the advantage of using it compared to the current make-based process. As Trent said, they are more pressing issues, like testing. Regards, David Dmitry Markman wrote: > if I understands the issue right > in order to be able to use ant for c/c++ compilation > you have to install ant's cc task > http://ant-contrib.sourceforge.net/cc.html > > it looks like it should work on mac os x > (authors claim, that it's platform independent) > but I never tested > > so all you have to do it's providing right command line > for the gcc compiler > > > > > On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: > >>> rxtx_root_directory >>> `-- src >>> |-- main >>> | `-- java >>> | `-- gnu >>> | `-- io >>> `-- test >>> `-- java >>> `-- gnu >>> `-- io >>> >> >> >>> From what I understand this will just be good. >> >> For me it makes no difference. So lets do the rxtx thing. Let if >> fester for two weeks and if nobody objects, we will do it. >> >> I'm not doing this because I care. I'm doing this to eliminate much >> of my inbox. >> >> But test... man is rxtx lacking there in the community aspect. It is >> covered but not right. _maybe_ I can change that this year. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> (cat hurding since 1997) From tjarvi at qbang.org Tue Feb 7 01:11:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 01:11:31 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <43E85056.2090608@trusted-logic.com> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: On Tue, 7 Feb 2006, David Garnier wrote: > Hello, > > I think that the make-based build process is fine as it is, apart from the location of the Java > source files. It is true that putting the Java source in a directory structure that map 1-to-1 to > the Java package structure is the norm and should make it easier for everyone to modify the Java > source, with or without an IDE. > > Ant is a good tool, but in the RXTX case I fail to see the advantage of using it compared to the > current make-based process. As Trent said, they are more pressing issues, like testing. > Hi David I have more experience with testing rxtx than I can talk about. But let it be known, rxtx has gone trough 100's of hours of testing. We are hobby folks interested in toys but there is more. rxtx has had some of the best guidance in the industry there. This is not an easy thing. I may be able to come back in a month from the other side of the corperate fence and help. I suspect the tests could just be made public but they are in a very unusual environment that just wont work in a wider sense. This is something I'll be trying to change. At one point it was agreed we could just make the results public so this isnt just noise.. There is interest and I think its safe to mention that much. The big problem with testing in the past is most of it is done with a loopback connection. So we *still* have major questions regarding things like flow control. rxtx talks to itself over a loopback and it works. regardless of right or wrong. This requires more thought to be done right. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Feb 7 02:46:34 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 02:46:34 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: > The big problem with testing in the past is most of it is done with a > loopback connection. So we *still* have major questions regarding things > like flow control. rxtx talks to itself over a loopback and it works. > regardless of right or wrong. With serial communication there are gold standards. ckermit is probably a definitive 'standard.' Maybe its possible to do ping/pong tests with ckermit? Is it scriptable? There are known issues in rxtx. Probably the worst is some threading issues regarding some JREs with multiple JNI threads setting java variables. Man did I get schooled there. Just switch the c functions to returning variables and things go away. Sometimes they work fine, sometimes they blow up. Without understanding everything, somehow rhat got it right and debian (and especially gentoo) grabbed kernel patches causing all sort of harm. Its not hard to fix once you understand whats going on but nearly impossible to track with a debugger. So I have a good idea what 2.1-8 will have outside of the IDE modifications. rxtx 2.1-7 is a release for everyone to sync with. Its not even as stable as -pre17 as far as I know - I ran no test suites. I'll be chasing it too. We just had so many contributions that it was time. It seriously broke internal scheduals but thats a great thing :) The other thing I want to do in 2.1-8 is automagic baud rates. It turns out lots of shops are doing really funky baud rates for things like automobile test equipment. It is possible but it requires a fair amount of change in the native code. Is anyone looking at this? -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Feb 7 02:57:21 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 07 Feb 2006 04:57:21 -0500 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <43E85056.2090608@trusted-logic.com> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: Hi All, I agree, testing is very important. The problem I have been trying to address is related to cross-platform testing and the robust nature of the installs. Typically, I visit 3 platforms to deploy my product, windows, linux and mac. A build is performed on each platform. The idea that you can build for many platforms from one copy the source code seems attractive. This should enable synchronized deployments of identical code. The question of how to achieve this goal remains open. As Trent mentioned, this is hard. Perhaps Ant will help here (but perhaps not). Ant does seem to help with running unit tests. However, it does not help with multi-platform tests. For that you need many machines and different operating environments. Toward that end, I have created a multi-platform test that can be run from web start, located at: http://show.docjava.com:8086/book/cgij/code/jnlp/serialPort.PortTest.jnlp This is interesting because many people in the community can run the test and we can improve the test, as time permits. No, it is not a perfect solution, however, the idea does help with multi-platform tests using many machines and different operating environments. If the group has a good test for a general serial port set-ups, i would be happy to deploy it, for general evaluation using web start. And as for ANT, it is just an idea. Not all my ideas are good ones! - Doug >Hello, > >I think that the make-based build process is fine as it is, apart >from the location of the Java >source files. It is true that putting the Java source in a directory >structure that map 1-to-1 to >the Java package structure is the norm and should make it easier for >everyone to modify the Java >source, with or without an IDE. > >Ant is a good tool, but in the RXTX case I fail to see the advantage >of using it compared to the >current make-based process. As Trent said, they are more pressing >issues, like testing. > >Regards, >David > >Dmitry Markman wrote: >> if I understands the issue right >> in order to be able to use ant for c/c++ compilation >> you have to install ant's cc task >> http://ant-contrib.sourceforge.net/cc.html >> >> it looks like it should work on mac os x >> (authors claim, that it's platform independent) >> but I never tested >> >> so all you have to do it's providing right command line >> for the gcc compiler >> >> >> >> >> On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: >> >>>> rxtx_root_directory >>>> `-- src >>>> |-- main >>>> | `-- java >>>> | `-- gnu >>>> | `-- io >>>> `-- test >>>> `-- java >>>> `-- gnu >>>> `-- io >>>> >>> >>> >>>> From what I understand this will just be good. >>> >>> For me it makes no difference. So lets do the rxtx thing. Let if >>> fester for two weeks and if nobody objects, we will do it. >>> >>> I'm not doing this because I care. I'm doing this to eliminate much >>> of my inbox. >>> >>> But test... man is rxtx lacking there in the community aspect. It is >>> covered but not right. _maybe_ I can change that this year. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> (cat hurding since 1997) > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From matt.higgins at gmail.com Tue Feb 7 08:28:34 2006 From: matt.higgins at gmail.com (Matt Higgins) Date: Tue, 7 Feb 2006 10:28:34 -0500 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final Message-ID: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? import java.io.*; import java.util.*; import gnu.io.*; public class MySimpleRead implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; public static void main(String[] args) { boolean portFound = false; String defaultPort = "COM1"; if (args.length > 0) { defaultPort = args[0]; } portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; MySimpleRead reader = new MySimpleRead(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } } public MySimpleRead() { try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) { e.printStackTrace(); } try { inputStream = serialPort.getInputStream(); } catch (IOException e) { e.printStackTrace(); } try { serialPort.addEventListener(this); } catch (TooManyListenersException e) { e.printStackTrace(); } try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { e.printStackTrace(); } System.out.println("Baud is " + serialPort.getBaudRate()); System.out.println("Bits is " + serialPort.getDataBits()); System.out.println("Stop is " + serialPort.getStopBits()); System.out.println("Par is " + serialPort.getParity()); serialPort.notifyOnDataAvailable(true); readThread = new Thread(this); readThread.start(); } public void run() { // Thread.sleep(20000); //} catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { System.out.println("An event occurred " + event.getEventType()); switch (event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: byte[] readBuffer = new byte[20]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } System.out.print(new String(readBuffer)); } catch (IOException e) {} break; } } } --------------- Result on windows ------------------------------ Stable Library ============================================================== Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port:: COM1 Baud is 9600 Bits is 8 Stop is 1 Par is 0 ----------------- End Results ----------------------------------------- ------------------ Result on Linux ----------------------------------- Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 Found port: /dev/ttyS0 Baud is 9600 Bits is 8 Stop is 1 Par is 0 An event occurred 1 043100066224 ------------------ End Results --------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/a1431630/attachment-0030.html From brian at mbari.org Tue Feb 7 09:48:37 2006 From: brian at mbari.org (Brian Schlining) Date: Tue, 7 Feb 2006 08:48:37 -0800 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> Message-ID: <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> Hi Matt > The following code works fine on Linux but I never see any data > when run on Windows. This is a cut and paste from the SimpleRead > example. > I am attempting to read data from a bar code scanner. I can fire > up HyperTermianl on windows and see that the device is working > properly as I see the barcodes are scanned and echoed back to the > terminal. However when I run the app I don't see any data. It is > however associating with the com port as the informational bits > print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. Cheers Brian Schlining Software Engineer http://www.mbari.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/16d07f37/attachment-0030.html From lux at diesel-research.com Tue Feb 7 11:59:58 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 11:59:58 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139293215.3689.4.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> Message-ID: <1139338798.8145.4.camel@zd7280> Any ideas on this ? Any reason why portList.hasMoreElements() should be false even though there are devices in /dev ? On Mon, 2006-02-06 at 23:20 -0700, Kim Lux wrote: > I'm running the code below. > > portlist.hasMoreElements() is false. > > /dev has ports in it as listed below. > > What am I doing wrong ? > > > ========================================================== > // Step through the list of ports until we find one that matches > // the one we are looking for. > > portList = CommPortIdentifier.getPortIdentifiers(); > > while(portList.hasMoreElements()) > { > portID = (CommPortIdentifier) portList.nextElement(); // > if (portID.getName().equals("/dev/ttyUSB0")) > { > myTA.append("Serial port ttyUSB0 has been found\n"); > break; > }// if portID equals... > }// End of while... > ========================================================== > > ls -al /dev/tty* > crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty > crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 > crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 > crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 > crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 > ... > crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 > crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 > crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 > > > -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 12:20:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 12:20:25 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139338798.8145.4.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> Message-ID: On Tue, 7 Feb 2006, Kim Lux wrote: > > Any ideas on this ? Any reason why portList.hasMoreElements() should be > false even though there are devices in /dev ? > > > On Mon, 2006-02-06 at 23:20 -0700, Kim Lux wrote: >> I'm running the code below. >> >> portlist.hasMoreElements() is false. >> >> /dev has ports in it as listed below. >> >> What am I doing wrong ? >> >> >> ========================================================== >> // Step through the list of ports until we find one that matches >> // the one we are looking for. >> >> portList = CommPortIdentifier.getPortIdentifiers(); >> >> while(portList.hasMoreElements()) >> { >> portID = (CommPortIdentifier) portList.nextElement(); // >> if (portID.getName().equals("/dev/ttyUSB0")) >> { >> myTA.append("Serial port ttyUSB0 has been found\n"); >> break; >> }// if portID equals... >> }// End of while... >> ========================================================== >> >> ls -al /dev/tty* >> crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty >> crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 >> crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 >> crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 >> crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 >> ... >> crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 >> crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 >> crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 >> >> >> > Hi Kim What rxtx does is try to open the port and do a timed out read. If the kernel/... do not complain it's enumarted. I suspect you could do a crude test by doing something like cat /dev/ttyS0 > /dev/null If that barfs then rxtx wont enumerate the port. hmm looking at your question again, I suspect it's a lockfile problem. This is documented in INSTALL with the source. Its easy enough to test this too.. touch /var/lock/testingrxtxlockfiles && rm -f /var/lock/testingrxtxlockfiles If you are not in the right group it will bail. Root will work regardless. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 12:37:56 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 12:37:56 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> Message-ID: <1139341076.8145.11.camel@zd7280> Exactly which ports does rxtx attempt to put into the list ? /dev/* or /dev/tty* or /dev/tty[0-9[0-9] ? or /dev/ttyS* ? For the record, only /dev/ttyUSB0 is a valid port on the machine I am presently on. Will this be a problem ? On Tue, 2006-02-07 at 12:20 -0700, Trent Jarvi wrote: > This is documented in INSTALL with the source. > I was wondering where that file was. I will download source and dig it up. Thanks. -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 12:51:09 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 12:51:09 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139341076.8145.11.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: On Tue, 7 Feb 2006, Kim Lux wrote: > > Exactly which ports does rxtx attempt to put into the list ? /dev/* > or /dev/tty* or /dev/tty[0-9[0-9] ? or /dev/ttyS* ? > > For the record, only /dev/ttyUSB0 is a valid port on the machine I am > presently on. Will this be a problem ? > > > On Tue, 2006-02-07 at 12:20 -0700, Trent Jarvi wrote: >> This is documented in INSTALL with the source. >> > I was wondering where that file was. I will download source and dig it > up. > > Thanks. > Hmm I'm looking at pre17 so this may have changed. (its just what I have on this machine) if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA" // for the IPAQs }; CandidatePortPrefixes=Temp; } So you may need to add "ttyUSB" to that list. RXTX used to enumerate _everything_ see if(osName.equals("Linux-all-ports") But it became less than practical. This is all in RXTXCommDriver.java hmm I just did a cvs update. if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have to get your fingers into the code. We aim for sane defaults. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 13:06:45 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 13:06:45 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139342805.8145.22.camel@zd7280> On Tue, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > Hmm I'm looking at pre17 so this may have changed. (its just what I have > on this machine) > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA" // for the IPAQs > }; > CandidatePortPrefixes=Temp; > } > > > So you may need to add "ttyUSB" to that list. RXTX used to enumerate > _everything_ see if(osName.equals("Linux-all-ports") But it became less > than practical. > > This is all in RXTXCommDriver.java > > hmm I just did a cvs update. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have > to get your fingers into the code. We aim for sane defaults. Excellent. Thanks for taking the time. -- Kim Lux, Diesel Research Inc. From ideiglenes1 at freemail.hu Tue Feb 7 13:53:39 2006 From: ideiglenes1 at freemail.hu (--) Date: Tue, 07 Feb 2006 21:53:39 +0100 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139345619.22534.2.camel@localhost> Hi! I use this code to get all the extra Linux devices. :) if ("Linux".equals(System.getProperty("os.name"))) { System.setProperty("os.name","Linux-all-ports"); } driver = new RXTXCommDriver(); On k, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > On Tue, 7 Feb 2006, Kim Lux wrote: > > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have > to get your fingers into the code. We aim for sane defaults. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From matt.higgins at gmail.com Tue Feb 7 13:45:54 2006 From: matt.higgins at gmail.com (Matt Higgins) Date: Tue, 7 Feb 2006 15:45:54 -0500 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> Message-ID: <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> Sweet this is exactly what I needed. I was searching the archives through marc.theamisgroup they only have archives back to 1/3/05. Should have hit the mailman archive! Thanks a lot! On 2/7/06, Brian Schlining wrote: > > Hi Matt > > The following code works fine on Linux but I never see any data when run > on Windows. This is a cut and paste from the SimpleRead example. > I am attempting to read data from a bar code scanner. I can fire up > HyperTermianl on windows and see that the device is working properly as I > see the barcodes are scanned and echoed back to the terminal. However when I > run the app I don't see any data. It is however associating with the com > port as the informational bits print fine? > > > You're not the only one whose had this problem, I don't know if Trent has > addressed this is the latest release of RXTX but there is a workaround. > Here's the recent thread from the RXTX mailing list regarding this issues: > > Thanasis Delenikas tdelenik at gmail.com > Wed Jan 18 13:56:23 MST 2006 > > * Previous message: [Rxtx] Re: More close() performance fixes > * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] > > Hi all. > (I've subscribed again from my other email account). > > Trent, > > You are right. Linux *always* works, no matter what flow control you set. > Windows *works only* with hardware flow control (I haven't tested what > happens with software XON/XOFF flow control). > > I assume (but I am not certain) that even with no flow control at all, all > platforms should work. Without flow control, you have the risk of bumping > into overflow or framing errors, but that's your (the end programmer, I > mean) problem. > > >From my side, I shouldn't be working without flow control. That was a bug > too... It was some code forgotten from the old times, when I used to work > with phone emulation drivers which didn't support flow control. The > correct > way is to have some flow control enabled and that's why I suppose this is > a > low-severity bug for RxTx. > > I have no idea which platform shows the correct behaviour, since > my knowledge about Linux and the inner workings of these low-level i/o > operations is limited. > > Regards, > Thanasis Delenikas. > > > > > Message: 2 > > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > > From: Trent Jarvi > > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > > To: RXTX Developers and Users > > Message-ID: > > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > > > Hi all, > > > > > > Trent, I have found something. > > > I read your comment about flow control, so I experimented a bit. > > > > > > If you remember, in my sample program I've used no flow control at all > ( > > i.e. > > > Java constant FLOWCONTROL_NONE). > > > > > > Now, during testing, I've switch to hardware inbound flow control (i.e > . > > Java > > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > > beautifully! > > > > > > I think I will switch to H/W flow control and test things for a while, > > but > > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > > > > > Hi Thanasis, > > > > I'm fairly sure you have identified a bug. I would not worry too much > > about what Sun CommAPI w32 defaults are. I think they did more or less > > whatever the port opened with. Just a guess. Linux tries to stomp on > > ports so they are all the same. > > > > So this started out with Linux worked, Windows XP/.. did not as I > recall. > > Something is wrong in rxtx. Do I understand this right? > > > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > > > Perhaps there is something Wayne or I did not understand when we wrote > > that code. I wasnt programming back in the BBS days so modems are not > my > > thing. I have a few questions. > > > > Is the above matrix confirmed by observation? > > Linux just always worked? > > Which one _should_ work? I'm guessing modems work with hardware flow > > control. I'll have to dig around. > > > > The windows flow control changes a couple things with hardware flow > > control. Following the w32 API documentation is confusing sometimes. > > But it looks like Linux could have a bug too. > > Cheers > > Brian Schlining > Software Engineer > http://www.mbari.org > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/9c989144/attachment-0030.html From tjarvi at qbang.org Tue Feb 7 14:06:14 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 14:06:14 -0700 (MST) Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> Message-ID: >> >> You're not the only one whose had this problem, I don't know if Trent has >> addressed this is the latest release of RXTX but there is a workaround. >> Here's the recent thread from the RXTX mailing list regarding this issues: >> I have not. I expect to have access to some test equipment next month and I'll go through all of this. I really don't know whats going on and I need a gold standard. I thought maybe linux was autodetecting the flow control. Your observations would certainly be welcome. I need to talk to Russell King and see what he is doing. Until then I'd just be toying around over a loopback as usual. This is very high on the list though. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 17:25:05 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 17:25:05 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139358305.17994.2.camel@zd7280> My application now works. I installed the libraries and jar from 2.1-7 (Final). portlist.hasMoreElements is no longer false. The application finds the port for /dev/ttyUSB0. Thanks for your help, Trent (et al) Sorry I bothered you with this. Next time I will look in the source first. I didn't think it was an rxtx issue, I thought it was a Linux setup issue . On Tue, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > Hmm I'm looking at pre17 so this may have changed. (its just what I > have > on this machine) > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux > Serial Ports > "ttySA" // for the > IPAQs > }; > > CandidatePortPrefixes=Temp; > } > > > So you may need to add "ttyUSB" to that list. RXTX used to enumerate > _everything_ see if(osName.equals("Linux-all-ports") But it became > less > than practical. > > This is all in RXTXCommDriver.java > > hmm I just did a cvs update. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux > Serial Ports > "ttySA", // for the > IPAQs > "ttyUSB" // for USB > frobs > }; > > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you > have > to get your fingers into the code. We aim for sane defaults. -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 19:21:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 19:21:54 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139358305.17994.2.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> <1139358305.17994.2.camel@zd7280> Message-ID: >Sorry I bothered you with this. Next time I will look in the source >first. I didn't think it was an rxtx issue, I thought it was a Linux >setup issue . Why would you be sorry? I would have done the same. I'm glad it's working :) -- Trent Jarvi tjarvi at qbang.org From tma at mail.island.net Wed Feb 8 13:39:35 2006 From: tma at mail.island.net (Tom Alldread) Date: Wed, 08 Feb 2006 12:39:35 -0800 Subject: [Rxtx] Win32/Linux Serial Port Data Dropouts In-Reply-To: <200602060702.k167255O007882@www.qbang.org> References: <200602060702.k167255O007882@www.qbang.org> Message-ID: <43EA5707.4020200@mail.island.net> Greetings Folks at RXTX: During the last couple of months I have been alternately testing with javax.comm 2 and RXTX 2.1 under Windows XP and CommApi 3 and RXTX 2.1 under Suse 10.0 Linux. In the process I have learned a little about java multi-threading under NetBeans 5 with Profiler. My java (jdk 1.5_06) application is used for data acquisition and provides a graphical display of A-D conversion data received from a 56KBaud serial port. The actual data throughput is about 10KBaud thus it is well below the speed of the port. I use hardware RTS/CTS flow control which can stall the data acquisition sample rate if necessary. This ensures the display computer has the ability to slow the data acquisition rate should it become too busy to accept the regular data flow. Both the serial port buffer and the java read buffer are set at 16KB. Usually the data transfers into the java read buffer are less than 100 bytes unless the data acquisition is recovering from a stall. The data flow normally hesitates after each 5 KB block as a continue command is needed from the display computer to start the drawing of a new graphics display line. Separate threads have been provided for the serial port event monitoring and data processing. The serial port event thread has been given the maximum priority and data processing thread the minimum priority provided by java. Thread yield statements have been placed within all data processing while/for loops as an effort to ensure quick access to CPU cycles for the serial port event thread. I have found that short data transmissions are essentially error free but occasional dropouts occur with continuous data flow especially under Windows XP. ....................................................................................................................................................................................... Linux results: I am happy to report that RXTX 2.1 appears to work very well under Linux although I did notice some errors when the screen savers were running with my dual monitors. I believe this is a local problem associated with my dual graphics which needs further attention. The recent CommApi 3 Linux release from Sun did not work at all with my program. It seemed to send commands out OK but did not receive any data. Although the serial port event triggered the ISR, the input stream appeared filled with nulls and thus did not contain any data. As my understanding is that CommApi 3 was tested with a Red Hat distribution of Linux I wonder if this problem is distro dependent? Although somewhat off topic here I wonder if anyone reading this has had similar experience? .................................................................................................................................................................................. Windows XP results: There are problems with occasional data dropouts which become more frequent as the sampling rate is increased or if the computer becomes busy with other duties. The dropouts typically consist of a half dozen byte block of lost data. It appears the lost bytes never get added to the java input stream. There has not been any indication of garbled data, overruns or framing errors which suggests the UART communications remains solid. Using javax.comm 2 I found that the setting of SerialPort 'enableReceiveThreshold' to 40 and 'enableReceiveTimeout' of 100mS reduced the dropouts error rate significantly. I found that I could not get RXTX 2.1 to function with the aforementioned threshold and timeout settings. The javax.comm 2 interface is consequently performing better for me under Windows than RXTX 2.1. I wonder if anyone here has any suggestions as to what I might try to improve RXTX 2.1? Although my settings are the same as under Suse 10.0, RXTX 2.1 performs much better for me under Linux than any of the alternatives that I have tried under Windows XP . ............................................................................................................................................................................... I would like to establish, based on the experience of others, if I have reached the normally expected performance limit of java serial port communications? Should I expect to achieve virtually error free serial port data input from a continuous stream under Windows XP java software? I am considering changing my protocol to packets with error checking if necessary but would like to know if the dropout problems I am experiencing are typical or not before I take this rather work intensive plunge. Many thanks in advance for any help! Best Regards, Tom Alldread -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.375 / Virus Database: 267.15.2/253 - Release Date: 2006-02-07 From jlaxson at mac.com Wed Feb 8 23:56:48 2006 From: jlaxson at mac.com (John Laxson) Date: Thu, 9 Feb 2006 00:56:48 -0600 Subject: [Rxtx] PortInUseException: Unknown Application on OSX Message-ID: Hi, I've been trying to get RXTX 2.1.7 going on Mac OS X for a while here, and am running up into a wall here. I've tried with pre- compiled and the source version and get the same problem, a gnu.io.PortInUseException: Unknown Application. I have run the fixperms script included with the source distribution, and id shows me as a member of the uucp group, and permissions on /var/spool/uucp are 775 root:uucp. Running a test program (included at the bottom for clarity) lets me enumerate all the serial ports correctly, but trying to open any of them gives the PortInUseException. If it helps, when I try to open a port that's set to make an outgoing bluetooth connection, there is no delay and no connection attempt at all. Thanks, John Laxson PS: The documentation wiki on qbang.org shows 404, and has for a few days now. My test code: public static void main(String[] args) { SerialPort serialPort; try { Enumeration e = CommPortIdentifier.getPortIdentifiers(); CommPortIdentifier ident; while (e.hasMoreElements()) { ident = (CommPortIdentifier)e.nextElement(); System.out.println(ident.getName()); } ident = CommPortIdentifier.getPortIdentifier("/dev/cu.modem"); serialPort = (SerialPort) ident.open("Me", 5000); } catch (Exception e) { e.printStackTrace(); } } From rajesh.invincible at gmail.com Thu Feb 9 03:39:38 2006 From: rajesh.invincible at gmail.com (Rajesh N) Date: Thu, 9 Feb 2006 16:09:38 +0530 Subject: [Rxtx] Re: Move .java Files in gnu.io filesystem hierarchy - Maven (2) In-Reply-To: <43DF21D2.7090200@ngi.it> References: <43DF21D2.7090200@ngi.it> Message-ID: <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Can anybody tell me how to overcome these EXCEPTIONS I AM WORKING ON SERIAL COMMN IN JAVA ON LINUX. 1. " NOT ALL PARAMETERS SUPPORTED BY THE KERNEL" This i came across the following statement inmy prog. SerialP is A SerialPort object SerialP.setSerialPortParams(9600(BAUDRATE),DATABITS_8,STOPBITS_1,PARITY_NONE) 2. NullPointer Exception at Event Dispatch Now i have checked all my object references for a null reference but i found none i have put up my entire code in try catch blocks but still I AM UNABLE TO CATCH THIS EXCEPTION AND HENCE MY APPLICATION CLOSES HOW DOES THESE GO? PLEASE HELP ME IT IS URGENTTTTTTTTTTTTTTTT yours sincerely RAJESH On 1/31/06, Fabio Frumento wrote: > Hi Xavier, > > I don't know maven at all but the directory hierarchy listed buy Trent > is fine for me... > > I'll take a look to maven, it seems an interesting project > > Regards > > Fabio Frumento > > Trent Jarvi wrote: > > On Tue, 31 Jan 2006, Xavier Frisaye wrote: > > > >> Hi all, > >> > >> If you are going to rearrange the src folder, i will propose to use > >> maven 2 and follow its directory structure > >> > (http://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html). > >> > >> Maven 2 simplify java project and give a standard way to make projects > >> (http://maven.apache.org/). > >> We are using it for internal projects and we are very satisfied. > >> > >> Is anybody interested? > >> > >> I'm not an expert in maven 2 (yet) but i'm agree to help using it if > >> you choose to make so. > >> > > > > so this would be: > > > > rxtx-devel/src/main/java/gnu.io > > rxtx-devel/src/test/java/ManIwish.java > > > > I don't use IDEs very much so I'll let others comment. But I don't see > > a problem with that. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Thu Feb 9 09:50:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 9 Feb 2006 09:50:31 -0700 (MST) Subject: [Rxtx] Re: Move .java Files in gnu.io filesystem hierarchy - Maven (2) In-Reply-To: <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Message-ID: On Thu, 9 Feb 2006, Rajesh N wrote: > Can anybody tell me how to overcome these EXCEPTIONS > I AM WORKING ON SERIAL COMMN IN JAVA ON LINUX. > > 1. " NOT ALL PARAMETERS SUPPORTED BY THE KERNEL" > > This i came across the following statement inmy prog. > SerialP is A SerialPort object > SerialP.setSerialPortParams(9600(BAUDRATE),DATABITS_8,STOPBITS_1,PARITY_NONE) > Strange. The parameters you use are the same the port should open with by default. Could you paste the actual exception you are getting? I don't see that in the rxtx source. Also it would help to know the rxtx version. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Fri Feb 10 15:29:05 2006 From: lux at diesel-research.com (Kim Lux) Date: Fri, 10 Feb 2006 15:29:05 -0700 Subject: [Rxtx] One serial port object for both sending and receiving ? Message-ID: <1139610545.18177.4.camel@zd7280> Is it OK to use one SerialPort ojbect (ex Serial Port serialPort;) and use it for both sending and receiving ? For example: ======================================================================== static SerialPort serialPort = null; static OutputStream serialOut = null; static InputStream serialIn = null; // assign it to an outputStream for use try{ serialOut = serialPort.getOutputStream(); System.out.println("Serial output stream has been assigned."); }//try catch(IOException e) { System.out.println("Error: Couldn't assign output stream to serial port."); }//catch //assign it to an inputStream for use try{ serialIn = serialPort.getInputStream(); System.out.println("Serial input stream has been assigned."); }//try catch(IOException e) { System.out.println("Error: Couldn't assign input stream to serial port."); }//catch ======================================================================== -- Kim Lux, Diesel Research Inc. From lux at diesel-research.com Fri Feb 10 21:23:00 2006 From: lux at diesel-research.com (Kim Lux) Date: Fri, 10 Feb 2006 21:23:00 -0700 Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Message-ID: <1139631780.23882.10.camel@zd7280> I've got a problem receiving chars with my version of serialRead, written in an SWT GUI. I had a Java pro have a good look at my code and he can't see anything wrong with it. I can send chars fine. When I receive a char the cpu usage for the app goes to 100% and the code in the serial event handler doesn't get executed. The instructions on the Java Comm Serial API How-To for Linux page state that I must install javacomm. Is that true ? Everything builds without it and I can send chars on rxtx just fine, but I can't receive them. Could this be the problem ? I downloaded and installed javacomm. I was not able to add "Driver=gnuio.RXTXCommDriver to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 installed in /usr/java/jre1.5.0_05. I added comm.jar to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext to the library paths. Is this OK ? Does it matter that I am receiving on /dev/ttyUSB0 ? Thanks. -- Kim Lux, Diesel Research Inc. From lunareclipse03 at web.de Sat Feb 11 09:44:46 2006 From: lunareclipse03 at web.de (lunareclipse03@web.de) Date: Sat, 11 Feb 2006 17:44:46 +0100 Subject: [Rxtx] Question about Serial I/O under Win32 Message-ID: <662084330@web.de> Hello everybody, I have a strange problem with a piece of code I made for myself. No, this is not really concerning rxtx, but nevertheless I post this to the list, hoping that some of you can help me. I've written two libraries, one for linux and one for win32. The linux port works quite well, I can send / receive faxes and / or replay voice messages over the telephone line using a voice modem. But the win32 port of the library causes some trouble. If, for example, I send out a fax with a certain modem under linux, it works well. The fax is complete when it comes out of the fax machine. If I then use the same modem to send out a fax under win32, the fax coming out of the fax machine gets "stuck" halfways, but the sending modem thinks that transmission was ok and drops the connection. The answering fax machine then gives me "error while receiving." The "upper layer" java code MUST be right, because if I do the same thing under linux (using the linux library), everything is alright. Now I have to ask: Can somebody please help me out with this??!? Could it be the case that some kind of flow control or COMMTIMEOUTS setting causes this behaviour? I set flow control to RTS/CTS before sending out a fax. How can I DISABLE flow control? Or what do you think? Can something else cause this problems? Thank you all for your time and PLEASE write back soon. Regards, --Sven Ahlemann Am Waldrand 31 45721 Haltern am See Germany ______________________________________________________________ Verschicken Sie romantische, coole und witzige Bilder per SMS! Jetzt bei WEB.DE FreeMail: http://f.web.de/?mc=021193 From lux at diesel-research.com Sat Feb 11 10:06:52 2006 From: lux at diesel-research.com (Kim Lux) Date: Sat, 11 Feb 2006 10:06:52 -0700 Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: <1139631780.23882.10.camel@zd7280> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> <1139631780.23882.10.camel@zd7280> Message-ID: <1139677612.3431.5.camel@zd7280> More on this problem. I copied and pasted simpleRead into a console based Eclipse project and I've got the same result, except that cpu usage doesn't go to 100%. I'm beginning to think there is an issue in rxtx. My imports for simpleRead are: ============================ import gnu.io.*; import java.util.*; //import javax.comm.*; import java.io.*; =========================== Any ideas ? I am trying to read from /dev/ttyUSB0 using a serial to USB adapter which has worked well with minicom and gtkterm. Thanks. On Fri, 2006-02-10 at 21:23 -0700, Kim Lux wrote: > I've got a problem receiving chars with my version of serialRead, > written in an SWT GUI. > > I had a Java pro have a good look at my code and he can't see anything > wrong with it. > > I can send chars fine. When I receive a char the cpu usage for the app > goes to 100% and the code in the serial event handler doesn't get > executed. > > The instructions on the Java Comm Serial API How-To for Linux page state > that I must install javacomm. Is that true ? Everything builds without > it and I can send chars on rxtx just fine, but I can't receive them. > Could this be the problem ? > > I downloaded and installed javacomm. I was not able to add > "Driver=gnuio.RXTXCommDriver > to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not > have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 > installed in /usr/java/jre1.5.0_05. I added comm.jar > to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext > to the library paths. Is this OK ? > > Does it matter that I am receiving on /dev/ttyUSB0 ? > > Thanks. > -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Sun Feb 12 21:01:33 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:01:33 -0700 (MST) Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: <1139677612.3431.5.camel@zd7280> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> <1139631780.23882.10.camel@zd7280> <1139677612.3431.5.camel@zd7280> Message-ID: I suspect what is happening is the select() is breaking out in the native code but the driver does not have support for notifying there are X bytes available. On some traditional Unix based systems, the only way you know data is available is the fd status changes and do an FIORDCHK ioctl. Or perhaps the only thing you can know is the fd status changed. It would take reading through the kernel driver code to know for sure. So on USB, depending upon the driver, the same may need to be done or the driver improved a bit if possible to support. Polling reads will also work but don't use the event driven model of CommAPI which isnt acceptable in the long run. The 100% cpu usage can then be explained because select no longer blocks until the data is read; the eventLoop spins loose. You can put a well placed sleep but rxtx only expects those are needed when it knows data is available. This may not be a super simple thing to understand and fix. I do have ideas to get you started. I'm going to be short on time the next couple weeks. I expect to put some good time in and answer some other questions I saw around the 25th. For now, I'd look at the following and go from there with the hints I've given. JNIEXPORT jint JNICALL RXTXPort(nativeavailable)( JNIEnv *env, jobject jobj ) { int fd = get_java_var( env, jobj,"fd","I" ); int result; /* char message[80]; ENTER( "RXTXPort:nativeavailable" ); On SCO OpenServer FIONREAD always fails for serial devices, so try ioctl FIORDCHK instead; will only tell us whether bytes are available, not how many, but better than nothing. This turns out to be true on Solaris also. taj. */ #ifdef FIORDCHK /* __unixware__ __sun__ probably others */ result = ioctl(fd, FIORDCHK, 0); #else if( ioctl( fd, FIONREAD, &result ) < 0 ) { goto fail; } #endif /* FIORDCHK */ On Sat, 11 Feb 2006, Kim Lux wrote: > > More on this problem. I copied and pasted simpleRead into a console > based Eclipse project and I've got the same result, except that cpu > usage doesn't go to 100%. I'm beginning to think there is an issue in > rxtx. > > My imports for simpleRead are: > > ============================ > import gnu.io.*; > import java.util.*; > //import javax.comm.*; > import java.io.*; > =========================== > > Any ideas ? I am trying to read from /dev/ttyUSB0 using a serial to > USB adapter which has worked well with minicom and gtkterm. > > Thanks. > > > > On Fri, 2006-02-10 at 21:23 -0700, Kim Lux wrote: >> I've got a problem receiving chars with my version of serialRead, >> written in an SWT GUI. >> >> I had a Java pro have a good look at my code and he can't see anything >> wrong with it. >> >> I can send chars fine. When I receive a char the cpu usage for the app >> goes to 100% and the code in the serial event handler doesn't get >> executed. >> >> The instructions on the Java Comm Serial API How-To for Linux page state >> that I must install javacomm. Is that true ? Everything builds without >> it and I can send chars on rxtx just fine, but I can't receive them. >> Could this be the problem ? >> >> I downloaded and installed javacomm. I was not able to add >> "Driver=gnuio.RXTXCommDriver >> to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not >> have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 >> installed in /usr/java/jre1.5.0_05. I added comm.jar >> to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext >> to the library paths. Is this OK ? >> >> Does it matter that I am receiving on /dev/ttyUSB0 ? >> >> Thanks. >> > From tjarvi at qbang.org Sun Feb 12 21:03:30 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:03:30 -0700 (MST) Subject: [Rxtx] One serial port object for both sending and receiving ? In-Reply-To: <1139610545.18177.4.camel@zd7280> References: <1139610545.18177.4.camel@zd7280> Message-ID: On Fri, 10 Feb 2006, Kim Lux wrote: > > Is it OK to use one SerialPort ojbect (ex Serial Port serialPort;) and > use it for both sending and receiving ? > > For example: > > ======================================================================== > static SerialPort serialPort = null; > static OutputStream serialOut = null; > static InputStream serialIn = null; > > > > > // assign it to an outputStream for use > try{ > serialOut = serialPort.getOutputStream(); > System.out.println("Serial output stream has been assigned."); > }//try > catch(IOException e) > { > System.out.println("Error: Couldn't assign output stream to serial > port."); > }//catch > > > //assign it to an inputStream for use > try{ > serialIn = serialPort.getInputStream(); > System.out.println("Serial input stream has been assigned."); > }//try > catch(IOException e) > { > System.out.println("Error: Couldn't assign input stream to serial > port."); > }//catch This should be fine. In fact trying to do it another way will probably not work as you will run into lockfile issues. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun Feb 12 21:13:13 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:13:13 -0700 (MST) Subject: [Rxtx] Question about Serial I/O under Win32 In-Reply-To: <662084330@web.de> References: <662084330@web.de> Message-ID: On Sat, 11 Feb 2006 lunareclipse03 at web.de wrote: > Hello everybody, > > I have a strange problem with a piece of code I made for myself. No, > this is not really concerning rxtx, but nevertheless I post this to the > list, hoping that some of you can help me. I've written two libraries, > one for linux and one for win32. The linux port works quite well, I can > send / receive faxes and / or replay voice messages over the telephone > line using a voice modem. But the win32 port of the library causes some > trouble. If, for example, I send out a fax with a certain modem under > linux, it works well. The fax is complete when it comes out of the fax > machine. If I then use the same modem to send out a fax under win32, the > fax coming out of the fax machine gets "stuck" halfways, but the sending > modem thinks that transmission was ok and drops the connection. The > answering fax machine then gives me "error while receiving." The "upper > layer" java code MUST be right, because if I do the same thing under > linux (using the linux library), everything is alright. Now I have to > ask: Can somebody please help me out with this??!? Could it be the case > that some kind of flow control or COMMTIMEOUTS setting causes this > behaviour? I set flow control to RTS/CTS before sending out a fax. How > can I DISABLE flow control? Or what do you think? Can something else > cause this problems? Thank you all for your time and PLEASE write back > soon. > Hi Sven I'm not too willing to talk about flow control at the low level until I confirm some things with test equipment later. It is not clear if you are using rxtx or writing your own native code. So I'm not sure how to answer much of this :) If you are wondering how to change the flow control using rxtx from java, The BlackBox example from Sun flips this back and forth. SerialPort.java in rxtx 2.1 uses the following: SerialPort.java: public static final int FLOWCONTROL_NONE =0; SerialPort.java: public static final int FLOWCONTROL_RTSCTS_IN =1; SerialPort.java: public static final int FLOWCONTROL_RTSCTS_OUT =2; SerialPort.java: public static final int FLOWCONTROL_XONXOFF_IN =4; SerialPort.java: public static final int FLOWCONTROL_XONXOFF_OUT=8; So if you set flowcontrol to RTSCTS, you can set it to NONE to turn it off. If you are looking for how to do it in native code, the rxtx Source is SerialImp.c (unix/linux/mac os x/w32) and termios.c (w32 only with SerialImp.c) You can track the code: SerialImp.c:JNIEXPORT void JNICALL RXTXPort(setflowcontrol)( JNIEnv *env, jobject jobj, jint flowmode ) termios.c:int tcgetattr( int fd, struct termios *s_termios ) termios.c:int tcsetattr( int fd, int when, struct termios *s_termios ) There may be a problem in the rxtx flow control code though. Rather than guess, I want to test this with a gold standard. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Feb 6 00:00:16 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 00:00:16 -0700 (MST) Subject: [Rxtx] wiki delay until tomorrow night. In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: On Sun, 5 Feb 2006, Trent Jarvi wrote: > On Sun, 5 Feb 2006, Kim Lux wrote: > >> usb ? Tell me more... I need that too. > > usb is a very proper design. Thats all it is. > Maybe rxtx could help usb. But it would start with helping bring back the community that was already there. It's not something I'd love to do but maybe its the right thing to do. It would probably take 2 years to do right. But maybe thats better than what we have now. I honestly don't know what IBM is doing which could just run over everything. Just some thoughts after some fine german wine. -- Trent Jarvi tjarvi at qbang.org From gadelavega at yahoo.com.ar Mon Feb 6 02:17:05 2006 From: gadelavega at yahoo.com.ar (Gonzalo A. de la Vega) Date: Mon, 06 Feb 2006 10:17:05 +0100 Subject: [Rxtx] Serial port ownership question In-Reply-To: References: <20060205113618.30274.qmail@web53501.mail.yahoo.com> <1139157422.4553.9.camel@zd7280> <1139158698.4936.9.camel@zd7280> Message-ID: <43E71411.4050402@yahoo.com.ar> On my Fedora Core 4: ls -l /dev/ttyS* crw-rw---- 1 root uucp 4, 64 Feb 6 2006 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Feb 6 2006 /dev/ttyS1 ... and: grep "ttyUSB" /etc/udev/rules.d/50-udev.rules KERNEL=="ttyUSB*", GROUP="uucp", MODE="0660" So anyone in the "uucp" group can use serial ports. On Gentoo the group is "tty". Trent Jarvi escribi?: > > > On Sun, 5 Feb 2006, Dr. Douglas Lyon wrote: > >> I can confirm that this is the case (only root ownership of >> serial ports, under fedora 4). >> Wow, what were they thinking?! >> - DL >> >>> I've found that the newer kernels have the serial ports owned by root. >>> For example, >>> >>> $ls -al /dev/tty* >>> crw-rw-rw- 1 root root 5, 0 Feb 5 02:06 /dev/tty >>> crw-rw---- 1 root root 4, 0 Feb 5 02:06 /dev/tty0 >>> crw------- 1 root root 4, 1 Feb 5 09:07 /dev/tty1 >>> crw-rw---- 1 root tty 4, 10 Feb 5 02:06 /dev/tty10 >>> crw-rw---- 1 root tty 4, 11 Feb 5 02:06 /dev/tty11 >>> ... > > > This is just not a problem jcp or such are going to solve. Its a > platform spitwad fight. But do look at pam. In fact thats what Sun > is doing too. Maybe Linux followed their lead.. I'm not a pam guy. > I've spent 16 hours trying to understand it but your users wont :) > > Solution? I have no clue. Its two tangent mentalities from my > perspective. > > -- > Trent Jarvi > tjarvi at qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mtnvega at yahoo.com.br Mon Feb 6 05:35:43 2006 From: mtnvega at yahoo.com.br (Luiz Jr) Date: Mon, 6 Feb 2006 12:35:43 +0000 (GMT) Subject: [Rxtx] Documentation Wiki In-Reply-To: <1139157422.4553.9.camel@zd7280> Message-ID: <20060206123543.57256.qmail@web53515.mail.yahoo.com> Hello, Thank you for you answer, but so the usage of the API is pretty much like the Java Communications Api? If yes, what version of the Java Comm Api? Thank you, Luiz A. Brandao Jr Kim Lux escreveu: On Sun, 2006-02-05 at 08:36 -0300, Luiz Jr wrote: > Hello, > > I want to start using the RXTX libraries, but I would to know how, > since I can not access the documentation wiki page I just started using them yesterday. Below is how I installed the libraries, if that helps. I used snippets of code from the SimpleWrite application here to get me going. http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html Instead of "import javax.comm.*;", use "import gnu.io.*;" which is gotten from RXTXcomm.jar, which you will need to include in your project references. I am working in Eclipse. BTW: there is no way to open a port without going through the port list and finding it. Maybe sometime in the future someone (me ?) will write a method called openSerialPort that allows the user to give a port identifier, such as "/dev/tty1" and return a port ready to use. It wouldn't take much to write that and it would save users a lot of code. Hope this helps. ======================================================================= 1) Figure out which java you are running, incase there is more than one installed. $ java -version java version "1.5.0_05" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_05-b05) Java HotSpot(TM) Client VM (build 1.5.0_05-b05, mixed mode, sharing) 2) Find all the jre directories and the one from which you are currently running. kfind (jre) 3) cd to that directory plus /lib/i386 cd /usr/java/jre1.5.0_05/lib/i386 4) Copy the library files (*.so) to that directory. cp /home/krlux/Desktop/'Java Controls'/rxtx-linux/bin/* . 5) Check that the copy was successful ls librxtx* librxtxI2C.so librxtxRaw.so librxtxSerial.so librxtxParallel.so librxtxRS485.so 6) cd to the /lib/ext directory for your java. cd /usr/java/jre1.5.0_05/lib/ext 7) Copy the Jar files there cp /home/krlux/Desktop/'Java Controls'/rxtx-linux/lib/ext/* . 8) Check that it was successful ls RXTX* RXTXcomm.jar Rxtx is now installed on your machine ready to use. =================================================================== -- Kim Lux, Diesel Research Inc. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx --------------------------------- Yahoo! Acesso Gr?tis - Internet r?pida e gr?tis. Instale o discador agora! -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/544aa403/attachment-0031.html From lyon at docjava.com Mon Feb 6 05:49:34 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 06 Feb 2006 07:49:34 -0500 Subject: [Rxtx] wiki delay until tomorrow night. In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: Hi All, I have often thought about USB drivers being needed. For example, the ironman watch will not interface to a mac (windows only). It is USB. My dymo label writer has no Java driver (native only). Etc. Most cheap web cameras are USB (and Java drivers go through JAI, if it supports the camera at all). The JAI code shows how sun did the USB drivers. You have to be a member of the jai project to download the source code. https://jai.dev.java.net has the jai distro. And then you are not allowed to redistribute it. However, we can all learn from it (if so inclined). Basically: cvs -d :pserver:lyon at cvs.dev.java.net:/cvs login cvs -d :pserver:lyon at cvs.dev.java.net:/cvs checkout jai-core You will need to user your own uid and pw to get in. The ant build has over 100 warnings from sun deprecations of its own code. You might say that they were hoisted on their own Picard ;) One interesting thing is that they support several platforms: linux-amd64 64-bit Linux-AMD64 linux-i586 32-bit Linux-x86 solaris-amd64 64-bit Solaris-AMD64 solaris-i586 32-bit Solaris-x86 solaris-sparc 32-bit Solaris-SPARC solaris-sparcv9 64-bit Solaris-SPARC windows-i586 32-bit Windows-x86 Thus, ant is used to provide a multi-platform native method distro. Neat. How do they do it? check this out: And: The core download does not contain any C source code (it was all pre-built). Basically, they are just copying .so and .dll files into build directories. I would love to see the C code for this...but Sun does not post it on the https://jai.dev.java.net site. I don't know why...Perhaps I missed it. - Doug >On Sun, 5 Feb 2006, Trent Jarvi wrote: > >>On Sun, 5 Feb 2006, Kim Lux wrote: >> >>>usb ? Tell me more... I need that too. >> >>usb is a very proper design. Thats all it is. >> > >Maybe rxtx could help usb. But it would start with helping bring >back the community that was already there. > >It's not something I'd love to do but maybe its the right thing to do. > >It would probably take 2 years to do right. But maybe thats better >than what we have now. > >I honestly don't know what IBM is doing which could just run over everything. > >Just some thoughts after some fine german wine. > >-- >Trent Jarvi >tjarvi at qbang.org > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tdelenik at gmail.com Mon Feb 6 05:56:32 2006 From: tdelenik at gmail.com (Thanasis Delenikas) Date: Mon, 6 Feb 2006 14:56:32 +0200 Subject: Fwd: [Rxtx] Documentation Wiki In-Reply-To: <1139157422.4553.9.camel@zd7280> References: <20060205113618.30274.qmail@web53501.mail.yahoo.com> <1139157422.4553.9.camel@zd7280> Message-ID: <310a1a930602060456t129f1dc6p5f2b908f13ab5a0b@mail.gmail.com> Hello all, Kim, this is a snippet from the code I use. The closest to directly opening a specific port without enumeration. << ... portId = CommPortIdentifier.getPortIdentifier(getPort()); serialPort = (SerialPort) portId.open("jSMSEngine", 1971); ... >> where getPort() return the string identifier of the port, i.e. "/dev/ttyS0" or "COM1" or whatever. Thanasis. ---------- Forwarded message ---------- From: Kim Lux Date: Feb 5, 2006 6:37 PM Subject: Re: [Rxtx] Documentation Wiki To: RXTX Developers and Users BTW: there is no way to open a port without going through the port list and finding it. Maybe sometime in the future someone (me ?) will write a method called openSerialPort that allows the user to give a port identifier, such as "/dev/tty1" and return a port ready to use. It wouldn't take much to write that and it would save users a lot of code. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/182ab5b8/attachment-0031.html From tjarvi at qbang.org Mon Feb 6 11:53:57 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 11:53:57 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: On Mon, 6 Feb 2006, Dr. Douglas Lyon wrote: > Hi All, > I have often thought about USB drivers being needed. > For example, the ironman watch will not interface > to a mac (windows only). It is USB. > My dymo label writer has no Java driver (native only). > Etc. > Most cheap web cameras are USB (and Java drivers go > through JAI, if it supports the camera at all). > The JAI code shows how sun did the USB drivers. > You have to be a member of the jai project to download > the source code. > https://jai.dev.java.net has the jai distro. > And then you are not allowed to redistribute it. However, > we can all learn from it (if so inclined). Basically: > cvs -d :pserver:lyon at cvs.dev.java.net:/cvs login > cvs -d :pserver:lyon at cvs.dev.java.net:/cvs checkout jai-core > You will need to user your own uid and pw to get in. > The ant build has over 100 warnings from sun deprecations > of its own code. > > You might say that they were hoisted on their own Picard ;) > > One interesting thing is that they support several platforms: > linux-amd64 64-bit Linux-AMD64 > linux-i586 32-bit Linux-x86 > solaris-amd64 64-bit Solaris-AMD64 > solaris-i586 32-bit Solaris-x86 > solaris-sparc 32-bit Solaris-SPARC > solaris-sparcv9 64-bit Solaris-SPARC > windows-i586 32-bit Windows-x86 > Thus, ant is used to provide a multi-platform native method distro. > Neat. > How do they do it? > check this out: > > > > > > > > > > > > > And: > > > > > > > > > > The core download does not contain any C source code (it was all pre-built). > Basically, they are just copying .so and .dll files into build directories. > > I would love to see the C code for this...but Sun does not post it on the > https://jai.dev.java.net site. > > I don't know why...Perhaps I missed it. > > - Doug > > I've looked at moving rxtx to Ant builds. I think that would help IDEs a great deal. I requested a evalutation desk copy the O'Reilly Ant book for some j2ee material I was teaching. http://www.oreilly.com/catalog/anttdg/ It has a one sentence mention of JNI. So there was not luck there. I saw that there is another Ant book that does mention JNI more. I can't find it now. Ant must be able to support it with extensions. http://ant.apache.org/manual/OptionalTasks/javah.html What the auto(break :) tools do in the rxtx build is 4 things really. 1) gcc compile flags 2) ld compile flags 3) config.h 4) compile flags for customizing rxtx (lockfiles, ...) See 1 All of this information except 4 can be static once obtained. So I'm not attached to the auto tools. If I could find an example of Ant being used for JNI code, I'd be one of the first to start moving that direction. Maybe someone saw an example someplace. The other thing we have not completed discussing is the directory structure. There is interest in making rxtx more IDE friendly. I get more mail about that off the list than how to install rxtx. And I see we have Ken Thompson in da house :) He is our trusted CVS maintainer and the guy that purchased the rxtx.org domain. Old community. We will need Ken for changing the directory structure of source. I would like to open up discussion about both of these as it is more than time. The problem is I have little experience with Ant and even less with IDEs. It would be nice if we could work with Eclipse and NetBeans. http://www.netbeans.org/ (sun and some community) http://www.eclipes.org (ibm,rhat,... perhaps more community) http://maven.apache.org/what-is-maven.html (apache. It is community) borland should sortof be here too but I think thats covered in eclipse. >From what I understand so far, we should morph rxtx to support those three maybe trusting apaches lead with maven. But I use vi. I have little to no clues beyond what people have fed me. Can we agree that thats the right direction to go? -- Trent Jarvi tjarvi at qbang.org From brian at mbari.org Mon Feb 6 14:57:50 2006 From: brian at mbari.org (Brian Schlining) Date: Mon, 6 Feb 2006 13:57:50 -0800 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> > The other thing we have not completed discussing is the directory > structure. There is interest in making rxtx more IDE friendly. I > get more mail about that off the list than how to install rxtx. > > And I see we have Ken Thompson in da house :) He is our trusted > CVS maintainer and the guy that purchased the rxtx.org domain. Old > community. We will need Ken for changing the directory structure of > source. > > I would like to open up discussion about both of these as it is > more than time. The problem is I have little experience with Ant > and even less with IDEs. It would be nice if we could work with > Eclipse and NetBeans. > > http://www.netbeans.org/ (sun and some community) > http://www.eclipes.org (ibm,rhat,... perhaps more community) > http://maven.apache.org/what-is-maven.html (apache. It is community) > borland should sortof be here too but I think thats covered in > eclipse. > >> From what I understand so far, we should morph rxtx to support >> those three > maybe trusting apaches lead with maven. But I use vi. I have > little to no clues beyond what people have fed me. > Maven likes the directory structure below for Java code. (From http:// maven.apache.org/guides/getting-started/index.html) This structure works fine with ant, netbeans, and eclipse. rxtx_root_directory `-- src |-- main | `-- java | `-- gnu | `-- io `-- test `-- java `-- gnu `-- io Brian Schlining Software Engineer http://www.mbari.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/d9451eba/attachment-0031.html From tjarvi at qbang.org Mon Feb 6 15:11:45 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 15:11:45 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: > rxtx_root_directory > `-- src > |-- main > | `-- java > | `-- gnu > | `-- io > `-- test > `-- java > `-- gnu > `-- io > >From what I understand this will just be good. For me it makes no difference. So lets do the rxtx thing. Let if fester for two weeks and if nobody objects, we will do it. I'm not doing this because I care. I'm doing this to eliminate much of my inbox. But test... man is rxtx lacking there in the community aspect. It is covered but not right. _maybe_ I can change that this year. -- Trent Jarvi tjarvi at qbang.org (cat hurding since 1997) From lux at diesel-research.com Mon Feb 6 21:38:49 2006 From: lux at diesel-research.com (Kim Lux) Date: Mon, 06 Feb 2006 21:38:49 -0700 Subject: [Rxtx] How can I use Lock Files with rxtx (in FC4) ? Message-ID: <1139287129.17031.3.camel@zd7280> I am now running an rxtx application on FC4. I am getting: ========================================================= check_group_uucp(): error testing lock file creation Error details: Permission denied check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL ========================================================= $ ls -al /var/lock total 32 drwxrwxr-x 4 root lock 4096 Feb 6 16:04 . drwxr-xr-x 24 root root 4096 Nov 14 01:19 .. drwx------ 2 root root 4096 Apr 27 2005 lvm drwxr-xr-x 2 root root 4096 Feb 6 16:04 subsys How do I fix this for regulator users ? -- Kim Lux, Diesel Research Inc. From dmarkman at mac.com Mon Feb 6 22:24:44 2006 From: dmarkman at mac.com (Dmitry Markman) Date: Tue, 7 Feb 2006 00:24:44 -0500 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: if I understands the issue right in order to be able to use ant for c/c++ compilation you have to install ant's cc task http://ant-contrib.sourceforge.net/cc.html it looks like it should work on mac os x (authors claim, that it's platform independent) but I never tested so all you have to do it's providing right command line for the gcc compiler On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: >> rxtx_root_directory >> `-- src >> |-- main >> | `-- java >> | `-- gnu >> | `-- io >> `-- test >> `-- java >> `-- gnu >> `-- io >> > > >> From what I understand this will just be good. > > For me it makes no difference. So lets do the rxtx thing. Let if > fester for two weeks and if nobody objects, we will do it. > > I'm not doing this because I care. I'm doing this to eliminate > much of my inbox. > > But test... man is rxtx lacking there in the community aspect. It > is covered but not right. _maybe_ I can change that this year. > > -- > Trent Jarvi > tjarvi at qbang.org > (cat hurding since 1997) > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx Dmitry Markman From lux at diesel-research.com Mon Feb 6 23:20:15 2006 From: lux at diesel-research.com (Kim Lux) Date: Mon, 06 Feb 2006 23:20:15 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? Message-ID: <1139293215.3689.4.camel@zd7280> I'm running the code below. portlist.hasMoreElements() is false. /dev has ports in it as listed below. What am I doing wrong ? ========================================================== // Step through the list of ports until we find one that matches // the one we are looking for. portList = CommPortIdentifier.getPortIdentifiers(); while(portList.hasMoreElements()) { portID = (CommPortIdentifier) portList.nextElement(); // if (portID.getName().equals("/dev/ttyUSB0")) { myTA.append("Serial port ttyUSB0 has been found\n"); break; }// if portID equals... }// End of while... ========================================================== ls -al /dev/tty* crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 ... crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 -- Kim Lux, Diesel Research Inc. From david.garnier at trusted-logic.com Tue Feb 7 00:46:30 2006 From: david.garnier at trusted-logic.com (David Garnier) Date: Tue, 07 Feb 2006 08:46:30 +0100 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: <43E85056.2090608@trusted-logic.com> Hello, I think that the make-based build process is fine as it is, apart from the location of the Java source files. It is true that putting the Java source in a directory structure that map 1-to-1 to the Java package structure is the norm and should make it easier for everyone to modify the Java source, with or without an IDE. Ant is a good tool, but in the RXTX case I fail to see the advantage of using it compared to the current make-based process. As Trent said, they are more pressing issues, like testing. Regards, David Dmitry Markman wrote: > if I understands the issue right > in order to be able to use ant for c/c++ compilation > you have to install ant's cc task > http://ant-contrib.sourceforge.net/cc.html > > it looks like it should work on mac os x > (authors claim, that it's platform independent) > but I never tested > > so all you have to do it's providing right command line > for the gcc compiler > > > > > On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: > >>> rxtx_root_directory >>> `-- src >>> |-- main >>> | `-- java >>> | `-- gnu >>> | `-- io >>> `-- test >>> `-- java >>> `-- gnu >>> `-- io >>> >> >> >>> From what I understand this will just be good. >> >> For me it makes no difference. So lets do the rxtx thing. Let if >> fester for two weeks and if nobody objects, we will do it. >> >> I'm not doing this because I care. I'm doing this to eliminate much >> of my inbox. >> >> But test... man is rxtx lacking there in the community aspect. It is >> covered but not right. _maybe_ I can change that this year. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> (cat hurding since 1997) From tjarvi at qbang.org Tue Feb 7 01:11:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 01:11:31 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <43E85056.2090608@trusted-logic.com> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: On Tue, 7 Feb 2006, David Garnier wrote: > Hello, > > I think that the make-based build process is fine as it is, apart from the location of the Java > source files. It is true that putting the Java source in a directory structure that map 1-to-1 to > the Java package structure is the norm and should make it easier for everyone to modify the Java > source, with or without an IDE. > > Ant is a good tool, but in the RXTX case I fail to see the advantage of using it compared to the > current make-based process. As Trent said, they are more pressing issues, like testing. > Hi David I have more experience with testing rxtx than I can talk about. But let it be known, rxtx has gone trough 100's of hours of testing. We are hobby folks interested in toys but there is more. rxtx has had some of the best guidance in the industry there. This is not an easy thing. I may be able to come back in a month from the other side of the corperate fence and help. I suspect the tests could just be made public but they are in a very unusual environment that just wont work in a wider sense. This is something I'll be trying to change. At one point it was agreed we could just make the results public so this isnt just noise.. There is interest and I think its safe to mention that much. The big problem with testing in the past is most of it is done with a loopback connection. So we *still* have major questions regarding things like flow control. rxtx talks to itself over a loopback and it works. regardless of right or wrong. This requires more thought to be done right. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Feb 7 02:46:34 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 02:46:34 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: > The big problem with testing in the past is most of it is done with a > loopback connection. So we *still* have major questions regarding things > like flow control. rxtx talks to itself over a loopback and it works. > regardless of right or wrong. With serial communication there are gold standards. ckermit is probably a definitive 'standard.' Maybe its possible to do ping/pong tests with ckermit? Is it scriptable? There are known issues in rxtx. Probably the worst is some threading issues regarding some JREs with multiple JNI threads setting java variables. Man did I get schooled there. Just switch the c functions to returning variables and things go away. Sometimes they work fine, sometimes they blow up. Without understanding everything, somehow rhat got it right and debian (and especially gentoo) grabbed kernel patches causing all sort of harm. Its not hard to fix once you understand whats going on but nearly impossible to track with a debugger. So I have a good idea what 2.1-8 will have outside of the IDE modifications. rxtx 2.1-7 is a release for everyone to sync with. Its not even as stable as -pre17 as far as I know - I ran no test suites. I'll be chasing it too. We just had so many contributions that it was time. It seriously broke internal scheduals but thats a great thing :) The other thing I want to do in 2.1-8 is automagic baud rates. It turns out lots of shops are doing really funky baud rates for things like automobile test equipment. It is possible but it requires a fair amount of change in the native code. Is anyone looking at this? -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Feb 7 02:57:21 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 07 Feb 2006 04:57:21 -0500 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <43E85056.2090608@trusted-logic.com> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: Hi All, I agree, testing is very important. The problem I have been trying to address is related to cross-platform testing and the robust nature of the installs. Typically, I visit 3 platforms to deploy my product, windows, linux and mac. A build is performed on each platform. The idea that you can build for many platforms from one copy the source code seems attractive. This should enable synchronized deployments of identical code. The question of how to achieve this goal remains open. As Trent mentioned, this is hard. Perhaps Ant will help here (but perhaps not). Ant does seem to help with running unit tests. However, it does not help with multi-platform tests. For that you need many machines and different operating environments. Toward that end, I have created a multi-platform test that can be run from web start, located at: http://show.docjava.com:8086/book/cgij/code/jnlp/serialPort.PortTest.jnlp This is interesting because many people in the community can run the test and we can improve the test, as time permits. No, it is not a perfect solution, however, the idea does help with multi-platform tests using many machines and different operating environments. If the group has a good test for a general serial port set-ups, i would be happy to deploy it, for general evaluation using web start. And as for ANT, it is just an idea. Not all my ideas are good ones! - Doug >Hello, > >I think that the make-based build process is fine as it is, apart >from the location of the Java >source files. It is true that putting the Java source in a directory >structure that map 1-to-1 to >the Java package structure is the norm and should make it easier for >everyone to modify the Java >source, with or without an IDE. > >Ant is a good tool, but in the RXTX case I fail to see the advantage >of using it compared to the >current make-based process. As Trent said, they are more pressing >issues, like testing. > >Regards, >David > >Dmitry Markman wrote: >> if I understands the issue right >> in order to be able to use ant for c/c++ compilation >> you have to install ant's cc task >> http://ant-contrib.sourceforge.net/cc.html >> >> it looks like it should work on mac os x >> (authors claim, that it's platform independent) >> but I never tested >> >> so all you have to do it's providing right command line >> for the gcc compiler >> >> >> >> >> On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: >> >>>> rxtx_root_directory >>>> `-- src >>>> |-- main >>>> | `-- java >>>> | `-- gnu >>>> | `-- io >>>> `-- test >>>> `-- java >>>> `-- gnu >>>> `-- io >>>> >>> >>> >>>> From what I understand this will just be good. >>> >>> For me it makes no difference. So lets do the rxtx thing. Let if >>> fester for two weeks and if nobody objects, we will do it. >>> >>> I'm not doing this because I care. I'm doing this to eliminate much >>> of my inbox. >>> >>> But test... man is rxtx lacking there in the community aspect. It is >>> covered but not right. _maybe_ I can change that this year. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> (cat hurding since 1997) > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From matt.higgins at gmail.com Tue Feb 7 08:28:34 2006 From: matt.higgins at gmail.com (Matt Higgins) Date: Tue, 7 Feb 2006 10:28:34 -0500 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final Message-ID: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? import java.io.*; import java.util.*; import gnu.io.*; public class MySimpleRead implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; public static void main(String[] args) { boolean portFound = false; String defaultPort = "COM1"; if (args.length > 0) { defaultPort = args[0]; } portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; MySimpleRead reader = new MySimpleRead(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } } public MySimpleRead() { try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) { e.printStackTrace(); } try { inputStream = serialPort.getInputStream(); } catch (IOException e) { e.printStackTrace(); } try { serialPort.addEventListener(this); } catch (TooManyListenersException e) { e.printStackTrace(); } try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { e.printStackTrace(); } System.out.println("Baud is " + serialPort.getBaudRate()); System.out.println("Bits is " + serialPort.getDataBits()); System.out.println("Stop is " + serialPort.getStopBits()); System.out.println("Par is " + serialPort.getParity()); serialPort.notifyOnDataAvailable(true); readThread = new Thread(this); readThread.start(); } public void run() { // Thread.sleep(20000); //} catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { System.out.println("An event occurred " + event.getEventType()); switch (event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: byte[] readBuffer = new byte[20]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } System.out.print(new String(readBuffer)); } catch (IOException e) {} break; } } } --------------- Result on windows ------------------------------ Stable Library ============================================================== Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port:: COM1 Baud is 9600 Bits is 8 Stop is 1 Par is 0 ----------------- End Results ----------------------------------------- ------------------ Result on Linux ----------------------------------- Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 Found port: /dev/ttyS0 Baud is 9600 Bits is 8 Stop is 1 Par is 0 An event occurred 1 043100066224 ------------------ End Results --------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/a1431630/attachment-0031.html From brian at mbari.org Tue Feb 7 09:48:37 2006 From: brian at mbari.org (Brian Schlining) Date: Tue, 7 Feb 2006 08:48:37 -0800 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> Message-ID: <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> Hi Matt > The following code works fine on Linux but I never see any data > when run on Windows. This is a cut and paste from the SimpleRead > example. > I am attempting to read data from a bar code scanner. I can fire > up HyperTermianl on windows and see that the device is working > properly as I see the barcodes are scanned and echoed back to the > terminal. However when I run the app I don't see any data. It is > however associating with the com port as the informational bits > print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. Cheers Brian Schlining Software Engineer http://www.mbari.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/16d07f37/attachment-0031.html From lux at diesel-research.com Tue Feb 7 11:59:58 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 11:59:58 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139293215.3689.4.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> Message-ID: <1139338798.8145.4.camel@zd7280> Any ideas on this ? Any reason why portList.hasMoreElements() should be false even though there are devices in /dev ? On Mon, 2006-02-06 at 23:20 -0700, Kim Lux wrote: > I'm running the code below. > > portlist.hasMoreElements() is false. > > /dev has ports in it as listed below. > > What am I doing wrong ? > > > ========================================================== > // Step through the list of ports until we find one that matches > // the one we are looking for. > > portList = CommPortIdentifier.getPortIdentifiers(); > > while(portList.hasMoreElements()) > { > portID = (CommPortIdentifier) portList.nextElement(); // > if (portID.getName().equals("/dev/ttyUSB0")) > { > myTA.append("Serial port ttyUSB0 has been found\n"); > break; > }// if portID equals... > }// End of while... > ========================================================== > > ls -al /dev/tty* > crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty > crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 > crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 > crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 > crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 > ... > crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 > crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 > crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 > > > -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 12:20:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 12:20:25 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139338798.8145.4.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> Message-ID: On Tue, 7 Feb 2006, Kim Lux wrote: > > Any ideas on this ? Any reason why portList.hasMoreElements() should be > false even though there are devices in /dev ? > > > On Mon, 2006-02-06 at 23:20 -0700, Kim Lux wrote: >> I'm running the code below. >> >> portlist.hasMoreElements() is false. >> >> /dev has ports in it as listed below. >> >> What am I doing wrong ? >> >> >> ========================================================== >> // Step through the list of ports until we find one that matches >> // the one we are looking for. >> >> portList = CommPortIdentifier.getPortIdentifiers(); >> >> while(portList.hasMoreElements()) >> { >> portID = (CommPortIdentifier) portList.nextElement(); // >> if (portID.getName().equals("/dev/ttyUSB0")) >> { >> myTA.append("Serial port ttyUSB0 has been found\n"); >> break; >> }// if portID equals... >> }// End of while... >> ========================================================== >> >> ls -al /dev/tty* >> crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty >> crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 >> crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 >> crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 >> crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 >> ... >> crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 >> crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 >> crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 >> >> >> > Hi Kim What rxtx does is try to open the port and do a timed out read. If the kernel/... do not complain it's enumarted. I suspect you could do a crude test by doing something like cat /dev/ttyS0 > /dev/null If that barfs then rxtx wont enumerate the port. hmm looking at your question again, I suspect it's a lockfile problem. This is documented in INSTALL with the source. Its easy enough to test this too.. touch /var/lock/testingrxtxlockfiles && rm -f /var/lock/testingrxtxlockfiles If you are not in the right group it will bail. Root will work regardless. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 12:37:56 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 12:37:56 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> Message-ID: <1139341076.8145.11.camel@zd7280> Exactly which ports does rxtx attempt to put into the list ? /dev/* or /dev/tty* or /dev/tty[0-9[0-9] ? or /dev/ttyS* ? For the record, only /dev/ttyUSB0 is a valid port on the machine I am presently on. Will this be a problem ? On Tue, 2006-02-07 at 12:20 -0700, Trent Jarvi wrote: > This is documented in INSTALL with the source. > I was wondering where that file was. I will download source and dig it up. Thanks. -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 12:51:09 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 12:51:09 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139341076.8145.11.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: On Tue, 7 Feb 2006, Kim Lux wrote: > > Exactly which ports does rxtx attempt to put into the list ? /dev/* > or /dev/tty* or /dev/tty[0-9[0-9] ? or /dev/ttyS* ? > > For the record, only /dev/ttyUSB0 is a valid port on the machine I am > presently on. Will this be a problem ? > > > On Tue, 2006-02-07 at 12:20 -0700, Trent Jarvi wrote: >> This is documented in INSTALL with the source. >> > I was wondering where that file was. I will download source and dig it > up. > > Thanks. > Hmm I'm looking at pre17 so this may have changed. (its just what I have on this machine) if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA" // for the IPAQs }; CandidatePortPrefixes=Temp; } So you may need to add "ttyUSB" to that list. RXTX used to enumerate _everything_ see if(osName.equals("Linux-all-ports") But it became less than practical. This is all in RXTXCommDriver.java hmm I just did a cvs update. if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have to get your fingers into the code. We aim for sane defaults. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 13:06:45 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 13:06:45 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139342805.8145.22.camel@zd7280> On Tue, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > Hmm I'm looking at pre17 so this may have changed. (its just what I have > on this machine) > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA" // for the IPAQs > }; > CandidatePortPrefixes=Temp; > } > > > So you may need to add "ttyUSB" to that list. RXTX used to enumerate > _everything_ see if(osName.equals("Linux-all-ports") But it became less > than practical. > > This is all in RXTXCommDriver.java > > hmm I just did a cvs update. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have > to get your fingers into the code. We aim for sane defaults. Excellent. Thanks for taking the time. -- Kim Lux, Diesel Research Inc. From ideiglenes1 at freemail.hu Tue Feb 7 13:53:39 2006 From: ideiglenes1 at freemail.hu (--) Date: Tue, 07 Feb 2006 21:53:39 +0100 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139345619.22534.2.camel@localhost> Hi! I use this code to get all the extra Linux devices. :) if ("Linux".equals(System.getProperty("os.name"))) { System.setProperty("os.name","Linux-all-ports"); } driver = new RXTXCommDriver(); On k, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > On Tue, 7 Feb 2006, Kim Lux wrote: > > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have > to get your fingers into the code. We aim for sane defaults. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From matt.higgins at gmail.com Tue Feb 7 13:45:54 2006 From: matt.higgins at gmail.com (Matt Higgins) Date: Tue, 7 Feb 2006 15:45:54 -0500 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> Message-ID: <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> Sweet this is exactly what I needed. I was searching the archives through marc.theamisgroup they only have archives back to 1/3/05. Should have hit the mailman archive! Thanks a lot! On 2/7/06, Brian Schlining wrote: > > Hi Matt > > The following code works fine on Linux but I never see any data when run > on Windows. This is a cut and paste from the SimpleRead example. > I am attempting to read data from a bar code scanner. I can fire up > HyperTermianl on windows and see that the device is working properly as I > see the barcodes are scanned and echoed back to the terminal. However when I > run the app I don't see any data. It is however associating with the com > port as the informational bits print fine? > > > You're not the only one whose had this problem, I don't know if Trent has > addressed this is the latest release of RXTX but there is a workaround. > Here's the recent thread from the RXTX mailing list regarding this issues: > > Thanasis Delenikas tdelenik at gmail.com > Wed Jan 18 13:56:23 MST 2006 > > * Previous message: [Rxtx] Re: More close() performance fixes > * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] > > Hi all. > (I've subscribed again from my other email account). > > Trent, > > You are right. Linux *always* works, no matter what flow control you set. > Windows *works only* with hardware flow control (I haven't tested what > happens with software XON/XOFF flow control). > > I assume (but I am not certain) that even with no flow control at all, all > platforms should work. Without flow control, you have the risk of bumping > into overflow or framing errors, but that's your (the end programmer, I > mean) problem. > > >From my side, I shouldn't be working without flow control. That was a bug > too... It was some code forgotten from the old times, when I used to work > with phone emulation drivers which didn't support flow control. The > correct > way is to have some flow control enabled and that's why I suppose this is > a > low-severity bug for RxTx. > > I have no idea which platform shows the correct behaviour, since > my knowledge about Linux and the inner workings of these low-level i/o > operations is limited. > > Regards, > Thanasis Delenikas. > > > > > Message: 2 > > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > > From: Trent Jarvi > > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > > To: RXTX Developers and Users > > Message-ID: > > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > > > Hi all, > > > > > > Trent, I have found something. > > > I read your comment about flow control, so I experimented a bit. > > > > > > If you remember, in my sample program I've used no flow control at all > ( > > i.e. > > > Java constant FLOWCONTROL_NONE). > > > > > > Now, during testing, I've switch to hardware inbound flow control (i.e > . > > Java > > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > > beautifully! > > > > > > I think I will switch to H/W flow control and test things for a while, > > but > > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > > > > > Hi Thanasis, > > > > I'm fairly sure you have identified a bug. I would not worry too much > > about what Sun CommAPI w32 defaults are. I think they did more or less > > whatever the port opened with. Just a guess. Linux tries to stomp on > > ports so they are all the same. > > > > So this started out with Linux worked, Windows XP/.. did not as I > recall. > > Something is wrong in rxtx. Do I understand this right? > > > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > > > Perhaps there is something Wayne or I did not understand when we wrote > > that code. I wasnt programming back in the BBS days so modems are not > my > > thing. I have a few questions. > > > > Is the above matrix confirmed by observation? > > Linux just always worked? > > Which one _should_ work? I'm guessing modems work with hardware flow > > control. I'll have to dig around. > > > > The windows flow control changes a couple things with hardware flow > > control. Following the w32 API documentation is confusing sometimes. > > But it looks like Linux could have a bug too. > > Cheers > > Brian Schlining > Software Engineer > http://www.mbari.org > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/9c989144/attachment-0031.html From tjarvi at qbang.org Tue Feb 7 14:06:14 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 14:06:14 -0700 (MST) Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> Message-ID: >> >> You're not the only one whose had this problem, I don't know if Trent has >> addressed this is the latest release of RXTX but there is a workaround. >> Here's the recent thread from the RXTX mailing list regarding this issues: >> I have not. I expect to have access to some test equipment next month and I'll go through all of this. I really don't know whats going on and I need a gold standard. I thought maybe linux was autodetecting the flow control. Your observations would certainly be welcome. I need to talk to Russell King and see what he is doing. Until then I'd just be toying around over a loopback as usual. This is very high on the list though. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 17:25:05 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 17:25:05 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139358305.17994.2.camel@zd7280> My application now works. I installed the libraries and jar from 2.1-7 (Final). portlist.hasMoreElements is no longer false. The application finds the port for /dev/ttyUSB0. Thanks for your help, Trent (et al) Sorry I bothered you with this. Next time I will look in the source first. I didn't think it was an rxtx issue, I thought it was a Linux setup issue . On Tue, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > Hmm I'm looking at pre17 so this may have changed. (its just what I > have > on this machine) > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux > Serial Ports > "ttySA" // for the > IPAQs > }; > > CandidatePortPrefixes=Temp; > } > > > So you may need to add "ttyUSB" to that list. RXTX used to enumerate > _everything_ see if(osName.equals("Linux-all-ports") But it became > less > than practical. > > This is all in RXTXCommDriver.java > > hmm I just did a cvs update. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux > Serial Ports > "ttySA", // for the > IPAQs > "ttyUSB" // for USB > frobs > }; > > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you > have > to get your fingers into the code. We aim for sane defaults. -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 19:21:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 19:21:54 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139358305.17994.2.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> <1139358305.17994.2.camel@zd7280> Message-ID: >Sorry I bothered you with this. Next time I will look in the source >first. I didn't think it was an rxtx issue, I thought it was a Linux >setup issue . Why would you be sorry? I would have done the same. I'm glad it's working :) -- Trent Jarvi tjarvi at qbang.org From tma at mail.island.net Wed Feb 8 13:39:35 2006 From: tma at mail.island.net (Tom Alldread) Date: Wed, 08 Feb 2006 12:39:35 -0800 Subject: [Rxtx] Win32/Linux Serial Port Data Dropouts In-Reply-To: <200602060702.k167255O007882@www.qbang.org> References: <200602060702.k167255O007882@www.qbang.org> Message-ID: <43EA5707.4020200@mail.island.net> Greetings Folks at RXTX: During the last couple of months I have been alternately testing with javax.comm 2 and RXTX 2.1 under Windows XP and CommApi 3 and RXTX 2.1 under Suse 10.0 Linux. In the process I have learned a little about java multi-threading under NetBeans 5 with Profiler. My java (jdk 1.5_06) application is used for data acquisition and provides a graphical display of A-D conversion data received from a 56KBaud serial port. The actual data throughput is about 10KBaud thus it is well below the speed of the port. I use hardware RTS/CTS flow control which can stall the data acquisition sample rate if necessary. This ensures the display computer has the ability to slow the data acquisition rate should it become too busy to accept the regular data flow. Both the serial port buffer and the java read buffer are set at 16KB. Usually the data transfers into the java read buffer are less than 100 bytes unless the data acquisition is recovering from a stall. The data flow normally hesitates after each 5 KB block as a continue command is needed from the display computer to start the drawing of a new graphics display line. Separate threads have been provided for the serial port event monitoring and data processing. The serial port event thread has been given the maximum priority and data processing thread the minimum priority provided by java. Thread yield statements have been placed within all data processing while/for loops as an effort to ensure quick access to CPU cycles for the serial port event thread. I have found that short data transmissions are essentially error free but occasional dropouts occur with continuous data flow especially under Windows XP. ....................................................................................................................................................................................... Linux results: I am happy to report that RXTX 2.1 appears to work very well under Linux although I did notice some errors when the screen savers were running with my dual monitors. I believe this is a local problem associated with my dual graphics which needs further attention. The recent CommApi 3 Linux release from Sun did not work at all with my program. It seemed to send commands out OK but did not receive any data. Although the serial port event triggered the ISR, the input stream appeared filled with nulls and thus did not contain any data. As my understanding is that CommApi 3 was tested with a Red Hat distribution of Linux I wonder if this problem is distro dependent? Although somewhat off topic here I wonder if anyone reading this has had similar experience? .................................................................................................................................................................................. Windows XP results: There are problems with occasional data dropouts which become more frequent as the sampling rate is increased or if the computer becomes busy with other duties. The dropouts typically consist of a half dozen byte block of lost data. It appears the lost bytes never get added to the java input stream. There has not been any indication of garbled data, overruns or framing errors which suggests the UART communications remains solid. Using javax.comm 2 I found that the setting of SerialPort 'enableReceiveThreshold' to 40 and 'enableReceiveTimeout' of 100mS reduced the dropouts error rate significantly. I found that I could not get RXTX 2.1 to function with the aforementioned threshold and timeout settings. The javax.comm 2 interface is consequently performing better for me under Windows than RXTX 2.1. I wonder if anyone here has any suggestions as to what I might try to improve RXTX 2.1? Although my settings are the same as under Suse 10.0, RXTX 2.1 performs much better for me under Linux than any of the alternatives that I have tried under Windows XP . ............................................................................................................................................................................... I would like to establish, based on the experience of others, if I have reached the normally expected performance limit of java serial port communications? Should I expect to achieve virtually error free serial port data input from a continuous stream under Windows XP java software? I am considering changing my protocol to packets with error checking if necessary but would like to know if the dropout problems I am experiencing are typical or not before I take this rather work intensive plunge. Many thanks in advance for any help! Best Regards, Tom Alldread -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.375 / Virus Database: 267.15.2/253 - Release Date: 2006-02-07 From jlaxson at mac.com Wed Feb 8 23:56:48 2006 From: jlaxson at mac.com (John Laxson) Date: Thu, 9 Feb 2006 00:56:48 -0600 Subject: [Rxtx] PortInUseException: Unknown Application on OSX Message-ID: Hi, I've been trying to get RXTX 2.1.7 going on Mac OS X for a while here, and am running up into a wall here. I've tried with pre- compiled and the source version and get the same problem, a gnu.io.PortInUseException: Unknown Application. I have run the fixperms script included with the source distribution, and id shows me as a member of the uucp group, and permissions on /var/spool/uucp are 775 root:uucp. Running a test program (included at the bottom for clarity) lets me enumerate all the serial ports correctly, but trying to open any of them gives the PortInUseException. If it helps, when I try to open a port that's set to make an outgoing bluetooth connection, there is no delay and no connection attempt at all. Thanks, John Laxson PS: The documentation wiki on qbang.org shows 404, and has for a few days now. My test code: public static void main(String[] args) { SerialPort serialPort; try { Enumeration e = CommPortIdentifier.getPortIdentifiers(); CommPortIdentifier ident; while (e.hasMoreElements()) { ident = (CommPortIdentifier)e.nextElement(); System.out.println(ident.getName()); } ident = CommPortIdentifier.getPortIdentifier("/dev/cu.modem"); serialPort = (SerialPort) ident.open("Me", 5000); } catch (Exception e) { e.printStackTrace(); } } From rajesh.invincible at gmail.com Thu Feb 9 03:39:38 2006 From: rajesh.invincible at gmail.com (Rajesh N) Date: Thu, 9 Feb 2006 16:09:38 +0530 Subject: [Rxtx] Re: Move .java Files in gnu.io filesystem hierarchy - Maven (2) In-Reply-To: <43DF21D2.7090200@ngi.it> References: <43DF21D2.7090200@ngi.it> Message-ID: <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Can anybody tell me how to overcome these EXCEPTIONS I AM WORKING ON SERIAL COMMN IN JAVA ON LINUX. 1. " NOT ALL PARAMETERS SUPPORTED BY THE KERNEL" This i came across the following statement inmy prog. SerialP is A SerialPort object SerialP.setSerialPortParams(9600(BAUDRATE),DATABITS_8,STOPBITS_1,PARITY_NONE) 2. NullPointer Exception at Event Dispatch Now i have checked all my object references for a null reference but i found none i have put up my entire code in try catch blocks but still I AM UNABLE TO CATCH THIS EXCEPTION AND HENCE MY APPLICATION CLOSES HOW DOES THESE GO? PLEASE HELP ME IT IS URGENTTTTTTTTTTTTTTTT yours sincerely RAJESH On 1/31/06, Fabio Frumento wrote: > Hi Xavier, > > I don't know maven at all but the directory hierarchy listed buy Trent > is fine for me... > > I'll take a look to maven, it seems an interesting project > > Regards > > Fabio Frumento > > Trent Jarvi wrote: > > On Tue, 31 Jan 2006, Xavier Frisaye wrote: > > > >> Hi all, > >> > >> If you are going to rearrange the src folder, i will propose to use > >> maven 2 and follow its directory structure > >> > (http://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html). > >> > >> Maven 2 simplify java project and give a standard way to make projects > >> (http://maven.apache.org/). > >> We are using it for internal projects and we are very satisfied. > >> > >> Is anybody interested? > >> > >> I'm not an expert in maven 2 (yet) but i'm agree to help using it if > >> you choose to make so. > >> > > > > so this would be: > > > > rxtx-devel/src/main/java/gnu.io > > rxtx-devel/src/test/java/ManIwish.java > > > > I don't use IDEs very much so I'll let others comment. But I don't see > > a problem with that. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Thu Feb 9 09:50:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 9 Feb 2006 09:50:31 -0700 (MST) Subject: [Rxtx] Re: Move .java Files in gnu.io filesystem hierarchy - Maven (2) In-Reply-To: <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Message-ID: On Thu, 9 Feb 2006, Rajesh N wrote: > Can anybody tell me how to overcome these EXCEPTIONS > I AM WORKING ON SERIAL COMMN IN JAVA ON LINUX. > > 1. " NOT ALL PARAMETERS SUPPORTED BY THE KERNEL" > > This i came across the following statement inmy prog. > SerialP is A SerialPort object > SerialP.setSerialPortParams(9600(BAUDRATE),DATABITS_8,STOPBITS_1,PARITY_NONE) > Strange. The parameters you use are the same the port should open with by default. Could you paste the actual exception you are getting? I don't see that in the rxtx source. Also it would help to know the rxtx version. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Fri Feb 10 15:29:05 2006 From: lux at diesel-research.com (Kim Lux) Date: Fri, 10 Feb 2006 15:29:05 -0700 Subject: [Rxtx] One serial port object for both sending and receiving ? Message-ID: <1139610545.18177.4.camel@zd7280> Is it OK to use one SerialPort ojbect (ex Serial Port serialPort;) and use it for both sending and receiving ? For example: ======================================================================== static SerialPort serialPort = null; static OutputStream serialOut = null; static InputStream serialIn = null; // assign it to an outputStream for use try{ serialOut = serialPort.getOutputStream(); System.out.println("Serial output stream has been assigned."); }//try catch(IOException e) { System.out.println("Error: Couldn't assign output stream to serial port."); }//catch //assign it to an inputStream for use try{ serialIn = serialPort.getInputStream(); System.out.println("Serial input stream has been assigned."); }//try catch(IOException e) { System.out.println("Error: Couldn't assign input stream to serial port."); }//catch ======================================================================== -- Kim Lux, Diesel Research Inc. From lux at diesel-research.com Fri Feb 10 21:23:00 2006 From: lux at diesel-research.com (Kim Lux) Date: Fri, 10 Feb 2006 21:23:00 -0700 Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Message-ID: <1139631780.23882.10.camel@zd7280> I've got a problem receiving chars with my version of serialRead, written in an SWT GUI. I had a Java pro have a good look at my code and he can't see anything wrong with it. I can send chars fine. When I receive a char the cpu usage for the app goes to 100% and the code in the serial event handler doesn't get executed. The instructions on the Java Comm Serial API How-To for Linux page state that I must install javacomm. Is that true ? Everything builds without it and I can send chars on rxtx just fine, but I can't receive them. Could this be the problem ? I downloaded and installed javacomm. I was not able to add "Driver=gnuio.RXTXCommDriver to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 installed in /usr/java/jre1.5.0_05. I added comm.jar to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext to the library paths. Is this OK ? Does it matter that I am receiving on /dev/ttyUSB0 ? Thanks. -- Kim Lux, Diesel Research Inc. From lunareclipse03 at web.de Sat Feb 11 09:44:46 2006 From: lunareclipse03 at web.de (lunareclipse03@web.de) Date: Sat, 11 Feb 2006 17:44:46 +0100 Subject: [Rxtx] Question about Serial I/O under Win32 Message-ID: <662084330@web.de> Hello everybody, I have a strange problem with a piece of code I made for myself. No, this is not really concerning rxtx, but nevertheless I post this to the list, hoping that some of you can help me. I've written two libraries, one for linux and one for win32. The linux port works quite well, I can send / receive faxes and / or replay voice messages over the telephone line using a voice modem. But the win32 port of the library causes some trouble. If, for example, I send out a fax with a certain modem under linux, it works well. The fax is complete when it comes out of the fax machine. If I then use the same modem to send out a fax under win32, the fax coming out of the fax machine gets "stuck" halfways, but the sending modem thinks that transmission was ok and drops the connection. The answering fax machine then gives me "error while receiving." The "upper layer" java code MUST be right, because if I do the same thing under linux (using the linux library), everything is alright. Now I have to ask: Can somebody please help me out with this??!? Could it be the case that some kind of flow control or COMMTIMEOUTS setting causes this behaviour? I set flow control to RTS/CTS before sending out a fax. How can I DISABLE flow control? Or what do you think? Can something else cause this problems? Thank you all for your time and PLEASE write back soon. Regards, --Sven Ahlemann Am Waldrand 31 45721 Haltern am See Germany ______________________________________________________________ Verschicken Sie romantische, coole und witzige Bilder per SMS! Jetzt bei WEB.DE FreeMail: http://f.web.de/?mc=021193 From lux at diesel-research.com Sat Feb 11 10:06:52 2006 From: lux at diesel-research.com (Kim Lux) Date: Sat, 11 Feb 2006 10:06:52 -0700 Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: <1139631780.23882.10.camel@zd7280> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> <1139631780.23882.10.camel@zd7280> Message-ID: <1139677612.3431.5.camel@zd7280> More on this problem. I copied and pasted simpleRead into a console based Eclipse project and I've got the same result, except that cpu usage doesn't go to 100%. I'm beginning to think there is an issue in rxtx. My imports for simpleRead are: ============================ import gnu.io.*; import java.util.*; //import javax.comm.*; import java.io.*; =========================== Any ideas ? I am trying to read from /dev/ttyUSB0 using a serial to USB adapter which has worked well with minicom and gtkterm. Thanks. On Fri, 2006-02-10 at 21:23 -0700, Kim Lux wrote: > I've got a problem receiving chars with my version of serialRead, > written in an SWT GUI. > > I had a Java pro have a good look at my code and he can't see anything > wrong with it. > > I can send chars fine. When I receive a char the cpu usage for the app > goes to 100% and the code in the serial event handler doesn't get > executed. > > The instructions on the Java Comm Serial API How-To for Linux page state > that I must install javacomm. Is that true ? Everything builds without > it and I can send chars on rxtx just fine, but I can't receive them. > Could this be the problem ? > > I downloaded and installed javacomm. I was not able to add > "Driver=gnuio.RXTXCommDriver > to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not > have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 > installed in /usr/java/jre1.5.0_05. I added comm.jar > to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext > to the library paths. Is this OK ? > > Does it matter that I am receiving on /dev/ttyUSB0 ? > > Thanks. > -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Sun Feb 12 21:01:33 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:01:33 -0700 (MST) Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: <1139677612.3431.5.camel@zd7280> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> <1139631780.23882.10.camel@zd7280> <1139677612.3431.5.camel@zd7280> Message-ID: I suspect what is happening is the select() is breaking out in the native code but the driver does not have support for notifying there are X bytes available. On some traditional Unix based systems, the only way you know data is available is the fd status changes and do an FIORDCHK ioctl. Or perhaps the only thing you can know is the fd status changed. It would take reading through the kernel driver code to know for sure. So on USB, depending upon the driver, the same may need to be done or the driver improved a bit if possible to support. Polling reads will also work but don't use the event driven model of CommAPI which isnt acceptable in the long run. The 100% cpu usage can then be explained because select no longer blocks until the data is read; the eventLoop spins loose. You can put a well placed sleep but rxtx only expects those are needed when it knows data is available. This may not be a super simple thing to understand and fix. I do have ideas to get you started. I'm going to be short on time the next couple weeks. I expect to put some good time in and answer some other questions I saw around the 25th. For now, I'd look at the following and go from there with the hints I've given. JNIEXPORT jint JNICALL RXTXPort(nativeavailable)( JNIEnv *env, jobject jobj ) { int fd = get_java_var( env, jobj,"fd","I" ); int result; /* char message[80]; ENTER( "RXTXPort:nativeavailable" ); On SCO OpenServer FIONREAD always fails for serial devices, so try ioctl FIORDCHK instead; will only tell us whether bytes are available, not how many, but better than nothing. This turns out to be true on Solaris also. taj. */ #ifdef FIORDCHK /* __unixware__ __sun__ probably others */ result = ioctl(fd, FIORDCHK, 0); #else if( ioctl( fd, FIONREAD, &result ) < 0 ) { goto fail; } #endif /* FIORDCHK */ On Sat, 11 Feb 2006, Kim Lux wrote: > > More on this problem. I copied and pasted simpleRead into a console > based Eclipse project and I've got the same result, except that cpu > usage doesn't go to 100%. I'm beginning to think there is an issue in > rxtx. > > My imports for simpleRead are: > > ============================ > import gnu.io.*; > import java.util.*; > //import javax.comm.*; > import java.io.*; > =========================== > > Any ideas ? I am trying to read from /dev/ttyUSB0 using a serial to > USB adapter which has worked well with minicom and gtkterm. > > Thanks. > > > > On Fri, 2006-02-10 at 21:23 -0700, Kim Lux wrote: >> I've got a problem receiving chars with my version of serialRead, >> written in an SWT GUI. >> >> I had a Java pro have a good look at my code and he can't see anything >> wrong with it. >> >> I can send chars fine. When I receive a char the cpu usage for the app >> goes to 100% and the code in the serial event handler doesn't get >> executed. >> >> The instructions on the Java Comm Serial API How-To for Linux page state >> that I must install javacomm. Is that true ? Everything builds without >> it and I can send chars on rxtx just fine, but I can't receive them. >> Could this be the problem ? >> >> I downloaded and installed javacomm. I was not able to add >> "Driver=gnuio.RXTXCommDriver >> to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not >> have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 >> installed in /usr/java/jre1.5.0_05. I added comm.jar >> to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext >> to the library paths. Is this OK ? >> >> Does it matter that I am receiving on /dev/ttyUSB0 ? >> >> Thanks. >> > From tjarvi at qbang.org Sun Feb 12 21:03:30 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:03:30 -0700 (MST) Subject: [Rxtx] One serial port object for both sending and receiving ? In-Reply-To: <1139610545.18177.4.camel@zd7280> References: <1139610545.18177.4.camel@zd7280> Message-ID: On Fri, 10 Feb 2006, Kim Lux wrote: > > Is it OK to use one SerialPort ojbect (ex Serial Port serialPort;) and > use it for both sending and receiving ? > > For example: > > ======================================================================== > static SerialPort serialPort = null; > static OutputStream serialOut = null; > static InputStream serialIn = null; > > > > > // assign it to an outputStream for use > try{ > serialOut = serialPort.getOutputStream(); > System.out.println("Serial output stream has been assigned."); > }//try > catch(IOException e) > { > System.out.println("Error: Couldn't assign output stream to serial > port."); > }//catch > > > //assign it to an inputStream for use > try{ > serialIn = serialPort.getInputStream(); > System.out.println("Serial input stream has been assigned."); > }//try > catch(IOException e) > { > System.out.println("Error: Couldn't assign input stream to serial > port."); > }//catch This should be fine. In fact trying to do it another way will probably not work as you will run into lockfile issues. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun Feb 12 21:13:13 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:13:13 -0700 (MST) Subject: [Rxtx] Question about Serial I/O under Win32 In-Reply-To: <662084330@web.de> References: <662084330@web.de> Message-ID: On Sat, 11 Feb 2006 lunareclipse03 at web.de wrote: > Hello everybody, > > I have a strange problem with a piece of code I made for myself. No, > this is not really concerning rxtx, but nevertheless I post this to the > list, hoping that some of you can help me. I've written two libraries, > one for linux and one for win32. The linux port works quite well, I can > send / receive faxes and / or replay voice messages over the telephone > line using a voice modem. But the win32 port of the library causes some > trouble. If, for example, I send out a fax with a certain modem under > linux, it works well. The fax is complete when it comes out of the fax > machine. If I then use the same modem to send out a fax under win32, the > fax coming out of the fax machine gets "stuck" halfways, but the sending > modem thinks that transmission was ok and drops the connection. The > answering fax machine then gives me "error while receiving." The "upper > layer" java code MUST be right, because if I do the same thing under > linux (using the linux library), everything is alright. Now I have to > ask: Can somebody please help me out with this??!? Could it be the case > that some kind of flow control or COMMTIMEOUTS setting causes this > behaviour? I set flow control to RTS/CTS before sending out a fax. How > can I DISABLE flow control? Or what do you think? Can something else > cause this problems? Thank you all for your time and PLEASE write back > soon. > Hi Sven I'm not too willing to talk about flow control at the low level until I confirm some things with test equipment later. It is not clear if you are using rxtx or writing your own native code. So I'm not sure how to answer much of this :) If you are wondering how to change the flow control using rxtx from java, The BlackBox example from Sun flips this back and forth. SerialPort.java in rxtx 2.1 uses the following: SerialPort.java: public static final int FLOWCONTROL_NONE =0; SerialPort.java: public static final int FLOWCONTROL_RTSCTS_IN =1; SerialPort.java: public static final int FLOWCONTROL_RTSCTS_OUT =2; SerialPort.java: public static final int FLOWCONTROL_XONXOFF_IN =4; SerialPort.java: public static final int FLOWCONTROL_XONXOFF_OUT=8; So if you set flowcontrol to RTSCTS, you can set it to NONE to turn it off. If you are looking for how to do it in native code, the rxtx Source is SerialImp.c (unix/linux/mac os x/w32) and termios.c (w32 only with SerialImp.c) You can track the code: SerialImp.c:JNIEXPORT void JNICALL RXTXPort(setflowcontrol)( JNIEnv *env, jobject jobj, jint flowmode ) termios.c:int tcgetattr( int fd, struct termios *s_termios ) termios.c:int tcsetattr( int fd, int when, struct termios *s_termios ) There may be a problem in the rxtx flow control code though. Rather than guess, I want to test this with a gold standard. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Feb 6 00:00:16 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 00:00:16 -0700 (MST) Subject: [Rxtx] wiki delay until tomorrow night. In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: On Sun, 5 Feb 2006, Trent Jarvi wrote: > On Sun, 5 Feb 2006, Kim Lux wrote: > >> usb ? Tell me more... I need that too. > > usb is a very proper design. Thats all it is. > Maybe rxtx could help usb. But it would start with helping bring back the community that was already there. It's not something I'd love to do but maybe its the right thing to do. It would probably take 2 years to do right. But maybe thats better than what we have now. I honestly don't know what IBM is doing which could just run over everything. Just some thoughts after some fine german wine. -- Trent Jarvi tjarvi at qbang.org From gadelavega at yahoo.com.ar Mon Feb 6 02:17:05 2006 From: gadelavega at yahoo.com.ar (Gonzalo A. de la Vega) Date: Mon, 06 Feb 2006 10:17:05 +0100 Subject: [Rxtx] Serial port ownership question In-Reply-To: References: <20060205113618.30274.qmail@web53501.mail.yahoo.com> <1139157422.4553.9.camel@zd7280> <1139158698.4936.9.camel@zd7280> Message-ID: <43E71411.4050402@yahoo.com.ar> On my Fedora Core 4: ls -l /dev/ttyS* crw-rw---- 1 root uucp 4, 64 Feb 6 2006 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Feb 6 2006 /dev/ttyS1 ... and: grep "ttyUSB" /etc/udev/rules.d/50-udev.rules KERNEL=="ttyUSB*", GROUP="uucp", MODE="0660" So anyone in the "uucp" group can use serial ports. On Gentoo the group is "tty". Trent Jarvi escribi?: > > > On Sun, 5 Feb 2006, Dr. Douglas Lyon wrote: > >> I can confirm that this is the case (only root ownership of >> serial ports, under fedora 4). >> Wow, what were they thinking?! >> - DL >> >>> I've found that the newer kernels have the serial ports owned by root. >>> For example, >>> >>> $ls -al /dev/tty* >>> crw-rw-rw- 1 root root 5, 0 Feb 5 02:06 /dev/tty >>> crw-rw---- 1 root root 4, 0 Feb 5 02:06 /dev/tty0 >>> crw------- 1 root root 4, 1 Feb 5 09:07 /dev/tty1 >>> crw-rw---- 1 root tty 4, 10 Feb 5 02:06 /dev/tty10 >>> crw-rw---- 1 root tty 4, 11 Feb 5 02:06 /dev/tty11 >>> ... > > > This is just not a problem jcp or such are going to solve. Its a > platform spitwad fight. But do look at pam. In fact thats what Sun > is doing too. Maybe Linux followed their lead.. I'm not a pam guy. > I've spent 16 hours trying to understand it but your users wont :) > > Solution? I have no clue. Its two tangent mentalities from my > perspective. > > -- > Trent Jarvi > tjarvi at qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mtnvega at yahoo.com.br Mon Feb 6 05:35:43 2006 From: mtnvega at yahoo.com.br (Luiz Jr) Date: Mon, 6 Feb 2006 12:35:43 +0000 (GMT) Subject: [Rxtx] Documentation Wiki In-Reply-To: <1139157422.4553.9.camel@zd7280> Message-ID: <20060206123543.57256.qmail@web53515.mail.yahoo.com> Hello, Thank you for you answer, but so the usage of the API is pretty much like the Java Communications Api? If yes, what version of the Java Comm Api? Thank you, Luiz A. Brandao Jr Kim Lux escreveu: On Sun, 2006-02-05 at 08:36 -0300, Luiz Jr wrote: > Hello, > > I want to start using the RXTX libraries, but I would to know how, > since I can not access the documentation wiki page I just started using them yesterday. Below is how I installed the libraries, if that helps. I used snippets of code from the SimpleWrite application here to get me going. http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html Instead of "import javax.comm.*;", use "import gnu.io.*;" which is gotten from RXTXcomm.jar, which you will need to include in your project references. I am working in Eclipse. BTW: there is no way to open a port without going through the port list and finding it. Maybe sometime in the future someone (me ?) will write a method called openSerialPort that allows the user to give a port identifier, such as "/dev/tty1" and return a port ready to use. It wouldn't take much to write that and it would save users a lot of code. Hope this helps. ======================================================================= 1) Figure out which java you are running, incase there is more than one installed. $ java -version java version "1.5.0_05" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_05-b05) Java HotSpot(TM) Client VM (build 1.5.0_05-b05, mixed mode, sharing) 2) Find all the jre directories and the one from which you are currently running. kfind (jre) 3) cd to that directory plus /lib/i386 cd /usr/java/jre1.5.0_05/lib/i386 4) Copy the library files (*.so) to that directory. cp /home/krlux/Desktop/'Java Controls'/rxtx-linux/bin/* . 5) Check that the copy was successful ls librxtx* librxtxI2C.so librxtxRaw.so librxtxSerial.so librxtxParallel.so librxtxRS485.so 6) cd to the /lib/ext directory for your java. cd /usr/java/jre1.5.0_05/lib/ext 7) Copy the Jar files there cp /home/krlux/Desktop/'Java Controls'/rxtx-linux/lib/ext/* . 8) Check that it was successful ls RXTX* RXTXcomm.jar Rxtx is now installed on your machine ready to use. =================================================================== -- Kim Lux, Diesel Research Inc. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx --------------------------------- Yahoo! Acesso Gr?tis - Internet r?pida e gr?tis. Instale o discador agora! -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/544aa403/attachment-0032.html From lyon at docjava.com Mon Feb 6 05:49:34 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 06 Feb 2006 07:49:34 -0500 Subject: [Rxtx] wiki delay until tomorrow night. In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: Hi All, I have often thought about USB drivers being needed. For example, the ironman watch will not interface to a mac (windows only). It is USB. My dymo label writer has no Java driver (native only). Etc. Most cheap web cameras are USB (and Java drivers go through JAI, if it supports the camera at all). The JAI code shows how sun did the USB drivers. You have to be a member of the jai project to download the source code. https://jai.dev.java.net has the jai distro. And then you are not allowed to redistribute it. However, we can all learn from it (if so inclined). Basically: cvs -d :pserver:lyon at cvs.dev.java.net:/cvs login cvs -d :pserver:lyon at cvs.dev.java.net:/cvs checkout jai-core You will need to user your own uid and pw to get in. The ant build has over 100 warnings from sun deprecations of its own code. You might say that they were hoisted on their own Picard ;) One interesting thing is that they support several platforms: linux-amd64 64-bit Linux-AMD64 linux-i586 32-bit Linux-x86 solaris-amd64 64-bit Solaris-AMD64 solaris-i586 32-bit Solaris-x86 solaris-sparc 32-bit Solaris-SPARC solaris-sparcv9 64-bit Solaris-SPARC windows-i586 32-bit Windows-x86 Thus, ant is used to provide a multi-platform native method distro. Neat. How do they do it? check this out: And: The core download does not contain any C source code (it was all pre-built). Basically, they are just copying .so and .dll files into build directories. I would love to see the C code for this...but Sun does not post it on the https://jai.dev.java.net site. I don't know why...Perhaps I missed it. - Doug >On Sun, 5 Feb 2006, Trent Jarvi wrote: > >>On Sun, 5 Feb 2006, Kim Lux wrote: >> >>>usb ? Tell me more... I need that too. >> >>usb is a very proper design. Thats all it is. >> > >Maybe rxtx could help usb. But it would start with helping bring >back the community that was already there. > >It's not something I'd love to do but maybe its the right thing to do. > >It would probably take 2 years to do right. But maybe thats better >than what we have now. > >I honestly don't know what IBM is doing which could just run over everything. > >Just some thoughts after some fine german wine. > >-- >Trent Jarvi >tjarvi at qbang.org > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tdelenik at gmail.com Mon Feb 6 05:56:32 2006 From: tdelenik at gmail.com (Thanasis Delenikas) Date: Mon, 6 Feb 2006 14:56:32 +0200 Subject: Fwd: [Rxtx] Documentation Wiki In-Reply-To: <1139157422.4553.9.camel@zd7280> References: <20060205113618.30274.qmail@web53501.mail.yahoo.com> <1139157422.4553.9.camel@zd7280> Message-ID: <310a1a930602060456t129f1dc6p5f2b908f13ab5a0b@mail.gmail.com> Hello all, Kim, this is a snippet from the code I use. The closest to directly opening a specific port without enumeration. << ... portId = CommPortIdentifier.getPortIdentifier(getPort()); serialPort = (SerialPort) portId.open("jSMSEngine", 1971); ... >> where getPort() return the string identifier of the port, i.e. "/dev/ttyS0" or "COM1" or whatever. Thanasis. ---------- Forwarded message ---------- From: Kim Lux Date: Feb 5, 2006 6:37 PM Subject: Re: [Rxtx] Documentation Wiki To: RXTX Developers and Users BTW: there is no way to open a port without going through the port list and finding it. Maybe sometime in the future someone (me ?) will write a method called openSerialPort that allows the user to give a port identifier, such as "/dev/tty1" and return a port ready to use. It wouldn't take much to write that and it would save users a lot of code. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/182ab5b8/attachment-0032.html From tjarvi at qbang.org Mon Feb 6 11:53:57 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 11:53:57 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: On Mon, 6 Feb 2006, Dr. Douglas Lyon wrote: > Hi All, > I have often thought about USB drivers being needed. > For example, the ironman watch will not interface > to a mac (windows only). It is USB. > My dymo label writer has no Java driver (native only). > Etc. > Most cheap web cameras are USB (and Java drivers go > through JAI, if it supports the camera at all). > The JAI code shows how sun did the USB drivers. > You have to be a member of the jai project to download > the source code. > https://jai.dev.java.net has the jai distro. > And then you are not allowed to redistribute it. However, > we can all learn from it (if so inclined). Basically: > cvs -d :pserver:lyon at cvs.dev.java.net:/cvs login > cvs -d :pserver:lyon at cvs.dev.java.net:/cvs checkout jai-core > You will need to user your own uid and pw to get in. > The ant build has over 100 warnings from sun deprecations > of its own code. > > You might say that they were hoisted on their own Picard ;) > > One interesting thing is that they support several platforms: > linux-amd64 64-bit Linux-AMD64 > linux-i586 32-bit Linux-x86 > solaris-amd64 64-bit Solaris-AMD64 > solaris-i586 32-bit Solaris-x86 > solaris-sparc 32-bit Solaris-SPARC > solaris-sparcv9 64-bit Solaris-SPARC > windows-i586 32-bit Windows-x86 > Thus, ant is used to provide a multi-platform native method distro. > Neat. > How do they do it? > check this out: > > > > > > > > > > > > > And: > > > > > > > > > > The core download does not contain any C source code (it was all pre-built). > Basically, they are just copying .so and .dll files into build directories. > > I would love to see the C code for this...but Sun does not post it on the > https://jai.dev.java.net site. > > I don't know why...Perhaps I missed it. > > - Doug > > I've looked at moving rxtx to Ant builds. I think that would help IDEs a great deal. I requested a evalutation desk copy the O'Reilly Ant book for some j2ee material I was teaching. http://www.oreilly.com/catalog/anttdg/ It has a one sentence mention of JNI. So there was not luck there. I saw that there is another Ant book that does mention JNI more. I can't find it now. Ant must be able to support it with extensions. http://ant.apache.org/manual/OptionalTasks/javah.html What the auto(break :) tools do in the rxtx build is 4 things really. 1) gcc compile flags 2) ld compile flags 3) config.h 4) compile flags for customizing rxtx (lockfiles, ...) See 1 All of this information except 4 can be static once obtained. So I'm not attached to the auto tools. If I could find an example of Ant being used for JNI code, I'd be one of the first to start moving that direction. Maybe someone saw an example someplace. The other thing we have not completed discussing is the directory structure. There is interest in making rxtx more IDE friendly. I get more mail about that off the list than how to install rxtx. And I see we have Ken Thompson in da house :) He is our trusted CVS maintainer and the guy that purchased the rxtx.org domain. Old community. We will need Ken for changing the directory structure of source. I would like to open up discussion about both of these as it is more than time. The problem is I have little experience with Ant and even less with IDEs. It would be nice if we could work with Eclipse and NetBeans. http://www.netbeans.org/ (sun and some community) http://www.eclipes.org (ibm,rhat,... perhaps more community) http://maven.apache.org/what-is-maven.html (apache. It is community) borland should sortof be here too but I think thats covered in eclipse. >From what I understand so far, we should morph rxtx to support those three maybe trusting apaches lead with maven. But I use vi. I have little to no clues beyond what people have fed me. Can we agree that thats the right direction to go? -- Trent Jarvi tjarvi at qbang.org From brian at mbari.org Mon Feb 6 14:57:50 2006 From: brian at mbari.org (Brian Schlining) Date: Mon, 6 Feb 2006 13:57:50 -0800 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> > The other thing we have not completed discussing is the directory > structure. There is interest in making rxtx more IDE friendly. I > get more mail about that off the list than how to install rxtx. > > And I see we have Ken Thompson in da house :) He is our trusted > CVS maintainer and the guy that purchased the rxtx.org domain. Old > community. We will need Ken for changing the directory structure of > source. > > I would like to open up discussion about both of these as it is > more than time. The problem is I have little experience with Ant > and even less with IDEs. It would be nice if we could work with > Eclipse and NetBeans. > > http://www.netbeans.org/ (sun and some community) > http://www.eclipes.org (ibm,rhat,... perhaps more community) > http://maven.apache.org/what-is-maven.html (apache. It is community) > borland should sortof be here too but I think thats covered in > eclipse. > >> From what I understand so far, we should morph rxtx to support >> those three > maybe trusting apaches lead with maven. But I use vi. I have > little to no clues beyond what people have fed me. > Maven likes the directory structure below for Java code. (From http:// maven.apache.org/guides/getting-started/index.html) This structure works fine with ant, netbeans, and eclipse. rxtx_root_directory `-- src |-- main | `-- java | `-- gnu | `-- io `-- test `-- java `-- gnu `-- io Brian Schlining Software Engineer http://www.mbari.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/d9451eba/attachment-0032.html From tjarvi at qbang.org Mon Feb 6 15:11:45 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 15:11:45 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: > rxtx_root_directory > `-- src > |-- main > | `-- java > | `-- gnu > | `-- io > `-- test > `-- java > `-- gnu > `-- io > >From what I understand this will just be good. For me it makes no difference. So lets do the rxtx thing. Let if fester for two weeks and if nobody objects, we will do it. I'm not doing this because I care. I'm doing this to eliminate much of my inbox. But test... man is rxtx lacking there in the community aspect. It is covered but not right. _maybe_ I can change that this year. -- Trent Jarvi tjarvi at qbang.org (cat hurding since 1997) From lux at diesel-research.com Mon Feb 6 21:38:49 2006 From: lux at diesel-research.com (Kim Lux) Date: Mon, 06 Feb 2006 21:38:49 -0700 Subject: [Rxtx] How can I use Lock Files with rxtx (in FC4) ? Message-ID: <1139287129.17031.3.camel@zd7280> I am now running an rxtx application on FC4. I am getting: ========================================================= check_group_uucp(): error testing lock file creation Error details: Permission denied check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL ========================================================= $ ls -al /var/lock total 32 drwxrwxr-x 4 root lock 4096 Feb 6 16:04 . drwxr-xr-x 24 root root 4096 Nov 14 01:19 .. drwx------ 2 root root 4096 Apr 27 2005 lvm drwxr-xr-x 2 root root 4096 Feb 6 16:04 subsys How do I fix this for regulator users ? -- Kim Lux, Diesel Research Inc. From dmarkman at mac.com Mon Feb 6 22:24:44 2006 From: dmarkman at mac.com (Dmitry Markman) Date: Tue, 7 Feb 2006 00:24:44 -0500 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: if I understands the issue right in order to be able to use ant for c/c++ compilation you have to install ant's cc task http://ant-contrib.sourceforge.net/cc.html it looks like it should work on mac os x (authors claim, that it's platform independent) but I never tested so all you have to do it's providing right command line for the gcc compiler On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: >> rxtx_root_directory >> `-- src >> |-- main >> | `-- java >> | `-- gnu >> | `-- io >> `-- test >> `-- java >> `-- gnu >> `-- io >> > > >> From what I understand this will just be good. > > For me it makes no difference. So lets do the rxtx thing. Let if > fester for two weeks and if nobody objects, we will do it. > > I'm not doing this because I care. I'm doing this to eliminate > much of my inbox. > > But test... man is rxtx lacking there in the community aspect. It > is covered but not right. _maybe_ I can change that this year. > > -- > Trent Jarvi > tjarvi at qbang.org > (cat hurding since 1997) > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx Dmitry Markman From lux at diesel-research.com Mon Feb 6 23:20:15 2006 From: lux at diesel-research.com (Kim Lux) Date: Mon, 06 Feb 2006 23:20:15 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? Message-ID: <1139293215.3689.4.camel@zd7280> I'm running the code below. portlist.hasMoreElements() is false. /dev has ports in it as listed below. What am I doing wrong ? ========================================================== // Step through the list of ports until we find one that matches // the one we are looking for. portList = CommPortIdentifier.getPortIdentifiers(); while(portList.hasMoreElements()) { portID = (CommPortIdentifier) portList.nextElement(); // if (portID.getName().equals("/dev/ttyUSB0")) { myTA.append("Serial port ttyUSB0 has been found\n"); break; }// if portID equals... }// End of while... ========================================================== ls -al /dev/tty* crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 ... crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 -- Kim Lux, Diesel Research Inc. From david.garnier at trusted-logic.com Tue Feb 7 00:46:30 2006 From: david.garnier at trusted-logic.com (David Garnier) Date: Tue, 07 Feb 2006 08:46:30 +0100 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: <43E85056.2090608@trusted-logic.com> Hello, I think that the make-based build process is fine as it is, apart from the location of the Java source files. It is true that putting the Java source in a directory structure that map 1-to-1 to the Java package structure is the norm and should make it easier for everyone to modify the Java source, with or without an IDE. Ant is a good tool, but in the RXTX case I fail to see the advantage of using it compared to the current make-based process. As Trent said, they are more pressing issues, like testing. Regards, David Dmitry Markman wrote: > if I understands the issue right > in order to be able to use ant for c/c++ compilation > you have to install ant's cc task > http://ant-contrib.sourceforge.net/cc.html > > it looks like it should work on mac os x > (authors claim, that it's platform independent) > but I never tested > > so all you have to do it's providing right command line > for the gcc compiler > > > > > On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: > >>> rxtx_root_directory >>> `-- src >>> |-- main >>> | `-- java >>> | `-- gnu >>> | `-- io >>> `-- test >>> `-- java >>> `-- gnu >>> `-- io >>> >> >> >>> From what I understand this will just be good. >> >> For me it makes no difference. So lets do the rxtx thing. Let if >> fester for two weeks and if nobody objects, we will do it. >> >> I'm not doing this because I care. I'm doing this to eliminate much >> of my inbox. >> >> But test... man is rxtx lacking there in the community aspect. It is >> covered but not right. _maybe_ I can change that this year. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> (cat hurding since 1997) From tjarvi at qbang.org Tue Feb 7 01:11:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 01:11:31 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <43E85056.2090608@trusted-logic.com> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: On Tue, 7 Feb 2006, David Garnier wrote: > Hello, > > I think that the make-based build process is fine as it is, apart from the location of the Java > source files. It is true that putting the Java source in a directory structure that map 1-to-1 to > the Java package structure is the norm and should make it easier for everyone to modify the Java > source, with or without an IDE. > > Ant is a good tool, but in the RXTX case I fail to see the advantage of using it compared to the > current make-based process. As Trent said, they are more pressing issues, like testing. > Hi David I have more experience with testing rxtx than I can talk about. But let it be known, rxtx has gone trough 100's of hours of testing. We are hobby folks interested in toys but there is more. rxtx has had some of the best guidance in the industry there. This is not an easy thing. I may be able to come back in a month from the other side of the corperate fence and help. I suspect the tests could just be made public but they are in a very unusual environment that just wont work in a wider sense. This is something I'll be trying to change. At one point it was agreed we could just make the results public so this isnt just noise.. There is interest and I think its safe to mention that much. The big problem with testing in the past is most of it is done with a loopback connection. So we *still* have major questions regarding things like flow control. rxtx talks to itself over a loopback and it works. regardless of right or wrong. This requires more thought to be done right. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Feb 7 02:46:34 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 02:46:34 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: > The big problem with testing in the past is most of it is done with a > loopback connection. So we *still* have major questions regarding things > like flow control. rxtx talks to itself over a loopback and it works. > regardless of right or wrong. With serial communication there are gold standards. ckermit is probably a definitive 'standard.' Maybe its possible to do ping/pong tests with ckermit? Is it scriptable? There are known issues in rxtx. Probably the worst is some threading issues regarding some JREs with multiple JNI threads setting java variables. Man did I get schooled there. Just switch the c functions to returning variables and things go away. Sometimes they work fine, sometimes they blow up. Without understanding everything, somehow rhat got it right and debian (and especially gentoo) grabbed kernel patches causing all sort of harm. Its not hard to fix once you understand whats going on but nearly impossible to track with a debugger. So I have a good idea what 2.1-8 will have outside of the IDE modifications. rxtx 2.1-7 is a release for everyone to sync with. Its not even as stable as -pre17 as far as I know - I ran no test suites. I'll be chasing it too. We just had so many contributions that it was time. It seriously broke internal scheduals but thats a great thing :) The other thing I want to do in 2.1-8 is automagic baud rates. It turns out lots of shops are doing really funky baud rates for things like automobile test equipment. It is possible but it requires a fair amount of change in the native code. Is anyone looking at this? -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Feb 7 02:57:21 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 07 Feb 2006 04:57:21 -0500 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <43E85056.2090608@trusted-logic.com> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: Hi All, I agree, testing is very important. The problem I have been trying to address is related to cross-platform testing and the robust nature of the installs. Typically, I visit 3 platforms to deploy my product, windows, linux and mac. A build is performed on each platform. The idea that you can build for many platforms from one copy the source code seems attractive. This should enable synchronized deployments of identical code. The question of how to achieve this goal remains open. As Trent mentioned, this is hard. Perhaps Ant will help here (but perhaps not). Ant does seem to help with running unit tests. However, it does not help with multi-platform tests. For that you need many machines and different operating environments. Toward that end, I have created a multi-platform test that can be run from web start, located at: http://show.docjava.com:8086/book/cgij/code/jnlp/serialPort.PortTest.jnlp This is interesting because many people in the community can run the test and we can improve the test, as time permits. No, it is not a perfect solution, however, the idea does help with multi-platform tests using many machines and different operating environments. If the group has a good test for a general serial port set-ups, i would be happy to deploy it, for general evaluation using web start. And as for ANT, it is just an idea. Not all my ideas are good ones! - Doug >Hello, > >I think that the make-based build process is fine as it is, apart >from the location of the Java >source files. It is true that putting the Java source in a directory >structure that map 1-to-1 to >the Java package structure is the norm and should make it easier for >everyone to modify the Java >source, with or without an IDE. > >Ant is a good tool, but in the RXTX case I fail to see the advantage >of using it compared to the >current make-based process. As Trent said, they are more pressing >issues, like testing. > >Regards, >David > >Dmitry Markman wrote: >> if I understands the issue right >> in order to be able to use ant for c/c++ compilation >> you have to install ant's cc task >> http://ant-contrib.sourceforge.net/cc.html >> >> it looks like it should work on mac os x >> (authors claim, that it's platform independent) >> but I never tested >> >> so all you have to do it's providing right command line >> for the gcc compiler >> >> >> >> >> On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: >> >>>> rxtx_root_directory >>>> `-- src >>>> |-- main >>>> | `-- java >>>> | `-- gnu >>>> | `-- io >>>> `-- test >>>> `-- java >>>> `-- gnu >>>> `-- io >>>> >>> >>> >>>> From what I understand this will just be good. >>> >>> For me it makes no difference. So lets do the rxtx thing. Let if >>> fester for two weeks and if nobody objects, we will do it. >>> >>> I'm not doing this because I care. I'm doing this to eliminate much >>> of my inbox. >>> >>> But test... man is rxtx lacking there in the community aspect. It is >>> covered but not right. _maybe_ I can change that this year. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> (cat hurding since 1997) > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From matt.higgins at gmail.com Tue Feb 7 08:28:34 2006 From: matt.higgins at gmail.com (Matt Higgins) Date: Tue, 7 Feb 2006 10:28:34 -0500 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final Message-ID: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? import java.io.*; import java.util.*; import gnu.io.*; public class MySimpleRead implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; public static void main(String[] args) { boolean portFound = false; String defaultPort = "COM1"; if (args.length > 0) { defaultPort = args[0]; } portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; MySimpleRead reader = new MySimpleRead(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } } public MySimpleRead() { try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) { e.printStackTrace(); } try { inputStream = serialPort.getInputStream(); } catch (IOException e) { e.printStackTrace(); } try { serialPort.addEventListener(this); } catch (TooManyListenersException e) { e.printStackTrace(); } try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { e.printStackTrace(); } System.out.println("Baud is " + serialPort.getBaudRate()); System.out.println("Bits is " + serialPort.getDataBits()); System.out.println("Stop is " + serialPort.getStopBits()); System.out.println("Par is " + serialPort.getParity()); serialPort.notifyOnDataAvailable(true); readThread = new Thread(this); readThread.start(); } public void run() { // Thread.sleep(20000); //} catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { System.out.println("An event occurred " + event.getEventType()); switch (event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: byte[] readBuffer = new byte[20]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } System.out.print(new String(readBuffer)); } catch (IOException e) {} break; } } } --------------- Result on windows ------------------------------ Stable Library ============================================================== Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port:: COM1 Baud is 9600 Bits is 8 Stop is 1 Par is 0 ----------------- End Results ----------------------------------------- ------------------ Result on Linux ----------------------------------- Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 Found port: /dev/ttyS0 Baud is 9600 Bits is 8 Stop is 1 Par is 0 An event occurred 1 043100066224 ------------------ End Results --------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/a1431630/attachment-0032.html From brian at mbari.org Tue Feb 7 09:48:37 2006 From: brian at mbari.org (Brian Schlining) Date: Tue, 7 Feb 2006 08:48:37 -0800 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> Message-ID: <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> Hi Matt > The following code works fine on Linux but I never see any data > when run on Windows. This is a cut and paste from the SimpleRead > example. > I am attempting to read data from a bar code scanner. I can fire > up HyperTermianl on windows and see that the device is working > properly as I see the barcodes are scanned and echoed back to the > terminal. However when I run the app I don't see any data. It is > however associating with the com port as the informational bits > print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. Cheers Brian Schlining Software Engineer http://www.mbari.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/16d07f37/attachment-0032.html From lux at diesel-research.com Tue Feb 7 11:59:58 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 11:59:58 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139293215.3689.4.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> Message-ID: <1139338798.8145.4.camel@zd7280> Any ideas on this ? Any reason why portList.hasMoreElements() should be false even though there are devices in /dev ? On Mon, 2006-02-06 at 23:20 -0700, Kim Lux wrote: > I'm running the code below. > > portlist.hasMoreElements() is false. > > /dev has ports in it as listed below. > > What am I doing wrong ? > > > ========================================================== > // Step through the list of ports until we find one that matches > // the one we are looking for. > > portList = CommPortIdentifier.getPortIdentifiers(); > > while(portList.hasMoreElements()) > { > portID = (CommPortIdentifier) portList.nextElement(); // > if (portID.getName().equals("/dev/ttyUSB0")) > { > myTA.append("Serial port ttyUSB0 has been found\n"); > break; > }// if portID equals... > }// End of while... > ========================================================== > > ls -al /dev/tty* > crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty > crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 > crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 > crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 > crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 > ... > crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 > crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 > crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 > > > -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 12:20:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 12:20:25 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139338798.8145.4.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> Message-ID: On Tue, 7 Feb 2006, Kim Lux wrote: > > Any ideas on this ? Any reason why portList.hasMoreElements() should be > false even though there are devices in /dev ? > > > On Mon, 2006-02-06 at 23:20 -0700, Kim Lux wrote: >> I'm running the code below. >> >> portlist.hasMoreElements() is false. >> >> /dev has ports in it as listed below. >> >> What am I doing wrong ? >> >> >> ========================================================== >> // Step through the list of ports until we find one that matches >> // the one we are looking for. >> >> portList = CommPortIdentifier.getPortIdentifiers(); >> >> while(portList.hasMoreElements()) >> { >> portID = (CommPortIdentifier) portList.nextElement(); // >> if (portID.getName().equals("/dev/ttyUSB0")) >> { >> myTA.append("Serial port ttyUSB0 has been found\n"); >> break; >> }// if portID equals... >> }// End of while... >> ========================================================== >> >> ls -al /dev/tty* >> crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty >> crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 >> crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 >> crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 >> crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 >> ... >> crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 >> crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 >> crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 >> >> >> > Hi Kim What rxtx does is try to open the port and do a timed out read. If the kernel/... do not complain it's enumarted. I suspect you could do a crude test by doing something like cat /dev/ttyS0 > /dev/null If that barfs then rxtx wont enumerate the port. hmm looking at your question again, I suspect it's a lockfile problem. This is documented in INSTALL with the source. Its easy enough to test this too.. touch /var/lock/testingrxtxlockfiles && rm -f /var/lock/testingrxtxlockfiles If you are not in the right group it will bail. Root will work regardless. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 12:37:56 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 12:37:56 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> Message-ID: <1139341076.8145.11.camel@zd7280> Exactly which ports does rxtx attempt to put into the list ? /dev/* or /dev/tty* or /dev/tty[0-9[0-9] ? or /dev/ttyS* ? For the record, only /dev/ttyUSB0 is a valid port on the machine I am presently on. Will this be a problem ? On Tue, 2006-02-07 at 12:20 -0700, Trent Jarvi wrote: > This is documented in INSTALL with the source. > I was wondering where that file was. I will download source and dig it up. Thanks. -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 12:51:09 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 12:51:09 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139341076.8145.11.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: On Tue, 7 Feb 2006, Kim Lux wrote: > > Exactly which ports does rxtx attempt to put into the list ? /dev/* > or /dev/tty* or /dev/tty[0-9[0-9] ? or /dev/ttyS* ? > > For the record, only /dev/ttyUSB0 is a valid port on the machine I am > presently on. Will this be a problem ? > > > On Tue, 2006-02-07 at 12:20 -0700, Trent Jarvi wrote: >> This is documented in INSTALL with the source. >> > I was wondering where that file was. I will download source and dig it > up. > > Thanks. > Hmm I'm looking at pre17 so this may have changed. (its just what I have on this machine) if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA" // for the IPAQs }; CandidatePortPrefixes=Temp; } So you may need to add "ttyUSB" to that list. RXTX used to enumerate _everything_ see if(osName.equals("Linux-all-ports") But it became less than practical. This is all in RXTXCommDriver.java hmm I just did a cvs update. if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have to get your fingers into the code. We aim for sane defaults. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 13:06:45 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 13:06:45 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139342805.8145.22.camel@zd7280> On Tue, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > Hmm I'm looking at pre17 so this may have changed. (its just what I have > on this machine) > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA" // for the IPAQs > }; > CandidatePortPrefixes=Temp; > } > > > So you may need to add "ttyUSB" to that list. RXTX used to enumerate > _everything_ see if(osName.equals("Linux-all-ports") But it became less > than practical. > > This is all in RXTXCommDriver.java > > hmm I just did a cvs update. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have > to get your fingers into the code. We aim for sane defaults. Excellent. Thanks for taking the time. -- Kim Lux, Diesel Research Inc. From ideiglenes1 at freemail.hu Tue Feb 7 13:53:39 2006 From: ideiglenes1 at freemail.hu (--) Date: Tue, 07 Feb 2006 21:53:39 +0100 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139345619.22534.2.camel@localhost> Hi! I use this code to get all the extra Linux devices. :) if ("Linux".equals(System.getProperty("os.name"))) { System.setProperty("os.name","Linux-all-ports"); } driver = new RXTXCommDriver(); On k, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > On Tue, 7 Feb 2006, Kim Lux wrote: > > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have > to get your fingers into the code. We aim for sane defaults. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From matt.higgins at gmail.com Tue Feb 7 13:45:54 2006 From: matt.higgins at gmail.com (Matt Higgins) Date: Tue, 7 Feb 2006 15:45:54 -0500 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> Message-ID: <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> Sweet this is exactly what I needed. I was searching the archives through marc.theamisgroup they only have archives back to 1/3/05. Should have hit the mailman archive! Thanks a lot! On 2/7/06, Brian Schlining wrote: > > Hi Matt > > The following code works fine on Linux but I never see any data when run > on Windows. This is a cut and paste from the SimpleRead example. > I am attempting to read data from a bar code scanner. I can fire up > HyperTermianl on windows and see that the device is working properly as I > see the barcodes are scanned and echoed back to the terminal. However when I > run the app I don't see any data. It is however associating with the com > port as the informational bits print fine? > > > You're not the only one whose had this problem, I don't know if Trent has > addressed this is the latest release of RXTX but there is a workaround. > Here's the recent thread from the RXTX mailing list regarding this issues: > > Thanasis Delenikas tdelenik at gmail.com > Wed Jan 18 13:56:23 MST 2006 > > * Previous message: [Rxtx] Re: More close() performance fixes > * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] > > Hi all. > (I've subscribed again from my other email account). > > Trent, > > You are right. Linux *always* works, no matter what flow control you set. > Windows *works only* with hardware flow control (I haven't tested what > happens with software XON/XOFF flow control). > > I assume (but I am not certain) that even with no flow control at all, all > platforms should work. Without flow control, you have the risk of bumping > into overflow or framing errors, but that's your (the end programmer, I > mean) problem. > > >From my side, I shouldn't be working without flow control. That was a bug > too... It was some code forgotten from the old times, when I used to work > with phone emulation drivers which didn't support flow control. The > correct > way is to have some flow control enabled and that's why I suppose this is > a > low-severity bug for RxTx. > > I have no idea which platform shows the correct behaviour, since > my knowledge about Linux and the inner workings of these low-level i/o > operations is limited. > > Regards, > Thanasis Delenikas. > > > > > Message: 2 > > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > > From: Trent Jarvi > > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > > To: RXTX Developers and Users > > Message-ID: > > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > > > Hi all, > > > > > > Trent, I have found something. > > > I read your comment about flow control, so I experimented a bit. > > > > > > If you remember, in my sample program I've used no flow control at all > ( > > i.e. > > > Java constant FLOWCONTROL_NONE). > > > > > > Now, during testing, I've switch to hardware inbound flow control (i.e > . > > Java > > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > > beautifully! > > > > > > I think I will switch to H/W flow control and test things for a while, > > but > > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > > > > > Hi Thanasis, > > > > I'm fairly sure you have identified a bug. I would not worry too much > > about what Sun CommAPI w32 defaults are. I think they did more or less > > whatever the port opened with. Just a guess. Linux tries to stomp on > > ports so they are all the same. > > > > So this started out with Linux worked, Windows XP/.. did not as I > recall. > > Something is wrong in rxtx. Do I understand this right? > > > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > > > Perhaps there is something Wayne or I did not understand when we wrote > > that code. I wasnt programming back in the BBS days so modems are not > my > > thing. I have a few questions. > > > > Is the above matrix confirmed by observation? > > Linux just always worked? > > Which one _should_ work? I'm guessing modems work with hardware flow > > control. I'll have to dig around. > > > > The windows flow control changes a couple things with hardware flow > > control. Following the w32 API documentation is confusing sometimes. > > But it looks like Linux could have a bug too. > > Cheers > > Brian Schlining > Software Engineer > http://www.mbari.org > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/9c989144/attachment-0032.html From tjarvi at qbang.org Tue Feb 7 14:06:14 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 14:06:14 -0700 (MST) Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> Message-ID: >> >> You're not the only one whose had this problem, I don't know if Trent has >> addressed this is the latest release of RXTX but there is a workaround. >> Here's the recent thread from the RXTX mailing list regarding this issues: >> I have not. I expect to have access to some test equipment next month and I'll go through all of this. I really don't know whats going on and I need a gold standard. I thought maybe linux was autodetecting the flow control. Your observations would certainly be welcome. I need to talk to Russell King and see what he is doing. Until then I'd just be toying around over a loopback as usual. This is very high on the list though. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 17:25:05 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 17:25:05 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139358305.17994.2.camel@zd7280> My application now works. I installed the libraries and jar from 2.1-7 (Final). portlist.hasMoreElements is no longer false. The application finds the port for /dev/ttyUSB0. Thanks for your help, Trent (et al) Sorry I bothered you with this. Next time I will look in the source first. I didn't think it was an rxtx issue, I thought it was a Linux setup issue . On Tue, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > Hmm I'm looking at pre17 so this may have changed. (its just what I > have > on this machine) > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux > Serial Ports > "ttySA" // for the > IPAQs > }; > > CandidatePortPrefixes=Temp; > } > > > So you may need to add "ttyUSB" to that list. RXTX used to enumerate > _everything_ see if(osName.equals("Linux-all-ports") But it became > less > than practical. > > This is all in RXTXCommDriver.java > > hmm I just did a cvs update. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux > Serial Ports > "ttySA", // for the > IPAQs > "ttyUSB" // for USB > frobs > }; > > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you > have > to get your fingers into the code. We aim for sane defaults. -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 19:21:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 19:21:54 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139358305.17994.2.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> <1139358305.17994.2.camel@zd7280> Message-ID: >Sorry I bothered you with this. Next time I will look in the source >first. I didn't think it was an rxtx issue, I thought it was a Linux >setup issue . Why would you be sorry? I would have done the same. I'm glad it's working :) -- Trent Jarvi tjarvi at qbang.org From tma at mail.island.net Wed Feb 8 13:39:35 2006 From: tma at mail.island.net (Tom Alldread) Date: Wed, 08 Feb 2006 12:39:35 -0800 Subject: [Rxtx] Win32/Linux Serial Port Data Dropouts In-Reply-To: <200602060702.k167255O007882@www.qbang.org> References: <200602060702.k167255O007882@www.qbang.org> Message-ID: <43EA5707.4020200@mail.island.net> Greetings Folks at RXTX: During the last couple of months I have been alternately testing with javax.comm 2 and RXTX 2.1 under Windows XP and CommApi 3 and RXTX 2.1 under Suse 10.0 Linux. In the process I have learned a little about java multi-threading under NetBeans 5 with Profiler. My java (jdk 1.5_06) application is used for data acquisition and provides a graphical display of A-D conversion data received from a 56KBaud serial port. The actual data throughput is about 10KBaud thus it is well below the speed of the port. I use hardware RTS/CTS flow control which can stall the data acquisition sample rate if necessary. This ensures the display computer has the ability to slow the data acquisition rate should it become too busy to accept the regular data flow. Both the serial port buffer and the java read buffer are set at 16KB. Usually the data transfers into the java read buffer are less than 100 bytes unless the data acquisition is recovering from a stall. The data flow normally hesitates after each 5 KB block as a continue command is needed from the display computer to start the drawing of a new graphics display line. Separate threads have been provided for the serial port event monitoring and data processing. The serial port event thread has been given the maximum priority and data processing thread the minimum priority provided by java. Thread yield statements have been placed within all data processing while/for loops as an effort to ensure quick access to CPU cycles for the serial port event thread. I have found that short data transmissions are essentially error free but occasional dropouts occur with continuous data flow especially under Windows XP. ....................................................................................................................................................................................... Linux results: I am happy to report that RXTX 2.1 appears to work very well under Linux although I did notice some errors when the screen savers were running with my dual monitors. I believe this is a local problem associated with my dual graphics which needs further attention. The recent CommApi 3 Linux release from Sun did not work at all with my program. It seemed to send commands out OK but did not receive any data. Although the serial port event triggered the ISR, the input stream appeared filled with nulls and thus did not contain any data. As my understanding is that CommApi 3 was tested with a Red Hat distribution of Linux I wonder if this problem is distro dependent? Although somewhat off topic here I wonder if anyone reading this has had similar experience? .................................................................................................................................................................................. Windows XP results: There are problems with occasional data dropouts which become more frequent as the sampling rate is increased or if the computer becomes busy with other duties. The dropouts typically consist of a half dozen byte block of lost data. It appears the lost bytes never get added to the java input stream. There has not been any indication of garbled data, overruns or framing errors which suggests the UART communications remains solid. Using javax.comm 2 I found that the setting of SerialPort 'enableReceiveThreshold' to 40 and 'enableReceiveTimeout' of 100mS reduced the dropouts error rate significantly. I found that I could not get RXTX 2.1 to function with the aforementioned threshold and timeout settings. The javax.comm 2 interface is consequently performing better for me under Windows than RXTX 2.1. I wonder if anyone here has any suggestions as to what I might try to improve RXTX 2.1? Although my settings are the same as under Suse 10.0, RXTX 2.1 performs much better for me under Linux than any of the alternatives that I have tried under Windows XP . ............................................................................................................................................................................... I would like to establish, based on the experience of others, if I have reached the normally expected performance limit of java serial port communications? Should I expect to achieve virtually error free serial port data input from a continuous stream under Windows XP java software? I am considering changing my protocol to packets with error checking if necessary but would like to know if the dropout problems I am experiencing are typical or not before I take this rather work intensive plunge. Many thanks in advance for any help! Best Regards, Tom Alldread -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.375 / Virus Database: 267.15.2/253 - Release Date: 2006-02-07 From jlaxson at mac.com Wed Feb 8 23:56:48 2006 From: jlaxson at mac.com (John Laxson) Date: Thu, 9 Feb 2006 00:56:48 -0600 Subject: [Rxtx] PortInUseException: Unknown Application on OSX Message-ID: Hi, I've been trying to get RXTX 2.1.7 going on Mac OS X for a while here, and am running up into a wall here. I've tried with pre- compiled and the source version and get the same problem, a gnu.io.PortInUseException: Unknown Application. I have run the fixperms script included with the source distribution, and id shows me as a member of the uucp group, and permissions on /var/spool/uucp are 775 root:uucp. Running a test program (included at the bottom for clarity) lets me enumerate all the serial ports correctly, but trying to open any of them gives the PortInUseException. If it helps, when I try to open a port that's set to make an outgoing bluetooth connection, there is no delay and no connection attempt at all. Thanks, John Laxson PS: The documentation wiki on qbang.org shows 404, and has for a few days now. My test code: public static void main(String[] args) { SerialPort serialPort; try { Enumeration e = CommPortIdentifier.getPortIdentifiers(); CommPortIdentifier ident; while (e.hasMoreElements()) { ident = (CommPortIdentifier)e.nextElement(); System.out.println(ident.getName()); } ident = CommPortIdentifier.getPortIdentifier("/dev/cu.modem"); serialPort = (SerialPort) ident.open("Me", 5000); } catch (Exception e) { e.printStackTrace(); } } From rajesh.invincible at gmail.com Thu Feb 9 03:39:38 2006 From: rajesh.invincible at gmail.com (Rajesh N) Date: Thu, 9 Feb 2006 16:09:38 +0530 Subject: [Rxtx] Re: Move .java Files in gnu.io filesystem hierarchy - Maven (2) In-Reply-To: <43DF21D2.7090200@ngi.it> References: <43DF21D2.7090200@ngi.it> Message-ID: <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Can anybody tell me how to overcome these EXCEPTIONS I AM WORKING ON SERIAL COMMN IN JAVA ON LINUX. 1. " NOT ALL PARAMETERS SUPPORTED BY THE KERNEL" This i came across the following statement inmy prog. SerialP is A SerialPort object SerialP.setSerialPortParams(9600(BAUDRATE),DATABITS_8,STOPBITS_1,PARITY_NONE) 2. NullPointer Exception at Event Dispatch Now i have checked all my object references for a null reference but i found none i have put up my entire code in try catch blocks but still I AM UNABLE TO CATCH THIS EXCEPTION AND HENCE MY APPLICATION CLOSES HOW DOES THESE GO? PLEASE HELP ME IT IS URGENTTTTTTTTTTTTTTTT yours sincerely RAJESH On 1/31/06, Fabio Frumento wrote: > Hi Xavier, > > I don't know maven at all but the directory hierarchy listed buy Trent > is fine for me... > > I'll take a look to maven, it seems an interesting project > > Regards > > Fabio Frumento > > Trent Jarvi wrote: > > On Tue, 31 Jan 2006, Xavier Frisaye wrote: > > > >> Hi all, > >> > >> If you are going to rearrange the src folder, i will propose to use > >> maven 2 and follow its directory structure > >> > (http://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html). > >> > >> Maven 2 simplify java project and give a standard way to make projects > >> (http://maven.apache.org/). > >> We are using it for internal projects and we are very satisfied. > >> > >> Is anybody interested? > >> > >> I'm not an expert in maven 2 (yet) but i'm agree to help using it if > >> you choose to make so. > >> > > > > so this would be: > > > > rxtx-devel/src/main/java/gnu.io > > rxtx-devel/src/test/java/ManIwish.java > > > > I don't use IDEs very much so I'll let others comment. But I don't see > > a problem with that. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Thu Feb 9 09:50:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 9 Feb 2006 09:50:31 -0700 (MST) Subject: [Rxtx] Re: Move .java Files in gnu.io filesystem hierarchy - Maven (2) In-Reply-To: <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Message-ID: On Thu, 9 Feb 2006, Rajesh N wrote: > Can anybody tell me how to overcome these EXCEPTIONS > I AM WORKING ON SERIAL COMMN IN JAVA ON LINUX. > > 1. " NOT ALL PARAMETERS SUPPORTED BY THE KERNEL" > > This i came across the following statement inmy prog. > SerialP is A SerialPort object > SerialP.setSerialPortParams(9600(BAUDRATE),DATABITS_8,STOPBITS_1,PARITY_NONE) > Strange. The parameters you use are the same the port should open with by default. Could you paste the actual exception you are getting? I don't see that in the rxtx source. Also it would help to know the rxtx version. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Fri Feb 10 15:29:05 2006 From: lux at diesel-research.com (Kim Lux) Date: Fri, 10 Feb 2006 15:29:05 -0700 Subject: [Rxtx] One serial port object for both sending and receiving ? Message-ID: <1139610545.18177.4.camel@zd7280> Is it OK to use one SerialPort ojbect (ex Serial Port serialPort;) and use it for both sending and receiving ? For example: ======================================================================== static SerialPort serialPort = null; static OutputStream serialOut = null; static InputStream serialIn = null; // assign it to an outputStream for use try{ serialOut = serialPort.getOutputStream(); System.out.println("Serial output stream has been assigned."); }//try catch(IOException e) { System.out.println("Error: Couldn't assign output stream to serial port."); }//catch //assign it to an inputStream for use try{ serialIn = serialPort.getInputStream(); System.out.println("Serial input stream has been assigned."); }//try catch(IOException e) { System.out.println("Error: Couldn't assign input stream to serial port."); }//catch ======================================================================== -- Kim Lux, Diesel Research Inc. From lux at diesel-research.com Fri Feb 10 21:23:00 2006 From: lux at diesel-research.com (Kim Lux) Date: Fri, 10 Feb 2006 21:23:00 -0700 Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Message-ID: <1139631780.23882.10.camel@zd7280> I've got a problem receiving chars with my version of serialRead, written in an SWT GUI. I had a Java pro have a good look at my code and he can't see anything wrong with it. I can send chars fine. When I receive a char the cpu usage for the app goes to 100% and the code in the serial event handler doesn't get executed. The instructions on the Java Comm Serial API How-To for Linux page state that I must install javacomm. Is that true ? Everything builds without it and I can send chars on rxtx just fine, but I can't receive them. Could this be the problem ? I downloaded and installed javacomm. I was not able to add "Driver=gnuio.RXTXCommDriver to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 installed in /usr/java/jre1.5.0_05. I added comm.jar to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext to the library paths. Is this OK ? Does it matter that I am receiving on /dev/ttyUSB0 ? Thanks. -- Kim Lux, Diesel Research Inc. From lunareclipse03 at web.de Sat Feb 11 09:44:46 2006 From: lunareclipse03 at web.de (lunareclipse03@web.de) Date: Sat, 11 Feb 2006 17:44:46 +0100 Subject: [Rxtx] Question about Serial I/O under Win32 Message-ID: <662084330@web.de> Hello everybody, I have a strange problem with a piece of code I made for myself. No, this is not really concerning rxtx, but nevertheless I post this to the list, hoping that some of you can help me. I've written two libraries, one for linux and one for win32. The linux port works quite well, I can send / receive faxes and / or replay voice messages over the telephone line using a voice modem. But the win32 port of the library causes some trouble. If, for example, I send out a fax with a certain modem under linux, it works well. The fax is complete when it comes out of the fax machine. If I then use the same modem to send out a fax under win32, the fax coming out of the fax machine gets "stuck" halfways, but the sending modem thinks that transmission was ok and drops the connection. The answering fax machine then gives me "error while receiving." The "upper layer" java code MUST be right, because if I do the same thing under linux (using the linux library), everything is alright. Now I have to ask: Can somebody please help me out with this??!? Could it be the case that some kind of flow control or COMMTIMEOUTS setting causes this behaviour? I set flow control to RTS/CTS before sending out a fax. How can I DISABLE flow control? Or what do you think? Can something else cause this problems? Thank you all for your time and PLEASE write back soon. Regards, --Sven Ahlemann Am Waldrand 31 45721 Haltern am See Germany ______________________________________________________________ Verschicken Sie romantische, coole und witzige Bilder per SMS! Jetzt bei WEB.DE FreeMail: http://f.web.de/?mc=021193 From lux at diesel-research.com Sat Feb 11 10:06:52 2006 From: lux at diesel-research.com (Kim Lux) Date: Sat, 11 Feb 2006 10:06:52 -0700 Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: <1139631780.23882.10.camel@zd7280> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> <1139631780.23882.10.camel@zd7280> Message-ID: <1139677612.3431.5.camel@zd7280> More on this problem. I copied and pasted simpleRead into a console based Eclipse project and I've got the same result, except that cpu usage doesn't go to 100%. I'm beginning to think there is an issue in rxtx. My imports for simpleRead are: ============================ import gnu.io.*; import java.util.*; //import javax.comm.*; import java.io.*; =========================== Any ideas ? I am trying to read from /dev/ttyUSB0 using a serial to USB adapter which has worked well with minicom and gtkterm. Thanks. On Fri, 2006-02-10 at 21:23 -0700, Kim Lux wrote: > I've got a problem receiving chars with my version of serialRead, > written in an SWT GUI. > > I had a Java pro have a good look at my code and he can't see anything > wrong with it. > > I can send chars fine. When I receive a char the cpu usage for the app > goes to 100% and the code in the serial event handler doesn't get > executed. > > The instructions on the Java Comm Serial API How-To for Linux page state > that I must install javacomm. Is that true ? Everything builds without > it and I can send chars on rxtx just fine, but I can't receive them. > Could this be the problem ? > > I downloaded and installed javacomm. I was not able to add > "Driver=gnuio.RXTXCommDriver > to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not > have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 > installed in /usr/java/jre1.5.0_05. I added comm.jar > to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext > to the library paths. Is this OK ? > > Does it matter that I am receiving on /dev/ttyUSB0 ? > > Thanks. > -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Sun Feb 12 21:01:33 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:01:33 -0700 (MST) Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: <1139677612.3431.5.camel@zd7280> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> <1139631780.23882.10.camel@zd7280> <1139677612.3431.5.camel@zd7280> Message-ID: I suspect what is happening is the select() is breaking out in the native code but the driver does not have support for notifying there are X bytes available. On some traditional Unix based systems, the only way you know data is available is the fd status changes and do an FIORDCHK ioctl. Or perhaps the only thing you can know is the fd status changed. It would take reading through the kernel driver code to know for sure. So on USB, depending upon the driver, the same may need to be done or the driver improved a bit if possible to support. Polling reads will also work but don't use the event driven model of CommAPI which isnt acceptable in the long run. The 100% cpu usage can then be explained because select no longer blocks until the data is read; the eventLoop spins loose. You can put a well placed sleep but rxtx only expects those are needed when it knows data is available. This may not be a super simple thing to understand and fix. I do have ideas to get you started. I'm going to be short on time the next couple weeks. I expect to put some good time in and answer some other questions I saw around the 25th. For now, I'd look at the following and go from there with the hints I've given. JNIEXPORT jint JNICALL RXTXPort(nativeavailable)( JNIEnv *env, jobject jobj ) { int fd = get_java_var( env, jobj,"fd","I" ); int result; /* char message[80]; ENTER( "RXTXPort:nativeavailable" ); On SCO OpenServer FIONREAD always fails for serial devices, so try ioctl FIORDCHK instead; will only tell us whether bytes are available, not how many, but better than nothing. This turns out to be true on Solaris also. taj. */ #ifdef FIORDCHK /* __unixware__ __sun__ probably others */ result = ioctl(fd, FIORDCHK, 0); #else if( ioctl( fd, FIONREAD, &result ) < 0 ) { goto fail; } #endif /* FIORDCHK */ On Sat, 11 Feb 2006, Kim Lux wrote: > > More on this problem. I copied and pasted simpleRead into a console > based Eclipse project and I've got the same result, except that cpu > usage doesn't go to 100%. I'm beginning to think there is an issue in > rxtx. > > My imports for simpleRead are: > > ============================ > import gnu.io.*; > import java.util.*; > //import javax.comm.*; > import java.io.*; > =========================== > > Any ideas ? I am trying to read from /dev/ttyUSB0 using a serial to > USB adapter which has worked well with minicom and gtkterm. > > Thanks. > > > > On Fri, 2006-02-10 at 21:23 -0700, Kim Lux wrote: >> I've got a problem receiving chars with my version of serialRead, >> written in an SWT GUI. >> >> I had a Java pro have a good look at my code and he can't see anything >> wrong with it. >> >> I can send chars fine. When I receive a char the cpu usage for the app >> goes to 100% and the code in the serial event handler doesn't get >> executed. >> >> The instructions on the Java Comm Serial API How-To for Linux page state >> that I must install javacomm. Is that true ? Everything builds without >> it and I can send chars on rxtx just fine, but I can't receive them. >> Could this be the problem ? >> >> I downloaded and installed javacomm. I was not able to add >> "Driver=gnuio.RXTXCommDriver >> to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not >> have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 >> installed in /usr/java/jre1.5.0_05. I added comm.jar >> to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext >> to the library paths. Is this OK ? >> >> Does it matter that I am receiving on /dev/ttyUSB0 ? >> >> Thanks. >> > From tjarvi at qbang.org Sun Feb 12 21:03:30 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:03:30 -0700 (MST) Subject: [Rxtx] One serial port object for both sending and receiving ? In-Reply-To: <1139610545.18177.4.camel@zd7280> References: <1139610545.18177.4.camel@zd7280> Message-ID: On Fri, 10 Feb 2006, Kim Lux wrote: > > Is it OK to use one SerialPort ojbect (ex Serial Port serialPort;) and > use it for both sending and receiving ? > > For example: > > ======================================================================== > static SerialPort serialPort = null; > static OutputStream serialOut = null; > static InputStream serialIn = null; > > > > > // assign it to an outputStream for use > try{ > serialOut = serialPort.getOutputStream(); > System.out.println("Serial output stream has been assigned."); > }//try > catch(IOException e) > { > System.out.println("Error: Couldn't assign output stream to serial > port."); > }//catch > > > //assign it to an inputStream for use > try{ > serialIn = serialPort.getInputStream(); > System.out.println("Serial input stream has been assigned."); > }//try > catch(IOException e) > { > System.out.println("Error: Couldn't assign input stream to serial > port."); > }//catch This should be fine. In fact trying to do it another way will probably not work as you will run into lockfile issues. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun Feb 12 21:13:13 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:13:13 -0700 (MST) Subject: [Rxtx] Question about Serial I/O under Win32 In-Reply-To: <662084330@web.de> References: <662084330@web.de> Message-ID: On Sat, 11 Feb 2006 lunareclipse03 at web.de wrote: > Hello everybody, > > I have a strange problem with a piece of code I made for myself. No, > this is not really concerning rxtx, but nevertheless I post this to the > list, hoping that some of you can help me. I've written two libraries, > one for linux and one for win32. The linux port works quite well, I can > send / receive faxes and / or replay voice messages over the telephone > line using a voice modem. But the win32 port of the library causes some > trouble. If, for example, I send out a fax with a certain modem under > linux, it works well. The fax is complete when it comes out of the fax > machine. If I then use the same modem to send out a fax under win32, the > fax coming out of the fax machine gets "stuck" halfways, but the sending > modem thinks that transmission was ok and drops the connection. The > answering fax machine then gives me "error while receiving." The "upper > layer" java code MUST be right, because if I do the same thing under > linux (using the linux library), everything is alright. Now I have to > ask: Can somebody please help me out with this??!? Could it be the case > that some kind of flow control or COMMTIMEOUTS setting causes this > behaviour? I set flow control to RTS/CTS before sending out a fax. How > can I DISABLE flow control? Or what do you think? Can something else > cause this problems? Thank you all for your time and PLEASE write back > soon. > Hi Sven I'm not too willing to talk about flow control at the low level until I confirm some things with test equipment later. It is not clear if you are using rxtx or writing your own native code. So I'm not sure how to answer much of this :) If you are wondering how to change the flow control using rxtx from java, The BlackBox example from Sun flips this back and forth. SerialPort.java in rxtx 2.1 uses the following: SerialPort.java: public static final int FLOWCONTROL_NONE =0; SerialPort.java: public static final int FLOWCONTROL_RTSCTS_IN =1; SerialPort.java: public static final int FLOWCONTROL_RTSCTS_OUT =2; SerialPort.java: public static final int FLOWCONTROL_XONXOFF_IN =4; SerialPort.java: public static final int FLOWCONTROL_XONXOFF_OUT=8; So if you set flowcontrol to RTSCTS, you can set it to NONE to turn it off. If you are looking for how to do it in native code, the rxtx Source is SerialImp.c (unix/linux/mac os x/w32) and termios.c (w32 only with SerialImp.c) You can track the code: SerialImp.c:JNIEXPORT void JNICALL RXTXPort(setflowcontrol)( JNIEnv *env, jobject jobj, jint flowmode ) termios.c:int tcgetattr( int fd, struct termios *s_termios ) termios.c:int tcsetattr( int fd, int when, struct termios *s_termios ) There may be a problem in the rxtx flow control code though. Rather than guess, I want to test this with a gold standard. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Feb 6 00:00:16 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 00:00:16 -0700 (MST) Subject: [Rxtx] wiki delay until tomorrow night. In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: On Sun, 5 Feb 2006, Trent Jarvi wrote: > On Sun, 5 Feb 2006, Kim Lux wrote: > >> usb ? Tell me more... I need that too. > > usb is a very proper design. Thats all it is. > Maybe rxtx could help usb. But it would start with helping bring back the community that was already there. It's not something I'd love to do but maybe its the right thing to do. It would probably take 2 years to do right. But maybe thats better than what we have now. I honestly don't know what IBM is doing which could just run over everything. Just some thoughts after some fine german wine. -- Trent Jarvi tjarvi at qbang.org From gadelavega at yahoo.com.ar Mon Feb 6 02:17:05 2006 From: gadelavega at yahoo.com.ar (Gonzalo A. de la Vega) Date: Mon, 06 Feb 2006 10:17:05 +0100 Subject: [Rxtx] Serial port ownership question In-Reply-To: References: <20060205113618.30274.qmail@web53501.mail.yahoo.com> <1139157422.4553.9.camel@zd7280> <1139158698.4936.9.camel@zd7280> Message-ID: <43E71411.4050402@yahoo.com.ar> On my Fedora Core 4: ls -l /dev/ttyS* crw-rw---- 1 root uucp 4, 64 Feb 6 2006 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Feb 6 2006 /dev/ttyS1 ... and: grep "ttyUSB" /etc/udev/rules.d/50-udev.rules KERNEL=="ttyUSB*", GROUP="uucp", MODE="0660" So anyone in the "uucp" group can use serial ports. On Gentoo the group is "tty". Trent Jarvi escribi?: > > > On Sun, 5 Feb 2006, Dr. Douglas Lyon wrote: > >> I can confirm that this is the case (only root ownership of >> serial ports, under fedora 4). >> Wow, what were they thinking?! >> - DL >> >>> I've found that the newer kernels have the serial ports owned by root. >>> For example, >>> >>> $ls -al /dev/tty* >>> crw-rw-rw- 1 root root 5, 0 Feb 5 02:06 /dev/tty >>> crw-rw---- 1 root root 4, 0 Feb 5 02:06 /dev/tty0 >>> crw------- 1 root root 4, 1 Feb 5 09:07 /dev/tty1 >>> crw-rw---- 1 root tty 4, 10 Feb 5 02:06 /dev/tty10 >>> crw-rw---- 1 root tty 4, 11 Feb 5 02:06 /dev/tty11 >>> ... > > > This is just not a problem jcp or such are going to solve. Its a > platform spitwad fight. But do look at pam. In fact thats what Sun > is doing too. Maybe Linux followed their lead.. I'm not a pam guy. > I've spent 16 hours trying to understand it but your users wont :) > > Solution? I have no clue. Its two tangent mentalities from my > perspective. > > -- > Trent Jarvi > tjarvi at qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mtnvega at yahoo.com.br Mon Feb 6 05:35:43 2006 From: mtnvega at yahoo.com.br (Luiz Jr) Date: Mon, 6 Feb 2006 12:35:43 +0000 (GMT) Subject: [Rxtx] Documentation Wiki In-Reply-To: <1139157422.4553.9.camel@zd7280> Message-ID: <20060206123543.57256.qmail@web53515.mail.yahoo.com> Hello, Thank you for you answer, but so the usage of the API is pretty much like the Java Communications Api? If yes, what version of the Java Comm Api? Thank you, Luiz A. Brandao Jr Kim Lux escreveu: On Sun, 2006-02-05 at 08:36 -0300, Luiz Jr wrote: > Hello, > > I want to start using the RXTX libraries, but I would to know how, > since I can not access the documentation wiki page I just started using them yesterday. Below is how I installed the libraries, if that helps. I used snippets of code from the SimpleWrite application here to get me going. http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html Instead of "import javax.comm.*;", use "import gnu.io.*;" which is gotten from RXTXcomm.jar, which you will need to include in your project references. I am working in Eclipse. BTW: there is no way to open a port without going through the port list and finding it. Maybe sometime in the future someone (me ?) will write a method called openSerialPort that allows the user to give a port identifier, such as "/dev/tty1" and return a port ready to use. It wouldn't take much to write that and it would save users a lot of code. Hope this helps. ======================================================================= 1) Figure out which java you are running, incase there is more than one installed. $ java -version java version "1.5.0_05" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_05-b05) Java HotSpot(TM) Client VM (build 1.5.0_05-b05, mixed mode, sharing) 2) Find all the jre directories and the one from which you are currently running. kfind (jre) 3) cd to that directory plus /lib/i386 cd /usr/java/jre1.5.0_05/lib/i386 4) Copy the library files (*.so) to that directory. cp /home/krlux/Desktop/'Java Controls'/rxtx-linux/bin/* . 5) Check that the copy was successful ls librxtx* librxtxI2C.so librxtxRaw.so librxtxSerial.so librxtxParallel.so librxtxRS485.so 6) cd to the /lib/ext directory for your java. cd /usr/java/jre1.5.0_05/lib/ext 7) Copy the Jar files there cp /home/krlux/Desktop/'Java Controls'/rxtx-linux/lib/ext/* . 8) Check that it was successful ls RXTX* RXTXcomm.jar Rxtx is now installed on your machine ready to use. =================================================================== -- Kim Lux, Diesel Research Inc. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx --------------------------------- Yahoo! Acesso Gr?tis - Internet r?pida e gr?tis. Instale o discador agora! -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/544aa403/attachment-0033.html From lyon at docjava.com Mon Feb 6 05:49:34 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 06 Feb 2006 07:49:34 -0500 Subject: [Rxtx] wiki delay until tomorrow night. In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: Hi All, I have often thought about USB drivers being needed. For example, the ironman watch will not interface to a mac (windows only). It is USB. My dymo label writer has no Java driver (native only). Etc. Most cheap web cameras are USB (and Java drivers go through JAI, if it supports the camera at all). The JAI code shows how sun did the USB drivers. You have to be a member of the jai project to download the source code. https://jai.dev.java.net has the jai distro. And then you are not allowed to redistribute it. However, we can all learn from it (if so inclined). Basically: cvs -d :pserver:lyon at cvs.dev.java.net:/cvs login cvs -d :pserver:lyon at cvs.dev.java.net:/cvs checkout jai-core You will need to user your own uid and pw to get in. The ant build has over 100 warnings from sun deprecations of its own code. You might say that they were hoisted on their own Picard ;) One interesting thing is that they support several platforms: linux-amd64 64-bit Linux-AMD64 linux-i586 32-bit Linux-x86 solaris-amd64 64-bit Solaris-AMD64 solaris-i586 32-bit Solaris-x86 solaris-sparc 32-bit Solaris-SPARC solaris-sparcv9 64-bit Solaris-SPARC windows-i586 32-bit Windows-x86 Thus, ant is used to provide a multi-platform native method distro. Neat. How do they do it? check this out: And: The core download does not contain any C source code (it was all pre-built). Basically, they are just copying .so and .dll files into build directories. I would love to see the C code for this...but Sun does not post it on the https://jai.dev.java.net site. I don't know why...Perhaps I missed it. - Doug >On Sun, 5 Feb 2006, Trent Jarvi wrote: > >>On Sun, 5 Feb 2006, Kim Lux wrote: >> >>>usb ? Tell me more... I need that too. >> >>usb is a very proper design. Thats all it is. >> > >Maybe rxtx could help usb. But it would start with helping bring >back the community that was already there. > >It's not something I'd love to do but maybe its the right thing to do. > >It would probably take 2 years to do right. But maybe thats better >than what we have now. > >I honestly don't know what IBM is doing which could just run over everything. > >Just some thoughts after some fine german wine. > >-- >Trent Jarvi >tjarvi at qbang.org > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tdelenik at gmail.com Mon Feb 6 05:56:32 2006 From: tdelenik at gmail.com (Thanasis Delenikas) Date: Mon, 6 Feb 2006 14:56:32 +0200 Subject: Fwd: [Rxtx] Documentation Wiki In-Reply-To: <1139157422.4553.9.camel@zd7280> References: <20060205113618.30274.qmail@web53501.mail.yahoo.com> <1139157422.4553.9.camel@zd7280> Message-ID: <310a1a930602060456t129f1dc6p5f2b908f13ab5a0b@mail.gmail.com> Hello all, Kim, this is a snippet from the code I use. The closest to directly opening a specific port without enumeration. << ... portId = CommPortIdentifier.getPortIdentifier(getPort()); serialPort = (SerialPort) portId.open("jSMSEngine", 1971); ... >> where getPort() return the string identifier of the port, i.e. "/dev/ttyS0" or "COM1" or whatever. Thanasis. ---------- Forwarded message ---------- From: Kim Lux Date: Feb 5, 2006 6:37 PM Subject: Re: [Rxtx] Documentation Wiki To: RXTX Developers and Users BTW: there is no way to open a port without going through the port list and finding it. Maybe sometime in the future someone (me ?) will write a method called openSerialPort that allows the user to give a port identifier, such as "/dev/tty1" and return a port ready to use. It wouldn't take much to write that and it would save users a lot of code. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/182ab5b8/attachment-0033.html From tjarvi at qbang.org Mon Feb 6 11:53:57 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 11:53:57 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: On Mon, 6 Feb 2006, Dr. Douglas Lyon wrote: > Hi All, > I have often thought about USB drivers being needed. > For example, the ironman watch will not interface > to a mac (windows only). It is USB. > My dymo label writer has no Java driver (native only). > Etc. > Most cheap web cameras are USB (and Java drivers go > through JAI, if it supports the camera at all). > The JAI code shows how sun did the USB drivers. > You have to be a member of the jai project to download > the source code. > https://jai.dev.java.net has the jai distro. > And then you are not allowed to redistribute it. However, > we can all learn from it (if so inclined). Basically: > cvs -d :pserver:lyon at cvs.dev.java.net:/cvs login > cvs -d :pserver:lyon at cvs.dev.java.net:/cvs checkout jai-core > You will need to user your own uid and pw to get in. > The ant build has over 100 warnings from sun deprecations > of its own code. > > You might say that they were hoisted on their own Picard ;) > > One interesting thing is that they support several platforms: > linux-amd64 64-bit Linux-AMD64 > linux-i586 32-bit Linux-x86 > solaris-amd64 64-bit Solaris-AMD64 > solaris-i586 32-bit Solaris-x86 > solaris-sparc 32-bit Solaris-SPARC > solaris-sparcv9 64-bit Solaris-SPARC > windows-i586 32-bit Windows-x86 > Thus, ant is used to provide a multi-platform native method distro. > Neat. > How do they do it? > check this out: > > > > > > > > > > > > > And: > > > > > > > > > > The core download does not contain any C source code (it was all pre-built). > Basically, they are just copying .so and .dll files into build directories. > > I would love to see the C code for this...but Sun does not post it on the > https://jai.dev.java.net site. > > I don't know why...Perhaps I missed it. > > - Doug > > I've looked at moving rxtx to Ant builds. I think that would help IDEs a great deal. I requested a evalutation desk copy the O'Reilly Ant book for some j2ee material I was teaching. http://www.oreilly.com/catalog/anttdg/ It has a one sentence mention of JNI. So there was not luck there. I saw that there is another Ant book that does mention JNI more. I can't find it now. Ant must be able to support it with extensions. http://ant.apache.org/manual/OptionalTasks/javah.html What the auto(break :) tools do in the rxtx build is 4 things really. 1) gcc compile flags 2) ld compile flags 3) config.h 4) compile flags for customizing rxtx (lockfiles, ...) See 1 All of this information except 4 can be static once obtained. So I'm not attached to the auto tools. If I could find an example of Ant being used for JNI code, I'd be one of the first to start moving that direction. Maybe someone saw an example someplace. The other thing we have not completed discussing is the directory structure. There is interest in making rxtx more IDE friendly. I get more mail about that off the list than how to install rxtx. And I see we have Ken Thompson in da house :) He is our trusted CVS maintainer and the guy that purchased the rxtx.org domain. Old community. We will need Ken for changing the directory structure of source. I would like to open up discussion about both of these as it is more than time. The problem is I have little experience with Ant and even less with IDEs. It would be nice if we could work with Eclipse and NetBeans. http://www.netbeans.org/ (sun and some community) http://www.eclipes.org (ibm,rhat,... perhaps more community) http://maven.apache.org/what-is-maven.html (apache. It is community) borland should sortof be here too but I think thats covered in eclipse. >From what I understand so far, we should morph rxtx to support those three maybe trusting apaches lead with maven. But I use vi. I have little to no clues beyond what people have fed me. Can we agree that thats the right direction to go? -- Trent Jarvi tjarvi at qbang.org From brian at mbari.org Mon Feb 6 14:57:50 2006 From: brian at mbari.org (Brian Schlining) Date: Mon, 6 Feb 2006 13:57:50 -0800 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> > The other thing we have not completed discussing is the directory > structure. There is interest in making rxtx more IDE friendly. I > get more mail about that off the list than how to install rxtx. > > And I see we have Ken Thompson in da house :) He is our trusted > CVS maintainer and the guy that purchased the rxtx.org domain. Old > community. We will need Ken for changing the directory structure of > source. > > I would like to open up discussion about both of these as it is > more than time. The problem is I have little experience with Ant > and even less with IDEs. It would be nice if we could work with > Eclipse and NetBeans. > > http://www.netbeans.org/ (sun and some community) > http://www.eclipes.org (ibm,rhat,... perhaps more community) > http://maven.apache.org/what-is-maven.html (apache. It is community) > borland should sortof be here too but I think thats covered in > eclipse. > >> From what I understand so far, we should morph rxtx to support >> those three > maybe trusting apaches lead with maven. But I use vi. I have > little to no clues beyond what people have fed me. > Maven likes the directory structure below for Java code. (From http:// maven.apache.org/guides/getting-started/index.html) This structure works fine with ant, netbeans, and eclipse. rxtx_root_directory `-- src |-- main | `-- java | `-- gnu | `-- io `-- test `-- java `-- gnu `-- io Brian Schlining Software Engineer http://www.mbari.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/d9451eba/attachment-0033.html From tjarvi at qbang.org Mon Feb 6 15:11:45 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 15:11:45 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: > rxtx_root_directory > `-- src > |-- main > | `-- java > | `-- gnu > | `-- io > `-- test > `-- java > `-- gnu > `-- io > >From what I understand this will just be good. For me it makes no difference. So lets do the rxtx thing. Let if fester for two weeks and if nobody objects, we will do it. I'm not doing this because I care. I'm doing this to eliminate much of my inbox. But test... man is rxtx lacking there in the community aspect. It is covered but not right. _maybe_ I can change that this year. -- Trent Jarvi tjarvi at qbang.org (cat hurding since 1997) From lux at diesel-research.com Mon Feb 6 21:38:49 2006 From: lux at diesel-research.com (Kim Lux) Date: Mon, 06 Feb 2006 21:38:49 -0700 Subject: [Rxtx] How can I use Lock Files with rxtx (in FC4) ? Message-ID: <1139287129.17031.3.camel@zd7280> I am now running an rxtx application on FC4. I am getting: ========================================================= check_group_uucp(): error testing lock file creation Error details: Permission denied check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL ========================================================= $ ls -al /var/lock total 32 drwxrwxr-x 4 root lock 4096 Feb 6 16:04 . drwxr-xr-x 24 root root 4096 Nov 14 01:19 .. drwx------ 2 root root 4096 Apr 27 2005 lvm drwxr-xr-x 2 root root 4096 Feb 6 16:04 subsys How do I fix this for regulator users ? -- Kim Lux, Diesel Research Inc. From dmarkman at mac.com Mon Feb 6 22:24:44 2006 From: dmarkman at mac.com (Dmitry Markman) Date: Tue, 7 Feb 2006 00:24:44 -0500 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: if I understands the issue right in order to be able to use ant for c/c++ compilation you have to install ant's cc task http://ant-contrib.sourceforge.net/cc.html it looks like it should work on mac os x (authors claim, that it's platform independent) but I never tested so all you have to do it's providing right command line for the gcc compiler On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: >> rxtx_root_directory >> `-- src >> |-- main >> | `-- java >> | `-- gnu >> | `-- io >> `-- test >> `-- java >> `-- gnu >> `-- io >> > > >> From what I understand this will just be good. > > For me it makes no difference. So lets do the rxtx thing. Let if > fester for two weeks and if nobody objects, we will do it. > > I'm not doing this because I care. I'm doing this to eliminate > much of my inbox. > > But test... man is rxtx lacking there in the community aspect. It > is covered but not right. _maybe_ I can change that this year. > > -- > Trent Jarvi > tjarvi at qbang.org > (cat hurding since 1997) > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx Dmitry Markman From lux at diesel-research.com Mon Feb 6 23:20:15 2006 From: lux at diesel-research.com (Kim Lux) Date: Mon, 06 Feb 2006 23:20:15 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? Message-ID: <1139293215.3689.4.camel@zd7280> I'm running the code below. portlist.hasMoreElements() is false. /dev has ports in it as listed below. What am I doing wrong ? ========================================================== // Step through the list of ports until we find one that matches // the one we are looking for. portList = CommPortIdentifier.getPortIdentifiers(); while(portList.hasMoreElements()) { portID = (CommPortIdentifier) portList.nextElement(); // if (portID.getName().equals("/dev/ttyUSB0")) { myTA.append("Serial port ttyUSB0 has been found\n"); break; }// if portID equals... }// End of while... ========================================================== ls -al /dev/tty* crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 ... crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 -- Kim Lux, Diesel Research Inc. From david.garnier at trusted-logic.com Tue Feb 7 00:46:30 2006 From: david.garnier at trusted-logic.com (David Garnier) Date: Tue, 07 Feb 2006 08:46:30 +0100 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: <43E85056.2090608@trusted-logic.com> Hello, I think that the make-based build process is fine as it is, apart from the location of the Java source files. It is true that putting the Java source in a directory structure that map 1-to-1 to the Java package structure is the norm and should make it easier for everyone to modify the Java source, with or without an IDE. Ant is a good tool, but in the RXTX case I fail to see the advantage of using it compared to the current make-based process. As Trent said, they are more pressing issues, like testing. Regards, David Dmitry Markman wrote: > if I understands the issue right > in order to be able to use ant for c/c++ compilation > you have to install ant's cc task > http://ant-contrib.sourceforge.net/cc.html > > it looks like it should work on mac os x > (authors claim, that it's platform independent) > but I never tested > > so all you have to do it's providing right command line > for the gcc compiler > > > > > On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: > >>> rxtx_root_directory >>> `-- src >>> |-- main >>> | `-- java >>> | `-- gnu >>> | `-- io >>> `-- test >>> `-- java >>> `-- gnu >>> `-- io >>> >> >> >>> From what I understand this will just be good. >> >> For me it makes no difference. So lets do the rxtx thing. Let if >> fester for two weeks and if nobody objects, we will do it. >> >> I'm not doing this because I care. I'm doing this to eliminate much >> of my inbox. >> >> But test... man is rxtx lacking there in the community aspect. It is >> covered but not right. _maybe_ I can change that this year. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> (cat hurding since 1997) From tjarvi at qbang.org Tue Feb 7 01:11:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 01:11:31 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <43E85056.2090608@trusted-logic.com> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: On Tue, 7 Feb 2006, David Garnier wrote: > Hello, > > I think that the make-based build process is fine as it is, apart from the location of the Java > source files. It is true that putting the Java source in a directory structure that map 1-to-1 to > the Java package structure is the norm and should make it easier for everyone to modify the Java > source, with or without an IDE. > > Ant is a good tool, but in the RXTX case I fail to see the advantage of using it compared to the > current make-based process. As Trent said, they are more pressing issues, like testing. > Hi David I have more experience with testing rxtx than I can talk about. But let it be known, rxtx has gone trough 100's of hours of testing. We are hobby folks interested in toys but there is more. rxtx has had some of the best guidance in the industry there. This is not an easy thing. I may be able to come back in a month from the other side of the corperate fence and help. I suspect the tests could just be made public but they are in a very unusual environment that just wont work in a wider sense. This is something I'll be trying to change. At one point it was agreed we could just make the results public so this isnt just noise.. There is interest and I think its safe to mention that much. The big problem with testing in the past is most of it is done with a loopback connection. So we *still* have major questions regarding things like flow control. rxtx talks to itself over a loopback and it works. regardless of right or wrong. This requires more thought to be done right. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Feb 7 02:46:34 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 02:46:34 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: > The big problem with testing in the past is most of it is done with a > loopback connection. So we *still* have major questions regarding things > like flow control. rxtx talks to itself over a loopback and it works. > regardless of right or wrong. With serial communication there are gold standards. ckermit is probably a definitive 'standard.' Maybe its possible to do ping/pong tests with ckermit? Is it scriptable? There are known issues in rxtx. Probably the worst is some threading issues regarding some JREs with multiple JNI threads setting java variables. Man did I get schooled there. Just switch the c functions to returning variables and things go away. Sometimes they work fine, sometimes they blow up. Without understanding everything, somehow rhat got it right and debian (and especially gentoo) grabbed kernel patches causing all sort of harm. Its not hard to fix once you understand whats going on but nearly impossible to track with a debugger. So I have a good idea what 2.1-8 will have outside of the IDE modifications. rxtx 2.1-7 is a release for everyone to sync with. Its not even as stable as -pre17 as far as I know - I ran no test suites. I'll be chasing it too. We just had so many contributions that it was time. It seriously broke internal scheduals but thats a great thing :) The other thing I want to do in 2.1-8 is automagic baud rates. It turns out lots of shops are doing really funky baud rates for things like automobile test equipment. It is possible but it requires a fair amount of change in the native code. Is anyone looking at this? -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Feb 7 02:57:21 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 07 Feb 2006 04:57:21 -0500 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <43E85056.2090608@trusted-logic.com> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: Hi All, I agree, testing is very important. The problem I have been trying to address is related to cross-platform testing and the robust nature of the installs. Typically, I visit 3 platforms to deploy my product, windows, linux and mac. A build is performed on each platform. The idea that you can build for many platforms from one copy the source code seems attractive. This should enable synchronized deployments of identical code. The question of how to achieve this goal remains open. As Trent mentioned, this is hard. Perhaps Ant will help here (but perhaps not). Ant does seem to help with running unit tests. However, it does not help with multi-platform tests. For that you need many machines and different operating environments. Toward that end, I have created a multi-platform test that can be run from web start, located at: http://show.docjava.com:8086/book/cgij/code/jnlp/serialPort.PortTest.jnlp This is interesting because many people in the community can run the test and we can improve the test, as time permits. No, it is not a perfect solution, however, the idea does help with multi-platform tests using many machines and different operating environments. If the group has a good test for a general serial port set-ups, i would be happy to deploy it, for general evaluation using web start. And as for ANT, it is just an idea. Not all my ideas are good ones! - Doug >Hello, > >I think that the make-based build process is fine as it is, apart >from the location of the Java >source files. It is true that putting the Java source in a directory >structure that map 1-to-1 to >the Java package structure is the norm and should make it easier for >everyone to modify the Java >source, with or without an IDE. > >Ant is a good tool, but in the RXTX case I fail to see the advantage >of using it compared to the >current make-based process. As Trent said, they are more pressing >issues, like testing. > >Regards, >David > >Dmitry Markman wrote: >> if I understands the issue right >> in order to be able to use ant for c/c++ compilation >> you have to install ant's cc task >> http://ant-contrib.sourceforge.net/cc.html >> >> it looks like it should work on mac os x >> (authors claim, that it's platform independent) >> but I never tested >> >> so all you have to do it's providing right command line >> for the gcc compiler >> >> >> >> >> On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: >> >>>> rxtx_root_directory >>>> `-- src >>>> |-- main >>>> | `-- java >>>> | `-- gnu >>>> | `-- io >>>> `-- test >>>> `-- java >>>> `-- gnu >>>> `-- io >>>> >>> >>> >>>> From what I understand this will just be good. >>> >>> For me it makes no difference. So lets do the rxtx thing. Let if >>> fester for two weeks and if nobody objects, we will do it. >>> >>> I'm not doing this because I care. I'm doing this to eliminate much >>> of my inbox. >>> >>> But test... man is rxtx lacking there in the community aspect. It is >>> covered but not right. _maybe_ I can change that this year. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> (cat hurding since 1997) > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From matt.higgins at gmail.com Tue Feb 7 08:28:34 2006 From: matt.higgins at gmail.com (Matt Higgins) Date: Tue, 7 Feb 2006 10:28:34 -0500 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final Message-ID: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? import java.io.*; import java.util.*; import gnu.io.*; public class MySimpleRead implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; public static void main(String[] args) { boolean portFound = false; String defaultPort = "COM1"; if (args.length > 0) { defaultPort = args[0]; } portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; MySimpleRead reader = new MySimpleRead(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } } public MySimpleRead() { try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) { e.printStackTrace(); } try { inputStream = serialPort.getInputStream(); } catch (IOException e) { e.printStackTrace(); } try { serialPort.addEventListener(this); } catch (TooManyListenersException e) { e.printStackTrace(); } try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { e.printStackTrace(); } System.out.println("Baud is " + serialPort.getBaudRate()); System.out.println("Bits is " + serialPort.getDataBits()); System.out.println("Stop is " + serialPort.getStopBits()); System.out.println("Par is " + serialPort.getParity()); serialPort.notifyOnDataAvailable(true); readThread = new Thread(this); readThread.start(); } public void run() { // Thread.sleep(20000); //} catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { System.out.println("An event occurred " + event.getEventType()); switch (event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: byte[] readBuffer = new byte[20]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } System.out.print(new String(readBuffer)); } catch (IOException e) {} break; } } } --------------- Result on windows ------------------------------ Stable Library ============================================================== Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port:: COM1 Baud is 9600 Bits is 8 Stop is 1 Par is 0 ----------------- End Results ----------------------------------------- ------------------ Result on Linux ----------------------------------- Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 Found port: /dev/ttyS0 Baud is 9600 Bits is 8 Stop is 1 Par is 0 An event occurred 1 043100066224 ------------------ End Results --------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/a1431630/attachment-0033.html From brian at mbari.org Tue Feb 7 09:48:37 2006 From: brian at mbari.org (Brian Schlining) Date: Tue, 7 Feb 2006 08:48:37 -0800 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> Message-ID: <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> Hi Matt > The following code works fine on Linux but I never see any data > when run on Windows. This is a cut and paste from the SimpleRead > example. > I am attempting to read data from a bar code scanner. I can fire > up HyperTermianl on windows and see that the device is working > properly as I see the barcodes are scanned and echoed back to the > terminal. However when I run the app I don't see any data. It is > however associating with the com port as the informational bits > print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. Cheers Brian Schlining Software Engineer http://www.mbari.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/16d07f37/attachment-0033.html From lux at diesel-research.com Tue Feb 7 11:59:58 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 11:59:58 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139293215.3689.4.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> Message-ID: <1139338798.8145.4.camel@zd7280> Any ideas on this ? Any reason why portList.hasMoreElements() should be false even though there are devices in /dev ? On Mon, 2006-02-06 at 23:20 -0700, Kim Lux wrote: > I'm running the code below. > > portlist.hasMoreElements() is false. > > /dev has ports in it as listed below. > > What am I doing wrong ? > > > ========================================================== > // Step through the list of ports until we find one that matches > // the one we are looking for. > > portList = CommPortIdentifier.getPortIdentifiers(); > > while(portList.hasMoreElements()) > { > portID = (CommPortIdentifier) portList.nextElement(); // > if (portID.getName().equals("/dev/ttyUSB0")) > { > myTA.append("Serial port ttyUSB0 has been found\n"); > break; > }// if portID equals... > }// End of while... > ========================================================== > > ls -al /dev/tty* > crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty > crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 > crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 > crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 > crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 > ... > crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 > crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 > crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 > > > -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 12:20:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 12:20:25 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139338798.8145.4.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> Message-ID: On Tue, 7 Feb 2006, Kim Lux wrote: > > Any ideas on this ? Any reason why portList.hasMoreElements() should be > false even though there are devices in /dev ? > > > On Mon, 2006-02-06 at 23:20 -0700, Kim Lux wrote: >> I'm running the code below. >> >> portlist.hasMoreElements() is false. >> >> /dev has ports in it as listed below. >> >> What am I doing wrong ? >> >> >> ========================================================== >> // Step through the list of ports until we find one that matches >> // the one we are looking for. >> >> portList = CommPortIdentifier.getPortIdentifiers(); >> >> while(portList.hasMoreElements()) >> { >> portID = (CommPortIdentifier) portList.nextElement(); // >> if (portID.getName().equals("/dev/ttyUSB0")) >> { >> myTA.append("Serial port ttyUSB0 has been found\n"); >> break; >> }// if portID equals... >> }// End of while... >> ========================================================== >> >> ls -al /dev/tty* >> crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty >> crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 >> crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 >> crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 >> crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 >> ... >> crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 >> crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 >> crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 >> >> >> > Hi Kim What rxtx does is try to open the port and do a timed out read. If the kernel/... do not complain it's enumarted. I suspect you could do a crude test by doing something like cat /dev/ttyS0 > /dev/null If that barfs then rxtx wont enumerate the port. hmm looking at your question again, I suspect it's a lockfile problem. This is documented in INSTALL with the source. Its easy enough to test this too.. touch /var/lock/testingrxtxlockfiles && rm -f /var/lock/testingrxtxlockfiles If you are not in the right group it will bail. Root will work regardless. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 12:37:56 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 12:37:56 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> Message-ID: <1139341076.8145.11.camel@zd7280> Exactly which ports does rxtx attempt to put into the list ? /dev/* or /dev/tty* or /dev/tty[0-9[0-9] ? or /dev/ttyS* ? For the record, only /dev/ttyUSB0 is a valid port on the machine I am presently on. Will this be a problem ? On Tue, 2006-02-07 at 12:20 -0700, Trent Jarvi wrote: > This is documented in INSTALL with the source. > I was wondering where that file was. I will download source and dig it up. Thanks. -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 12:51:09 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 12:51:09 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139341076.8145.11.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: On Tue, 7 Feb 2006, Kim Lux wrote: > > Exactly which ports does rxtx attempt to put into the list ? /dev/* > or /dev/tty* or /dev/tty[0-9[0-9] ? or /dev/ttyS* ? > > For the record, only /dev/ttyUSB0 is a valid port on the machine I am > presently on. Will this be a problem ? > > > On Tue, 2006-02-07 at 12:20 -0700, Trent Jarvi wrote: >> This is documented in INSTALL with the source. >> > I was wondering where that file was. I will download source and dig it > up. > > Thanks. > Hmm I'm looking at pre17 so this may have changed. (its just what I have on this machine) if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA" // for the IPAQs }; CandidatePortPrefixes=Temp; } So you may need to add "ttyUSB" to that list. RXTX used to enumerate _everything_ see if(osName.equals("Linux-all-ports") But it became less than practical. This is all in RXTXCommDriver.java hmm I just did a cvs update. if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have to get your fingers into the code. We aim for sane defaults. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 13:06:45 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 13:06:45 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139342805.8145.22.camel@zd7280> On Tue, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > Hmm I'm looking at pre17 so this may have changed. (its just what I have > on this machine) > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA" // for the IPAQs > }; > CandidatePortPrefixes=Temp; > } > > > So you may need to add "ttyUSB" to that list. RXTX used to enumerate > _everything_ see if(osName.equals("Linux-all-ports") But it became less > than practical. > > This is all in RXTXCommDriver.java > > hmm I just did a cvs update. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have > to get your fingers into the code. We aim for sane defaults. Excellent. Thanks for taking the time. -- Kim Lux, Diesel Research Inc. From ideiglenes1 at freemail.hu Tue Feb 7 13:53:39 2006 From: ideiglenes1 at freemail.hu (--) Date: Tue, 07 Feb 2006 21:53:39 +0100 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139345619.22534.2.camel@localhost> Hi! I use this code to get all the extra Linux devices. :) if ("Linux".equals(System.getProperty("os.name"))) { System.setProperty("os.name","Linux-all-ports"); } driver = new RXTXCommDriver(); On k, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > On Tue, 7 Feb 2006, Kim Lux wrote: > > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have > to get your fingers into the code. We aim for sane defaults. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From matt.higgins at gmail.com Tue Feb 7 13:45:54 2006 From: matt.higgins at gmail.com (Matt Higgins) Date: Tue, 7 Feb 2006 15:45:54 -0500 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> Message-ID: <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> Sweet this is exactly what I needed. I was searching the archives through marc.theamisgroup they only have archives back to 1/3/05. Should have hit the mailman archive! Thanks a lot! On 2/7/06, Brian Schlining wrote: > > Hi Matt > > The following code works fine on Linux but I never see any data when run > on Windows. This is a cut and paste from the SimpleRead example. > I am attempting to read data from a bar code scanner. I can fire up > HyperTermianl on windows and see that the device is working properly as I > see the barcodes are scanned and echoed back to the terminal. However when I > run the app I don't see any data. It is however associating with the com > port as the informational bits print fine? > > > You're not the only one whose had this problem, I don't know if Trent has > addressed this is the latest release of RXTX but there is a workaround. > Here's the recent thread from the RXTX mailing list regarding this issues: > > Thanasis Delenikas tdelenik at gmail.com > Wed Jan 18 13:56:23 MST 2006 > > * Previous message: [Rxtx] Re: More close() performance fixes > * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] > > Hi all. > (I've subscribed again from my other email account). > > Trent, > > You are right. Linux *always* works, no matter what flow control you set. > Windows *works only* with hardware flow control (I haven't tested what > happens with software XON/XOFF flow control). > > I assume (but I am not certain) that even with no flow control at all, all > platforms should work. Without flow control, you have the risk of bumping > into overflow or framing errors, but that's your (the end programmer, I > mean) problem. > > >From my side, I shouldn't be working without flow control. That was a bug > too... It was some code forgotten from the old times, when I used to work > with phone emulation drivers which didn't support flow control. The > correct > way is to have some flow control enabled and that's why I suppose this is > a > low-severity bug for RxTx. > > I have no idea which platform shows the correct behaviour, since > my knowledge about Linux and the inner workings of these low-level i/o > operations is limited. > > Regards, > Thanasis Delenikas. > > > > > Message: 2 > > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > > From: Trent Jarvi > > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > > To: RXTX Developers and Users > > Message-ID: > > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > > > Hi all, > > > > > > Trent, I have found something. > > > I read your comment about flow control, so I experimented a bit. > > > > > > If you remember, in my sample program I've used no flow control at all > ( > > i.e. > > > Java constant FLOWCONTROL_NONE). > > > > > > Now, during testing, I've switch to hardware inbound flow control (i.e > . > > Java > > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > > beautifully! > > > > > > I think I will switch to H/W flow control and test things for a while, > > but > > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > > > > > Hi Thanasis, > > > > I'm fairly sure you have identified a bug. I would not worry too much > > about what Sun CommAPI w32 defaults are. I think they did more or less > > whatever the port opened with. Just a guess. Linux tries to stomp on > > ports so they are all the same. > > > > So this started out with Linux worked, Windows XP/.. did not as I > recall. > > Something is wrong in rxtx. Do I understand this right? > > > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > > > Perhaps there is something Wayne or I did not understand when we wrote > > that code. I wasnt programming back in the BBS days so modems are not > my > > thing. I have a few questions. > > > > Is the above matrix confirmed by observation? > > Linux just always worked? > > Which one _should_ work? I'm guessing modems work with hardware flow > > control. I'll have to dig around. > > > > The windows flow control changes a couple things with hardware flow > > control. Following the w32 API documentation is confusing sometimes. > > But it looks like Linux could have a bug too. > > Cheers > > Brian Schlining > Software Engineer > http://www.mbari.org > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/9c989144/attachment-0033.html From tjarvi at qbang.org Tue Feb 7 14:06:14 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 14:06:14 -0700 (MST) Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> Message-ID: >> >> You're not the only one whose had this problem, I don't know if Trent has >> addressed this is the latest release of RXTX but there is a workaround. >> Here's the recent thread from the RXTX mailing list regarding this issues: >> I have not. I expect to have access to some test equipment next month and I'll go through all of this. I really don't know whats going on and I need a gold standard. I thought maybe linux was autodetecting the flow control. Your observations would certainly be welcome. I need to talk to Russell King and see what he is doing. Until then I'd just be toying around over a loopback as usual. This is very high on the list though. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 17:25:05 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 17:25:05 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139358305.17994.2.camel@zd7280> My application now works. I installed the libraries and jar from 2.1-7 (Final). portlist.hasMoreElements is no longer false. The application finds the port for /dev/ttyUSB0. Thanks for your help, Trent (et al) Sorry I bothered you with this. Next time I will look in the source first. I didn't think it was an rxtx issue, I thought it was a Linux setup issue . On Tue, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > Hmm I'm looking at pre17 so this may have changed. (its just what I > have > on this machine) > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux > Serial Ports > "ttySA" // for the > IPAQs > }; > > CandidatePortPrefixes=Temp; > } > > > So you may need to add "ttyUSB" to that list. RXTX used to enumerate > _everything_ see if(osName.equals("Linux-all-ports") But it became > less > than practical. > > This is all in RXTXCommDriver.java > > hmm I just did a cvs update. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux > Serial Ports > "ttySA", // for the > IPAQs > "ttyUSB" // for USB > frobs > }; > > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you > have > to get your fingers into the code. We aim for sane defaults. -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 19:21:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 19:21:54 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139358305.17994.2.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> <1139358305.17994.2.camel@zd7280> Message-ID: >Sorry I bothered you with this. Next time I will look in the source >first. I didn't think it was an rxtx issue, I thought it was a Linux >setup issue . Why would you be sorry? I would have done the same. I'm glad it's working :) -- Trent Jarvi tjarvi at qbang.org From tma at mail.island.net Wed Feb 8 13:39:35 2006 From: tma at mail.island.net (Tom Alldread) Date: Wed, 08 Feb 2006 12:39:35 -0800 Subject: [Rxtx] Win32/Linux Serial Port Data Dropouts In-Reply-To: <200602060702.k167255O007882@www.qbang.org> References: <200602060702.k167255O007882@www.qbang.org> Message-ID: <43EA5707.4020200@mail.island.net> Greetings Folks at RXTX: During the last couple of months I have been alternately testing with javax.comm 2 and RXTX 2.1 under Windows XP and CommApi 3 and RXTX 2.1 under Suse 10.0 Linux. In the process I have learned a little about java multi-threading under NetBeans 5 with Profiler. My java (jdk 1.5_06) application is used for data acquisition and provides a graphical display of A-D conversion data received from a 56KBaud serial port. The actual data throughput is about 10KBaud thus it is well below the speed of the port. I use hardware RTS/CTS flow control which can stall the data acquisition sample rate if necessary. This ensures the display computer has the ability to slow the data acquisition rate should it become too busy to accept the regular data flow. Both the serial port buffer and the java read buffer are set at 16KB. Usually the data transfers into the java read buffer are less than 100 bytes unless the data acquisition is recovering from a stall. The data flow normally hesitates after each 5 KB block as a continue command is needed from the display computer to start the drawing of a new graphics display line. Separate threads have been provided for the serial port event monitoring and data processing. The serial port event thread has been given the maximum priority and data processing thread the minimum priority provided by java. Thread yield statements have been placed within all data processing while/for loops as an effort to ensure quick access to CPU cycles for the serial port event thread. I have found that short data transmissions are essentially error free but occasional dropouts occur with continuous data flow especially under Windows XP. ....................................................................................................................................................................................... Linux results: I am happy to report that RXTX 2.1 appears to work very well under Linux although I did notice some errors when the screen savers were running with my dual monitors. I believe this is a local problem associated with my dual graphics which needs further attention. The recent CommApi 3 Linux release from Sun did not work at all with my program. It seemed to send commands out OK but did not receive any data. Although the serial port event triggered the ISR, the input stream appeared filled with nulls and thus did not contain any data. As my understanding is that CommApi 3 was tested with a Red Hat distribution of Linux I wonder if this problem is distro dependent? Although somewhat off topic here I wonder if anyone reading this has had similar experience? .................................................................................................................................................................................. Windows XP results: There are problems with occasional data dropouts which become more frequent as the sampling rate is increased or if the computer becomes busy with other duties. The dropouts typically consist of a half dozen byte block of lost data. It appears the lost bytes never get added to the java input stream. There has not been any indication of garbled data, overruns or framing errors which suggests the UART communications remains solid. Using javax.comm 2 I found that the setting of SerialPort 'enableReceiveThreshold' to 40 and 'enableReceiveTimeout' of 100mS reduced the dropouts error rate significantly. I found that I could not get RXTX 2.1 to function with the aforementioned threshold and timeout settings. The javax.comm 2 interface is consequently performing better for me under Windows than RXTX 2.1. I wonder if anyone here has any suggestions as to what I might try to improve RXTX 2.1? Although my settings are the same as under Suse 10.0, RXTX 2.1 performs much better for me under Linux than any of the alternatives that I have tried under Windows XP . ............................................................................................................................................................................... I would like to establish, based on the experience of others, if I have reached the normally expected performance limit of java serial port communications? Should I expect to achieve virtually error free serial port data input from a continuous stream under Windows XP java software? I am considering changing my protocol to packets with error checking if necessary but would like to know if the dropout problems I am experiencing are typical or not before I take this rather work intensive plunge. Many thanks in advance for any help! Best Regards, Tom Alldread -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.375 / Virus Database: 267.15.2/253 - Release Date: 2006-02-07 From jlaxson at mac.com Wed Feb 8 23:56:48 2006 From: jlaxson at mac.com (John Laxson) Date: Thu, 9 Feb 2006 00:56:48 -0600 Subject: [Rxtx] PortInUseException: Unknown Application on OSX Message-ID: Hi, I've been trying to get RXTX 2.1.7 going on Mac OS X for a while here, and am running up into a wall here. I've tried with pre- compiled and the source version and get the same problem, a gnu.io.PortInUseException: Unknown Application. I have run the fixperms script included with the source distribution, and id shows me as a member of the uucp group, and permissions on /var/spool/uucp are 775 root:uucp. Running a test program (included at the bottom for clarity) lets me enumerate all the serial ports correctly, but trying to open any of them gives the PortInUseException. If it helps, when I try to open a port that's set to make an outgoing bluetooth connection, there is no delay and no connection attempt at all. Thanks, John Laxson PS: The documentation wiki on qbang.org shows 404, and has for a few days now. My test code: public static void main(String[] args) { SerialPort serialPort; try { Enumeration e = CommPortIdentifier.getPortIdentifiers(); CommPortIdentifier ident; while (e.hasMoreElements()) { ident = (CommPortIdentifier)e.nextElement(); System.out.println(ident.getName()); } ident = CommPortIdentifier.getPortIdentifier("/dev/cu.modem"); serialPort = (SerialPort) ident.open("Me", 5000); } catch (Exception e) { e.printStackTrace(); } } From rajesh.invincible at gmail.com Thu Feb 9 03:39:38 2006 From: rajesh.invincible at gmail.com (Rajesh N) Date: Thu, 9 Feb 2006 16:09:38 +0530 Subject: [Rxtx] Re: Move .java Files in gnu.io filesystem hierarchy - Maven (2) In-Reply-To: <43DF21D2.7090200@ngi.it> References: <43DF21D2.7090200@ngi.it> Message-ID: <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Can anybody tell me how to overcome these EXCEPTIONS I AM WORKING ON SERIAL COMMN IN JAVA ON LINUX. 1. " NOT ALL PARAMETERS SUPPORTED BY THE KERNEL" This i came across the following statement inmy prog. SerialP is A SerialPort object SerialP.setSerialPortParams(9600(BAUDRATE),DATABITS_8,STOPBITS_1,PARITY_NONE) 2. NullPointer Exception at Event Dispatch Now i have checked all my object references for a null reference but i found none i have put up my entire code in try catch blocks but still I AM UNABLE TO CATCH THIS EXCEPTION AND HENCE MY APPLICATION CLOSES HOW DOES THESE GO? PLEASE HELP ME IT IS URGENTTTTTTTTTTTTTTTT yours sincerely RAJESH On 1/31/06, Fabio Frumento wrote: > Hi Xavier, > > I don't know maven at all but the directory hierarchy listed buy Trent > is fine for me... > > I'll take a look to maven, it seems an interesting project > > Regards > > Fabio Frumento > > Trent Jarvi wrote: > > On Tue, 31 Jan 2006, Xavier Frisaye wrote: > > > >> Hi all, > >> > >> If you are going to rearrange the src folder, i will propose to use > >> maven 2 and follow its directory structure > >> > (http://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html). > >> > >> Maven 2 simplify java project and give a standard way to make projects > >> (http://maven.apache.org/). > >> We are using it for internal projects and we are very satisfied. > >> > >> Is anybody interested? > >> > >> I'm not an expert in maven 2 (yet) but i'm agree to help using it if > >> you choose to make so. > >> > > > > so this would be: > > > > rxtx-devel/src/main/java/gnu.io > > rxtx-devel/src/test/java/ManIwish.java > > > > I don't use IDEs very much so I'll let others comment. But I don't see > > a problem with that. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Thu Feb 9 09:50:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 9 Feb 2006 09:50:31 -0700 (MST) Subject: [Rxtx] Re: Move .java Files in gnu.io filesystem hierarchy - Maven (2) In-Reply-To: <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Message-ID: On Thu, 9 Feb 2006, Rajesh N wrote: > Can anybody tell me how to overcome these EXCEPTIONS > I AM WORKING ON SERIAL COMMN IN JAVA ON LINUX. > > 1. " NOT ALL PARAMETERS SUPPORTED BY THE KERNEL" > > This i came across the following statement inmy prog. > SerialP is A SerialPort object > SerialP.setSerialPortParams(9600(BAUDRATE),DATABITS_8,STOPBITS_1,PARITY_NONE) > Strange. The parameters you use are the same the port should open with by default. Could you paste the actual exception you are getting? I don't see that in the rxtx source. Also it would help to know the rxtx version. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Fri Feb 10 15:29:05 2006 From: lux at diesel-research.com (Kim Lux) Date: Fri, 10 Feb 2006 15:29:05 -0700 Subject: [Rxtx] One serial port object for both sending and receiving ? Message-ID: <1139610545.18177.4.camel@zd7280> Is it OK to use one SerialPort ojbect (ex Serial Port serialPort;) and use it for both sending and receiving ? For example: ======================================================================== static SerialPort serialPort = null; static OutputStream serialOut = null; static InputStream serialIn = null; // assign it to an outputStream for use try{ serialOut = serialPort.getOutputStream(); System.out.println("Serial output stream has been assigned."); }//try catch(IOException e) { System.out.println("Error: Couldn't assign output stream to serial port."); }//catch //assign it to an inputStream for use try{ serialIn = serialPort.getInputStream(); System.out.println("Serial input stream has been assigned."); }//try catch(IOException e) { System.out.println("Error: Couldn't assign input stream to serial port."); }//catch ======================================================================== -- Kim Lux, Diesel Research Inc. From lux at diesel-research.com Fri Feb 10 21:23:00 2006 From: lux at diesel-research.com (Kim Lux) Date: Fri, 10 Feb 2006 21:23:00 -0700 Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Message-ID: <1139631780.23882.10.camel@zd7280> I've got a problem receiving chars with my version of serialRead, written in an SWT GUI. I had a Java pro have a good look at my code and he can't see anything wrong with it. I can send chars fine. When I receive a char the cpu usage for the app goes to 100% and the code in the serial event handler doesn't get executed. The instructions on the Java Comm Serial API How-To for Linux page state that I must install javacomm. Is that true ? Everything builds without it and I can send chars on rxtx just fine, but I can't receive them. Could this be the problem ? I downloaded and installed javacomm. I was not able to add "Driver=gnuio.RXTXCommDriver to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 installed in /usr/java/jre1.5.0_05. I added comm.jar to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext to the library paths. Is this OK ? Does it matter that I am receiving on /dev/ttyUSB0 ? Thanks. -- Kim Lux, Diesel Research Inc. From lunareclipse03 at web.de Sat Feb 11 09:44:46 2006 From: lunareclipse03 at web.de (lunareclipse03@web.de) Date: Sat, 11 Feb 2006 17:44:46 +0100 Subject: [Rxtx] Question about Serial I/O under Win32 Message-ID: <662084330@web.de> Hello everybody, I have a strange problem with a piece of code I made for myself. No, this is not really concerning rxtx, but nevertheless I post this to the list, hoping that some of you can help me. I've written two libraries, one for linux and one for win32. The linux port works quite well, I can send / receive faxes and / or replay voice messages over the telephone line using a voice modem. But the win32 port of the library causes some trouble. If, for example, I send out a fax with a certain modem under linux, it works well. The fax is complete when it comes out of the fax machine. If I then use the same modem to send out a fax under win32, the fax coming out of the fax machine gets "stuck" halfways, but the sending modem thinks that transmission was ok and drops the connection. The answering fax machine then gives me "error while receiving." The "upper layer" java code MUST be right, because if I do the same thing under linux (using the linux library), everything is alright. Now I have to ask: Can somebody please help me out with this??!? Could it be the case that some kind of flow control or COMMTIMEOUTS setting causes this behaviour? I set flow control to RTS/CTS before sending out a fax. How can I DISABLE flow control? Or what do you think? Can something else cause this problems? Thank you all for your time and PLEASE write back soon. Regards, --Sven Ahlemann Am Waldrand 31 45721 Haltern am See Germany ______________________________________________________________ Verschicken Sie romantische, coole und witzige Bilder per SMS! Jetzt bei WEB.DE FreeMail: http://f.web.de/?mc=021193 From lux at diesel-research.com Sat Feb 11 10:06:52 2006 From: lux at diesel-research.com (Kim Lux) Date: Sat, 11 Feb 2006 10:06:52 -0700 Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: <1139631780.23882.10.camel@zd7280> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> <1139631780.23882.10.camel@zd7280> Message-ID: <1139677612.3431.5.camel@zd7280> More on this problem. I copied and pasted simpleRead into a console based Eclipse project and I've got the same result, except that cpu usage doesn't go to 100%. I'm beginning to think there is an issue in rxtx. My imports for simpleRead are: ============================ import gnu.io.*; import java.util.*; //import javax.comm.*; import java.io.*; =========================== Any ideas ? I am trying to read from /dev/ttyUSB0 using a serial to USB adapter which has worked well with minicom and gtkterm. Thanks. On Fri, 2006-02-10 at 21:23 -0700, Kim Lux wrote: > I've got a problem receiving chars with my version of serialRead, > written in an SWT GUI. > > I had a Java pro have a good look at my code and he can't see anything > wrong with it. > > I can send chars fine. When I receive a char the cpu usage for the app > goes to 100% and the code in the serial event handler doesn't get > executed. > > The instructions on the Java Comm Serial API How-To for Linux page state > that I must install javacomm. Is that true ? Everything builds without > it and I can send chars on rxtx just fine, but I can't receive them. > Could this be the problem ? > > I downloaded and installed javacomm. I was not able to add > "Driver=gnuio.RXTXCommDriver > to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not > have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 > installed in /usr/java/jre1.5.0_05. I added comm.jar > to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext > to the library paths. Is this OK ? > > Does it matter that I am receiving on /dev/ttyUSB0 ? > > Thanks. > -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Sun Feb 12 21:01:33 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:01:33 -0700 (MST) Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: <1139677612.3431.5.camel@zd7280> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> <1139631780.23882.10.camel@zd7280> <1139677612.3431.5.camel@zd7280> Message-ID: I suspect what is happening is the select() is breaking out in the native code but the driver does not have support for notifying there are X bytes available. On some traditional Unix based systems, the only way you know data is available is the fd status changes and do an FIORDCHK ioctl. Or perhaps the only thing you can know is the fd status changed. It would take reading through the kernel driver code to know for sure. So on USB, depending upon the driver, the same may need to be done or the driver improved a bit if possible to support. Polling reads will also work but don't use the event driven model of CommAPI which isnt acceptable in the long run. The 100% cpu usage can then be explained because select no longer blocks until the data is read; the eventLoop spins loose. You can put a well placed sleep but rxtx only expects those are needed when it knows data is available. This may not be a super simple thing to understand and fix. I do have ideas to get you started. I'm going to be short on time the next couple weeks. I expect to put some good time in and answer some other questions I saw around the 25th. For now, I'd look at the following and go from there with the hints I've given. JNIEXPORT jint JNICALL RXTXPort(nativeavailable)( JNIEnv *env, jobject jobj ) { int fd = get_java_var( env, jobj,"fd","I" ); int result; /* char message[80]; ENTER( "RXTXPort:nativeavailable" ); On SCO OpenServer FIONREAD always fails for serial devices, so try ioctl FIORDCHK instead; will only tell us whether bytes are available, not how many, but better than nothing. This turns out to be true on Solaris also. taj. */ #ifdef FIORDCHK /* __unixware__ __sun__ probably others */ result = ioctl(fd, FIORDCHK, 0); #else if( ioctl( fd, FIONREAD, &result ) < 0 ) { goto fail; } #endif /* FIORDCHK */ On Sat, 11 Feb 2006, Kim Lux wrote: > > More on this problem. I copied and pasted simpleRead into a console > based Eclipse project and I've got the same result, except that cpu > usage doesn't go to 100%. I'm beginning to think there is an issue in > rxtx. > > My imports for simpleRead are: > > ============================ > import gnu.io.*; > import java.util.*; > //import javax.comm.*; > import java.io.*; > =========================== > > Any ideas ? I am trying to read from /dev/ttyUSB0 using a serial to > USB adapter which has worked well with minicom and gtkterm. > > Thanks. > > > > On Fri, 2006-02-10 at 21:23 -0700, Kim Lux wrote: >> I've got a problem receiving chars with my version of serialRead, >> written in an SWT GUI. >> >> I had a Java pro have a good look at my code and he can't see anything >> wrong with it. >> >> I can send chars fine. When I receive a char the cpu usage for the app >> goes to 100% and the code in the serial event handler doesn't get >> executed. >> >> The instructions on the Java Comm Serial API How-To for Linux page state >> that I must install javacomm. Is that true ? Everything builds without >> it and I can send chars on rxtx just fine, but I can't receive them. >> Could this be the problem ? >> >> I downloaded and installed javacomm. I was not able to add >> "Driver=gnuio.RXTXCommDriver >> to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not >> have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 >> installed in /usr/java/jre1.5.0_05. I added comm.jar >> to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext >> to the library paths. Is this OK ? >> >> Does it matter that I am receiving on /dev/ttyUSB0 ? >> >> Thanks. >> > From tjarvi at qbang.org Sun Feb 12 21:03:30 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:03:30 -0700 (MST) Subject: [Rxtx] One serial port object for both sending and receiving ? In-Reply-To: <1139610545.18177.4.camel@zd7280> References: <1139610545.18177.4.camel@zd7280> Message-ID: On Fri, 10 Feb 2006, Kim Lux wrote: > > Is it OK to use one SerialPort ojbect (ex Serial Port serialPort;) and > use it for both sending and receiving ? > > For example: > > ======================================================================== > static SerialPort serialPort = null; > static OutputStream serialOut = null; > static InputStream serialIn = null; > > > > > // assign it to an outputStream for use > try{ > serialOut = serialPort.getOutputStream(); > System.out.println("Serial output stream has been assigned."); > }//try > catch(IOException e) > { > System.out.println("Error: Couldn't assign output stream to serial > port."); > }//catch > > > //assign it to an inputStream for use > try{ > serialIn = serialPort.getInputStream(); > System.out.println("Serial input stream has been assigned."); > }//try > catch(IOException e) > { > System.out.println("Error: Couldn't assign input stream to serial > port."); > }//catch This should be fine. In fact trying to do it another way will probably not work as you will run into lockfile issues. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun Feb 12 21:13:13 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:13:13 -0700 (MST) Subject: [Rxtx] Question about Serial I/O under Win32 In-Reply-To: <662084330@web.de> References: <662084330@web.de> Message-ID: On Sat, 11 Feb 2006 lunareclipse03 at web.de wrote: > Hello everybody, > > I have a strange problem with a piece of code I made for myself. No, > this is not really concerning rxtx, but nevertheless I post this to the > list, hoping that some of you can help me. I've written two libraries, > one for linux and one for win32. The linux port works quite well, I can > send / receive faxes and / or replay voice messages over the telephone > line using a voice modem. But the win32 port of the library causes some > trouble. If, for example, I send out a fax with a certain modem under > linux, it works well. The fax is complete when it comes out of the fax > machine. If I then use the same modem to send out a fax under win32, the > fax coming out of the fax machine gets "stuck" halfways, but the sending > modem thinks that transmission was ok and drops the connection. The > answering fax machine then gives me "error while receiving." The "upper > layer" java code MUST be right, because if I do the same thing under > linux (using the linux library), everything is alright. Now I have to > ask: Can somebody please help me out with this??!? Could it be the case > that some kind of flow control or COMMTIMEOUTS setting causes this > behaviour? I set flow control to RTS/CTS before sending out a fax. How > can I DISABLE flow control? Or what do you think? Can something else > cause this problems? Thank you all for your time and PLEASE write back > soon. > Hi Sven I'm not too willing to talk about flow control at the low level until I confirm some things with test equipment later. It is not clear if you are using rxtx or writing your own native code. So I'm not sure how to answer much of this :) If you are wondering how to change the flow control using rxtx from java, The BlackBox example from Sun flips this back and forth. SerialPort.java in rxtx 2.1 uses the following: SerialPort.java: public static final int FLOWCONTROL_NONE =0; SerialPort.java: public static final int FLOWCONTROL_RTSCTS_IN =1; SerialPort.java: public static final int FLOWCONTROL_RTSCTS_OUT =2; SerialPort.java: public static final int FLOWCONTROL_XONXOFF_IN =4; SerialPort.java: public static final int FLOWCONTROL_XONXOFF_OUT=8; So if you set flowcontrol to RTSCTS, you can set it to NONE to turn it off. If you are looking for how to do it in native code, the rxtx Source is SerialImp.c (unix/linux/mac os x/w32) and termios.c (w32 only with SerialImp.c) You can track the code: SerialImp.c:JNIEXPORT void JNICALL RXTXPort(setflowcontrol)( JNIEnv *env, jobject jobj, jint flowmode ) termios.c:int tcgetattr( int fd, struct termios *s_termios ) termios.c:int tcsetattr( int fd, int when, struct termios *s_termios ) There may be a problem in the rxtx flow control code though. Rather than guess, I want to test this with a gold standard. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Feb 6 00:00:16 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 00:00:16 -0700 (MST) Subject: [Rxtx] wiki delay until tomorrow night. In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: On Sun, 5 Feb 2006, Trent Jarvi wrote: > On Sun, 5 Feb 2006, Kim Lux wrote: > >> usb ? Tell me more... I need that too. > > usb is a very proper design. Thats all it is. > Maybe rxtx could help usb. But it would start with helping bring back the community that was already there. It's not something I'd love to do but maybe its the right thing to do. It would probably take 2 years to do right. But maybe thats better than what we have now. I honestly don't know what IBM is doing which could just run over everything. Just some thoughts after some fine german wine. -- Trent Jarvi tjarvi at qbang.org From gadelavega at yahoo.com.ar Mon Feb 6 02:17:05 2006 From: gadelavega at yahoo.com.ar (Gonzalo A. de la Vega) Date: Mon, 06 Feb 2006 10:17:05 +0100 Subject: [Rxtx] Serial port ownership question In-Reply-To: References: <20060205113618.30274.qmail@web53501.mail.yahoo.com> <1139157422.4553.9.camel@zd7280> <1139158698.4936.9.camel@zd7280> Message-ID: <43E71411.4050402@yahoo.com.ar> On my Fedora Core 4: ls -l /dev/ttyS* crw-rw---- 1 root uucp 4, 64 Feb 6 2006 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Feb 6 2006 /dev/ttyS1 ... and: grep "ttyUSB" /etc/udev/rules.d/50-udev.rules KERNEL=="ttyUSB*", GROUP="uucp", MODE="0660" So anyone in the "uucp" group can use serial ports. On Gentoo the group is "tty". Trent Jarvi escribi?: > > > On Sun, 5 Feb 2006, Dr. Douglas Lyon wrote: > >> I can confirm that this is the case (only root ownership of >> serial ports, under fedora 4). >> Wow, what were they thinking?! >> - DL >> >>> I've found that the newer kernels have the serial ports owned by root. >>> For example, >>> >>> $ls -al /dev/tty* >>> crw-rw-rw- 1 root root 5, 0 Feb 5 02:06 /dev/tty >>> crw-rw---- 1 root root 4, 0 Feb 5 02:06 /dev/tty0 >>> crw------- 1 root root 4, 1 Feb 5 09:07 /dev/tty1 >>> crw-rw---- 1 root tty 4, 10 Feb 5 02:06 /dev/tty10 >>> crw-rw---- 1 root tty 4, 11 Feb 5 02:06 /dev/tty11 >>> ... > > > This is just not a problem jcp or such are going to solve. Its a > platform spitwad fight. But do look at pam. In fact thats what Sun > is doing too. Maybe Linux followed their lead.. I'm not a pam guy. > I've spent 16 hours trying to understand it but your users wont :) > > Solution? I have no clue. Its two tangent mentalities from my > perspective. > > -- > Trent Jarvi > tjarvi at qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mtnvega at yahoo.com.br Mon Feb 6 05:35:43 2006 From: mtnvega at yahoo.com.br (Luiz Jr) Date: Mon, 6 Feb 2006 12:35:43 +0000 (GMT) Subject: [Rxtx] Documentation Wiki In-Reply-To: <1139157422.4553.9.camel@zd7280> Message-ID: <20060206123543.57256.qmail@web53515.mail.yahoo.com> Hello, Thank you for you answer, but so the usage of the API is pretty much like the Java Communications Api? If yes, what version of the Java Comm Api? Thank you, Luiz A. Brandao Jr Kim Lux escreveu: On Sun, 2006-02-05 at 08:36 -0300, Luiz Jr wrote: > Hello, > > I want to start using the RXTX libraries, but I would to know how, > since I can not access the documentation wiki page I just started using them yesterday. Below is how I installed the libraries, if that helps. I used snippets of code from the SimpleWrite application here to get me going. http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html Instead of "import javax.comm.*;", use "import gnu.io.*;" which is gotten from RXTXcomm.jar, which you will need to include in your project references. I am working in Eclipse. BTW: there is no way to open a port without going through the port list and finding it. Maybe sometime in the future someone (me ?) will write a method called openSerialPort that allows the user to give a port identifier, such as "/dev/tty1" and return a port ready to use. It wouldn't take much to write that and it would save users a lot of code. Hope this helps. ======================================================================= 1) Figure out which java you are running, incase there is more than one installed. $ java -version java version "1.5.0_05" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_05-b05) Java HotSpot(TM) Client VM (build 1.5.0_05-b05, mixed mode, sharing) 2) Find all the jre directories and the one from which you are currently running. kfind (jre) 3) cd to that directory plus /lib/i386 cd /usr/java/jre1.5.0_05/lib/i386 4) Copy the library files (*.so) to that directory. cp /home/krlux/Desktop/'Java Controls'/rxtx-linux/bin/* . 5) Check that the copy was successful ls librxtx* librxtxI2C.so librxtxRaw.so librxtxSerial.so librxtxParallel.so librxtxRS485.so 6) cd to the /lib/ext directory for your java. cd /usr/java/jre1.5.0_05/lib/ext 7) Copy the Jar files there cp /home/krlux/Desktop/'Java Controls'/rxtx-linux/lib/ext/* . 8) Check that it was successful ls RXTX* RXTXcomm.jar Rxtx is now installed on your machine ready to use. =================================================================== -- Kim Lux, Diesel Research Inc. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx --------------------------------- Yahoo! Acesso Gr?tis - Internet r?pida e gr?tis. Instale o discador agora! -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/544aa403/attachment-0034.html From lyon at docjava.com Mon Feb 6 05:49:34 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 06 Feb 2006 07:49:34 -0500 Subject: [Rxtx] wiki delay until tomorrow night. In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: Hi All, I have often thought about USB drivers being needed. For example, the ironman watch will not interface to a mac (windows only). It is USB. My dymo label writer has no Java driver (native only). Etc. Most cheap web cameras are USB (and Java drivers go through JAI, if it supports the camera at all). The JAI code shows how sun did the USB drivers. You have to be a member of the jai project to download the source code. https://jai.dev.java.net has the jai distro. And then you are not allowed to redistribute it. However, we can all learn from it (if so inclined). Basically: cvs -d :pserver:lyon at cvs.dev.java.net:/cvs login cvs -d :pserver:lyon at cvs.dev.java.net:/cvs checkout jai-core You will need to user your own uid and pw to get in. The ant build has over 100 warnings from sun deprecations of its own code. You might say that they were hoisted on their own Picard ;) One interesting thing is that they support several platforms: linux-amd64 64-bit Linux-AMD64 linux-i586 32-bit Linux-x86 solaris-amd64 64-bit Solaris-AMD64 solaris-i586 32-bit Solaris-x86 solaris-sparc 32-bit Solaris-SPARC solaris-sparcv9 64-bit Solaris-SPARC windows-i586 32-bit Windows-x86 Thus, ant is used to provide a multi-platform native method distro. Neat. How do they do it? check this out: And: The core download does not contain any C source code (it was all pre-built). Basically, they are just copying .so and .dll files into build directories. I would love to see the C code for this...but Sun does not post it on the https://jai.dev.java.net site. I don't know why...Perhaps I missed it. - Doug >On Sun, 5 Feb 2006, Trent Jarvi wrote: > >>On Sun, 5 Feb 2006, Kim Lux wrote: >> >>>usb ? Tell me more... I need that too. >> >>usb is a very proper design. Thats all it is. >> > >Maybe rxtx could help usb. But it would start with helping bring >back the community that was already there. > >It's not something I'd love to do but maybe its the right thing to do. > >It would probably take 2 years to do right. But maybe thats better >than what we have now. > >I honestly don't know what IBM is doing which could just run over everything. > >Just some thoughts after some fine german wine. > >-- >Trent Jarvi >tjarvi at qbang.org > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tdelenik at gmail.com Mon Feb 6 05:56:32 2006 From: tdelenik at gmail.com (Thanasis Delenikas) Date: Mon, 6 Feb 2006 14:56:32 +0200 Subject: Fwd: [Rxtx] Documentation Wiki In-Reply-To: <1139157422.4553.9.camel@zd7280> References: <20060205113618.30274.qmail@web53501.mail.yahoo.com> <1139157422.4553.9.camel@zd7280> Message-ID: <310a1a930602060456t129f1dc6p5f2b908f13ab5a0b@mail.gmail.com> Hello all, Kim, this is a snippet from the code I use. The closest to directly opening a specific port without enumeration. << ... portId = CommPortIdentifier.getPortIdentifier(getPort()); serialPort = (SerialPort) portId.open("jSMSEngine", 1971); ... >> where getPort() return the string identifier of the port, i.e. "/dev/ttyS0" or "COM1" or whatever. Thanasis. ---------- Forwarded message ---------- From: Kim Lux Date: Feb 5, 2006 6:37 PM Subject: Re: [Rxtx] Documentation Wiki To: RXTX Developers and Users BTW: there is no way to open a port without going through the port list and finding it. Maybe sometime in the future someone (me ?) will write a method called openSerialPort that allows the user to give a port identifier, such as "/dev/tty1" and return a port ready to use. It wouldn't take much to write that and it would save users a lot of code. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/182ab5b8/attachment-0034.html From tjarvi at qbang.org Mon Feb 6 11:53:57 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 11:53:57 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: On Mon, 6 Feb 2006, Dr. Douglas Lyon wrote: > Hi All, > I have often thought about USB drivers being needed. > For example, the ironman watch will not interface > to a mac (windows only). It is USB. > My dymo label writer has no Java driver (native only). > Etc. > Most cheap web cameras are USB (and Java drivers go > through JAI, if it supports the camera at all). > The JAI code shows how sun did the USB drivers. > You have to be a member of the jai project to download > the source code. > https://jai.dev.java.net has the jai distro. > And then you are not allowed to redistribute it. However, > we can all learn from it (if so inclined). Basically: > cvs -d :pserver:lyon at cvs.dev.java.net:/cvs login > cvs -d :pserver:lyon at cvs.dev.java.net:/cvs checkout jai-core > You will need to user your own uid and pw to get in. > The ant build has over 100 warnings from sun deprecations > of its own code. > > You might say that they were hoisted on their own Picard ;) > > One interesting thing is that they support several platforms: > linux-amd64 64-bit Linux-AMD64 > linux-i586 32-bit Linux-x86 > solaris-amd64 64-bit Solaris-AMD64 > solaris-i586 32-bit Solaris-x86 > solaris-sparc 32-bit Solaris-SPARC > solaris-sparcv9 64-bit Solaris-SPARC > windows-i586 32-bit Windows-x86 > Thus, ant is used to provide a multi-platform native method distro. > Neat. > How do they do it? > check this out: > > > > > > > > > > > > > And: > > > > > > > > > > The core download does not contain any C source code (it was all pre-built). > Basically, they are just copying .so and .dll files into build directories. > > I would love to see the C code for this...but Sun does not post it on the > https://jai.dev.java.net site. > > I don't know why...Perhaps I missed it. > > - Doug > > I've looked at moving rxtx to Ant builds. I think that would help IDEs a great deal. I requested a evalutation desk copy the O'Reilly Ant book for some j2ee material I was teaching. http://www.oreilly.com/catalog/anttdg/ It has a one sentence mention of JNI. So there was not luck there. I saw that there is another Ant book that does mention JNI more. I can't find it now. Ant must be able to support it with extensions. http://ant.apache.org/manual/OptionalTasks/javah.html What the auto(break :) tools do in the rxtx build is 4 things really. 1) gcc compile flags 2) ld compile flags 3) config.h 4) compile flags for customizing rxtx (lockfiles, ...) See 1 All of this information except 4 can be static once obtained. So I'm not attached to the auto tools. If I could find an example of Ant being used for JNI code, I'd be one of the first to start moving that direction. Maybe someone saw an example someplace. The other thing we have not completed discussing is the directory structure. There is interest in making rxtx more IDE friendly. I get more mail about that off the list than how to install rxtx. And I see we have Ken Thompson in da house :) He is our trusted CVS maintainer and the guy that purchased the rxtx.org domain. Old community. We will need Ken for changing the directory structure of source. I would like to open up discussion about both of these as it is more than time. The problem is I have little experience with Ant and even less with IDEs. It would be nice if we could work with Eclipse and NetBeans. http://www.netbeans.org/ (sun and some community) http://www.eclipes.org (ibm,rhat,... perhaps more community) http://maven.apache.org/what-is-maven.html (apache. It is community) borland should sortof be here too but I think thats covered in eclipse. >From what I understand so far, we should morph rxtx to support those three maybe trusting apaches lead with maven. But I use vi. I have little to no clues beyond what people have fed me. Can we agree that thats the right direction to go? -- Trent Jarvi tjarvi at qbang.org From brian at mbari.org Mon Feb 6 14:57:50 2006 From: brian at mbari.org (Brian Schlining) Date: Mon, 6 Feb 2006 13:57:50 -0800 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> > The other thing we have not completed discussing is the directory > structure. There is interest in making rxtx more IDE friendly. I > get more mail about that off the list than how to install rxtx. > > And I see we have Ken Thompson in da house :) He is our trusted > CVS maintainer and the guy that purchased the rxtx.org domain. Old > community. We will need Ken for changing the directory structure of > source. > > I would like to open up discussion about both of these as it is > more than time. The problem is I have little experience with Ant > and even less with IDEs. It would be nice if we could work with > Eclipse and NetBeans. > > http://www.netbeans.org/ (sun and some community) > http://www.eclipes.org (ibm,rhat,... perhaps more community) > http://maven.apache.org/what-is-maven.html (apache. It is community) > borland should sortof be here too but I think thats covered in > eclipse. > >> From what I understand so far, we should morph rxtx to support >> those three > maybe trusting apaches lead with maven. But I use vi. I have > little to no clues beyond what people have fed me. > Maven likes the directory structure below for Java code. (From http:// maven.apache.org/guides/getting-started/index.html) This structure works fine with ant, netbeans, and eclipse. rxtx_root_directory `-- src |-- main | `-- java | `-- gnu | `-- io `-- test `-- java `-- gnu `-- io Brian Schlining Software Engineer http://www.mbari.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/d9451eba/attachment-0034.html From tjarvi at qbang.org Mon Feb 6 15:11:45 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 15:11:45 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: > rxtx_root_directory > `-- src > |-- main > | `-- java > | `-- gnu > | `-- io > `-- test > `-- java > `-- gnu > `-- io > >From what I understand this will just be good. For me it makes no difference. So lets do the rxtx thing. Let if fester for two weeks and if nobody objects, we will do it. I'm not doing this because I care. I'm doing this to eliminate much of my inbox. But test... man is rxtx lacking there in the community aspect. It is covered but not right. _maybe_ I can change that this year. -- Trent Jarvi tjarvi at qbang.org (cat hurding since 1997) From lux at diesel-research.com Mon Feb 6 21:38:49 2006 From: lux at diesel-research.com (Kim Lux) Date: Mon, 06 Feb 2006 21:38:49 -0700 Subject: [Rxtx] How can I use Lock Files with rxtx (in FC4) ? Message-ID: <1139287129.17031.3.camel@zd7280> I am now running an rxtx application on FC4. I am getting: ========================================================= check_group_uucp(): error testing lock file creation Error details: Permission denied check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL ========================================================= $ ls -al /var/lock total 32 drwxrwxr-x 4 root lock 4096 Feb 6 16:04 . drwxr-xr-x 24 root root 4096 Nov 14 01:19 .. drwx------ 2 root root 4096 Apr 27 2005 lvm drwxr-xr-x 2 root root 4096 Feb 6 16:04 subsys How do I fix this for regulator users ? -- Kim Lux, Diesel Research Inc. From dmarkman at mac.com Mon Feb 6 22:24:44 2006 From: dmarkman at mac.com (Dmitry Markman) Date: Tue, 7 Feb 2006 00:24:44 -0500 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: if I understands the issue right in order to be able to use ant for c/c++ compilation you have to install ant's cc task http://ant-contrib.sourceforge.net/cc.html it looks like it should work on mac os x (authors claim, that it's platform independent) but I never tested so all you have to do it's providing right command line for the gcc compiler On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: >> rxtx_root_directory >> `-- src >> |-- main >> | `-- java >> | `-- gnu >> | `-- io >> `-- test >> `-- java >> `-- gnu >> `-- io >> > > >> From what I understand this will just be good. > > For me it makes no difference. So lets do the rxtx thing. Let if > fester for two weeks and if nobody objects, we will do it. > > I'm not doing this because I care. I'm doing this to eliminate > much of my inbox. > > But test... man is rxtx lacking there in the community aspect. It > is covered but not right. _maybe_ I can change that this year. > > -- > Trent Jarvi > tjarvi at qbang.org > (cat hurding since 1997) > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx Dmitry Markman From lux at diesel-research.com Mon Feb 6 23:20:15 2006 From: lux at diesel-research.com (Kim Lux) Date: Mon, 06 Feb 2006 23:20:15 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? Message-ID: <1139293215.3689.4.camel@zd7280> I'm running the code below. portlist.hasMoreElements() is false. /dev has ports in it as listed below. What am I doing wrong ? ========================================================== // Step through the list of ports until we find one that matches // the one we are looking for. portList = CommPortIdentifier.getPortIdentifiers(); while(portList.hasMoreElements()) { portID = (CommPortIdentifier) portList.nextElement(); // if (portID.getName().equals("/dev/ttyUSB0")) { myTA.append("Serial port ttyUSB0 has been found\n"); break; }// if portID equals... }// End of while... ========================================================== ls -al /dev/tty* crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 ... crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 -- Kim Lux, Diesel Research Inc. From david.garnier at trusted-logic.com Tue Feb 7 00:46:30 2006 From: david.garnier at trusted-logic.com (David Garnier) Date: Tue, 07 Feb 2006 08:46:30 +0100 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: <43E85056.2090608@trusted-logic.com> Hello, I think that the make-based build process is fine as it is, apart from the location of the Java source files. It is true that putting the Java source in a directory structure that map 1-to-1 to the Java package structure is the norm and should make it easier for everyone to modify the Java source, with or without an IDE. Ant is a good tool, but in the RXTX case I fail to see the advantage of using it compared to the current make-based process. As Trent said, they are more pressing issues, like testing. Regards, David Dmitry Markman wrote: > if I understands the issue right > in order to be able to use ant for c/c++ compilation > you have to install ant's cc task > http://ant-contrib.sourceforge.net/cc.html > > it looks like it should work on mac os x > (authors claim, that it's platform independent) > but I never tested > > so all you have to do it's providing right command line > for the gcc compiler > > > > > On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: > >>> rxtx_root_directory >>> `-- src >>> |-- main >>> | `-- java >>> | `-- gnu >>> | `-- io >>> `-- test >>> `-- java >>> `-- gnu >>> `-- io >>> >> >> >>> From what I understand this will just be good. >> >> For me it makes no difference. So lets do the rxtx thing. Let if >> fester for two weeks and if nobody objects, we will do it. >> >> I'm not doing this because I care. I'm doing this to eliminate much >> of my inbox. >> >> But test... man is rxtx lacking there in the community aspect. It is >> covered but not right. _maybe_ I can change that this year. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> (cat hurding since 1997) From tjarvi at qbang.org Tue Feb 7 01:11:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 01:11:31 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <43E85056.2090608@trusted-logic.com> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: On Tue, 7 Feb 2006, David Garnier wrote: > Hello, > > I think that the make-based build process is fine as it is, apart from the location of the Java > source files. It is true that putting the Java source in a directory structure that map 1-to-1 to > the Java package structure is the norm and should make it easier for everyone to modify the Java > source, with or without an IDE. > > Ant is a good tool, but in the RXTX case I fail to see the advantage of using it compared to the > current make-based process. As Trent said, they are more pressing issues, like testing. > Hi David I have more experience with testing rxtx than I can talk about. But let it be known, rxtx has gone trough 100's of hours of testing. We are hobby folks interested in toys but there is more. rxtx has had some of the best guidance in the industry there. This is not an easy thing. I may be able to come back in a month from the other side of the corperate fence and help. I suspect the tests could just be made public but they are in a very unusual environment that just wont work in a wider sense. This is something I'll be trying to change. At one point it was agreed we could just make the results public so this isnt just noise.. There is interest and I think its safe to mention that much. The big problem with testing in the past is most of it is done with a loopback connection. So we *still* have major questions regarding things like flow control. rxtx talks to itself over a loopback and it works. regardless of right or wrong. This requires more thought to be done right. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Feb 7 02:46:34 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 02:46:34 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: > The big problem with testing in the past is most of it is done with a > loopback connection. So we *still* have major questions regarding things > like flow control. rxtx talks to itself over a loopback and it works. > regardless of right or wrong. With serial communication there are gold standards. ckermit is probably a definitive 'standard.' Maybe its possible to do ping/pong tests with ckermit? Is it scriptable? There are known issues in rxtx. Probably the worst is some threading issues regarding some JREs with multiple JNI threads setting java variables. Man did I get schooled there. Just switch the c functions to returning variables and things go away. Sometimes they work fine, sometimes they blow up. Without understanding everything, somehow rhat got it right and debian (and especially gentoo) grabbed kernel patches causing all sort of harm. Its not hard to fix once you understand whats going on but nearly impossible to track with a debugger. So I have a good idea what 2.1-8 will have outside of the IDE modifications. rxtx 2.1-7 is a release for everyone to sync with. Its not even as stable as -pre17 as far as I know - I ran no test suites. I'll be chasing it too. We just had so many contributions that it was time. It seriously broke internal scheduals but thats a great thing :) The other thing I want to do in 2.1-8 is automagic baud rates. It turns out lots of shops are doing really funky baud rates for things like automobile test equipment. It is possible but it requires a fair amount of change in the native code. Is anyone looking at this? -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Feb 7 02:57:21 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 07 Feb 2006 04:57:21 -0500 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <43E85056.2090608@trusted-logic.com> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: Hi All, I agree, testing is very important. The problem I have been trying to address is related to cross-platform testing and the robust nature of the installs. Typically, I visit 3 platforms to deploy my product, windows, linux and mac. A build is performed on each platform. The idea that you can build for many platforms from one copy the source code seems attractive. This should enable synchronized deployments of identical code. The question of how to achieve this goal remains open. As Trent mentioned, this is hard. Perhaps Ant will help here (but perhaps not). Ant does seem to help with running unit tests. However, it does not help with multi-platform tests. For that you need many machines and different operating environments. Toward that end, I have created a multi-platform test that can be run from web start, located at: http://show.docjava.com:8086/book/cgij/code/jnlp/serialPort.PortTest.jnlp This is interesting because many people in the community can run the test and we can improve the test, as time permits. No, it is not a perfect solution, however, the idea does help with multi-platform tests using many machines and different operating environments. If the group has a good test for a general serial port set-ups, i would be happy to deploy it, for general evaluation using web start. And as for ANT, it is just an idea. Not all my ideas are good ones! - Doug >Hello, > >I think that the make-based build process is fine as it is, apart >from the location of the Java >source files. It is true that putting the Java source in a directory >structure that map 1-to-1 to >the Java package structure is the norm and should make it easier for >everyone to modify the Java >source, with or without an IDE. > >Ant is a good tool, but in the RXTX case I fail to see the advantage >of using it compared to the >current make-based process. As Trent said, they are more pressing >issues, like testing. > >Regards, >David > >Dmitry Markman wrote: >> if I understands the issue right >> in order to be able to use ant for c/c++ compilation >> you have to install ant's cc task >> http://ant-contrib.sourceforge.net/cc.html >> >> it looks like it should work on mac os x >> (authors claim, that it's platform independent) >> but I never tested >> >> so all you have to do it's providing right command line >> for the gcc compiler >> >> >> >> >> On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: >> >>>> rxtx_root_directory >>>> `-- src >>>> |-- main >>>> | `-- java >>>> | `-- gnu >>>> | `-- io >>>> `-- test >>>> `-- java >>>> `-- gnu >>>> `-- io >>>> >>> >>> >>>> From what I understand this will just be good. >>> >>> For me it makes no difference. So lets do the rxtx thing. Let if >>> fester for two weeks and if nobody objects, we will do it. >>> >>> I'm not doing this because I care. I'm doing this to eliminate much >>> of my inbox. >>> >>> But test... man is rxtx lacking there in the community aspect. It is >>> covered but not right. _maybe_ I can change that this year. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> (cat hurding since 1997) > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From matt.higgins at gmail.com Tue Feb 7 08:28:34 2006 From: matt.higgins at gmail.com (Matt Higgins) Date: Tue, 7 Feb 2006 10:28:34 -0500 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final Message-ID: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? import java.io.*; import java.util.*; import gnu.io.*; public class MySimpleRead implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; public static void main(String[] args) { boolean portFound = false; String defaultPort = "COM1"; if (args.length > 0) { defaultPort = args[0]; } portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; MySimpleRead reader = new MySimpleRead(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } } public MySimpleRead() { try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) { e.printStackTrace(); } try { inputStream = serialPort.getInputStream(); } catch (IOException e) { e.printStackTrace(); } try { serialPort.addEventListener(this); } catch (TooManyListenersException e) { e.printStackTrace(); } try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { e.printStackTrace(); } System.out.println("Baud is " + serialPort.getBaudRate()); System.out.println("Bits is " + serialPort.getDataBits()); System.out.println("Stop is " + serialPort.getStopBits()); System.out.println("Par is " + serialPort.getParity()); serialPort.notifyOnDataAvailable(true); readThread = new Thread(this); readThread.start(); } public void run() { // Thread.sleep(20000); //} catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { System.out.println("An event occurred " + event.getEventType()); switch (event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: byte[] readBuffer = new byte[20]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } System.out.print(new String(readBuffer)); } catch (IOException e) {} break; } } } --------------- Result on windows ------------------------------ Stable Library ============================================================== Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port:: COM1 Baud is 9600 Bits is 8 Stop is 1 Par is 0 ----------------- End Results ----------------------------------------- ------------------ Result on Linux ----------------------------------- Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 Found port: /dev/ttyS0 Baud is 9600 Bits is 8 Stop is 1 Par is 0 An event occurred 1 043100066224 ------------------ End Results --------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/a1431630/attachment-0034.html From brian at mbari.org Tue Feb 7 09:48:37 2006 From: brian at mbari.org (Brian Schlining) Date: Tue, 7 Feb 2006 08:48:37 -0800 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> Message-ID: <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> Hi Matt > The following code works fine on Linux but I never see any data > when run on Windows. This is a cut and paste from the SimpleRead > example. > I am attempting to read data from a bar code scanner. I can fire > up HyperTermianl on windows and see that the device is working > properly as I see the barcodes are scanned and echoed back to the > terminal. However when I run the app I don't see any data. It is > however associating with the com port as the informational bits > print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. Cheers Brian Schlining Software Engineer http://www.mbari.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/16d07f37/attachment-0034.html From lux at diesel-research.com Tue Feb 7 11:59:58 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 11:59:58 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139293215.3689.4.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> Message-ID: <1139338798.8145.4.camel@zd7280> Any ideas on this ? Any reason why portList.hasMoreElements() should be false even though there are devices in /dev ? On Mon, 2006-02-06 at 23:20 -0700, Kim Lux wrote: > I'm running the code below. > > portlist.hasMoreElements() is false. > > /dev has ports in it as listed below. > > What am I doing wrong ? > > > ========================================================== > // Step through the list of ports until we find one that matches > // the one we are looking for. > > portList = CommPortIdentifier.getPortIdentifiers(); > > while(portList.hasMoreElements()) > { > portID = (CommPortIdentifier) portList.nextElement(); // > if (portID.getName().equals("/dev/ttyUSB0")) > { > myTA.append("Serial port ttyUSB0 has been found\n"); > break; > }// if portID equals... > }// End of while... > ========================================================== > > ls -al /dev/tty* > crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty > crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 > crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 > crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 > crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 > ... > crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 > crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 > crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 > > > -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 12:20:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 12:20:25 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139338798.8145.4.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> Message-ID: On Tue, 7 Feb 2006, Kim Lux wrote: > > Any ideas on this ? Any reason why portList.hasMoreElements() should be > false even though there are devices in /dev ? > > > On Mon, 2006-02-06 at 23:20 -0700, Kim Lux wrote: >> I'm running the code below. >> >> portlist.hasMoreElements() is false. >> >> /dev has ports in it as listed below. >> >> What am I doing wrong ? >> >> >> ========================================================== >> // Step through the list of ports until we find one that matches >> // the one we are looking for. >> >> portList = CommPortIdentifier.getPortIdentifiers(); >> >> while(portList.hasMoreElements()) >> { >> portID = (CommPortIdentifier) portList.nextElement(); // >> if (portID.getName().equals("/dev/ttyUSB0")) >> { >> myTA.append("Serial port ttyUSB0 has been found\n"); >> break; >> }// if portID equals... >> }// End of while... >> ========================================================== >> >> ls -al /dev/tty* >> crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty >> crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 >> crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 >> crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 >> crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 >> ... >> crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 >> crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 >> crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 >> >> >> > Hi Kim What rxtx does is try to open the port and do a timed out read. If the kernel/... do not complain it's enumarted. I suspect you could do a crude test by doing something like cat /dev/ttyS0 > /dev/null If that barfs then rxtx wont enumerate the port. hmm looking at your question again, I suspect it's a lockfile problem. This is documented in INSTALL with the source. Its easy enough to test this too.. touch /var/lock/testingrxtxlockfiles && rm -f /var/lock/testingrxtxlockfiles If you are not in the right group it will bail. Root will work regardless. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 12:37:56 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 12:37:56 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> Message-ID: <1139341076.8145.11.camel@zd7280> Exactly which ports does rxtx attempt to put into the list ? /dev/* or /dev/tty* or /dev/tty[0-9[0-9] ? or /dev/ttyS* ? For the record, only /dev/ttyUSB0 is a valid port on the machine I am presently on. Will this be a problem ? On Tue, 2006-02-07 at 12:20 -0700, Trent Jarvi wrote: > This is documented in INSTALL with the source. > I was wondering where that file was. I will download source and dig it up. Thanks. -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 12:51:09 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 12:51:09 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139341076.8145.11.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: On Tue, 7 Feb 2006, Kim Lux wrote: > > Exactly which ports does rxtx attempt to put into the list ? /dev/* > or /dev/tty* or /dev/tty[0-9[0-9] ? or /dev/ttyS* ? > > For the record, only /dev/ttyUSB0 is a valid port on the machine I am > presently on. Will this be a problem ? > > > On Tue, 2006-02-07 at 12:20 -0700, Trent Jarvi wrote: >> This is documented in INSTALL with the source. >> > I was wondering where that file was. I will download source and dig it > up. > > Thanks. > Hmm I'm looking at pre17 so this may have changed. (its just what I have on this machine) if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA" // for the IPAQs }; CandidatePortPrefixes=Temp; } So you may need to add "ttyUSB" to that list. RXTX used to enumerate _everything_ see if(osName.equals("Linux-all-ports") But it became less than practical. This is all in RXTXCommDriver.java hmm I just did a cvs update. if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have to get your fingers into the code. We aim for sane defaults. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 13:06:45 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 13:06:45 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139342805.8145.22.camel@zd7280> On Tue, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > Hmm I'm looking at pre17 so this may have changed. (its just what I have > on this machine) > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA" // for the IPAQs > }; > CandidatePortPrefixes=Temp; > } > > > So you may need to add "ttyUSB" to that list. RXTX used to enumerate > _everything_ see if(osName.equals("Linux-all-ports") But it became less > than practical. > > This is all in RXTXCommDriver.java > > hmm I just did a cvs update. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have > to get your fingers into the code. We aim for sane defaults. Excellent. Thanks for taking the time. -- Kim Lux, Diesel Research Inc. From ideiglenes1 at freemail.hu Tue Feb 7 13:53:39 2006 From: ideiglenes1 at freemail.hu (--) Date: Tue, 07 Feb 2006 21:53:39 +0100 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139345619.22534.2.camel@localhost> Hi! I use this code to get all the extra Linux devices. :) if ("Linux".equals(System.getProperty("os.name"))) { System.setProperty("os.name","Linux-all-ports"); } driver = new RXTXCommDriver(); On k, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > On Tue, 7 Feb 2006, Kim Lux wrote: > > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have > to get your fingers into the code. We aim for sane defaults. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From matt.higgins at gmail.com Tue Feb 7 13:45:54 2006 From: matt.higgins at gmail.com (Matt Higgins) Date: Tue, 7 Feb 2006 15:45:54 -0500 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> Message-ID: <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> Sweet this is exactly what I needed. I was searching the archives through marc.theamisgroup they only have archives back to 1/3/05. Should have hit the mailman archive! Thanks a lot! On 2/7/06, Brian Schlining wrote: > > Hi Matt > > The following code works fine on Linux but I never see any data when run > on Windows. This is a cut and paste from the SimpleRead example. > I am attempting to read data from a bar code scanner. I can fire up > HyperTermianl on windows and see that the device is working properly as I > see the barcodes are scanned and echoed back to the terminal. However when I > run the app I don't see any data. It is however associating with the com > port as the informational bits print fine? > > > You're not the only one whose had this problem, I don't know if Trent has > addressed this is the latest release of RXTX but there is a workaround. > Here's the recent thread from the RXTX mailing list regarding this issues: > > Thanasis Delenikas tdelenik at gmail.com > Wed Jan 18 13:56:23 MST 2006 > > * Previous message: [Rxtx] Re: More close() performance fixes > * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] > > Hi all. > (I've subscribed again from my other email account). > > Trent, > > You are right. Linux *always* works, no matter what flow control you set. > Windows *works only* with hardware flow control (I haven't tested what > happens with software XON/XOFF flow control). > > I assume (but I am not certain) that even with no flow control at all, all > platforms should work. Without flow control, you have the risk of bumping > into overflow or framing errors, but that's your (the end programmer, I > mean) problem. > > >From my side, I shouldn't be working without flow control. That was a bug > too... It was some code forgotten from the old times, when I used to work > with phone emulation drivers which didn't support flow control. The > correct > way is to have some flow control enabled and that's why I suppose this is > a > low-severity bug for RxTx. > > I have no idea which platform shows the correct behaviour, since > my knowledge about Linux and the inner workings of these low-level i/o > operations is limited. > > Regards, > Thanasis Delenikas. > > > > > Message: 2 > > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > > From: Trent Jarvi > > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > > To: RXTX Developers and Users > > Message-ID: > > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > > > Hi all, > > > > > > Trent, I have found something. > > > I read your comment about flow control, so I experimented a bit. > > > > > > If you remember, in my sample program I've used no flow control at all > ( > > i.e. > > > Java constant FLOWCONTROL_NONE). > > > > > > Now, during testing, I've switch to hardware inbound flow control (i.e > . > > Java > > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > > beautifully! > > > > > > I think I will switch to H/W flow control and test things for a while, > > but > > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > > > > > Hi Thanasis, > > > > I'm fairly sure you have identified a bug. I would not worry too much > > about what Sun CommAPI w32 defaults are. I think they did more or less > > whatever the port opened with. Just a guess. Linux tries to stomp on > > ports so they are all the same. > > > > So this started out with Linux worked, Windows XP/.. did not as I > recall. > > Something is wrong in rxtx. Do I understand this right? > > > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > > > Perhaps there is something Wayne or I did not understand when we wrote > > that code. I wasnt programming back in the BBS days so modems are not > my > > thing. I have a few questions. > > > > Is the above matrix confirmed by observation? > > Linux just always worked? > > Which one _should_ work? I'm guessing modems work with hardware flow > > control. I'll have to dig around. > > > > The windows flow control changes a couple things with hardware flow > > control. Following the w32 API documentation is confusing sometimes. > > But it looks like Linux could have a bug too. > > Cheers > > Brian Schlining > Software Engineer > http://www.mbari.org > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/9c989144/attachment-0034.html From tjarvi at qbang.org Tue Feb 7 14:06:14 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 14:06:14 -0700 (MST) Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> Message-ID: >> >> You're not the only one whose had this problem, I don't know if Trent has >> addressed this is the latest release of RXTX but there is a workaround. >> Here's the recent thread from the RXTX mailing list regarding this issues: >> I have not. I expect to have access to some test equipment next month and I'll go through all of this. I really don't know whats going on and I need a gold standard. I thought maybe linux was autodetecting the flow control. Your observations would certainly be welcome. I need to talk to Russell King and see what he is doing. Until then I'd just be toying around over a loopback as usual. This is very high on the list though. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 17:25:05 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 17:25:05 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139358305.17994.2.camel@zd7280> My application now works. I installed the libraries and jar from 2.1-7 (Final). portlist.hasMoreElements is no longer false. The application finds the port for /dev/ttyUSB0. Thanks for your help, Trent (et al) Sorry I bothered you with this. Next time I will look in the source first. I didn't think it was an rxtx issue, I thought it was a Linux setup issue . On Tue, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > Hmm I'm looking at pre17 so this may have changed. (its just what I > have > on this machine) > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux > Serial Ports > "ttySA" // for the > IPAQs > }; > > CandidatePortPrefixes=Temp; > } > > > So you may need to add "ttyUSB" to that list. RXTX used to enumerate > _everything_ see if(osName.equals("Linux-all-ports") But it became > less > than practical. > > This is all in RXTXCommDriver.java > > hmm I just did a cvs update. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux > Serial Ports > "ttySA", // for the > IPAQs > "ttyUSB" // for USB > frobs > }; > > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you > have > to get your fingers into the code. We aim for sane defaults. -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 19:21:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 19:21:54 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139358305.17994.2.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> <1139358305.17994.2.camel@zd7280> Message-ID: >Sorry I bothered you with this. Next time I will look in the source >first. I didn't think it was an rxtx issue, I thought it was a Linux >setup issue . Why would you be sorry? I would have done the same. I'm glad it's working :) -- Trent Jarvi tjarvi at qbang.org From tma at mail.island.net Wed Feb 8 13:39:35 2006 From: tma at mail.island.net (Tom Alldread) Date: Wed, 08 Feb 2006 12:39:35 -0800 Subject: [Rxtx] Win32/Linux Serial Port Data Dropouts In-Reply-To: <200602060702.k167255O007882@www.qbang.org> References: <200602060702.k167255O007882@www.qbang.org> Message-ID: <43EA5707.4020200@mail.island.net> Greetings Folks at RXTX: During the last couple of months I have been alternately testing with javax.comm 2 and RXTX 2.1 under Windows XP and CommApi 3 and RXTX 2.1 under Suse 10.0 Linux. In the process I have learned a little about java multi-threading under NetBeans 5 with Profiler. My java (jdk 1.5_06) application is used for data acquisition and provides a graphical display of A-D conversion data received from a 56KBaud serial port. The actual data throughput is about 10KBaud thus it is well below the speed of the port. I use hardware RTS/CTS flow control which can stall the data acquisition sample rate if necessary. This ensures the display computer has the ability to slow the data acquisition rate should it become too busy to accept the regular data flow. Both the serial port buffer and the java read buffer are set at 16KB. Usually the data transfers into the java read buffer are less than 100 bytes unless the data acquisition is recovering from a stall. The data flow normally hesitates after each 5 KB block as a continue command is needed from the display computer to start the drawing of a new graphics display line. Separate threads have been provided for the serial port event monitoring and data processing. The serial port event thread has been given the maximum priority and data processing thread the minimum priority provided by java. Thread yield statements have been placed within all data processing while/for loops as an effort to ensure quick access to CPU cycles for the serial port event thread. I have found that short data transmissions are essentially error free but occasional dropouts occur with continuous data flow especially under Windows XP. ....................................................................................................................................................................................... Linux results: I am happy to report that RXTX 2.1 appears to work very well under Linux although I did notice some errors when the screen savers were running with my dual monitors. I believe this is a local problem associated with my dual graphics which needs further attention. The recent CommApi 3 Linux release from Sun did not work at all with my program. It seemed to send commands out OK but did not receive any data. Although the serial port event triggered the ISR, the input stream appeared filled with nulls and thus did not contain any data. As my understanding is that CommApi 3 was tested with a Red Hat distribution of Linux I wonder if this problem is distro dependent? Although somewhat off topic here I wonder if anyone reading this has had similar experience? .................................................................................................................................................................................. Windows XP results: There are problems with occasional data dropouts which become more frequent as the sampling rate is increased or if the computer becomes busy with other duties. The dropouts typically consist of a half dozen byte block of lost data. It appears the lost bytes never get added to the java input stream. There has not been any indication of garbled data, overruns or framing errors which suggests the UART communications remains solid. Using javax.comm 2 I found that the setting of SerialPort 'enableReceiveThreshold' to 40 and 'enableReceiveTimeout' of 100mS reduced the dropouts error rate significantly. I found that I could not get RXTX 2.1 to function with the aforementioned threshold and timeout settings. The javax.comm 2 interface is consequently performing better for me under Windows than RXTX 2.1. I wonder if anyone here has any suggestions as to what I might try to improve RXTX 2.1? Although my settings are the same as under Suse 10.0, RXTX 2.1 performs much better for me under Linux than any of the alternatives that I have tried under Windows XP . ............................................................................................................................................................................... I would like to establish, based on the experience of others, if I have reached the normally expected performance limit of java serial port communications? Should I expect to achieve virtually error free serial port data input from a continuous stream under Windows XP java software? I am considering changing my protocol to packets with error checking if necessary but would like to know if the dropout problems I am experiencing are typical or not before I take this rather work intensive plunge. Many thanks in advance for any help! Best Regards, Tom Alldread -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.375 / Virus Database: 267.15.2/253 - Release Date: 2006-02-07 From jlaxson at mac.com Wed Feb 8 23:56:48 2006 From: jlaxson at mac.com (John Laxson) Date: Thu, 9 Feb 2006 00:56:48 -0600 Subject: [Rxtx] PortInUseException: Unknown Application on OSX Message-ID: Hi, I've been trying to get RXTX 2.1.7 going on Mac OS X for a while here, and am running up into a wall here. I've tried with pre- compiled and the source version and get the same problem, a gnu.io.PortInUseException: Unknown Application. I have run the fixperms script included with the source distribution, and id shows me as a member of the uucp group, and permissions on /var/spool/uucp are 775 root:uucp. Running a test program (included at the bottom for clarity) lets me enumerate all the serial ports correctly, but trying to open any of them gives the PortInUseException. If it helps, when I try to open a port that's set to make an outgoing bluetooth connection, there is no delay and no connection attempt at all. Thanks, John Laxson PS: The documentation wiki on qbang.org shows 404, and has for a few days now. My test code: public static void main(String[] args) { SerialPort serialPort; try { Enumeration e = CommPortIdentifier.getPortIdentifiers(); CommPortIdentifier ident; while (e.hasMoreElements()) { ident = (CommPortIdentifier)e.nextElement(); System.out.println(ident.getName()); } ident = CommPortIdentifier.getPortIdentifier("/dev/cu.modem"); serialPort = (SerialPort) ident.open("Me", 5000); } catch (Exception e) { e.printStackTrace(); } } From rajesh.invincible at gmail.com Thu Feb 9 03:39:38 2006 From: rajesh.invincible at gmail.com (Rajesh N) Date: Thu, 9 Feb 2006 16:09:38 +0530 Subject: [Rxtx] Re: Move .java Files in gnu.io filesystem hierarchy - Maven (2) In-Reply-To: <43DF21D2.7090200@ngi.it> References: <43DF21D2.7090200@ngi.it> Message-ID: <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Can anybody tell me how to overcome these EXCEPTIONS I AM WORKING ON SERIAL COMMN IN JAVA ON LINUX. 1. " NOT ALL PARAMETERS SUPPORTED BY THE KERNEL" This i came across the following statement inmy prog. SerialP is A SerialPort object SerialP.setSerialPortParams(9600(BAUDRATE),DATABITS_8,STOPBITS_1,PARITY_NONE) 2. NullPointer Exception at Event Dispatch Now i have checked all my object references for a null reference but i found none i have put up my entire code in try catch blocks but still I AM UNABLE TO CATCH THIS EXCEPTION AND HENCE MY APPLICATION CLOSES HOW DOES THESE GO? PLEASE HELP ME IT IS URGENTTTTTTTTTTTTTTTT yours sincerely RAJESH On 1/31/06, Fabio Frumento wrote: > Hi Xavier, > > I don't know maven at all but the directory hierarchy listed buy Trent > is fine for me... > > I'll take a look to maven, it seems an interesting project > > Regards > > Fabio Frumento > > Trent Jarvi wrote: > > On Tue, 31 Jan 2006, Xavier Frisaye wrote: > > > >> Hi all, > >> > >> If you are going to rearrange the src folder, i will propose to use > >> maven 2 and follow its directory structure > >> > (http://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html). > >> > >> Maven 2 simplify java project and give a standard way to make projects > >> (http://maven.apache.org/). > >> We are using it for internal projects and we are very satisfied. > >> > >> Is anybody interested? > >> > >> I'm not an expert in maven 2 (yet) but i'm agree to help using it if > >> you choose to make so. > >> > > > > so this would be: > > > > rxtx-devel/src/main/java/gnu.io > > rxtx-devel/src/test/java/ManIwish.java > > > > I don't use IDEs very much so I'll let others comment. But I don't see > > a problem with that. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Thu Feb 9 09:50:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 9 Feb 2006 09:50:31 -0700 (MST) Subject: [Rxtx] Re: Move .java Files in gnu.io filesystem hierarchy - Maven (2) In-Reply-To: <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Message-ID: On Thu, 9 Feb 2006, Rajesh N wrote: > Can anybody tell me how to overcome these EXCEPTIONS > I AM WORKING ON SERIAL COMMN IN JAVA ON LINUX. > > 1. " NOT ALL PARAMETERS SUPPORTED BY THE KERNEL" > > This i came across the following statement inmy prog. > SerialP is A SerialPort object > SerialP.setSerialPortParams(9600(BAUDRATE),DATABITS_8,STOPBITS_1,PARITY_NONE) > Strange. The parameters you use are the same the port should open with by default. Could you paste the actual exception you are getting? I don't see that in the rxtx source. Also it would help to know the rxtx version. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Fri Feb 10 15:29:05 2006 From: lux at diesel-research.com (Kim Lux) Date: Fri, 10 Feb 2006 15:29:05 -0700 Subject: [Rxtx] One serial port object for both sending and receiving ? Message-ID: <1139610545.18177.4.camel@zd7280> Is it OK to use one SerialPort ojbect (ex Serial Port serialPort;) and use it for both sending and receiving ? For example: ======================================================================== static SerialPort serialPort = null; static OutputStream serialOut = null; static InputStream serialIn = null; // assign it to an outputStream for use try{ serialOut = serialPort.getOutputStream(); System.out.println("Serial output stream has been assigned."); }//try catch(IOException e) { System.out.println("Error: Couldn't assign output stream to serial port."); }//catch //assign it to an inputStream for use try{ serialIn = serialPort.getInputStream(); System.out.println("Serial input stream has been assigned."); }//try catch(IOException e) { System.out.println("Error: Couldn't assign input stream to serial port."); }//catch ======================================================================== -- Kim Lux, Diesel Research Inc. From lux at diesel-research.com Fri Feb 10 21:23:00 2006 From: lux at diesel-research.com (Kim Lux) Date: Fri, 10 Feb 2006 21:23:00 -0700 Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Message-ID: <1139631780.23882.10.camel@zd7280> I've got a problem receiving chars with my version of serialRead, written in an SWT GUI. I had a Java pro have a good look at my code and he can't see anything wrong with it. I can send chars fine. When I receive a char the cpu usage for the app goes to 100% and the code in the serial event handler doesn't get executed. The instructions on the Java Comm Serial API How-To for Linux page state that I must install javacomm. Is that true ? Everything builds without it and I can send chars on rxtx just fine, but I can't receive them. Could this be the problem ? I downloaded and installed javacomm. I was not able to add "Driver=gnuio.RXTXCommDriver to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 installed in /usr/java/jre1.5.0_05. I added comm.jar to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext to the library paths. Is this OK ? Does it matter that I am receiving on /dev/ttyUSB0 ? Thanks. -- Kim Lux, Diesel Research Inc. From lunareclipse03 at web.de Sat Feb 11 09:44:46 2006 From: lunareclipse03 at web.de (lunareclipse03@web.de) Date: Sat, 11 Feb 2006 17:44:46 +0100 Subject: [Rxtx] Question about Serial I/O under Win32 Message-ID: <662084330@web.de> Hello everybody, I have a strange problem with a piece of code I made for myself. No, this is not really concerning rxtx, but nevertheless I post this to the list, hoping that some of you can help me. I've written two libraries, one for linux and one for win32. The linux port works quite well, I can send / receive faxes and / or replay voice messages over the telephone line using a voice modem. But the win32 port of the library causes some trouble. If, for example, I send out a fax with a certain modem under linux, it works well. The fax is complete when it comes out of the fax machine. If I then use the same modem to send out a fax under win32, the fax coming out of the fax machine gets "stuck" halfways, but the sending modem thinks that transmission was ok and drops the connection. The answering fax machine then gives me "error while receiving." The "upper layer" java code MUST be right, because if I do the same thing under linux (using the linux library), everything is alright. Now I have to ask: Can somebody please help me out with this??!? Could it be the case that some kind of flow control or COMMTIMEOUTS setting causes this behaviour? I set flow control to RTS/CTS before sending out a fax. How can I DISABLE flow control? Or what do you think? Can something else cause this problems? Thank you all for your time and PLEASE write back soon. Regards, --Sven Ahlemann Am Waldrand 31 45721 Haltern am See Germany ______________________________________________________________ Verschicken Sie romantische, coole und witzige Bilder per SMS! Jetzt bei WEB.DE FreeMail: http://f.web.de/?mc=021193 From lux at diesel-research.com Sat Feb 11 10:06:52 2006 From: lux at diesel-research.com (Kim Lux) Date: Sat, 11 Feb 2006 10:06:52 -0700 Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: <1139631780.23882.10.camel@zd7280> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> <1139631780.23882.10.camel@zd7280> Message-ID: <1139677612.3431.5.camel@zd7280> More on this problem. I copied and pasted simpleRead into a console based Eclipse project and I've got the same result, except that cpu usage doesn't go to 100%. I'm beginning to think there is an issue in rxtx. My imports for simpleRead are: ============================ import gnu.io.*; import java.util.*; //import javax.comm.*; import java.io.*; =========================== Any ideas ? I am trying to read from /dev/ttyUSB0 using a serial to USB adapter which has worked well with minicom and gtkterm. Thanks. On Fri, 2006-02-10 at 21:23 -0700, Kim Lux wrote: > I've got a problem receiving chars with my version of serialRead, > written in an SWT GUI. > > I had a Java pro have a good look at my code and he can't see anything > wrong with it. > > I can send chars fine. When I receive a char the cpu usage for the app > goes to 100% and the code in the serial event handler doesn't get > executed. > > The instructions on the Java Comm Serial API How-To for Linux page state > that I must install javacomm. Is that true ? Everything builds without > it and I can send chars on rxtx just fine, but I can't receive them. > Could this be the problem ? > > I downloaded and installed javacomm. I was not able to add > "Driver=gnuio.RXTXCommDriver > to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not > have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 > installed in /usr/java/jre1.5.0_05. I added comm.jar > to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext > to the library paths. Is this OK ? > > Does it matter that I am receiving on /dev/ttyUSB0 ? > > Thanks. > -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Sun Feb 12 21:01:33 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:01:33 -0700 (MST) Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: <1139677612.3431.5.camel@zd7280> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> <1139631780.23882.10.camel@zd7280> <1139677612.3431.5.camel@zd7280> Message-ID: I suspect what is happening is the select() is breaking out in the native code but the driver does not have support for notifying there are X bytes available. On some traditional Unix based systems, the only way you know data is available is the fd status changes and do an FIORDCHK ioctl. Or perhaps the only thing you can know is the fd status changed. It would take reading through the kernel driver code to know for sure. So on USB, depending upon the driver, the same may need to be done or the driver improved a bit if possible to support. Polling reads will also work but don't use the event driven model of CommAPI which isnt acceptable in the long run. The 100% cpu usage can then be explained because select no longer blocks until the data is read; the eventLoop spins loose. You can put a well placed sleep but rxtx only expects those are needed when it knows data is available. This may not be a super simple thing to understand and fix. I do have ideas to get you started. I'm going to be short on time the next couple weeks. I expect to put some good time in and answer some other questions I saw around the 25th. For now, I'd look at the following and go from there with the hints I've given. JNIEXPORT jint JNICALL RXTXPort(nativeavailable)( JNIEnv *env, jobject jobj ) { int fd = get_java_var( env, jobj,"fd","I" ); int result; /* char message[80]; ENTER( "RXTXPort:nativeavailable" ); On SCO OpenServer FIONREAD always fails for serial devices, so try ioctl FIORDCHK instead; will only tell us whether bytes are available, not how many, but better than nothing. This turns out to be true on Solaris also. taj. */ #ifdef FIORDCHK /* __unixware__ __sun__ probably others */ result = ioctl(fd, FIORDCHK, 0); #else if( ioctl( fd, FIONREAD, &result ) < 0 ) { goto fail; } #endif /* FIORDCHK */ On Sat, 11 Feb 2006, Kim Lux wrote: > > More on this problem. I copied and pasted simpleRead into a console > based Eclipse project and I've got the same result, except that cpu > usage doesn't go to 100%. I'm beginning to think there is an issue in > rxtx. > > My imports for simpleRead are: > > ============================ > import gnu.io.*; > import java.util.*; > //import javax.comm.*; > import java.io.*; > =========================== > > Any ideas ? I am trying to read from /dev/ttyUSB0 using a serial to > USB adapter which has worked well with minicom and gtkterm. > > Thanks. > > > > On Fri, 2006-02-10 at 21:23 -0700, Kim Lux wrote: >> I've got a problem receiving chars with my version of serialRead, >> written in an SWT GUI. >> >> I had a Java pro have a good look at my code and he can't see anything >> wrong with it. >> >> I can send chars fine. When I receive a char the cpu usage for the app >> goes to 100% and the code in the serial event handler doesn't get >> executed. >> >> The instructions on the Java Comm Serial API How-To for Linux page state >> that I must install javacomm. Is that true ? Everything builds without >> it and I can send chars on rxtx just fine, but I can't receive them. >> Could this be the problem ? >> >> I downloaded and installed javacomm. I was not able to add >> "Driver=gnuio.RXTXCommDriver >> to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not >> have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 >> installed in /usr/java/jre1.5.0_05. I added comm.jar >> to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext >> to the library paths. Is this OK ? >> >> Does it matter that I am receiving on /dev/ttyUSB0 ? >> >> Thanks. >> > From tjarvi at qbang.org Sun Feb 12 21:03:30 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:03:30 -0700 (MST) Subject: [Rxtx] One serial port object for both sending and receiving ? In-Reply-To: <1139610545.18177.4.camel@zd7280> References: <1139610545.18177.4.camel@zd7280> Message-ID: On Fri, 10 Feb 2006, Kim Lux wrote: > > Is it OK to use one SerialPort ojbect (ex Serial Port serialPort;) and > use it for both sending and receiving ? > > For example: > > ======================================================================== > static SerialPort serialPort = null; > static OutputStream serialOut = null; > static InputStream serialIn = null; > > > > > // assign it to an outputStream for use > try{ > serialOut = serialPort.getOutputStream(); > System.out.println("Serial output stream has been assigned."); > }//try > catch(IOException e) > { > System.out.println("Error: Couldn't assign output stream to serial > port."); > }//catch > > > //assign it to an inputStream for use > try{ > serialIn = serialPort.getInputStream(); > System.out.println("Serial input stream has been assigned."); > }//try > catch(IOException e) > { > System.out.println("Error: Couldn't assign input stream to serial > port."); > }//catch This should be fine. In fact trying to do it another way will probably not work as you will run into lockfile issues. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun Feb 12 21:13:13 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:13:13 -0700 (MST) Subject: [Rxtx] Question about Serial I/O under Win32 In-Reply-To: <662084330@web.de> References: <662084330@web.de> Message-ID: On Sat, 11 Feb 2006 lunareclipse03 at web.de wrote: > Hello everybody, > > I have a strange problem with a piece of code I made for myself. No, > this is not really concerning rxtx, but nevertheless I post this to the > list, hoping that some of you can help me. I've written two libraries, > one for linux and one for win32. The linux port works quite well, I can > send / receive faxes and / or replay voice messages over the telephone > line using a voice modem. But the win32 port of the library causes some > trouble. If, for example, I send out a fax with a certain modem under > linux, it works well. The fax is complete when it comes out of the fax > machine. If I then use the same modem to send out a fax under win32, the > fax coming out of the fax machine gets "stuck" halfways, but the sending > modem thinks that transmission was ok and drops the connection. The > answering fax machine then gives me "error while receiving." The "upper > layer" java code MUST be right, because if I do the same thing under > linux (using the linux library), everything is alright. Now I have to > ask: Can somebody please help me out with this??!? Could it be the case > that some kind of flow control or COMMTIMEOUTS setting causes this > behaviour? I set flow control to RTS/CTS before sending out a fax. How > can I DISABLE flow control? Or what do you think? Can something else > cause this problems? Thank you all for your time and PLEASE write back > soon. > Hi Sven I'm not too willing to talk about flow control at the low level until I confirm some things with test equipment later. It is not clear if you are using rxtx or writing your own native code. So I'm not sure how to answer much of this :) If you are wondering how to change the flow control using rxtx from java, The BlackBox example from Sun flips this back and forth. SerialPort.java in rxtx 2.1 uses the following: SerialPort.java: public static final int FLOWCONTROL_NONE =0; SerialPort.java: public static final int FLOWCONTROL_RTSCTS_IN =1; SerialPort.java: public static final int FLOWCONTROL_RTSCTS_OUT =2; SerialPort.java: public static final int FLOWCONTROL_XONXOFF_IN =4; SerialPort.java: public static final int FLOWCONTROL_XONXOFF_OUT=8; So if you set flowcontrol to RTSCTS, you can set it to NONE to turn it off. If you are looking for how to do it in native code, the rxtx Source is SerialImp.c (unix/linux/mac os x/w32) and termios.c (w32 only with SerialImp.c) You can track the code: SerialImp.c:JNIEXPORT void JNICALL RXTXPort(setflowcontrol)( JNIEnv *env, jobject jobj, jint flowmode ) termios.c:int tcgetattr( int fd, struct termios *s_termios ) termios.c:int tcsetattr( int fd, int when, struct termios *s_termios ) There may be a problem in the rxtx flow control code though. Rather than guess, I want to test this with a gold standard. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Feb 6 00:00:16 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 00:00:16 -0700 (MST) Subject: [Rxtx] wiki delay until tomorrow night. In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: On Sun, 5 Feb 2006, Trent Jarvi wrote: > On Sun, 5 Feb 2006, Kim Lux wrote: > >> usb ? Tell me more... I need that too. > > usb is a very proper design. Thats all it is. > Maybe rxtx could help usb. But it would start with helping bring back the community that was already there. It's not something I'd love to do but maybe its the right thing to do. It would probably take 2 years to do right. But maybe thats better than what we have now. I honestly don't know what IBM is doing which could just run over everything. Just some thoughts after some fine german wine. -- Trent Jarvi tjarvi at qbang.org From gadelavega at yahoo.com.ar Mon Feb 6 02:17:05 2006 From: gadelavega at yahoo.com.ar (Gonzalo A. de la Vega) Date: Mon, 06 Feb 2006 10:17:05 +0100 Subject: [Rxtx] Serial port ownership question In-Reply-To: References: <20060205113618.30274.qmail@web53501.mail.yahoo.com> <1139157422.4553.9.camel@zd7280> <1139158698.4936.9.camel@zd7280> Message-ID: <43E71411.4050402@yahoo.com.ar> On my Fedora Core 4: ls -l /dev/ttyS* crw-rw---- 1 root uucp 4, 64 Feb 6 2006 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Feb 6 2006 /dev/ttyS1 ... and: grep "ttyUSB" /etc/udev/rules.d/50-udev.rules KERNEL=="ttyUSB*", GROUP="uucp", MODE="0660" So anyone in the "uucp" group can use serial ports. On Gentoo the group is "tty". Trent Jarvi escribi?: > > > On Sun, 5 Feb 2006, Dr. Douglas Lyon wrote: > >> I can confirm that this is the case (only root ownership of >> serial ports, under fedora 4). >> Wow, what were they thinking?! >> - DL >> >>> I've found that the newer kernels have the serial ports owned by root. >>> For example, >>> >>> $ls -al /dev/tty* >>> crw-rw-rw- 1 root root 5, 0 Feb 5 02:06 /dev/tty >>> crw-rw---- 1 root root 4, 0 Feb 5 02:06 /dev/tty0 >>> crw------- 1 root root 4, 1 Feb 5 09:07 /dev/tty1 >>> crw-rw---- 1 root tty 4, 10 Feb 5 02:06 /dev/tty10 >>> crw-rw---- 1 root tty 4, 11 Feb 5 02:06 /dev/tty11 >>> ... > > > This is just not a problem jcp or such are going to solve. Its a > platform spitwad fight. But do look at pam. In fact thats what Sun > is doing too. Maybe Linux followed their lead.. I'm not a pam guy. > I've spent 16 hours trying to understand it but your users wont :) > > Solution? I have no clue. Its two tangent mentalities from my > perspective. > > -- > Trent Jarvi > tjarvi at qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mtnvega at yahoo.com.br Mon Feb 6 05:35:43 2006 From: mtnvega at yahoo.com.br (Luiz Jr) Date: Mon, 6 Feb 2006 12:35:43 +0000 (GMT) Subject: [Rxtx] Documentation Wiki In-Reply-To: <1139157422.4553.9.camel@zd7280> Message-ID: <20060206123543.57256.qmail@web53515.mail.yahoo.com> Hello, Thank you for you answer, but so the usage of the API is pretty much like the Java Communications Api? If yes, what version of the Java Comm Api? Thank you, Luiz A. Brandao Jr Kim Lux escreveu: On Sun, 2006-02-05 at 08:36 -0300, Luiz Jr wrote: > Hello, > > I want to start using the RXTX libraries, but I would to know how, > since I can not access the documentation wiki page I just started using them yesterday. Below is how I installed the libraries, if that helps. I used snippets of code from the SimpleWrite application here to get me going. http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html Instead of "import javax.comm.*;", use "import gnu.io.*;" which is gotten from RXTXcomm.jar, which you will need to include in your project references. I am working in Eclipse. BTW: there is no way to open a port without going through the port list and finding it. Maybe sometime in the future someone (me ?) will write a method called openSerialPort that allows the user to give a port identifier, such as "/dev/tty1" and return a port ready to use. It wouldn't take much to write that and it would save users a lot of code. Hope this helps. ======================================================================= 1) Figure out which java you are running, incase there is more than one installed. $ java -version java version "1.5.0_05" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_05-b05) Java HotSpot(TM) Client VM (build 1.5.0_05-b05, mixed mode, sharing) 2) Find all the jre directories and the one from which you are currently running. kfind (jre) 3) cd to that directory plus /lib/i386 cd /usr/java/jre1.5.0_05/lib/i386 4) Copy the library files (*.so) to that directory. cp /home/krlux/Desktop/'Java Controls'/rxtx-linux/bin/* . 5) Check that the copy was successful ls librxtx* librxtxI2C.so librxtxRaw.so librxtxSerial.so librxtxParallel.so librxtxRS485.so 6) cd to the /lib/ext directory for your java. cd /usr/java/jre1.5.0_05/lib/ext 7) Copy the Jar files there cp /home/krlux/Desktop/'Java Controls'/rxtx-linux/lib/ext/* . 8) Check that it was successful ls RXTX* RXTXcomm.jar Rxtx is now installed on your machine ready to use. =================================================================== -- Kim Lux, Diesel Research Inc. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx --------------------------------- Yahoo! Acesso Gr?tis - Internet r?pida e gr?tis. Instale o discador agora! -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/544aa403/attachment-0035.html From lyon at docjava.com Mon Feb 6 05:49:34 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 06 Feb 2006 07:49:34 -0500 Subject: [Rxtx] wiki delay until tomorrow night. In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: Hi All, I have often thought about USB drivers being needed. For example, the ironman watch will not interface to a mac (windows only). It is USB. My dymo label writer has no Java driver (native only). Etc. Most cheap web cameras are USB (and Java drivers go through JAI, if it supports the camera at all). The JAI code shows how sun did the USB drivers. You have to be a member of the jai project to download the source code. https://jai.dev.java.net has the jai distro. And then you are not allowed to redistribute it. However, we can all learn from it (if so inclined). Basically: cvs -d :pserver:lyon at cvs.dev.java.net:/cvs login cvs -d :pserver:lyon at cvs.dev.java.net:/cvs checkout jai-core You will need to user your own uid and pw to get in. The ant build has over 100 warnings from sun deprecations of its own code. You might say that they were hoisted on their own Picard ;) One interesting thing is that they support several platforms: linux-amd64 64-bit Linux-AMD64 linux-i586 32-bit Linux-x86 solaris-amd64 64-bit Solaris-AMD64 solaris-i586 32-bit Solaris-x86 solaris-sparc 32-bit Solaris-SPARC solaris-sparcv9 64-bit Solaris-SPARC windows-i586 32-bit Windows-x86 Thus, ant is used to provide a multi-platform native method distro. Neat. How do they do it? check this out: And: The core download does not contain any C source code (it was all pre-built). Basically, they are just copying .so and .dll files into build directories. I would love to see the C code for this...but Sun does not post it on the https://jai.dev.java.net site. I don't know why...Perhaps I missed it. - Doug >On Sun, 5 Feb 2006, Trent Jarvi wrote: > >>On Sun, 5 Feb 2006, Kim Lux wrote: >> >>>usb ? Tell me more... I need that too. >> >>usb is a very proper design. Thats all it is. >> > >Maybe rxtx could help usb. But it would start with helping bring >back the community that was already there. > >It's not something I'd love to do but maybe its the right thing to do. > >It would probably take 2 years to do right. But maybe thats better >than what we have now. > >I honestly don't know what IBM is doing which could just run over everything. > >Just some thoughts after some fine german wine. > >-- >Trent Jarvi >tjarvi at qbang.org > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tdelenik at gmail.com Mon Feb 6 05:56:32 2006 From: tdelenik at gmail.com (Thanasis Delenikas) Date: Mon, 6 Feb 2006 14:56:32 +0200 Subject: Fwd: [Rxtx] Documentation Wiki In-Reply-To: <1139157422.4553.9.camel@zd7280> References: <20060205113618.30274.qmail@web53501.mail.yahoo.com> <1139157422.4553.9.camel@zd7280> Message-ID: <310a1a930602060456t129f1dc6p5f2b908f13ab5a0b@mail.gmail.com> Hello all, Kim, this is a snippet from the code I use. The closest to directly opening a specific port without enumeration. << ... portId = CommPortIdentifier.getPortIdentifier(getPort()); serialPort = (SerialPort) portId.open("jSMSEngine", 1971); ... >> where getPort() return the string identifier of the port, i.e. "/dev/ttyS0" or "COM1" or whatever. Thanasis. ---------- Forwarded message ---------- From: Kim Lux Date: Feb 5, 2006 6:37 PM Subject: Re: [Rxtx] Documentation Wiki To: RXTX Developers and Users BTW: there is no way to open a port without going through the port list and finding it. Maybe sometime in the future someone (me ?) will write a method called openSerialPort that allows the user to give a port identifier, such as "/dev/tty1" and return a port ready to use. It wouldn't take much to write that and it would save users a lot of code. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/182ab5b8/attachment-0035.html From tjarvi at qbang.org Mon Feb 6 11:53:57 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 11:53:57 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: On Mon, 6 Feb 2006, Dr. Douglas Lyon wrote: > Hi All, > I have often thought about USB drivers being needed. > For example, the ironman watch will not interface > to a mac (windows only). It is USB. > My dymo label writer has no Java driver (native only). > Etc. > Most cheap web cameras are USB (and Java drivers go > through JAI, if it supports the camera at all). > The JAI code shows how sun did the USB drivers. > You have to be a member of the jai project to download > the source code. > https://jai.dev.java.net has the jai distro. > And then you are not allowed to redistribute it. However, > we can all learn from it (if so inclined). Basically: > cvs -d :pserver:lyon at cvs.dev.java.net:/cvs login > cvs -d :pserver:lyon at cvs.dev.java.net:/cvs checkout jai-core > You will need to user your own uid and pw to get in. > The ant build has over 100 warnings from sun deprecations > of its own code. > > You might say that they were hoisted on their own Picard ;) > > One interesting thing is that they support several platforms: > linux-amd64 64-bit Linux-AMD64 > linux-i586 32-bit Linux-x86 > solaris-amd64 64-bit Solaris-AMD64 > solaris-i586 32-bit Solaris-x86 > solaris-sparc 32-bit Solaris-SPARC > solaris-sparcv9 64-bit Solaris-SPARC > windows-i586 32-bit Windows-x86 > Thus, ant is used to provide a multi-platform native method distro. > Neat. > How do they do it? > check this out: > > > > > > > > > > > > > And: > > > > > > > > > > The core download does not contain any C source code (it was all pre-built). > Basically, they are just copying .so and .dll files into build directories. > > I would love to see the C code for this...but Sun does not post it on the > https://jai.dev.java.net site. > > I don't know why...Perhaps I missed it. > > - Doug > > I've looked at moving rxtx to Ant builds. I think that would help IDEs a great deal. I requested a evalutation desk copy the O'Reilly Ant book for some j2ee material I was teaching. http://www.oreilly.com/catalog/anttdg/ It has a one sentence mention of JNI. So there was not luck there. I saw that there is another Ant book that does mention JNI more. I can't find it now. Ant must be able to support it with extensions. http://ant.apache.org/manual/OptionalTasks/javah.html What the auto(break :) tools do in the rxtx build is 4 things really. 1) gcc compile flags 2) ld compile flags 3) config.h 4) compile flags for customizing rxtx (lockfiles, ...) See 1 All of this information except 4 can be static once obtained. So I'm not attached to the auto tools. If I could find an example of Ant being used for JNI code, I'd be one of the first to start moving that direction. Maybe someone saw an example someplace. The other thing we have not completed discussing is the directory structure. There is interest in making rxtx more IDE friendly. I get more mail about that off the list than how to install rxtx. And I see we have Ken Thompson in da house :) He is our trusted CVS maintainer and the guy that purchased the rxtx.org domain. Old community. We will need Ken for changing the directory structure of source. I would like to open up discussion about both of these as it is more than time. The problem is I have little experience with Ant and even less with IDEs. It would be nice if we could work with Eclipse and NetBeans. http://www.netbeans.org/ (sun and some community) http://www.eclipes.org (ibm,rhat,... perhaps more community) http://maven.apache.org/what-is-maven.html (apache. It is community) borland should sortof be here too but I think thats covered in eclipse. >From what I understand so far, we should morph rxtx to support those three maybe trusting apaches lead with maven. But I use vi. I have little to no clues beyond what people have fed me. Can we agree that thats the right direction to go? -- Trent Jarvi tjarvi at qbang.org From brian at mbari.org Mon Feb 6 14:57:50 2006 From: brian at mbari.org (Brian Schlining) Date: Mon, 6 Feb 2006 13:57:50 -0800 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> > The other thing we have not completed discussing is the directory > structure. There is interest in making rxtx more IDE friendly. I > get more mail about that off the list than how to install rxtx. > > And I see we have Ken Thompson in da house :) He is our trusted > CVS maintainer and the guy that purchased the rxtx.org domain. Old > community. We will need Ken for changing the directory structure of > source. > > I would like to open up discussion about both of these as it is > more than time. The problem is I have little experience with Ant > and even less with IDEs. It would be nice if we could work with > Eclipse and NetBeans. > > http://www.netbeans.org/ (sun and some community) > http://www.eclipes.org (ibm,rhat,... perhaps more community) > http://maven.apache.org/what-is-maven.html (apache. It is community) > borland should sortof be here too but I think thats covered in > eclipse. > >> From what I understand so far, we should morph rxtx to support >> those three > maybe trusting apaches lead with maven. But I use vi. I have > little to no clues beyond what people have fed me. > Maven likes the directory structure below for Java code. (From http:// maven.apache.org/guides/getting-started/index.html) This structure works fine with ant, netbeans, and eclipse. rxtx_root_directory `-- src |-- main | `-- java | `-- gnu | `-- io `-- test `-- java `-- gnu `-- io Brian Schlining Software Engineer http://www.mbari.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/d9451eba/attachment-0035.html From tjarvi at qbang.org Mon Feb 6 15:11:45 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 15:11:45 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: > rxtx_root_directory > `-- src > |-- main > | `-- java > | `-- gnu > | `-- io > `-- test > `-- java > `-- gnu > `-- io > >From what I understand this will just be good. For me it makes no difference. So lets do the rxtx thing. Let if fester for two weeks and if nobody objects, we will do it. I'm not doing this because I care. I'm doing this to eliminate much of my inbox. But test... man is rxtx lacking there in the community aspect. It is covered but not right. _maybe_ I can change that this year. -- Trent Jarvi tjarvi at qbang.org (cat hurding since 1997) From lux at diesel-research.com Mon Feb 6 21:38:49 2006 From: lux at diesel-research.com (Kim Lux) Date: Mon, 06 Feb 2006 21:38:49 -0700 Subject: [Rxtx] How can I use Lock Files with rxtx (in FC4) ? Message-ID: <1139287129.17031.3.camel@zd7280> I am now running an rxtx application on FC4. I am getting: ========================================================= check_group_uucp(): error testing lock file creation Error details: Permission denied check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL ========================================================= $ ls -al /var/lock total 32 drwxrwxr-x 4 root lock 4096 Feb 6 16:04 . drwxr-xr-x 24 root root 4096 Nov 14 01:19 .. drwx------ 2 root root 4096 Apr 27 2005 lvm drwxr-xr-x 2 root root 4096 Feb 6 16:04 subsys How do I fix this for regulator users ? -- Kim Lux, Diesel Research Inc. From dmarkman at mac.com Mon Feb 6 22:24:44 2006 From: dmarkman at mac.com (Dmitry Markman) Date: Tue, 7 Feb 2006 00:24:44 -0500 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: if I understands the issue right in order to be able to use ant for c/c++ compilation you have to install ant's cc task http://ant-contrib.sourceforge.net/cc.html it looks like it should work on mac os x (authors claim, that it's platform independent) but I never tested so all you have to do it's providing right command line for the gcc compiler On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: >> rxtx_root_directory >> `-- src >> |-- main >> | `-- java >> | `-- gnu >> | `-- io >> `-- test >> `-- java >> `-- gnu >> `-- io >> > > >> From what I understand this will just be good. > > For me it makes no difference. So lets do the rxtx thing. Let if > fester for two weeks and if nobody objects, we will do it. > > I'm not doing this because I care. I'm doing this to eliminate > much of my inbox. > > But test... man is rxtx lacking there in the community aspect. It > is covered but not right. _maybe_ I can change that this year. > > -- > Trent Jarvi > tjarvi at qbang.org > (cat hurding since 1997) > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx Dmitry Markman From lux at diesel-research.com Mon Feb 6 23:20:15 2006 From: lux at diesel-research.com (Kim Lux) Date: Mon, 06 Feb 2006 23:20:15 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? Message-ID: <1139293215.3689.4.camel@zd7280> I'm running the code below. portlist.hasMoreElements() is false. /dev has ports in it as listed below. What am I doing wrong ? ========================================================== // Step through the list of ports until we find one that matches // the one we are looking for. portList = CommPortIdentifier.getPortIdentifiers(); while(portList.hasMoreElements()) { portID = (CommPortIdentifier) portList.nextElement(); // if (portID.getName().equals("/dev/ttyUSB0")) { myTA.append("Serial port ttyUSB0 has been found\n"); break; }// if portID equals... }// End of while... ========================================================== ls -al /dev/tty* crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 ... crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 -- Kim Lux, Diesel Research Inc. From david.garnier at trusted-logic.com Tue Feb 7 00:46:30 2006 From: david.garnier at trusted-logic.com (David Garnier) Date: Tue, 07 Feb 2006 08:46:30 +0100 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: <43E85056.2090608@trusted-logic.com> Hello, I think that the make-based build process is fine as it is, apart from the location of the Java source files. It is true that putting the Java source in a directory structure that map 1-to-1 to the Java package structure is the norm and should make it easier for everyone to modify the Java source, with or without an IDE. Ant is a good tool, but in the RXTX case I fail to see the advantage of using it compared to the current make-based process. As Trent said, they are more pressing issues, like testing. Regards, David Dmitry Markman wrote: > if I understands the issue right > in order to be able to use ant for c/c++ compilation > you have to install ant's cc task > http://ant-contrib.sourceforge.net/cc.html > > it looks like it should work on mac os x > (authors claim, that it's platform independent) > but I never tested > > so all you have to do it's providing right command line > for the gcc compiler > > > > > On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: > >>> rxtx_root_directory >>> `-- src >>> |-- main >>> | `-- java >>> | `-- gnu >>> | `-- io >>> `-- test >>> `-- java >>> `-- gnu >>> `-- io >>> >> >> >>> From what I understand this will just be good. >> >> For me it makes no difference. So lets do the rxtx thing. Let if >> fester for two weeks and if nobody objects, we will do it. >> >> I'm not doing this because I care. I'm doing this to eliminate much >> of my inbox. >> >> But test... man is rxtx lacking there in the community aspect. It is >> covered but not right. _maybe_ I can change that this year. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> (cat hurding since 1997) From tjarvi at qbang.org Tue Feb 7 01:11:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 01:11:31 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <43E85056.2090608@trusted-logic.com> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: On Tue, 7 Feb 2006, David Garnier wrote: > Hello, > > I think that the make-based build process is fine as it is, apart from the location of the Java > source files. It is true that putting the Java source in a directory structure that map 1-to-1 to > the Java package structure is the norm and should make it easier for everyone to modify the Java > source, with or without an IDE. > > Ant is a good tool, but in the RXTX case I fail to see the advantage of using it compared to the > current make-based process. As Trent said, they are more pressing issues, like testing. > Hi David I have more experience with testing rxtx than I can talk about. But let it be known, rxtx has gone trough 100's of hours of testing. We are hobby folks interested in toys but there is more. rxtx has had some of the best guidance in the industry there. This is not an easy thing. I may be able to come back in a month from the other side of the corperate fence and help. I suspect the tests could just be made public but they are in a very unusual environment that just wont work in a wider sense. This is something I'll be trying to change. At one point it was agreed we could just make the results public so this isnt just noise.. There is interest and I think its safe to mention that much. The big problem with testing in the past is most of it is done with a loopback connection. So we *still* have major questions regarding things like flow control. rxtx talks to itself over a loopback and it works. regardless of right or wrong. This requires more thought to be done right. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Feb 7 02:46:34 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 02:46:34 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: > The big problem with testing in the past is most of it is done with a > loopback connection. So we *still* have major questions regarding things > like flow control. rxtx talks to itself over a loopback and it works. > regardless of right or wrong. With serial communication there are gold standards. ckermit is probably a definitive 'standard.' Maybe its possible to do ping/pong tests with ckermit? Is it scriptable? There are known issues in rxtx. Probably the worst is some threading issues regarding some JREs with multiple JNI threads setting java variables. Man did I get schooled there. Just switch the c functions to returning variables and things go away. Sometimes they work fine, sometimes they blow up. Without understanding everything, somehow rhat got it right and debian (and especially gentoo) grabbed kernel patches causing all sort of harm. Its not hard to fix once you understand whats going on but nearly impossible to track with a debugger. So I have a good idea what 2.1-8 will have outside of the IDE modifications. rxtx 2.1-7 is a release for everyone to sync with. Its not even as stable as -pre17 as far as I know - I ran no test suites. I'll be chasing it too. We just had so many contributions that it was time. It seriously broke internal scheduals but thats a great thing :) The other thing I want to do in 2.1-8 is automagic baud rates. It turns out lots of shops are doing really funky baud rates for things like automobile test equipment. It is possible but it requires a fair amount of change in the native code. Is anyone looking at this? -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Feb 7 02:57:21 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 07 Feb 2006 04:57:21 -0500 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <43E85056.2090608@trusted-logic.com> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: Hi All, I agree, testing is very important. The problem I have been trying to address is related to cross-platform testing and the robust nature of the installs. Typically, I visit 3 platforms to deploy my product, windows, linux and mac. A build is performed on each platform. The idea that you can build for many platforms from one copy the source code seems attractive. This should enable synchronized deployments of identical code. The question of how to achieve this goal remains open. As Trent mentioned, this is hard. Perhaps Ant will help here (but perhaps not). Ant does seem to help with running unit tests. However, it does not help with multi-platform tests. For that you need many machines and different operating environments. Toward that end, I have created a multi-platform test that can be run from web start, located at: http://show.docjava.com:8086/book/cgij/code/jnlp/serialPort.PortTest.jnlp This is interesting because many people in the community can run the test and we can improve the test, as time permits. No, it is not a perfect solution, however, the idea does help with multi-platform tests using many machines and different operating environments. If the group has a good test for a general serial port set-ups, i would be happy to deploy it, for general evaluation using web start. And as for ANT, it is just an idea. Not all my ideas are good ones! - Doug >Hello, > >I think that the make-based build process is fine as it is, apart >from the location of the Java >source files. It is true that putting the Java source in a directory >structure that map 1-to-1 to >the Java package structure is the norm and should make it easier for >everyone to modify the Java >source, with or without an IDE. > >Ant is a good tool, but in the RXTX case I fail to see the advantage >of using it compared to the >current make-based process. As Trent said, they are more pressing >issues, like testing. > >Regards, >David > >Dmitry Markman wrote: >> if I understands the issue right >> in order to be able to use ant for c/c++ compilation >> you have to install ant's cc task >> http://ant-contrib.sourceforge.net/cc.html >> >> it looks like it should work on mac os x >> (authors claim, that it's platform independent) >> but I never tested >> >> so all you have to do it's providing right command line >> for the gcc compiler >> >> >> >> >> On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: >> >>>> rxtx_root_directory >>>> `-- src >>>> |-- main >>>> | `-- java >>>> | `-- gnu >>>> | `-- io >>>> `-- test >>>> `-- java >>>> `-- gnu >>>> `-- io >>>> >>> >>> >>>> From what I understand this will just be good. >>> >>> For me it makes no difference. So lets do the rxtx thing. Let if >>> fester for two weeks and if nobody objects, we will do it. >>> >>> I'm not doing this because I care. I'm doing this to eliminate much >>> of my inbox. >>> >>> But test... man is rxtx lacking there in the community aspect. It is >>> covered but not right. _maybe_ I can change that this year. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> (cat hurding since 1997) > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From matt.higgins at gmail.com Tue Feb 7 08:28:34 2006 From: matt.higgins at gmail.com (Matt Higgins) Date: Tue, 7 Feb 2006 10:28:34 -0500 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final Message-ID: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? import java.io.*; import java.util.*; import gnu.io.*; public class MySimpleRead implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; public static void main(String[] args) { boolean portFound = false; String defaultPort = "COM1"; if (args.length > 0) { defaultPort = args[0]; } portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; MySimpleRead reader = new MySimpleRead(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } } public MySimpleRead() { try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) { e.printStackTrace(); } try { inputStream = serialPort.getInputStream(); } catch (IOException e) { e.printStackTrace(); } try { serialPort.addEventListener(this); } catch (TooManyListenersException e) { e.printStackTrace(); } try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { e.printStackTrace(); } System.out.println("Baud is " + serialPort.getBaudRate()); System.out.println("Bits is " + serialPort.getDataBits()); System.out.println("Stop is " + serialPort.getStopBits()); System.out.println("Par is " + serialPort.getParity()); serialPort.notifyOnDataAvailable(true); readThread = new Thread(this); readThread.start(); } public void run() { // Thread.sleep(20000); //} catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { System.out.println("An event occurred " + event.getEventType()); switch (event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: byte[] readBuffer = new byte[20]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } System.out.print(new String(readBuffer)); } catch (IOException e) {} break; } } } --------------- Result on windows ------------------------------ Stable Library ============================================================== Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port:: COM1 Baud is 9600 Bits is 8 Stop is 1 Par is 0 ----------------- End Results ----------------------------------------- ------------------ Result on Linux ----------------------------------- Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 Found port: /dev/ttyS0 Baud is 9600 Bits is 8 Stop is 1 Par is 0 An event occurred 1 043100066224 ------------------ End Results --------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/a1431630/attachment-0035.html From brian at mbari.org Tue Feb 7 09:48:37 2006 From: brian at mbari.org (Brian Schlining) Date: Tue, 7 Feb 2006 08:48:37 -0800 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> Message-ID: <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> Hi Matt > The following code works fine on Linux but I never see any data > when run on Windows. This is a cut and paste from the SimpleRead > example. > I am attempting to read data from a bar code scanner. I can fire > up HyperTermianl on windows and see that the device is working > properly as I see the barcodes are scanned and echoed back to the > terminal. However when I run the app I don't see any data. It is > however associating with the com port as the informational bits > print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. Cheers Brian Schlining Software Engineer http://www.mbari.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/16d07f37/attachment-0035.html From lux at diesel-research.com Tue Feb 7 11:59:58 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 11:59:58 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139293215.3689.4.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> Message-ID: <1139338798.8145.4.camel@zd7280> Any ideas on this ? Any reason why portList.hasMoreElements() should be false even though there are devices in /dev ? On Mon, 2006-02-06 at 23:20 -0700, Kim Lux wrote: > I'm running the code below. > > portlist.hasMoreElements() is false. > > /dev has ports in it as listed below. > > What am I doing wrong ? > > > ========================================================== > // Step through the list of ports until we find one that matches > // the one we are looking for. > > portList = CommPortIdentifier.getPortIdentifiers(); > > while(portList.hasMoreElements()) > { > portID = (CommPortIdentifier) portList.nextElement(); // > if (portID.getName().equals("/dev/ttyUSB0")) > { > myTA.append("Serial port ttyUSB0 has been found\n"); > break; > }// if portID equals... > }// End of while... > ========================================================== > > ls -al /dev/tty* > crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty > crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 > crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 > crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 > crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 > ... > crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 > crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 > crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 > > > -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 12:20:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 12:20:25 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139338798.8145.4.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> Message-ID: On Tue, 7 Feb 2006, Kim Lux wrote: > > Any ideas on this ? Any reason why portList.hasMoreElements() should be > false even though there are devices in /dev ? > > > On Mon, 2006-02-06 at 23:20 -0700, Kim Lux wrote: >> I'm running the code below. >> >> portlist.hasMoreElements() is false. >> >> /dev has ports in it as listed below. >> >> What am I doing wrong ? >> >> >> ========================================================== >> // Step through the list of ports until we find one that matches >> // the one we are looking for. >> >> portList = CommPortIdentifier.getPortIdentifiers(); >> >> while(portList.hasMoreElements()) >> { >> portID = (CommPortIdentifier) portList.nextElement(); // >> if (portID.getName().equals("/dev/ttyUSB0")) >> { >> myTA.append("Serial port ttyUSB0 has been found\n"); >> break; >> }// if portID equals... >> }// End of while... >> ========================================================== >> >> ls -al /dev/tty* >> crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty >> crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 >> crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 >> crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 >> crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 >> ... >> crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 >> crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 >> crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 >> >> >> > Hi Kim What rxtx does is try to open the port and do a timed out read. If the kernel/... do not complain it's enumarted. I suspect you could do a crude test by doing something like cat /dev/ttyS0 > /dev/null If that barfs then rxtx wont enumerate the port. hmm looking at your question again, I suspect it's a lockfile problem. This is documented in INSTALL with the source. Its easy enough to test this too.. touch /var/lock/testingrxtxlockfiles && rm -f /var/lock/testingrxtxlockfiles If you are not in the right group it will bail. Root will work regardless. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 12:37:56 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 12:37:56 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> Message-ID: <1139341076.8145.11.camel@zd7280> Exactly which ports does rxtx attempt to put into the list ? /dev/* or /dev/tty* or /dev/tty[0-9[0-9] ? or /dev/ttyS* ? For the record, only /dev/ttyUSB0 is a valid port on the machine I am presently on. Will this be a problem ? On Tue, 2006-02-07 at 12:20 -0700, Trent Jarvi wrote: > This is documented in INSTALL with the source. > I was wondering where that file was. I will download source and dig it up. Thanks. -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 12:51:09 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 12:51:09 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139341076.8145.11.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: On Tue, 7 Feb 2006, Kim Lux wrote: > > Exactly which ports does rxtx attempt to put into the list ? /dev/* > or /dev/tty* or /dev/tty[0-9[0-9] ? or /dev/ttyS* ? > > For the record, only /dev/ttyUSB0 is a valid port on the machine I am > presently on. Will this be a problem ? > > > On Tue, 2006-02-07 at 12:20 -0700, Trent Jarvi wrote: >> This is documented in INSTALL with the source. >> > I was wondering where that file was. I will download source and dig it > up. > > Thanks. > Hmm I'm looking at pre17 so this may have changed. (its just what I have on this machine) if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA" // for the IPAQs }; CandidatePortPrefixes=Temp; } So you may need to add "ttyUSB" to that list. RXTX used to enumerate _everything_ see if(osName.equals("Linux-all-ports") But it became less than practical. This is all in RXTXCommDriver.java hmm I just did a cvs update. if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have to get your fingers into the code. We aim for sane defaults. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 13:06:45 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 13:06:45 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139342805.8145.22.camel@zd7280> On Tue, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > Hmm I'm looking at pre17 so this may have changed. (its just what I have > on this machine) > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA" // for the IPAQs > }; > CandidatePortPrefixes=Temp; > } > > > So you may need to add "ttyUSB" to that list. RXTX used to enumerate > _everything_ see if(osName.equals("Linux-all-ports") But it became less > than practical. > > This is all in RXTXCommDriver.java > > hmm I just did a cvs update. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have > to get your fingers into the code. We aim for sane defaults. Excellent. Thanks for taking the time. -- Kim Lux, Diesel Research Inc. From ideiglenes1 at freemail.hu Tue Feb 7 13:53:39 2006 From: ideiglenes1 at freemail.hu (--) Date: Tue, 07 Feb 2006 21:53:39 +0100 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139345619.22534.2.camel@localhost> Hi! I use this code to get all the extra Linux devices. :) if ("Linux".equals(System.getProperty("os.name"))) { System.setProperty("os.name","Linux-all-ports"); } driver = new RXTXCommDriver(); On k, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > On Tue, 7 Feb 2006, Kim Lux wrote: > > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have > to get your fingers into the code. We aim for sane defaults. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From matt.higgins at gmail.com Tue Feb 7 13:45:54 2006 From: matt.higgins at gmail.com (Matt Higgins) Date: Tue, 7 Feb 2006 15:45:54 -0500 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> Message-ID: <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> Sweet this is exactly what I needed. I was searching the archives through marc.theamisgroup they only have archives back to 1/3/05. Should have hit the mailman archive! Thanks a lot! On 2/7/06, Brian Schlining wrote: > > Hi Matt > > The following code works fine on Linux but I never see any data when run > on Windows. This is a cut and paste from the SimpleRead example. > I am attempting to read data from a bar code scanner. I can fire up > HyperTermianl on windows and see that the device is working properly as I > see the barcodes are scanned and echoed back to the terminal. However when I > run the app I don't see any data. It is however associating with the com > port as the informational bits print fine? > > > You're not the only one whose had this problem, I don't know if Trent has > addressed this is the latest release of RXTX but there is a workaround. > Here's the recent thread from the RXTX mailing list regarding this issues: > > Thanasis Delenikas tdelenik at gmail.com > Wed Jan 18 13:56:23 MST 2006 > > * Previous message: [Rxtx] Re: More close() performance fixes > * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] > > Hi all. > (I've subscribed again from my other email account). > > Trent, > > You are right. Linux *always* works, no matter what flow control you set. > Windows *works only* with hardware flow control (I haven't tested what > happens with software XON/XOFF flow control). > > I assume (but I am not certain) that even with no flow control at all, all > platforms should work. Without flow control, you have the risk of bumping > into overflow or framing errors, but that's your (the end programmer, I > mean) problem. > > >From my side, I shouldn't be working without flow control. That was a bug > too... It was some code forgotten from the old times, when I used to work > with phone emulation drivers which didn't support flow control. The > correct > way is to have some flow control enabled and that's why I suppose this is > a > low-severity bug for RxTx. > > I have no idea which platform shows the correct behaviour, since > my knowledge about Linux and the inner workings of these low-level i/o > operations is limited. > > Regards, > Thanasis Delenikas. > > > > > Message: 2 > > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > > From: Trent Jarvi > > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > > To: RXTX Developers and Users > > Message-ID: > > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > > > Hi all, > > > > > > Trent, I have found something. > > > I read your comment about flow control, so I experimented a bit. > > > > > > If you remember, in my sample program I've used no flow control at all > ( > > i.e. > > > Java constant FLOWCONTROL_NONE). > > > > > > Now, during testing, I've switch to hardware inbound flow control (i.e > . > > Java > > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > > beautifully! > > > > > > I think I will switch to H/W flow control and test things for a while, > > but > > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > > > > > Hi Thanasis, > > > > I'm fairly sure you have identified a bug. I would not worry too much > > about what Sun CommAPI w32 defaults are. I think they did more or less > > whatever the port opened with. Just a guess. Linux tries to stomp on > > ports so they are all the same. > > > > So this started out with Linux worked, Windows XP/.. did not as I > recall. > > Something is wrong in rxtx. Do I understand this right? > > > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > > > Perhaps there is something Wayne or I did not understand when we wrote > > that code. I wasnt programming back in the BBS days so modems are not > my > > thing. I have a few questions. > > > > Is the above matrix confirmed by observation? > > Linux just always worked? > > Which one _should_ work? I'm guessing modems work with hardware flow > > control. I'll have to dig around. > > > > The windows flow control changes a couple things with hardware flow > > control. Following the w32 API documentation is confusing sometimes. > > But it looks like Linux could have a bug too. > > Cheers > > Brian Schlining > Software Engineer > http://www.mbari.org > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/9c989144/attachment-0035.html From tjarvi at qbang.org Tue Feb 7 14:06:14 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 14:06:14 -0700 (MST) Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> Message-ID: >> >> You're not the only one whose had this problem, I don't know if Trent has >> addressed this is the latest release of RXTX but there is a workaround. >> Here's the recent thread from the RXTX mailing list regarding this issues: >> I have not. I expect to have access to some test equipment next month and I'll go through all of this. I really don't know whats going on and I need a gold standard. I thought maybe linux was autodetecting the flow control. Your observations would certainly be welcome. I need to talk to Russell King and see what he is doing. Until then I'd just be toying around over a loopback as usual. This is very high on the list though. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 17:25:05 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 17:25:05 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139358305.17994.2.camel@zd7280> My application now works. I installed the libraries and jar from 2.1-7 (Final). portlist.hasMoreElements is no longer false. The application finds the port for /dev/ttyUSB0. Thanks for your help, Trent (et al) Sorry I bothered you with this. Next time I will look in the source first. I didn't think it was an rxtx issue, I thought it was a Linux setup issue . On Tue, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > Hmm I'm looking at pre17 so this may have changed. (its just what I > have > on this machine) > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux > Serial Ports > "ttySA" // for the > IPAQs > }; > > CandidatePortPrefixes=Temp; > } > > > So you may need to add "ttyUSB" to that list. RXTX used to enumerate > _everything_ see if(osName.equals("Linux-all-ports") But it became > less > than practical. > > This is all in RXTXCommDriver.java > > hmm I just did a cvs update. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux > Serial Ports > "ttySA", // for the > IPAQs > "ttyUSB" // for USB > frobs > }; > > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you > have > to get your fingers into the code. We aim for sane defaults. -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 19:21:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 19:21:54 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139358305.17994.2.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> <1139358305.17994.2.camel@zd7280> Message-ID: >Sorry I bothered you with this. Next time I will look in the source >first. I didn't think it was an rxtx issue, I thought it was a Linux >setup issue . Why would you be sorry? I would have done the same. I'm glad it's working :) -- Trent Jarvi tjarvi at qbang.org From tma at mail.island.net Wed Feb 8 13:39:35 2006 From: tma at mail.island.net (Tom Alldread) Date: Wed, 08 Feb 2006 12:39:35 -0800 Subject: [Rxtx] Win32/Linux Serial Port Data Dropouts In-Reply-To: <200602060702.k167255O007882@www.qbang.org> References: <200602060702.k167255O007882@www.qbang.org> Message-ID: <43EA5707.4020200@mail.island.net> Greetings Folks at RXTX: During the last couple of months I have been alternately testing with javax.comm 2 and RXTX 2.1 under Windows XP and CommApi 3 and RXTX 2.1 under Suse 10.0 Linux. In the process I have learned a little about java multi-threading under NetBeans 5 with Profiler. My java (jdk 1.5_06) application is used for data acquisition and provides a graphical display of A-D conversion data received from a 56KBaud serial port. The actual data throughput is about 10KBaud thus it is well below the speed of the port. I use hardware RTS/CTS flow control which can stall the data acquisition sample rate if necessary. This ensures the display computer has the ability to slow the data acquisition rate should it become too busy to accept the regular data flow. Both the serial port buffer and the java read buffer are set at 16KB. Usually the data transfers into the java read buffer are less than 100 bytes unless the data acquisition is recovering from a stall. The data flow normally hesitates after each 5 KB block as a continue command is needed from the display computer to start the drawing of a new graphics display line. Separate threads have been provided for the serial port event monitoring and data processing. The serial port event thread has been given the maximum priority and data processing thread the minimum priority provided by java. Thread yield statements have been placed within all data processing while/for loops as an effort to ensure quick access to CPU cycles for the serial port event thread. I have found that short data transmissions are essentially error free but occasional dropouts occur with continuous data flow especially under Windows XP. ....................................................................................................................................................................................... Linux results: I am happy to report that RXTX 2.1 appears to work very well under Linux although I did notice some errors when the screen savers were running with my dual monitors. I believe this is a local problem associated with my dual graphics which needs further attention. The recent CommApi 3 Linux release from Sun did not work at all with my program. It seemed to send commands out OK but did not receive any data. Although the serial port event triggered the ISR, the input stream appeared filled with nulls and thus did not contain any data. As my understanding is that CommApi 3 was tested with a Red Hat distribution of Linux I wonder if this problem is distro dependent? Although somewhat off topic here I wonder if anyone reading this has had similar experience? .................................................................................................................................................................................. Windows XP results: There are problems with occasional data dropouts which become more frequent as the sampling rate is increased or if the computer becomes busy with other duties. The dropouts typically consist of a half dozen byte block of lost data. It appears the lost bytes never get added to the java input stream. There has not been any indication of garbled data, overruns or framing errors which suggests the UART communications remains solid. Using javax.comm 2 I found that the setting of SerialPort 'enableReceiveThreshold' to 40 and 'enableReceiveTimeout' of 100mS reduced the dropouts error rate significantly. I found that I could not get RXTX 2.1 to function with the aforementioned threshold and timeout settings. The javax.comm 2 interface is consequently performing better for me under Windows than RXTX 2.1. I wonder if anyone here has any suggestions as to what I might try to improve RXTX 2.1? Although my settings are the same as under Suse 10.0, RXTX 2.1 performs much better for me under Linux than any of the alternatives that I have tried under Windows XP . ............................................................................................................................................................................... I would like to establish, based on the experience of others, if I have reached the normally expected performance limit of java serial port communications? Should I expect to achieve virtually error free serial port data input from a continuous stream under Windows XP java software? I am considering changing my protocol to packets with error checking if necessary but would like to know if the dropout problems I am experiencing are typical or not before I take this rather work intensive plunge. Many thanks in advance for any help! Best Regards, Tom Alldread -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.375 / Virus Database: 267.15.2/253 - Release Date: 2006-02-07 From jlaxson at mac.com Wed Feb 8 23:56:48 2006 From: jlaxson at mac.com (John Laxson) Date: Thu, 9 Feb 2006 00:56:48 -0600 Subject: [Rxtx] PortInUseException: Unknown Application on OSX Message-ID: Hi, I've been trying to get RXTX 2.1.7 going on Mac OS X for a while here, and am running up into a wall here. I've tried with pre- compiled and the source version and get the same problem, a gnu.io.PortInUseException: Unknown Application. I have run the fixperms script included with the source distribution, and id shows me as a member of the uucp group, and permissions on /var/spool/uucp are 775 root:uucp. Running a test program (included at the bottom for clarity) lets me enumerate all the serial ports correctly, but trying to open any of them gives the PortInUseException. If it helps, when I try to open a port that's set to make an outgoing bluetooth connection, there is no delay and no connection attempt at all. Thanks, John Laxson PS: The documentation wiki on qbang.org shows 404, and has for a few days now. My test code: public static void main(String[] args) { SerialPort serialPort; try { Enumeration e = CommPortIdentifier.getPortIdentifiers(); CommPortIdentifier ident; while (e.hasMoreElements()) { ident = (CommPortIdentifier)e.nextElement(); System.out.println(ident.getName()); } ident = CommPortIdentifier.getPortIdentifier("/dev/cu.modem"); serialPort = (SerialPort) ident.open("Me", 5000); } catch (Exception e) { e.printStackTrace(); } } From rajesh.invincible at gmail.com Thu Feb 9 03:39:38 2006 From: rajesh.invincible at gmail.com (Rajesh N) Date: Thu, 9 Feb 2006 16:09:38 +0530 Subject: [Rxtx] Re: Move .java Files in gnu.io filesystem hierarchy - Maven (2) In-Reply-To: <43DF21D2.7090200@ngi.it> References: <43DF21D2.7090200@ngi.it> Message-ID: <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Can anybody tell me how to overcome these EXCEPTIONS I AM WORKING ON SERIAL COMMN IN JAVA ON LINUX. 1. " NOT ALL PARAMETERS SUPPORTED BY THE KERNEL" This i came across the following statement inmy prog. SerialP is A SerialPort object SerialP.setSerialPortParams(9600(BAUDRATE),DATABITS_8,STOPBITS_1,PARITY_NONE) 2. NullPointer Exception at Event Dispatch Now i have checked all my object references for a null reference but i found none i have put up my entire code in try catch blocks but still I AM UNABLE TO CATCH THIS EXCEPTION AND HENCE MY APPLICATION CLOSES HOW DOES THESE GO? PLEASE HELP ME IT IS URGENTTTTTTTTTTTTTTTT yours sincerely RAJESH On 1/31/06, Fabio Frumento wrote: > Hi Xavier, > > I don't know maven at all but the directory hierarchy listed buy Trent > is fine for me... > > I'll take a look to maven, it seems an interesting project > > Regards > > Fabio Frumento > > Trent Jarvi wrote: > > On Tue, 31 Jan 2006, Xavier Frisaye wrote: > > > >> Hi all, > >> > >> If you are going to rearrange the src folder, i will propose to use > >> maven 2 and follow its directory structure > >> > (http://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html). > >> > >> Maven 2 simplify java project and give a standard way to make projects > >> (http://maven.apache.org/). > >> We are using it for internal projects and we are very satisfied. > >> > >> Is anybody interested? > >> > >> I'm not an expert in maven 2 (yet) but i'm agree to help using it if > >> you choose to make so. > >> > > > > so this would be: > > > > rxtx-devel/src/main/java/gnu.io > > rxtx-devel/src/test/java/ManIwish.java > > > > I don't use IDEs very much so I'll let others comment. But I don't see > > a problem with that. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Thu Feb 9 09:50:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 9 Feb 2006 09:50:31 -0700 (MST) Subject: [Rxtx] Re: Move .java Files in gnu.io filesystem hierarchy - Maven (2) In-Reply-To: <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Message-ID: On Thu, 9 Feb 2006, Rajesh N wrote: > Can anybody tell me how to overcome these EXCEPTIONS > I AM WORKING ON SERIAL COMMN IN JAVA ON LINUX. > > 1. " NOT ALL PARAMETERS SUPPORTED BY THE KERNEL" > > This i came across the following statement inmy prog. > SerialP is A SerialPort object > SerialP.setSerialPortParams(9600(BAUDRATE),DATABITS_8,STOPBITS_1,PARITY_NONE) > Strange. The parameters you use are the same the port should open with by default. Could you paste the actual exception you are getting? I don't see that in the rxtx source. Also it would help to know the rxtx version. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Fri Feb 10 15:29:05 2006 From: lux at diesel-research.com (Kim Lux) Date: Fri, 10 Feb 2006 15:29:05 -0700 Subject: [Rxtx] One serial port object for both sending and receiving ? Message-ID: <1139610545.18177.4.camel@zd7280> Is it OK to use one SerialPort ojbect (ex Serial Port serialPort;) and use it for both sending and receiving ? For example: ======================================================================== static SerialPort serialPort = null; static OutputStream serialOut = null; static InputStream serialIn = null; // assign it to an outputStream for use try{ serialOut = serialPort.getOutputStream(); System.out.println("Serial output stream has been assigned."); }//try catch(IOException e) { System.out.println("Error: Couldn't assign output stream to serial port."); }//catch //assign it to an inputStream for use try{ serialIn = serialPort.getInputStream(); System.out.println("Serial input stream has been assigned."); }//try catch(IOException e) { System.out.println("Error: Couldn't assign input stream to serial port."); }//catch ======================================================================== -- Kim Lux, Diesel Research Inc. From lux at diesel-research.com Fri Feb 10 21:23:00 2006 From: lux at diesel-research.com (Kim Lux) Date: Fri, 10 Feb 2006 21:23:00 -0700 Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Message-ID: <1139631780.23882.10.camel@zd7280> I've got a problem receiving chars with my version of serialRead, written in an SWT GUI. I had a Java pro have a good look at my code and he can't see anything wrong with it. I can send chars fine. When I receive a char the cpu usage for the app goes to 100% and the code in the serial event handler doesn't get executed. The instructions on the Java Comm Serial API How-To for Linux page state that I must install javacomm. Is that true ? Everything builds without it and I can send chars on rxtx just fine, but I can't receive them. Could this be the problem ? I downloaded and installed javacomm. I was not able to add "Driver=gnuio.RXTXCommDriver to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 installed in /usr/java/jre1.5.0_05. I added comm.jar to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext to the library paths. Is this OK ? Does it matter that I am receiving on /dev/ttyUSB0 ? Thanks. -- Kim Lux, Diesel Research Inc. From lunareclipse03 at web.de Sat Feb 11 09:44:46 2006 From: lunareclipse03 at web.de (lunareclipse03@web.de) Date: Sat, 11 Feb 2006 17:44:46 +0100 Subject: [Rxtx] Question about Serial I/O under Win32 Message-ID: <662084330@web.de> Hello everybody, I have a strange problem with a piece of code I made for myself. No, this is not really concerning rxtx, but nevertheless I post this to the list, hoping that some of you can help me. I've written two libraries, one for linux and one for win32. The linux port works quite well, I can send / receive faxes and / or replay voice messages over the telephone line using a voice modem. But the win32 port of the library causes some trouble. If, for example, I send out a fax with a certain modem under linux, it works well. The fax is complete when it comes out of the fax machine. If I then use the same modem to send out a fax under win32, the fax coming out of the fax machine gets "stuck" halfways, but the sending modem thinks that transmission was ok and drops the connection. The answering fax machine then gives me "error while receiving." The "upper layer" java code MUST be right, because if I do the same thing under linux (using the linux library), everything is alright. Now I have to ask: Can somebody please help me out with this??!? Could it be the case that some kind of flow control or COMMTIMEOUTS setting causes this behaviour? I set flow control to RTS/CTS before sending out a fax. How can I DISABLE flow control? Or what do you think? Can something else cause this problems? Thank you all for your time and PLEASE write back soon. Regards, --Sven Ahlemann Am Waldrand 31 45721 Haltern am See Germany ______________________________________________________________ Verschicken Sie romantische, coole und witzige Bilder per SMS! Jetzt bei WEB.DE FreeMail: http://f.web.de/?mc=021193 From lux at diesel-research.com Sat Feb 11 10:06:52 2006 From: lux at diesel-research.com (Kim Lux) Date: Sat, 11 Feb 2006 10:06:52 -0700 Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: <1139631780.23882.10.camel@zd7280> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> <1139631780.23882.10.camel@zd7280> Message-ID: <1139677612.3431.5.camel@zd7280> More on this problem. I copied and pasted simpleRead into a console based Eclipse project and I've got the same result, except that cpu usage doesn't go to 100%. I'm beginning to think there is an issue in rxtx. My imports for simpleRead are: ============================ import gnu.io.*; import java.util.*; //import javax.comm.*; import java.io.*; =========================== Any ideas ? I am trying to read from /dev/ttyUSB0 using a serial to USB adapter which has worked well with minicom and gtkterm. Thanks. On Fri, 2006-02-10 at 21:23 -0700, Kim Lux wrote: > I've got a problem receiving chars with my version of serialRead, > written in an SWT GUI. > > I had a Java pro have a good look at my code and he can't see anything > wrong with it. > > I can send chars fine. When I receive a char the cpu usage for the app > goes to 100% and the code in the serial event handler doesn't get > executed. > > The instructions on the Java Comm Serial API How-To for Linux page state > that I must install javacomm. Is that true ? Everything builds without > it and I can send chars on rxtx just fine, but I can't receive them. > Could this be the problem ? > > I downloaded and installed javacomm. I was not able to add > "Driver=gnuio.RXTXCommDriver > to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not > have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 > installed in /usr/java/jre1.5.0_05. I added comm.jar > to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext > to the library paths. Is this OK ? > > Does it matter that I am receiving on /dev/ttyUSB0 ? > > Thanks. > -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Sun Feb 12 21:01:33 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:01:33 -0700 (MST) Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: <1139677612.3431.5.camel@zd7280> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> <1139631780.23882.10.camel@zd7280> <1139677612.3431.5.camel@zd7280> Message-ID: I suspect what is happening is the select() is breaking out in the native code but the driver does not have support for notifying there are X bytes available. On some traditional Unix based systems, the only way you know data is available is the fd status changes and do an FIORDCHK ioctl. Or perhaps the only thing you can know is the fd status changed. It would take reading through the kernel driver code to know for sure. So on USB, depending upon the driver, the same may need to be done or the driver improved a bit if possible to support. Polling reads will also work but don't use the event driven model of CommAPI which isnt acceptable in the long run. The 100% cpu usage can then be explained because select no longer blocks until the data is read; the eventLoop spins loose. You can put a well placed sleep but rxtx only expects those are needed when it knows data is available. This may not be a super simple thing to understand and fix. I do have ideas to get you started. I'm going to be short on time the next couple weeks. I expect to put some good time in and answer some other questions I saw around the 25th. For now, I'd look at the following and go from there with the hints I've given. JNIEXPORT jint JNICALL RXTXPort(nativeavailable)( JNIEnv *env, jobject jobj ) { int fd = get_java_var( env, jobj,"fd","I" ); int result; /* char message[80]; ENTER( "RXTXPort:nativeavailable" ); On SCO OpenServer FIONREAD always fails for serial devices, so try ioctl FIORDCHK instead; will only tell us whether bytes are available, not how many, but better than nothing. This turns out to be true on Solaris also. taj. */ #ifdef FIORDCHK /* __unixware__ __sun__ probably others */ result = ioctl(fd, FIORDCHK, 0); #else if( ioctl( fd, FIONREAD, &result ) < 0 ) { goto fail; } #endif /* FIORDCHK */ On Sat, 11 Feb 2006, Kim Lux wrote: > > More on this problem. I copied and pasted simpleRead into a console > based Eclipse project and I've got the same result, except that cpu > usage doesn't go to 100%. I'm beginning to think there is an issue in > rxtx. > > My imports for simpleRead are: > > ============================ > import gnu.io.*; > import java.util.*; > //import javax.comm.*; > import java.io.*; > =========================== > > Any ideas ? I am trying to read from /dev/ttyUSB0 using a serial to > USB adapter which has worked well with minicom and gtkterm. > > Thanks. > > > > On Fri, 2006-02-10 at 21:23 -0700, Kim Lux wrote: >> I've got a problem receiving chars with my version of serialRead, >> written in an SWT GUI. >> >> I had a Java pro have a good look at my code and he can't see anything >> wrong with it. >> >> I can send chars fine. When I receive a char the cpu usage for the app >> goes to 100% and the code in the serial event handler doesn't get >> executed. >> >> The instructions on the Java Comm Serial API How-To for Linux page state >> that I must install javacomm. Is that true ? Everything builds without >> it and I can send chars on rxtx just fine, but I can't receive them. >> Could this be the problem ? >> >> I downloaded and installed javacomm. I was not able to add >> "Driver=gnuio.RXTXCommDriver >> to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not >> have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 >> installed in /usr/java/jre1.5.0_05. I added comm.jar >> to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext >> to the library paths. Is this OK ? >> >> Does it matter that I am receiving on /dev/ttyUSB0 ? >> >> Thanks. >> > From tjarvi at qbang.org Sun Feb 12 21:03:30 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:03:30 -0700 (MST) Subject: [Rxtx] One serial port object for both sending and receiving ? In-Reply-To: <1139610545.18177.4.camel@zd7280> References: <1139610545.18177.4.camel@zd7280> Message-ID: On Fri, 10 Feb 2006, Kim Lux wrote: > > Is it OK to use one SerialPort ojbect (ex Serial Port serialPort;) and > use it for both sending and receiving ? > > For example: > > ======================================================================== > static SerialPort serialPort = null; > static OutputStream serialOut = null; > static InputStream serialIn = null; > > > > > // assign it to an outputStream for use > try{ > serialOut = serialPort.getOutputStream(); > System.out.println("Serial output stream has been assigned."); > }//try > catch(IOException e) > { > System.out.println("Error: Couldn't assign output stream to serial > port."); > }//catch > > > //assign it to an inputStream for use > try{ > serialIn = serialPort.getInputStream(); > System.out.println("Serial input stream has been assigned."); > }//try > catch(IOException e) > { > System.out.println("Error: Couldn't assign input stream to serial > port."); > }//catch This should be fine. In fact trying to do it another way will probably not work as you will run into lockfile issues. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun Feb 12 21:13:13 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:13:13 -0700 (MST) Subject: [Rxtx] Question about Serial I/O under Win32 In-Reply-To: <662084330@web.de> References: <662084330@web.de> Message-ID: On Sat, 11 Feb 2006 lunareclipse03 at web.de wrote: > Hello everybody, > > I have a strange problem with a piece of code I made for myself. No, > this is not really concerning rxtx, but nevertheless I post this to the > list, hoping that some of you can help me. I've written two libraries, > one for linux and one for win32. The linux port works quite well, I can > send / receive faxes and / or replay voice messages over the telephone > line using a voice modem. But the win32 port of the library causes some > trouble. If, for example, I send out a fax with a certain modem under > linux, it works well. The fax is complete when it comes out of the fax > machine. If I then use the same modem to send out a fax under win32, the > fax coming out of the fax machine gets "stuck" halfways, but the sending > modem thinks that transmission was ok and drops the connection. The > answering fax machine then gives me "error while receiving." The "upper > layer" java code MUST be right, because if I do the same thing under > linux (using the linux library), everything is alright. Now I have to > ask: Can somebody please help me out with this??!? Could it be the case > that some kind of flow control or COMMTIMEOUTS setting causes this > behaviour? I set flow control to RTS/CTS before sending out a fax. How > can I DISABLE flow control? Or what do you think? Can something else > cause this problems? Thank you all for your time and PLEASE write back > soon. > Hi Sven I'm not too willing to talk about flow control at the low level until I confirm some things with test equipment later. It is not clear if you are using rxtx or writing your own native code. So I'm not sure how to answer much of this :) If you are wondering how to change the flow control using rxtx from java, The BlackBox example from Sun flips this back and forth. SerialPort.java in rxtx 2.1 uses the following: SerialPort.java: public static final int FLOWCONTROL_NONE =0; SerialPort.java: public static final int FLOWCONTROL_RTSCTS_IN =1; SerialPort.java: public static final int FLOWCONTROL_RTSCTS_OUT =2; SerialPort.java: public static final int FLOWCONTROL_XONXOFF_IN =4; SerialPort.java: public static final int FLOWCONTROL_XONXOFF_OUT=8; So if you set flowcontrol to RTSCTS, you can set it to NONE to turn it off. If you are looking for how to do it in native code, the rxtx Source is SerialImp.c (unix/linux/mac os x/w32) and termios.c (w32 only with SerialImp.c) You can track the code: SerialImp.c:JNIEXPORT void JNICALL RXTXPort(setflowcontrol)( JNIEnv *env, jobject jobj, jint flowmode ) termios.c:int tcgetattr( int fd, struct termios *s_termios ) termios.c:int tcsetattr( int fd, int when, struct termios *s_termios ) There may be a problem in the rxtx flow control code though. Rather than guess, I want to test this with a gold standard. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Feb 6 00:00:16 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 00:00:16 -0700 (MST) Subject: [Rxtx] wiki delay until tomorrow night. In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: On Sun, 5 Feb 2006, Trent Jarvi wrote: > On Sun, 5 Feb 2006, Kim Lux wrote: > >> usb ? Tell me more... I need that too. > > usb is a very proper design. Thats all it is. > Maybe rxtx could help usb. But it would start with helping bring back the community that was already there. It's not something I'd love to do but maybe its the right thing to do. It would probably take 2 years to do right. But maybe thats better than what we have now. I honestly don't know what IBM is doing which could just run over everything. Just some thoughts after some fine german wine. -- Trent Jarvi tjarvi at qbang.org From gadelavega at yahoo.com.ar Mon Feb 6 02:17:05 2006 From: gadelavega at yahoo.com.ar (Gonzalo A. de la Vega) Date: Mon, 06 Feb 2006 10:17:05 +0100 Subject: [Rxtx] Serial port ownership question In-Reply-To: References: <20060205113618.30274.qmail@web53501.mail.yahoo.com> <1139157422.4553.9.camel@zd7280> <1139158698.4936.9.camel@zd7280> Message-ID: <43E71411.4050402@yahoo.com.ar> On my Fedora Core 4: ls -l /dev/ttyS* crw-rw---- 1 root uucp 4, 64 Feb 6 2006 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Feb 6 2006 /dev/ttyS1 ... and: grep "ttyUSB" /etc/udev/rules.d/50-udev.rules KERNEL=="ttyUSB*", GROUP="uucp", MODE="0660" So anyone in the "uucp" group can use serial ports. On Gentoo the group is "tty". Trent Jarvi escribi?: > > > On Sun, 5 Feb 2006, Dr. Douglas Lyon wrote: > >> I can confirm that this is the case (only root ownership of >> serial ports, under fedora 4). >> Wow, what were they thinking?! >> - DL >> >>> I've found that the newer kernels have the serial ports owned by root. >>> For example, >>> >>> $ls -al /dev/tty* >>> crw-rw-rw- 1 root root 5, 0 Feb 5 02:06 /dev/tty >>> crw-rw---- 1 root root 4, 0 Feb 5 02:06 /dev/tty0 >>> crw------- 1 root root 4, 1 Feb 5 09:07 /dev/tty1 >>> crw-rw---- 1 root tty 4, 10 Feb 5 02:06 /dev/tty10 >>> crw-rw---- 1 root tty 4, 11 Feb 5 02:06 /dev/tty11 >>> ... > > > This is just not a problem jcp or such are going to solve. Its a > platform spitwad fight. But do look at pam. In fact thats what Sun > is doing too. Maybe Linux followed their lead.. I'm not a pam guy. > I've spent 16 hours trying to understand it but your users wont :) > > Solution? I have no clue. Its two tangent mentalities from my > perspective. > > -- > Trent Jarvi > tjarvi at qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mtnvega at yahoo.com.br Mon Feb 6 05:35:43 2006 From: mtnvega at yahoo.com.br (Luiz Jr) Date: Mon, 6 Feb 2006 12:35:43 +0000 (GMT) Subject: [Rxtx] Documentation Wiki In-Reply-To: <1139157422.4553.9.camel@zd7280> Message-ID: <20060206123543.57256.qmail@web53515.mail.yahoo.com> Hello, Thank you for you answer, but so the usage of the API is pretty much like the Java Communications Api? If yes, what version of the Java Comm Api? Thank you, Luiz A. Brandao Jr Kim Lux escreveu: On Sun, 2006-02-05 at 08:36 -0300, Luiz Jr wrote: > Hello, > > I want to start using the RXTX libraries, but I would to know how, > since I can not access the documentation wiki page I just started using them yesterday. Below is how I installed the libraries, if that helps. I used snippets of code from the SimpleWrite application here to get me going. http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html Instead of "import javax.comm.*;", use "import gnu.io.*;" which is gotten from RXTXcomm.jar, which you will need to include in your project references. I am working in Eclipse. BTW: there is no way to open a port without going through the port list and finding it. Maybe sometime in the future someone (me ?) will write a method called openSerialPort that allows the user to give a port identifier, such as "/dev/tty1" and return a port ready to use. It wouldn't take much to write that and it would save users a lot of code. Hope this helps. ======================================================================= 1) Figure out which java you are running, incase there is more than one installed. $ java -version java version "1.5.0_05" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_05-b05) Java HotSpot(TM) Client VM (build 1.5.0_05-b05, mixed mode, sharing) 2) Find all the jre directories and the one from which you are currently running. kfind (jre) 3) cd to that directory plus /lib/i386 cd /usr/java/jre1.5.0_05/lib/i386 4) Copy the library files (*.so) to that directory. cp /home/krlux/Desktop/'Java Controls'/rxtx-linux/bin/* . 5) Check that the copy was successful ls librxtx* librxtxI2C.so librxtxRaw.so librxtxSerial.so librxtxParallel.so librxtxRS485.so 6) cd to the /lib/ext directory for your java. cd /usr/java/jre1.5.0_05/lib/ext 7) Copy the Jar files there cp /home/krlux/Desktop/'Java Controls'/rxtx-linux/lib/ext/* . 8) Check that it was successful ls RXTX* RXTXcomm.jar Rxtx is now installed on your machine ready to use. =================================================================== -- Kim Lux, Diesel Research Inc. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx --------------------------------- Yahoo! Acesso Gr?tis - Internet r?pida e gr?tis. Instale o discador agora! -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/544aa403/attachment-0036.html From lyon at docjava.com Mon Feb 6 05:49:34 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 06 Feb 2006 07:49:34 -0500 Subject: [Rxtx] wiki delay until tomorrow night. In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: Hi All, I have often thought about USB drivers being needed. For example, the ironman watch will not interface to a mac (windows only). It is USB. My dymo label writer has no Java driver (native only). Etc. Most cheap web cameras are USB (and Java drivers go through JAI, if it supports the camera at all). The JAI code shows how sun did the USB drivers. You have to be a member of the jai project to download the source code. https://jai.dev.java.net has the jai distro. And then you are not allowed to redistribute it. However, we can all learn from it (if so inclined). Basically: cvs -d :pserver:lyon at cvs.dev.java.net:/cvs login cvs -d :pserver:lyon at cvs.dev.java.net:/cvs checkout jai-core You will need to user your own uid and pw to get in. The ant build has over 100 warnings from sun deprecations of its own code. You might say that they were hoisted on their own Picard ;) One interesting thing is that they support several platforms: linux-amd64 64-bit Linux-AMD64 linux-i586 32-bit Linux-x86 solaris-amd64 64-bit Solaris-AMD64 solaris-i586 32-bit Solaris-x86 solaris-sparc 32-bit Solaris-SPARC solaris-sparcv9 64-bit Solaris-SPARC windows-i586 32-bit Windows-x86 Thus, ant is used to provide a multi-platform native method distro. Neat. How do they do it? check this out: And: The core download does not contain any C source code (it was all pre-built). Basically, they are just copying .so and .dll files into build directories. I would love to see the C code for this...but Sun does not post it on the https://jai.dev.java.net site. I don't know why...Perhaps I missed it. - Doug >On Sun, 5 Feb 2006, Trent Jarvi wrote: > >>On Sun, 5 Feb 2006, Kim Lux wrote: >> >>>usb ? Tell me more... I need that too. >> >>usb is a very proper design. Thats all it is. >> > >Maybe rxtx could help usb. But it would start with helping bring >back the community that was already there. > >It's not something I'd love to do but maybe its the right thing to do. > >It would probably take 2 years to do right. But maybe thats better >than what we have now. > >I honestly don't know what IBM is doing which could just run over everything. > >Just some thoughts after some fine german wine. > >-- >Trent Jarvi >tjarvi at qbang.org > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tdelenik at gmail.com Mon Feb 6 05:56:32 2006 From: tdelenik at gmail.com (Thanasis Delenikas) Date: Mon, 6 Feb 2006 14:56:32 +0200 Subject: Fwd: [Rxtx] Documentation Wiki In-Reply-To: <1139157422.4553.9.camel@zd7280> References: <20060205113618.30274.qmail@web53501.mail.yahoo.com> <1139157422.4553.9.camel@zd7280> Message-ID: <310a1a930602060456t129f1dc6p5f2b908f13ab5a0b@mail.gmail.com> Hello all, Kim, this is a snippet from the code I use. The closest to directly opening a specific port without enumeration. << ... portId = CommPortIdentifier.getPortIdentifier(getPort()); serialPort = (SerialPort) portId.open("jSMSEngine", 1971); ... >> where getPort() return the string identifier of the port, i.e. "/dev/ttyS0" or "COM1" or whatever. Thanasis. ---------- Forwarded message ---------- From: Kim Lux Date: Feb 5, 2006 6:37 PM Subject: Re: [Rxtx] Documentation Wiki To: RXTX Developers and Users BTW: there is no way to open a port without going through the port list and finding it. Maybe sometime in the future someone (me ?) will write a method called openSerialPort that allows the user to give a port identifier, such as "/dev/tty1" and return a port ready to use. It wouldn't take much to write that and it would save users a lot of code. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/182ab5b8/attachment-0036.html From tjarvi at qbang.org Mon Feb 6 11:53:57 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 11:53:57 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: On Mon, 6 Feb 2006, Dr. Douglas Lyon wrote: > Hi All, > I have often thought about USB drivers being needed. > For example, the ironman watch will not interface > to a mac (windows only). It is USB. > My dymo label writer has no Java driver (native only). > Etc. > Most cheap web cameras are USB (and Java drivers go > through JAI, if it supports the camera at all). > The JAI code shows how sun did the USB drivers. > You have to be a member of the jai project to download > the source code. > https://jai.dev.java.net has the jai distro. > And then you are not allowed to redistribute it. However, > we can all learn from it (if so inclined). Basically: > cvs -d :pserver:lyon at cvs.dev.java.net:/cvs login > cvs -d :pserver:lyon at cvs.dev.java.net:/cvs checkout jai-core > You will need to user your own uid and pw to get in. > The ant build has over 100 warnings from sun deprecations > of its own code. > > You might say that they were hoisted on their own Picard ;) > > One interesting thing is that they support several platforms: > linux-amd64 64-bit Linux-AMD64 > linux-i586 32-bit Linux-x86 > solaris-amd64 64-bit Solaris-AMD64 > solaris-i586 32-bit Solaris-x86 > solaris-sparc 32-bit Solaris-SPARC > solaris-sparcv9 64-bit Solaris-SPARC > windows-i586 32-bit Windows-x86 > Thus, ant is used to provide a multi-platform native method distro. > Neat. > How do they do it? > check this out: > > > > > > > > > > > > > And: > > > > > > > > > > The core download does not contain any C source code (it was all pre-built). > Basically, they are just copying .so and .dll files into build directories. > > I would love to see the C code for this...but Sun does not post it on the > https://jai.dev.java.net site. > > I don't know why...Perhaps I missed it. > > - Doug > > I've looked at moving rxtx to Ant builds. I think that would help IDEs a great deal. I requested a evalutation desk copy the O'Reilly Ant book for some j2ee material I was teaching. http://www.oreilly.com/catalog/anttdg/ It has a one sentence mention of JNI. So there was not luck there. I saw that there is another Ant book that does mention JNI more. I can't find it now. Ant must be able to support it with extensions. http://ant.apache.org/manual/OptionalTasks/javah.html What the auto(break :) tools do in the rxtx build is 4 things really. 1) gcc compile flags 2) ld compile flags 3) config.h 4) compile flags for customizing rxtx (lockfiles, ...) See 1 All of this information except 4 can be static once obtained. So I'm not attached to the auto tools. If I could find an example of Ant being used for JNI code, I'd be one of the first to start moving that direction. Maybe someone saw an example someplace. The other thing we have not completed discussing is the directory structure. There is interest in making rxtx more IDE friendly. I get more mail about that off the list than how to install rxtx. And I see we have Ken Thompson in da house :) He is our trusted CVS maintainer and the guy that purchased the rxtx.org domain. Old community. We will need Ken for changing the directory structure of source. I would like to open up discussion about both of these as it is more than time. The problem is I have little experience with Ant and even less with IDEs. It would be nice if we could work with Eclipse and NetBeans. http://www.netbeans.org/ (sun and some community) http://www.eclipes.org (ibm,rhat,... perhaps more community) http://maven.apache.org/what-is-maven.html (apache. It is community) borland should sortof be here too but I think thats covered in eclipse. >From what I understand so far, we should morph rxtx to support those three maybe trusting apaches lead with maven. But I use vi. I have little to no clues beyond what people have fed me. Can we agree that thats the right direction to go? -- Trent Jarvi tjarvi at qbang.org From brian at mbari.org Mon Feb 6 14:57:50 2006 From: brian at mbari.org (Brian Schlining) Date: Mon, 6 Feb 2006 13:57:50 -0800 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> > The other thing we have not completed discussing is the directory > structure. There is interest in making rxtx more IDE friendly. I > get more mail about that off the list than how to install rxtx. > > And I see we have Ken Thompson in da house :) He is our trusted > CVS maintainer and the guy that purchased the rxtx.org domain. Old > community. We will need Ken for changing the directory structure of > source. > > I would like to open up discussion about both of these as it is > more than time. The problem is I have little experience with Ant > and even less with IDEs. It would be nice if we could work with > Eclipse and NetBeans. > > http://www.netbeans.org/ (sun and some community) > http://www.eclipes.org (ibm,rhat,... perhaps more community) > http://maven.apache.org/what-is-maven.html (apache. It is community) > borland should sortof be here too but I think thats covered in > eclipse. > >> From what I understand so far, we should morph rxtx to support >> those three > maybe trusting apaches lead with maven. But I use vi. I have > little to no clues beyond what people have fed me. > Maven likes the directory structure below for Java code. (From http:// maven.apache.org/guides/getting-started/index.html) This structure works fine with ant, netbeans, and eclipse. rxtx_root_directory `-- src |-- main | `-- java | `-- gnu | `-- io `-- test `-- java `-- gnu `-- io Brian Schlining Software Engineer http://www.mbari.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/d9451eba/attachment-0036.html From tjarvi at qbang.org Mon Feb 6 15:11:45 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 15:11:45 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: > rxtx_root_directory > `-- src > |-- main > | `-- java > | `-- gnu > | `-- io > `-- test > `-- java > `-- gnu > `-- io > >From what I understand this will just be good. For me it makes no difference. So lets do the rxtx thing. Let if fester for two weeks and if nobody objects, we will do it. I'm not doing this because I care. I'm doing this to eliminate much of my inbox. But test... man is rxtx lacking there in the community aspect. It is covered but not right. _maybe_ I can change that this year. -- Trent Jarvi tjarvi at qbang.org (cat hurding since 1997) From lux at diesel-research.com Mon Feb 6 21:38:49 2006 From: lux at diesel-research.com (Kim Lux) Date: Mon, 06 Feb 2006 21:38:49 -0700 Subject: [Rxtx] How can I use Lock Files with rxtx (in FC4) ? Message-ID: <1139287129.17031.3.camel@zd7280> I am now running an rxtx application on FC4. I am getting: ========================================================= check_group_uucp(): error testing lock file creation Error details: Permission denied check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL ========================================================= $ ls -al /var/lock total 32 drwxrwxr-x 4 root lock 4096 Feb 6 16:04 . drwxr-xr-x 24 root root 4096 Nov 14 01:19 .. drwx------ 2 root root 4096 Apr 27 2005 lvm drwxr-xr-x 2 root root 4096 Feb 6 16:04 subsys How do I fix this for regulator users ? -- Kim Lux, Diesel Research Inc. From dmarkman at mac.com Mon Feb 6 22:24:44 2006 From: dmarkman at mac.com (Dmitry Markman) Date: Tue, 7 Feb 2006 00:24:44 -0500 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: if I understands the issue right in order to be able to use ant for c/c++ compilation you have to install ant's cc task http://ant-contrib.sourceforge.net/cc.html it looks like it should work on mac os x (authors claim, that it's platform independent) but I never tested so all you have to do it's providing right command line for the gcc compiler On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: >> rxtx_root_directory >> `-- src >> |-- main >> | `-- java >> | `-- gnu >> | `-- io >> `-- test >> `-- java >> `-- gnu >> `-- io >> > > >> From what I understand this will just be good. > > For me it makes no difference. So lets do the rxtx thing. Let if > fester for two weeks and if nobody objects, we will do it. > > I'm not doing this because I care. I'm doing this to eliminate > much of my inbox. > > But test... man is rxtx lacking there in the community aspect. It > is covered but not right. _maybe_ I can change that this year. > > -- > Trent Jarvi > tjarvi at qbang.org > (cat hurding since 1997) > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx Dmitry Markman From lux at diesel-research.com Mon Feb 6 23:20:15 2006 From: lux at diesel-research.com (Kim Lux) Date: Mon, 06 Feb 2006 23:20:15 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? Message-ID: <1139293215.3689.4.camel@zd7280> I'm running the code below. portlist.hasMoreElements() is false. /dev has ports in it as listed below. What am I doing wrong ? ========================================================== // Step through the list of ports until we find one that matches // the one we are looking for. portList = CommPortIdentifier.getPortIdentifiers(); while(portList.hasMoreElements()) { portID = (CommPortIdentifier) portList.nextElement(); // if (portID.getName().equals("/dev/ttyUSB0")) { myTA.append("Serial port ttyUSB0 has been found\n"); break; }// if portID equals... }// End of while... ========================================================== ls -al /dev/tty* crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 ... crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 -- Kim Lux, Diesel Research Inc. From david.garnier at trusted-logic.com Tue Feb 7 00:46:30 2006 From: david.garnier at trusted-logic.com (David Garnier) Date: Tue, 07 Feb 2006 08:46:30 +0100 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: <43E85056.2090608@trusted-logic.com> Hello, I think that the make-based build process is fine as it is, apart from the location of the Java source files. It is true that putting the Java source in a directory structure that map 1-to-1 to the Java package structure is the norm and should make it easier for everyone to modify the Java source, with or without an IDE. Ant is a good tool, but in the RXTX case I fail to see the advantage of using it compared to the current make-based process. As Trent said, they are more pressing issues, like testing. Regards, David Dmitry Markman wrote: > if I understands the issue right > in order to be able to use ant for c/c++ compilation > you have to install ant's cc task > http://ant-contrib.sourceforge.net/cc.html > > it looks like it should work on mac os x > (authors claim, that it's platform independent) > but I never tested > > so all you have to do it's providing right command line > for the gcc compiler > > > > > On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: > >>> rxtx_root_directory >>> `-- src >>> |-- main >>> | `-- java >>> | `-- gnu >>> | `-- io >>> `-- test >>> `-- java >>> `-- gnu >>> `-- io >>> >> >> >>> From what I understand this will just be good. >> >> For me it makes no difference. So lets do the rxtx thing. Let if >> fester for two weeks and if nobody objects, we will do it. >> >> I'm not doing this because I care. I'm doing this to eliminate much >> of my inbox. >> >> But test... man is rxtx lacking there in the community aspect. It is >> covered but not right. _maybe_ I can change that this year. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> (cat hurding since 1997) From tjarvi at qbang.org Tue Feb 7 01:11:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 01:11:31 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <43E85056.2090608@trusted-logic.com> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: On Tue, 7 Feb 2006, David Garnier wrote: > Hello, > > I think that the make-based build process is fine as it is, apart from the location of the Java > source files. It is true that putting the Java source in a directory structure that map 1-to-1 to > the Java package structure is the norm and should make it easier for everyone to modify the Java > source, with or without an IDE. > > Ant is a good tool, but in the RXTX case I fail to see the advantage of using it compared to the > current make-based process. As Trent said, they are more pressing issues, like testing. > Hi David I have more experience with testing rxtx than I can talk about. But let it be known, rxtx has gone trough 100's of hours of testing. We are hobby folks interested in toys but there is more. rxtx has had some of the best guidance in the industry there. This is not an easy thing. I may be able to come back in a month from the other side of the corperate fence and help. I suspect the tests could just be made public but they are in a very unusual environment that just wont work in a wider sense. This is something I'll be trying to change. At one point it was agreed we could just make the results public so this isnt just noise.. There is interest and I think its safe to mention that much. The big problem with testing in the past is most of it is done with a loopback connection. So we *still* have major questions regarding things like flow control. rxtx talks to itself over a loopback and it works. regardless of right or wrong. This requires more thought to be done right. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Feb 7 02:46:34 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 02:46:34 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: > The big problem with testing in the past is most of it is done with a > loopback connection. So we *still* have major questions regarding things > like flow control. rxtx talks to itself over a loopback and it works. > regardless of right or wrong. With serial communication there are gold standards. ckermit is probably a definitive 'standard.' Maybe its possible to do ping/pong tests with ckermit? Is it scriptable? There are known issues in rxtx. Probably the worst is some threading issues regarding some JREs with multiple JNI threads setting java variables. Man did I get schooled there. Just switch the c functions to returning variables and things go away. Sometimes they work fine, sometimes they blow up. Without understanding everything, somehow rhat got it right and debian (and especially gentoo) grabbed kernel patches causing all sort of harm. Its not hard to fix once you understand whats going on but nearly impossible to track with a debugger. So I have a good idea what 2.1-8 will have outside of the IDE modifications. rxtx 2.1-7 is a release for everyone to sync with. Its not even as stable as -pre17 as far as I know - I ran no test suites. I'll be chasing it too. We just had so many contributions that it was time. It seriously broke internal scheduals but thats a great thing :) The other thing I want to do in 2.1-8 is automagic baud rates. It turns out lots of shops are doing really funky baud rates for things like automobile test equipment. It is possible but it requires a fair amount of change in the native code. Is anyone looking at this? -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Feb 7 02:57:21 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 07 Feb 2006 04:57:21 -0500 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <43E85056.2090608@trusted-logic.com> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: Hi All, I agree, testing is very important. The problem I have been trying to address is related to cross-platform testing and the robust nature of the installs. Typically, I visit 3 platforms to deploy my product, windows, linux and mac. A build is performed on each platform. The idea that you can build for many platforms from one copy the source code seems attractive. This should enable synchronized deployments of identical code. The question of how to achieve this goal remains open. As Trent mentioned, this is hard. Perhaps Ant will help here (but perhaps not). Ant does seem to help with running unit tests. However, it does not help with multi-platform tests. For that you need many machines and different operating environments. Toward that end, I have created a multi-platform test that can be run from web start, located at: http://show.docjava.com:8086/book/cgij/code/jnlp/serialPort.PortTest.jnlp This is interesting because many people in the community can run the test and we can improve the test, as time permits. No, it is not a perfect solution, however, the idea does help with multi-platform tests using many machines and different operating environments. If the group has a good test for a general serial port set-ups, i would be happy to deploy it, for general evaluation using web start. And as for ANT, it is just an idea. Not all my ideas are good ones! - Doug >Hello, > >I think that the make-based build process is fine as it is, apart >from the location of the Java >source files. It is true that putting the Java source in a directory >structure that map 1-to-1 to >the Java package structure is the norm and should make it easier for >everyone to modify the Java >source, with or without an IDE. > >Ant is a good tool, but in the RXTX case I fail to see the advantage >of using it compared to the >current make-based process. As Trent said, they are more pressing >issues, like testing. > >Regards, >David > >Dmitry Markman wrote: >> if I understands the issue right >> in order to be able to use ant for c/c++ compilation >> you have to install ant's cc task >> http://ant-contrib.sourceforge.net/cc.html >> >> it looks like it should work on mac os x >> (authors claim, that it's platform independent) >> but I never tested >> >> so all you have to do it's providing right command line >> for the gcc compiler >> >> >> >> >> On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: >> >>>> rxtx_root_directory >>>> `-- src >>>> |-- main >>>> | `-- java >>>> | `-- gnu >>>> | `-- io >>>> `-- test >>>> `-- java >>>> `-- gnu >>>> `-- io >>>> >>> >>> >>>> From what I understand this will just be good. >>> >>> For me it makes no difference. So lets do the rxtx thing. Let if >>> fester for two weeks and if nobody objects, we will do it. >>> >>> I'm not doing this because I care. I'm doing this to eliminate much >>> of my inbox. >>> >>> But test... man is rxtx lacking there in the community aspect. It is >>> covered but not right. _maybe_ I can change that this year. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> (cat hurding since 1997) > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From matt.higgins at gmail.com Tue Feb 7 08:28:34 2006 From: matt.higgins at gmail.com (Matt Higgins) Date: Tue, 7 Feb 2006 10:28:34 -0500 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final Message-ID: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? import java.io.*; import java.util.*; import gnu.io.*; public class MySimpleRead implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; public static void main(String[] args) { boolean portFound = false; String defaultPort = "COM1"; if (args.length > 0) { defaultPort = args[0]; } portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; MySimpleRead reader = new MySimpleRead(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } } public MySimpleRead() { try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) { e.printStackTrace(); } try { inputStream = serialPort.getInputStream(); } catch (IOException e) { e.printStackTrace(); } try { serialPort.addEventListener(this); } catch (TooManyListenersException e) { e.printStackTrace(); } try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { e.printStackTrace(); } System.out.println("Baud is " + serialPort.getBaudRate()); System.out.println("Bits is " + serialPort.getDataBits()); System.out.println("Stop is " + serialPort.getStopBits()); System.out.println("Par is " + serialPort.getParity()); serialPort.notifyOnDataAvailable(true); readThread = new Thread(this); readThread.start(); } public void run() { // Thread.sleep(20000); //} catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { System.out.println("An event occurred " + event.getEventType()); switch (event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: byte[] readBuffer = new byte[20]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } System.out.print(new String(readBuffer)); } catch (IOException e) {} break; } } } --------------- Result on windows ------------------------------ Stable Library ============================================================== Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port:: COM1 Baud is 9600 Bits is 8 Stop is 1 Par is 0 ----------------- End Results ----------------------------------------- ------------------ Result on Linux ----------------------------------- Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 Found port: /dev/ttyS0 Baud is 9600 Bits is 8 Stop is 1 Par is 0 An event occurred 1 043100066224 ------------------ End Results --------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/a1431630/attachment-0036.html From brian at mbari.org Tue Feb 7 09:48:37 2006 From: brian at mbari.org (Brian Schlining) Date: Tue, 7 Feb 2006 08:48:37 -0800 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> Message-ID: <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> Hi Matt > The following code works fine on Linux but I never see any data > when run on Windows. This is a cut and paste from the SimpleRead > example. > I am attempting to read data from a bar code scanner. I can fire > up HyperTermianl on windows and see that the device is working > properly as I see the barcodes are scanned and echoed back to the > terminal. However when I run the app I don't see any data. It is > however associating with the com port as the informational bits > print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. Cheers Brian Schlining Software Engineer http://www.mbari.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/16d07f37/attachment-0036.html From lux at diesel-research.com Tue Feb 7 11:59:58 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 11:59:58 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139293215.3689.4.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> Message-ID: <1139338798.8145.4.camel@zd7280> Any ideas on this ? Any reason why portList.hasMoreElements() should be false even though there are devices in /dev ? On Mon, 2006-02-06 at 23:20 -0700, Kim Lux wrote: > I'm running the code below. > > portlist.hasMoreElements() is false. > > /dev has ports in it as listed below. > > What am I doing wrong ? > > > ========================================================== > // Step through the list of ports until we find one that matches > // the one we are looking for. > > portList = CommPortIdentifier.getPortIdentifiers(); > > while(portList.hasMoreElements()) > { > portID = (CommPortIdentifier) portList.nextElement(); // > if (portID.getName().equals("/dev/ttyUSB0")) > { > myTA.append("Serial port ttyUSB0 has been found\n"); > break; > }// if portID equals... > }// End of while... > ========================================================== > > ls -al /dev/tty* > crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty > crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 > crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 > crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 > crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 > ... > crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 > crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 > crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 > > > -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 12:20:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 12:20:25 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139338798.8145.4.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> Message-ID: On Tue, 7 Feb 2006, Kim Lux wrote: > > Any ideas on this ? Any reason why portList.hasMoreElements() should be > false even though there are devices in /dev ? > > > On Mon, 2006-02-06 at 23:20 -0700, Kim Lux wrote: >> I'm running the code below. >> >> portlist.hasMoreElements() is false. >> >> /dev has ports in it as listed below. >> >> What am I doing wrong ? >> >> >> ========================================================== >> // Step through the list of ports until we find one that matches >> // the one we are looking for. >> >> portList = CommPortIdentifier.getPortIdentifiers(); >> >> while(portList.hasMoreElements()) >> { >> portID = (CommPortIdentifier) portList.nextElement(); // >> if (portID.getName().equals("/dev/ttyUSB0")) >> { >> myTA.append("Serial port ttyUSB0 has been found\n"); >> break; >> }// if portID equals... >> }// End of while... >> ========================================================== >> >> ls -al /dev/tty* >> crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty >> crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 >> crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 >> crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 >> crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 >> ... >> crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 >> crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 >> crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 >> >> >> > Hi Kim What rxtx does is try to open the port and do a timed out read. If the kernel/... do not complain it's enumarted. I suspect you could do a crude test by doing something like cat /dev/ttyS0 > /dev/null If that barfs then rxtx wont enumerate the port. hmm looking at your question again, I suspect it's a lockfile problem. This is documented in INSTALL with the source. Its easy enough to test this too.. touch /var/lock/testingrxtxlockfiles && rm -f /var/lock/testingrxtxlockfiles If you are not in the right group it will bail. Root will work regardless. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 12:37:56 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 12:37:56 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> Message-ID: <1139341076.8145.11.camel@zd7280> Exactly which ports does rxtx attempt to put into the list ? /dev/* or /dev/tty* or /dev/tty[0-9[0-9] ? or /dev/ttyS* ? For the record, only /dev/ttyUSB0 is a valid port on the machine I am presently on. Will this be a problem ? On Tue, 2006-02-07 at 12:20 -0700, Trent Jarvi wrote: > This is documented in INSTALL with the source. > I was wondering where that file was. I will download source and dig it up. Thanks. -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 12:51:09 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 12:51:09 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139341076.8145.11.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: On Tue, 7 Feb 2006, Kim Lux wrote: > > Exactly which ports does rxtx attempt to put into the list ? /dev/* > or /dev/tty* or /dev/tty[0-9[0-9] ? or /dev/ttyS* ? > > For the record, only /dev/ttyUSB0 is a valid port on the machine I am > presently on. Will this be a problem ? > > > On Tue, 2006-02-07 at 12:20 -0700, Trent Jarvi wrote: >> This is documented in INSTALL with the source. >> > I was wondering where that file was. I will download source and dig it > up. > > Thanks. > Hmm I'm looking at pre17 so this may have changed. (its just what I have on this machine) if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA" // for the IPAQs }; CandidatePortPrefixes=Temp; } So you may need to add "ttyUSB" to that list. RXTX used to enumerate _everything_ see if(osName.equals("Linux-all-ports") But it became less than practical. This is all in RXTXCommDriver.java hmm I just did a cvs update. if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have to get your fingers into the code. We aim for sane defaults. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 13:06:45 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 13:06:45 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139342805.8145.22.camel@zd7280> On Tue, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > Hmm I'm looking at pre17 so this may have changed. (its just what I have > on this machine) > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA" // for the IPAQs > }; > CandidatePortPrefixes=Temp; > } > > > So you may need to add "ttyUSB" to that list. RXTX used to enumerate > _everything_ see if(osName.equals("Linux-all-ports") But it became less > than practical. > > This is all in RXTXCommDriver.java > > hmm I just did a cvs update. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have > to get your fingers into the code. We aim for sane defaults. Excellent. Thanks for taking the time. -- Kim Lux, Diesel Research Inc. From ideiglenes1 at freemail.hu Tue Feb 7 13:53:39 2006 From: ideiglenes1 at freemail.hu (--) Date: Tue, 07 Feb 2006 21:53:39 +0100 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139345619.22534.2.camel@localhost> Hi! I use this code to get all the extra Linux devices. :) if ("Linux".equals(System.getProperty("os.name"))) { System.setProperty("os.name","Linux-all-ports"); } driver = new RXTXCommDriver(); On k, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > On Tue, 7 Feb 2006, Kim Lux wrote: > > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have > to get your fingers into the code. We aim for sane defaults. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From matt.higgins at gmail.com Tue Feb 7 13:45:54 2006 From: matt.higgins at gmail.com (Matt Higgins) Date: Tue, 7 Feb 2006 15:45:54 -0500 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> Message-ID: <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> Sweet this is exactly what I needed. I was searching the archives through marc.theamisgroup they only have archives back to 1/3/05. Should have hit the mailman archive! Thanks a lot! On 2/7/06, Brian Schlining wrote: > > Hi Matt > > The following code works fine on Linux but I never see any data when run > on Windows. This is a cut and paste from the SimpleRead example. > I am attempting to read data from a bar code scanner. I can fire up > HyperTermianl on windows and see that the device is working properly as I > see the barcodes are scanned and echoed back to the terminal. However when I > run the app I don't see any data. It is however associating with the com > port as the informational bits print fine? > > > You're not the only one whose had this problem, I don't know if Trent has > addressed this is the latest release of RXTX but there is a workaround. > Here's the recent thread from the RXTX mailing list regarding this issues: > > Thanasis Delenikas tdelenik at gmail.com > Wed Jan 18 13:56:23 MST 2006 > > * Previous message: [Rxtx] Re: More close() performance fixes > * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] > > Hi all. > (I've subscribed again from my other email account). > > Trent, > > You are right. Linux *always* works, no matter what flow control you set. > Windows *works only* with hardware flow control (I haven't tested what > happens with software XON/XOFF flow control). > > I assume (but I am not certain) that even with no flow control at all, all > platforms should work. Without flow control, you have the risk of bumping > into overflow or framing errors, but that's your (the end programmer, I > mean) problem. > > >From my side, I shouldn't be working without flow control. That was a bug > too... It was some code forgotten from the old times, when I used to work > with phone emulation drivers which didn't support flow control. The > correct > way is to have some flow control enabled and that's why I suppose this is > a > low-severity bug for RxTx. > > I have no idea which platform shows the correct behaviour, since > my knowledge about Linux and the inner workings of these low-level i/o > operations is limited. > > Regards, > Thanasis Delenikas. > > > > > Message: 2 > > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > > From: Trent Jarvi > > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > > To: RXTX Developers and Users > > Message-ID: > > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > > > Hi all, > > > > > > Trent, I have found something. > > > I read your comment about flow control, so I experimented a bit. > > > > > > If you remember, in my sample program I've used no flow control at all > ( > > i.e. > > > Java constant FLOWCONTROL_NONE). > > > > > > Now, during testing, I've switch to hardware inbound flow control (i.e > . > > Java > > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > > beautifully! > > > > > > I think I will switch to H/W flow control and test things for a while, > > but > > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > > > > > Hi Thanasis, > > > > I'm fairly sure you have identified a bug. I would not worry too much > > about what Sun CommAPI w32 defaults are. I think they did more or less > > whatever the port opened with. Just a guess. Linux tries to stomp on > > ports so they are all the same. > > > > So this started out with Linux worked, Windows XP/.. did not as I > recall. > > Something is wrong in rxtx. Do I understand this right? > > > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > > > Perhaps there is something Wayne or I did not understand when we wrote > > that code. I wasnt programming back in the BBS days so modems are not > my > > thing. I have a few questions. > > > > Is the above matrix confirmed by observation? > > Linux just always worked? > > Which one _should_ work? I'm guessing modems work with hardware flow > > control. I'll have to dig around. > > > > The windows flow control changes a couple things with hardware flow > > control. Following the w32 API documentation is confusing sometimes. > > But it looks like Linux could have a bug too. > > Cheers > > Brian Schlining > Software Engineer > http://www.mbari.org > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/9c989144/attachment-0036.html From tjarvi at qbang.org Tue Feb 7 14:06:14 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 14:06:14 -0700 (MST) Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> Message-ID: >> >> You're not the only one whose had this problem, I don't know if Trent has >> addressed this is the latest release of RXTX but there is a workaround. >> Here's the recent thread from the RXTX mailing list regarding this issues: >> I have not. I expect to have access to some test equipment next month and I'll go through all of this. I really don't know whats going on and I need a gold standard. I thought maybe linux was autodetecting the flow control. Your observations would certainly be welcome. I need to talk to Russell King and see what he is doing. Until then I'd just be toying around over a loopback as usual. This is very high on the list though. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 17:25:05 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 17:25:05 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139358305.17994.2.camel@zd7280> My application now works. I installed the libraries and jar from 2.1-7 (Final). portlist.hasMoreElements is no longer false. The application finds the port for /dev/ttyUSB0. Thanks for your help, Trent (et al) Sorry I bothered you with this. Next time I will look in the source first. I didn't think it was an rxtx issue, I thought it was a Linux setup issue . On Tue, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > Hmm I'm looking at pre17 so this may have changed. (its just what I > have > on this machine) > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux > Serial Ports > "ttySA" // for the > IPAQs > }; > > CandidatePortPrefixes=Temp; > } > > > So you may need to add "ttyUSB" to that list. RXTX used to enumerate > _everything_ see if(osName.equals("Linux-all-ports") But it became > less > than practical. > > This is all in RXTXCommDriver.java > > hmm I just did a cvs update. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux > Serial Ports > "ttySA", // for the > IPAQs > "ttyUSB" // for USB > frobs > }; > > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you > have > to get your fingers into the code. We aim for sane defaults. -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 19:21:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 19:21:54 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139358305.17994.2.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> <1139358305.17994.2.camel@zd7280> Message-ID: >Sorry I bothered you with this. Next time I will look in the source >first. I didn't think it was an rxtx issue, I thought it was a Linux >setup issue . Why would you be sorry? I would have done the same. I'm glad it's working :) -- Trent Jarvi tjarvi at qbang.org From tma at mail.island.net Wed Feb 8 13:39:35 2006 From: tma at mail.island.net (Tom Alldread) Date: Wed, 08 Feb 2006 12:39:35 -0800 Subject: [Rxtx] Win32/Linux Serial Port Data Dropouts In-Reply-To: <200602060702.k167255O007882@www.qbang.org> References: <200602060702.k167255O007882@www.qbang.org> Message-ID: <43EA5707.4020200@mail.island.net> Greetings Folks at RXTX: During the last couple of months I have been alternately testing with javax.comm 2 and RXTX 2.1 under Windows XP and CommApi 3 and RXTX 2.1 under Suse 10.0 Linux. In the process I have learned a little about java multi-threading under NetBeans 5 with Profiler. My java (jdk 1.5_06) application is used for data acquisition and provides a graphical display of A-D conversion data received from a 56KBaud serial port. The actual data throughput is about 10KBaud thus it is well below the speed of the port. I use hardware RTS/CTS flow control which can stall the data acquisition sample rate if necessary. This ensures the display computer has the ability to slow the data acquisition rate should it become too busy to accept the regular data flow. Both the serial port buffer and the java read buffer are set at 16KB. Usually the data transfers into the java read buffer are less than 100 bytes unless the data acquisition is recovering from a stall. The data flow normally hesitates after each 5 KB block as a continue command is needed from the display computer to start the drawing of a new graphics display line. Separate threads have been provided for the serial port event monitoring and data processing. The serial port event thread has been given the maximum priority and data processing thread the minimum priority provided by java. Thread yield statements have been placed within all data processing while/for loops as an effort to ensure quick access to CPU cycles for the serial port event thread. I have found that short data transmissions are essentially error free but occasional dropouts occur with continuous data flow especially under Windows XP. ....................................................................................................................................................................................... Linux results: I am happy to report that RXTX 2.1 appears to work very well under Linux although I did notice some errors when the screen savers were running with my dual monitors. I believe this is a local problem associated with my dual graphics which needs further attention. The recent CommApi 3 Linux release from Sun did not work at all with my program. It seemed to send commands out OK but did not receive any data. Although the serial port event triggered the ISR, the input stream appeared filled with nulls and thus did not contain any data. As my understanding is that CommApi 3 was tested with a Red Hat distribution of Linux I wonder if this problem is distro dependent? Although somewhat off topic here I wonder if anyone reading this has had similar experience? .................................................................................................................................................................................. Windows XP results: There are problems with occasional data dropouts which become more frequent as the sampling rate is increased or if the computer becomes busy with other duties. The dropouts typically consist of a half dozen byte block of lost data. It appears the lost bytes never get added to the java input stream. There has not been any indication of garbled data, overruns or framing errors which suggests the UART communications remains solid. Using javax.comm 2 I found that the setting of SerialPort 'enableReceiveThreshold' to 40 and 'enableReceiveTimeout' of 100mS reduced the dropouts error rate significantly. I found that I could not get RXTX 2.1 to function with the aforementioned threshold and timeout settings. The javax.comm 2 interface is consequently performing better for me under Windows than RXTX 2.1. I wonder if anyone here has any suggestions as to what I might try to improve RXTX 2.1? Although my settings are the same as under Suse 10.0, RXTX 2.1 performs much better for me under Linux than any of the alternatives that I have tried under Windows XP . ............................................................................................................................................................................... I would like to establish, based on the experience of others, if I have reached the normally expected performance limit of java serial port communications? Should I expect to achieve virtually error free serial port data input from a continuous stream under Windows XP java software? I am considering changing my protocol to packets with error checking if necessary but would like to know if the dropout problems I am experiencing are typical or not before I take this rather work intensive plunge. Many thanks in advance for any help! Best Regards, Tom Alldread -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.375 / Virus Database: 267.15.2/253 - Release Date: 2006-02-07 From jlaxson at mac.com Wed Feb 8 23:56:48 2006 From: jlaxson at mac.com (John Laxson) Date: Thu, 9 Feb 2006 00:56:48 -0600 Subject: [Rxtx] PortInUseException: Unknown Application on OSX Message-ID: Hi, I've been trying to get RXTX 2.1.7 going on Mac OS X for a while here, and am running up into a wall here. I've tried with pre- compiled and the source version and get the same problem, a gnu.io.PortInUseException: Unknown Application. I have run the fixperms script included with the source distribution, and id shows me as a member of the uucp group, and permissions on /var/spool/uucp are 775 root:uucp. Running a test program (included at the bottom for clarity) lets me enumerate all the serial ports correctly, but trying to open any of them gives the PortInUseException. If it helps, when I try to open a port that's set to make an outgoing bluetooth connection, there is no delay and no connection attempt at all. Thanks, John Laxson PS: The documentation wiki on qbang.org shows 404, and has for a few days now. My test code: public static void main(String[] args) { SerialPort serialPort; try { Enumeration e = CommPortIdentifier.getPortIdentifiers(); CommPortIdentifier ident; while (e.hasMoreElements()) { ident = (CommPortIdentifier)e.nextElement(); System.out.println(ident.getName()); } ident = CommPortIdentifier.getPortIdentifier("/dev/cu.modem"); serialPort = (SerialPort) ident.open("Me", 5000); } catch (Exception e) { e.printStackTrace(); } } From rajesh.invincible at gmail.com Thu Feb 9 03:39:38 2006 From: rajesh.invincible at gmail.com (Rajesh N) Date: Thu, 9 Feb 2006 16:09:38 +0530 Subject: [Rxtx] Re: Move .java Files in gnu.io filesystem hierarchy - Maven (2) In-Reply-To: <43DF21D2.7090200@ngi.it> References: <43DF21D2.7090200@ngi.it> Message-ID: <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Can anybody tell me how to overcome these EXCEPTIONS I AM WORKING ON SERIAL COMMN IN JAVA ON LINUX. 1. " NOT ALL PARAMETERS SUPPORTED BY THE KERNEL" This i came across the following statement inmy prog. SerialP is A SerialPort object SerialP.setSerialPortParams(9600(BAUDRATE),DATABITS_8,STOPBITS_1,PARITY_NONE) 2. NullPointer Exception at Event Dispatch Now i have checked all my object references for a null reference but i found none i have put up my entire code in try catch blocks but still I AM UNABLE TO CATCH THIS EXCEPTION AND HENCE MY APPLICATION CLOSES HOW DOES THESE GO? PLEASE HELP ME IT IS URGENTTTTTTTTTTTTTTTT yours sincerely RAJESH On 1/31/06, Fabio Frumento wrote: > Hi Xavier, > > I don't know maven at all but the directory hierarchy listed buy Trent > is fine for me... > > I'll take a look to maven, it seems an interesting project > > Regards > > Fabio Frumento > > Trent Jarvi wrote: > > On Tue, 31 Jan 2006, Xavier Frisaye wrote: > > > >> Hi all, > >> > >> If you are going to rearrange the src folder, i will propose to use > >> maven 2 and follow its directory structure > >> > (http://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html). > >> > >> Maven 2 simplify java project and give a standard way to make projects > >> (http://maven.apache.org/). > >> We are using it for internal projects and we are very satisfied. > >> > >> Is anybody interested? > >> > >> I'm not an expert in maven 2 (yet) but i'm agree to help using it if > >> you choose to make so. > >> > > > > so this would be: > > > > rxtx-devel/src/main/java/gnu.io > > rxtx-devel/src/test/java/ManIwish.java > > > > I don't use IDEs very much so I'll let others comment. But I don't see > > a problem with that. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Thu Feb 9 09:50:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 9 Feb 2006 09:50:31 -0700 (MST) Subject: [Rxtx] Re: Move .java Files in gnu.io filesystem hierarchy - Maven (2) In-Reply-To: <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Message-ID: On Thu, 9 Feb 2006, Rajesh N wrote: > Can anybody tell me how to overcome these EXCEPTIONS > I AM WORKING ON SERIAL COMMN IN JAVA ON LINUX. > > 1. " NOT ALL PARAMETERS SUPPORTED BY THE KERNEL" > > This i came across the following statement inmy prog. > SerialP is A SerialPort object > SerialP.setSerialPortParams(9600(BAUDRATE),DATABITS_8,STOPBITS_1,PARITY_NONE) > Strange. The parameters you use are the same the port should open with by default. Could you paste the actual exception you are getting? I don't see that in the rxtx source. Also it would help to know the rxtx version. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Fri Feb 10 15:29:05 2006 From: lux at diesel-research.com (Kim Lux) Date: Fri, 10 Feb 2006 15:29:05 -0700 Subject: [Rxtx] One serial port object for both sending and receiving ? Message-ID: <1139610545.18177.4.camel@zd7280> Is it OK to use one SerialPort ojbect (ex Serial Port serialPort;) and use it for both sending and receiving ? For example: ======================================================================== static SerialPort serialPort = null; static OutputStream serialOut = null; static InputStream serialIn = null; // assign it to an outputStream for use try{ serialOut = serialPort.getOutputStream(); System.out.println("Serial output stream has been assigned."); }//try catch(IOException e) { System.out.println("Error: Couldn't assign output stream to serial port."); }//catch //assign it to an inputStream for use try{ serialIn = serialPort.getInputStream(); System.out.println("Serial input stream has been assigned."); }//try catch(IOException e) { System.out.println("Error: Couldn't assign input stream to serial port."); }//catch ======================================================================== -- Kim Lux, Diesel Research Inc. From lux at diesel-research.com Fri Feb 10 21:23:00 2006 From: lux at diesel-research.com (Kim Lux) Date: Fri, 10 Feb 2006 21:23:00 -0700 Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Message-ID: <1139631780.23882.10.camel@zd7280> I've got a problem receiving chars with my version of serialRead, written in an SWT GUI. I had a Java pro have a good look at my code and he can't see anything wrong with it. I can send chars fine. When I receive a char the cpu usage for the app goes to 100% and the code in the serial event handler doesn't get executed. The instructions on the Java Comm Serial API How-To for Linux page state that I must install javacomm. Is that true ? Everything builds without it and I can send chars on rxtx just fine, but I can't receive them. Could this be the problem ? I downloaded and installed javacomm. I was not able to add "Driver=gnuio.RXTXCommDriver to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 installed in /usr/java/jre1.5.0_05. I added comm.jar to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext to the library paths. Is this OK ? Does it matter that I am receiving on /dev/ttyUSB0 ? Thanks. -- Kim Lux, Diesel Research Inc. From lunareclipse03 at web.de Sat Feb 11 09:44:46 2006 From: lunareclipse03 at web.de (lunareclipse03@web.de) Date: Sat, 11 Feb 2006 17:44:46 +0100 Subject: [Rxtx] Question about Serial I/O under Win32 Message-ID: <662084330@web.de> Hello everybody, I have a strange problem with a piece of code I made for myself. No, this is not really concerning rxtx, but nevertheless I post this to the list, hoping that some of you can help me. I've written two libraries, one for linux and one for win32. The linux port works quite well, I can send / receive faxes and / or replay voice messages over the telephone line using a voice modem. But the win32 port of the library causes some trouble. If, for example, I send out a fax with a certain modem under linux, it works well. The fax is complete when it comes out of the fax machine. If I then use the same modem to send out a fax under win32, the fax coming out of the fax machine gets "stuck" halfways, but the sending modem thinks that transmission was ok and drops the connection. The answering fax machine then gives me "error while receiving." The "upper layer" java code MUST be right, because if I do the same thing under linux (using the linux library), everything is alright. Now I have to ask: Can somebody please help me out with this??!? Could it be the case that some kind of flow control or COMMTIMEOUTS setting causes this behaviour? I set flow control to RTS/CTS before sending out a fax. How can I DISABLE flow control? Or what do you think? Can something else cause this problems? Thank you all for your time and PLEASE write back soon. Regards, --Sven Ahlemann Am Waldrand 31 45721 Haltern am See Germany ______________________________________________________________ Verschicken Sie romantische, coole und witzige Bilder per SMS! Jetzt bei WEB.DE FreeMail: http://f.web.de/?mc=021193 From lux at diesel-research.com Sat Feb 11 10:06:52 2006 From: lux at diesel-research.com (Kim Lux) Date: Sat, 11 Feb 2006 10:06:52 -0700 Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: <1139631780.23882.10.camel@zd7280> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> <1139631780.23882.10.camel@zd7280> Message-ID: <1139677612.3431.5.camel@zd7280> More on this problem. I copied and pasted simpleRead into a console based Eclipse project and I've got the same result, except that cpu usage doesn't go to 100%. I'm beginning to think there is an issue in rxtx. My imports for simpleRead are: ============================ import gnu.io.*; import java.util.*; //import javax.comm.*; import java.io.*; =========================== Any ideas ? I am trying to read from /dev/ttyUSB0 using a serial to USB adapter which has worked well with minicom and gtkterm. Thanks. On Fri, 2006-02-10 at 21:23 -0700, Kim Lux wrote: > I've got a problem receiving chars with my version of serialRead, > written in an SWT GUI. > > I had a Java pro have a good look at my code and he can't see anything > wrong with it. > > I can send chars fine. When I receive a char the cpu usage for the app > goes to 100% and the code in the serial event handler doesn't get > executed. > > The instructions on the Java Comm Serial API How-To for Linux page state > that I must install javacomm. Is that true ? Everything builds without > it and I can send chars on rxtx just fine, but I can't receive them. > Could this be the problem ? > > I downloaded and installed javacomm. I was not able to add > "Driver=gnuio.RXTXCommDriver > to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not > have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 > installed in /usr/java/jre1.5.0_05. I added comm.jar > to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext > to the library paths. Is this OK ? > > Does it matter that I am receiving on /dev/ttyUSB0 ? > > Thanks. > -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Sun Feb 12 21:01:33 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:01:33 -0700 (MST) Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: <1139677612.3431.5.camel@zd7280> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> <1139631780.23882.10.camel@zd7280> <1139677612.3431.5.camel@zd7280> Message-ID: I suspect what is happening is the select() is breaking out in the native code but the driver does not have support for notifying there are X bytes available. On some traditional Unix based systems, the only way you know data is available is the fd status changes and do an FIORDCHK ioctl. Or perhaps the only thing you can know is the fd status changed. It would take reading through the kernel driver code to know for sure. So on USB, depending upon the driver, the same may need to be done or the driver improved a bit if possible to support. Polling reads will also work but don't use the event driven model of CommAPI which isnt acceptable in the long run. The 100% cpu usage can then be explained because select no longer blocks until the data is read; the eventLoop spins loose. You can put a well placed sleep but rxtx only expects those are needed when it knows data is available. This may not be a super simple thing to understand and fix. I do have ideas to get you started. I'm going to be short on time the next couple weeks. I expect to put some good time in and answer some other questions I saw around the 25th. For now, I'd look at the following and go from there with the hints I've given. JNIEXPORT jint JNICALL RXTXPort(nativeavailable)( JNIEnv *env, jobject jobj ) { int fd = get_java_var( env, jobj,"fd","I" ); int result; /* char message[80]; ENTER( "RXTXPort:nativeavailable" ); On SCO OpenServer FIONREAD always fails for serial devices, so try ioctl FIORDCHK instead; will only tell us whether bytes are available, not how many, but better than nothing. This turns out to be true on Solaris also. taj. */ #ifdef FIORDCHK /* __unixware__ __sun__ probably others */ result = ioctl(fd, FIORDCHK, 0); #else if( ioctl( fd, FIONREAD, &result ) < 0 ) { goto fail; } #endif /* FIORDCHK */ On Sat, 11 Feb 2006, Kim Lux wrote: > > More on this problem. I copied and pasted simpleRead into a console > based Eclipse project and I've got the same result, except that cpu > usage doesn't go to 100%. I'm beginning to think there is an issue in > rxtx. > > My imports for simpleRead are: > > ============================ > import gnu.io.*; > import java.util.*; > //import javax.comm.*; > import java.io.*; > =========================== > > Any ideas ? I am trying to read from /dev/ttyUSB0 using a serial to > USB adapter which has worked well with minicom and gtkterm. > > Thanks. > > > > On Fri, 2006-02-10 at 21:23 -0700, Kim Lux wrote: >> I've got a problem receiving chars with my version of serialRead, >> written in an SWT GUI. >> >> I had a Java pro have a good look at my code and he can't see anything >> wrong with it. >> >> I can send chars fine. When I receive a char the cpu usage for the app >> goes to 100% and the code in the serial event handler doesn't get >> executed. >> >> The instructions on the Java Comm Serial API How-To for Linux page state >> that I must install javacomm. Is that true ? Everything builds without >> it and I can send chars on rxtx just fine, but I can't receive them. >> Could this be the problem ? >> >> I downloaded and installed javacomm. I was not able to add >> "Driver=gnuio.RXTXCommDriver >> to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not >> have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 >> installed in /usr/java/jre1.5.0_05. I added comm.jar >> to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext >> to the library paths. Is this OK ? >> >> Does it matter that I am receiving on /dev/ttyUSB0 ? >> >> Thanks. >> > From tjarvi at qbang.org Sun Feb 12 21:03:30 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:03:30 -0700 (MST) Subject: [Rxtx] One serial port object for both sending and receiving ? In-Reply-To: <1139610545.18177.4.camel@zd7280> References: <1139610545.18177.4.camel@zd7280> Message-ID: On Fri, 10 Feb 2006, Kim Lux wrote: > > Is it OK to use one SerialPort ojbect (ex Serial Port serialPort;) and > use it for both sending and receiving ? > > For example: > > ======================================================================== > static SerialPort serialPort = null; > static OutputStream serialOut = null; > static InputStream serialIn = null; > > > > > // assign it to an outputStream for use > try{ > serialOut = serialPort.getOutputStream(); > System.out.println("Serial output stream has been assigned."); > }//try > catch(IOException e) > { > System.out.println("Error: Couldn't assign output stream to serial > port."); > }//catch > > > //assign it to an inputStream for use > try{ > serialIn = serialPort.getInputStream(); > System.out.println("Serial input stream has been assigned."); > }//try > catch(IOException e) > { > System.out.println("Error: Couldn't assign input stream to serial > port."); > }//catch This should be fine. In fact trying to do it another way will probably not work as you will run into lockfile issues. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun Feb 12 21:13:13 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:13:13 -0700 (MST) Subject: [Rxtx] Question about Serial I/O under Win32 In-Reply-To: <662084330@web.de> References: <662084330@web.de> Message-ID: On Sat, 11 Feb 2006 lunareclipse03 at web.de wrote: > Hello everybody, > > I have a strange problem with a piece of code I made for myself. No, > this is not really concerning rxtx, but nevertheless I post this to the > list, hoping that some of you can help me. I've written two libraries, > one for linux and one for win32. The linux port works quite well, I can > send / receive faxes and / or replay voice messages over the telephone > line using a voice modem. But the win32 port of the library causes some > trouble. If, for example, I send out a fax with a certain modem under > linux, it works well. The fax is complete when it comes out of the fax > machine. If I then use the same modem to send out a fax under win32, the > fax coming out of the fax machine gets "stuck" halfways, but the sending > modem thinks that transmission was ok and drops the connection. The > answering fax machine then gives me "error while receiving." The "upper > layer" java code MUST be right, because if I do the same thing under > linux (using the linux library), everything is alright. Now I have to > ask: Can somebody please help me out with this??!? Could it be the case > that some kind of flow control or COMMTIMEOUTS setting causes this > behaviour? I set flow control to RTS/CTS before sending out a fax. How > can I DISABLE flow control? Or what do you think? Can something else > cause this problems? Thank you all for your time and PLEASE write back > soon. > Hi Sven I'm not too willing to talk about flow control at the low level until I confirm some things with test equipment later. It is not clear if you are using rxtx or writing your own native code. So I'm not sure how to answer much of this :) If you are wondering how to change the flow control using rxtx from java, The BlackBox example from Sun flips this back and forth. SerialPort.java in rxtx 2.1 uses the following: SerialPort.java: public static final int FLOWCONTROL_NONE =0; SerialPort.java: public static final int FLOWCONTROL_RTSCTS_IN =1; SerialPort.java: public static final int FLOWCONTROL_RTSCTS_OUT =2; SerialPort.java: public static final int FLOWCONTROL_XONXOFF_IN =4; SerialPort.java: public static final int FLOWCONTROL_XONXOFF_OUT=8; So if you set flowcontrol to RTSCTS, you can set it to NONE to turn it off. If you are looking for how to do it in native code, the rxtx Source is SerialImp.c (unix/linux/mac os x/w32) and termios.c (w32 only with SerialImp.c) You can track the code: SerialImp.c:JNIEXPORT void JNICALL RXTXPort(setflowcontrol)( JNIEnv *env, jobject jobj, jint flowmode ) termios.c:int tcgetattr( int fd, struct termios *s_termios ) termios.c:int tcsetattr( int fd, int when, struct termios *s_termios ) There may be a problem in the rxtx flow control code though. Rather than guess, I want to test this with a gold standard. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Feb 6 00:00:16 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 00:00:16 -0700 (MST) Subject: [Rxtx] wiki delay until tomorrow night. In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: On Sun, 5 Feb 2006, Trent Jarvi wrote: > On Sun, 5 Feb 2006, Kim Lux wrote: > >> usb ? Tell me more... I need that too. > > usb is a very proper design. Thats all it is. > Maybe rxtx could help usb. But it would start with helping bring back the community that was already there. It's not something I'd love to do but maybe its the right thing to do. It would probably take 2 years to do right. But maybe thats better than what we have now. I honestly don't know what IBM is doing which could just run over everything. Just some thoughts after some fine german wine. -- Trent Jarvi tjarvi at qbang.org From gadelavega at yahoo.com.ar Mon Feb 6 02:17:05 2006 From: gadelavega at yahoo.com.ar (Gonzalo A. de la Vega) Date: Mon, 06 Feb 2006 10:17:05 +0100 Subject: [Rxtx] Serial port ownership question In-Reply-To: References: <20060205113618.30274.qmail@web53501.mail.yahoo.com> <1139157422.4553.9.camel@zd7280> <1139158698.4936.9.camel@zd7280> Message-ID: <43E71411.4050402@yahoo.com.ar> On my Fedora Core 4: ls -l /dev/ttyS* crw-rw---- 1 root uucp 4, 64 Feb 6 2006 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Feb 6 2006 /dev/ttyS1 ... and: grep "ttyUSB" /etc/udev/rules.d/50-udev.rules KERNEL=="ttyUSB*", GROUP="uucp", MODE="0660" So anyone in the "uucp" group can use serial ports. On Gentoo the group is "tty". Trent Jarvi escribi?: > > > On Sun, 5 Feb 2006, Dr. Douglas Lyon wrote: > >> I can confirm that this is the case (only root ownership of >> serial ports, under fedora 4). >> Wow, what were they thinking?! >> - DL >> >>> I've found that the newer kernels have the serial ports owned by root. >>> For example, >>> >>> $ls -al /dev/tty* >>> crw-rw-rw- 1 root root 5, 0 Feb 5 02:06 /dev/tty >>> crw-rw---- 1 root root 4, 0 Feb 5 02:06 /dev/tty0 >>> crw------- 1 root root 4, 1 Feb 5 09:07 /dev/tty1 >>> crw-rw---- 1 root tty 4, 10 Feb 5 02:06 /dev/tty10 >>> crw-rw---- 1 root tty 4, 11 Feb 5 02:06 /dev/tty11 >>> ... > > > This is just not a problem jcp or such are going to solve. Its a > platform spitwad fight. But do look at pam. In fact thats what Sun > is doing too. Maybe Linux followed their lead.. I'm not a pam guy. > I've spent 16 hours trying to understand it but your users wont :) > > Solution? I have no clue. Its two tangent mentalities from my > perspective. > > -- > Trent Jarvi > tjarvi at qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mtnvega at yahoo.com.br Mon Feb 6 05:35:43 2006 From: mtnvega at yahoo.com.br (Luiz Jr) Date: Mon, 6 Feb 2006 12:35:43 +0000 (GMT) Subject: [Rxtx] Documentation Wiki In-Reply-To: <1139157422.4553.9.camel@zd7280> Message-ID: <20060206123543.57256.qmail@web53515.mail.yahoo.com> Hello, Thank you for you answer, but so the usage of the API is pretty much like the Java Communications Api? If yes, what version of the Java Comm Api? Thank you, Luiz A. Brandao Jr Kim Lux escreveu: On Sun, 2006-02-05 at 08:36 -0300, Luiz Jr wrote: > Hello, > > I want to start using the RXTX libraries, but I would to know how, > since I can not access the documentation wiki page I just started using them yesterday. Below is how I installed the libraries, if that helps. I used snippets of code from the SimpleWrite application here to get me going. http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html Instead of "import javax.comm.*;", use "import gnu.io.*;" which is gotten from RXTXcomm.jar, which you will need to include in your project references. I am working in Eclipse. BTW: there is no way to open a port without going through the port list and finding it. Maybe sometime in the future someone (me ?) will write a method called openSerialPort that allows the user to give a port identifier, such as "/dev/tty1" and return a port ready to use. It wouldn't take much to write that and it would save users a lot of code. Hope this helps. ======================================================================= 1) Figure out which java you are running, incase there is more than one installed. $ java -version java version "1.5.0_05" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_05-b05) Java HotSpot(TM) Client VM (build 1.5.0_05-b05, mixed mode, sharing) 2) Find all the jre directories and the one from which you are currently running. kfind (jre) 3) cd to that directory plus /lib/i386 cd /usr/java/jre1.5.0_05/lib/i386 4) Copy the library files (*.so) to that directory. cp /home/krlux/Desktop/'Java Controls'/rxtx-linux/bin/* . 5) Check that the copy was successful ls librxtx* librxtxI2C.so librxtxRaw.so librxtxSerial.so librxtxParallel.so librxtxRS485.so 6) cd to the /lib/ext directory for your java. cd /usr/java/jre1.5.0_05/lib/ext 7) Copy the Jar files there cp /home/krlux/Desktop/'Java Controls'/rxtx-linux/lib/ext/* . 8) Check that it was successful ls RXTX* RXTXcomm.jar Rxtx is now installed on your machine ready to use. =================================================================== -- Kim Lux, Diesel Research Inc. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx --------------------------------- Yahoo! Acesso Gr?tis - Internet r?pida e gr?tis. Instale o discador agora! -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/544aa403/attachment-0037.html From lyon at docjava.com Mon Feb 6 05:49:34 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 06 Feb 2006 07:49:34 -0500 Subject: [Rxtx] wiki delay until tomorrow night. In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: Hi All, I have often thought about USB drivers being needed. For example, the ironman watch will not interface to a mac (windows only). It is USB. My dymo label writer has no Java driver (native only). Etc. Most cheap web cameras are USB (and Java drivers go through JAI, if it supports the camera at all). The JAI code shows how sun did the USB drivers. You have to be a member of the jai project to download the source code. https://jai.dev.java.net has the jai distro. And then you are not allowed to redistribute it. However, we can all learn from it (if so inclined). Basically: cvs -d :pserver:lyon at cvs.dev.java.net:/cvs login cvs -d :pserver:lyon at cvs.dev.java.net:/cvs checkout jai-core You will need to user your own uid and pw to get in. The ant build has over 100 warnings from sun deprecations of its own code. You might say that they were hoisted on their own Picard ;) One interesting thing is that they support several platforms: linux-amd64 64-bit Linux-AMD64 linux-i586 32-bit Linux-x86 solaris-amd64 64-bit Solaris-AMD64 solaris-i586 32-bit Solaris-x86 solaris-sparc 32-bit Solaris-SPARC solaris-sparcv9 64-bit Solaris-SPARC windows-i586 32-bit Windows-x86 Thus, ant is used to provide a multi-platform native method distro. Neat. How do they do it? check this out: And: The core download does not contain any C source code (it was all pre-built). Basically, they are just copying .so and .dll files into build directories. I would love to see the C code for this...but Sun does not post it on the https://jai.dev.java.net site. I don't know why...Perhaps I missed it. - Doug >On Sun, 5 Feb 2006, Trent Jarvi wrote: > >>On Sun, 5 Feb 2006, Kim Lux wrote: >> >>>usb ? Tell me more... I need that too. >> >>usb is a very proper design. Thats all it is. >> > >Maybe rxtx could help usb. But it would start with helping bring >back the community that was already there. > >It's not something I'd love to do but maybe its the right thing to do. > >It would probably take 2 years to do right. But maybe thats better >than what we have now. > >I honestly don't know what IBM is doing which could just run over everything. > >Just some thoughts after some fine german wine. > >-- >Trent Jarvi >tjarvi at qbang.org > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tdelenik at gmail.com Mon Feb 6 05:56:32 2006 From: tdelenik at gmail.com (Thanasis Delenikas) Date: Mon, 6 Feb 2006 14:56:32 +0200 Subject: Fwd: [Rxtx] Documentation Wiki In-Reply-To: <1139157422.4553.9.camel@zd7280> References: <20060205113618.30274.qmail@web53501.mail.yahoo.com> <1139157422.4553.9.camel@zd7280> Message-ID: <310a1a930602060456t129f1dc6p5f2b908f13ab5a0b@mail.gmail.com> Hello all, Kim, this is a snippet from the code I use. The closest to directly opening a specific port without enumeration. << ... portId = CommPortIdentifier.getPortIdentifier(getPort()); serialPort = (SerialPort) portId.open("jSMSEngine", 1971); ... >> where getPort() return the string identifier of the port, i.e. "/dev/ttyS0" or "COM1" or whatever. Thanasis. ---------- Forwarded message ---------- From: Kim Lux Date: Feb 5, 2006 6:37 PM Subject: Re: [Rxtx] Documentation Wiki To: RXTX Developers and Users BTW: there is no way to open a port without going through the port list and finding it. Maybe sometime in the future someone (me ?) will write a method called openSerialPort that allows the user to give a port identifier, such as "/dev/tty1" and return a port ready to use. It wouldn't take much to write that and it would save users a lot of code. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/182ab5b8/attachment-0037.html From tjarvi at qbang.org Mon Feb 6 11:53:57 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 11:53:57 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: On Mon, 6 Feb 2006, Dr. Douglas Lyon wrote: > Hi All, > I have often thought about USB drivers being needed. > For example, the ironman watch will not interface > to a mac (windows only). It is USB. > My dymo label writer has no Java driver (native only). > Etc. > Most cheap web cameras are USB (and Java drivers go > through JAI, if it supports the camera at all). > The JAI code shows how sun did the USB drivers. > You have to be a member of the jai project to download > the source code. > https://jai.dev.java.net has the jai distro. > And then you are not allowed to redistribute it. However, > we can all learn from it (if so inclined). Basically: > cvs -d :pserver:lyon at cvs.dev.java.net:/cvs login > cvs -d :pserver:lyon at cvs.dev.java.net:/cvs checkout jai-core > You will need to user your own uid and pw to get in. > The ant build has over 100 warnings from sun deprecations > of its own code. > > You might say that they were hoisted on their own Picard ;) > > One interesting thing is that they support several platforms: > linux-amd64 64-bit Linux-AMD64 > linux-i586 32-bit Linux-x86 > solaris-amd64 64-bit Solaris-AMD64 > solaris-i586 32-bit Solaris-x86 > solaris-sparc 32-bit Solaris-SPARC > solaris-sparcv9 64-bit Solaris-SPARC > windows-i586 32-bit Windows-x86 > Thus, ant is used to provide a multi-platform native method distro. > Neat. > How do they do it? > check this out: > > > > > > > > > > > > > And: > > > > > > > > > > The core download does not contain any C source code (it was all pre-built). > Basically, they are just copying .so and .dll files into build directories. > > I would love to see the C code for this...but Sun does not post it on the > https://jai.dev.java.net site. > > I don't know why...Perhaps I missed it. > > - Doug > > I've looked at moving rxtx to Ant builds. I think that would help IDEs a great deal. I requested a evalutation desk copy the O'Reilly Ant book for some j2ee material I was teaching. http://www.oreilly.com/catalog/anttdg/ It has a one sentence mention of JNI. So there was not luck there. I saw that there is another Ant book that does mention JNI more. I can't find it now. Ant must be able to support it with extensions. http://ant.apache.org/manual/OptionalTasks/javah.html What the auto(break :) tools do in the rxtx build is 4 things really. 1) gcc compile flags 2) ld compile flags 3) config.h 4) compile flags for customizing rxtx (lockfiles, ...) See 1 All of this information except 4 can be static once obtained. So I'm not attached to the auto tools. If I could find an example of Ant being used for JNI code, I'd be one of the first to start moving that direction. Maybe someone saw an example someplace. The other thing we have not completed discussing is the directory structure. There is interest in making rxtx more IDE friendly. I get more mail about that off the list than how to install rxtx. And I see we have Ken Thompson in da house :) He is our trusted CVS maintainer and the guy that purchased the rxtx.org domain. Old community. We will need Ken for changing the directory structure of source. I would like to open up discussion about both of these as it is more than time. The problem is I have little experience with Ant and even less with IDEs. It would be nice if we could work with Eclipse and NetBeans. http://www.netbeans.org/ (sun and some community) http://www.eclipes.org (ibm,rhat,... perhaps more community) http://maven.apache.org/what-is-maven.html (apache. It is community) borland should sortof be here too but I think thats covered in eclipse. >From what I understand so far, we should morph rxtx to support those three maybe trusting apaches lead with maven. But I use vi. I have little to no clues beyond what people have fed me. Can we agree that thats the right direction to go? -- Trent Jarvi tjarvi at qbang.org From brian at mbari.org Mon Feb 6 14:57:50 2006 From: brian at mbari.org (Brian Schlining) Date: Mon, 6 Feb 2006 13:57:50 -0800 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> > The other thing we have not completed discussing is the directory > structure. There is interest in making rxtx more IDE friendly. I > get more mail about that off the list than how to install rxtx. > > And I see we have Ken Thompson in da house :) He is our trusted > CVS maintainer and the guy that purchased the rxtx.org domain. Old > community. We will need Ken for changing the directory structure of > source. > > I would like to open up discussion about both of these as it is > more than time. The problem is I have little experience with Ant > and even less with IDEs. It would be nice if we could work with > Eclipse and NetBeans. > > http://www.netbeans.org/ (sun and some community) > http://www.eclipes.org (ibm,rhat,... perhaps more community) > http://maven.apache.org/what-is-maven.html (apache. It is community) > borland should sortof be here too but I think thats covered in > eclipse. > >> From what I understand so far, we should morph rxtx to support >> those three > maybe trusting apaches lead with maven. But I use vi. I have > little to no clues beyond what people have fed me. > Maven likes the directory structure below for Java code. (From http:// maven.apache.org/guides/getting-started/index.html) This structure works fine with ant, netbeans, and eclipse. rxtx_root_directory `-- src |-- main | `-- java | `-- gnu | `-- io `-- test `-- java `-- gnu `-- io Brian Schlining Software Engineer http://www.mbari.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/d9451eba/attachment-0037.html From tjarvi at qbang.org Mon Feb 6 15:11:45 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 15:11:45 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: > rxtx_root_directory > `-- src > |-- main > | `-- java > | `-- gnu > | `-- io > `-- test > `-- java > `-- gnu > `-- io > >From what I understand this will just be good. For me it makes no difference. So lets do the rxtx thing. Let if fester for two weeks and if nobody objects, we will do it. I'm not doing this because I care. I'm doing this to eliminate much of my inbox. But test... man is rxtx lacking there in the community aspect. It is covered but not right. _maybe_ I can change that this year. -- Trent Jarvi tjarvi at qbang.org (cat hurding since 1997) From lux at diesel-research.com Mon Feb 6 21:38:49 2006 From: lux at diesel-research.com (Kim Lux) Date: Mon, 06 Feb 2006 21:38:49 -0700 Subject: [Rxtx] How can I use Lock Files with rxtx (in FC4) ? Message-ID: <1139287129.17031.3.camel@zd7280> I am now running an rxtx application on FC4. I am getting: ========================================================= check_group_uucp(): error testing lock file creation Error details: Permission denied check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL ========================================================= $ ls -al /var/lock total 32 drwxrwxr-x 4 root lock 4096 Feb 6 16:04 . drwxr-xr-x 24 root root 4096 Nov 14 01:19 .. drwx------ 2 root root 4096 Apr 27 2005 lvm drwxr-xr-x 2 root root 4096 Feb 6 16:04 subsys How do I fix this for regulator users ? -- Kim Lux, Diesel Research Inc. From dmarkman at mac.com Mon Feb 6 22:24:44 2006 From: dmarkman at mac.com (Dmitry Markman) Date: Tue, 7 Feb 2006 00:24:44 -0500 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: if I understands the issue right in order to be able to use ant for c/c++ compilation you have to install ant's cc task http://ant-contrib.sourceforge.net/cc.html it looks like it should work on mac os x (authors claim, that it's platform independent) but I never tested so all you have to do it's providing right command line for the gcc compiler On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: >> rxtx_root_directory >> `-- src >> |-- main >> | `-- java >> | `-- gnu >> | `-- io >> `-- test >> `-- java >> `-- gnu >> `-- io >> > > >> From what I understand this will just be good. > > For me it makes no difference. So lets do the rxtx thing. Let if > fester for two weeks and if nobody objects, we will do it. > > I'm not doing this because I care. I'm doing this to eliminate > much of my inbox. > > But test... man is rxtx lacking there in the community aspect. It > is covered but not right. _maybe_ I can change that this year. > > -- > Trent Jarvi > tjarvi at qbang.org > (cat hurding since 1997) > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx Dmitry Markman From lux at diesel-research.com Mon Feb 6 23:20:15 2006 From: lux at diesel-research.com (Kim Lux) Date: Mon, 06 Feb 2006 23:20:15 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? Message-ID: <1139293215.3689.4.camel@zd7280> I'm running the code below. portlist.hasMoreElements() is false. /dev has ports in it as listed below. What am I doing wrong ? ========================================================== // Step through the list of ports until we find one that matches // the one we are looking for. portList = CommPortIdentifier.getPortIdentifiers(); while(portList.hasMoreElements()) { portID = (CommPortIdentifier) portList.nextElement(); // if (portID.getName().equals("/dev/ttyUSB0")) { myTA.append("Serial port ttyUSB0 has been found\n"); break; }// if portID equals... }// End of while... ========================================================== ls -al /dev/tty* crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 ... crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 -- Kim Lux, Diesel Research Inc. From david.garnier at trusted-logic.com Tue Feb 7 00:46:30 2006 From: david.garnier at trusted-logic.com (David Garnier) Date: Tue, 07 Feb 2006 08:46:30 +0100 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: <43E85056.2090608@trusted-logic.com> Hello, I think that the make-based build process is fine as it is, apart from the location of the Java source files. It is true that putting the Java source in a directory structure that map 1-to-1 to the Java package structure is the norm and should make it easier for everyone to modify the Java source, with or without an IDE. Ant is a good tool, but in the RXTX case I fail to see the advantage of using it compared to the current make-based process. As Trent said, they are more pressing issues, like testing. Regards, David Dmitry Markman wrote: > if I understands the issue right > in order to be able to use ant for c/c++ compilation > you have to install ant's cc task > http://ant-contrib.sourceforge.net/cc.html > > it looks like it should work on mac os x > (authors claim, that it's platform independent) > but I never tested > > so all you have to do it's providing right command line > for the gcc compiler > > > > > On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: > >>> rxtx_root_directory >>> `-- src >>> |-- main >>> | `-- java >>> | `-- gnu >>> | `-- io >>> `-- test >>> `-- java >>> `-- gnu >>> `-- io >>> >> >> >>> From what I understand this will just be good. >> >> For me it makes no difference. So lets do the rxtx thing. Let if >> fester for two weeks and if nobody objects, we will do it. >> >> I'm not doing this because I care. I'm doing this to eliminate much >> of my inbox. >> >> But test... man is rxtx lacking there in the community aspect. It is >> covered but not right. _maybe_ I can change that this year. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> (cat hurding since 1997) From tjarvi at qbang.org Tue Feb 7 01:11:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 01:11:31 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <43E85056.2090608@trusted-logic.com> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: On Tue, 7 Feb 2006, David Garnier wrote: > Hello, > > I think that the make-based build process is fine as it is, apart from the location of the Java > source files. It is true that putting the Java source in a directory structure that map 1-to-1 to > the Java package structure is the norm and should make it easier for everyone to modify the Java > source, with or without an IDE. > > Ant is a good tool, but in the RXTX case I fail to see the advantage of using it compared to the > current make-based process. As Trent said, they are more pressing issues, like testing. > Hi David I have more experience with testing rxtx than I can talk about. But let it be known, rxtx has gone trough 100's of hours of testing. We are hobby folks interested in toys but there is more. rxtx has had some of the best guidance in the industry there. This is not an easy thing. I may be able to come back in a month from the other side of the corperate fence and help. I suspect the tests could just be made public but they are in a very unusual environment that just wont work in a wider sense. This is something I'll be trying to change. At one point it was agreed we could just make the results public so this isnt just noise.. There is interest and I think its safe to mention that much. The big problem with testing in the past is most of it is done with a loopback connection. So we *still* have major questions regarding things like flow control. rxtx talks to itself over a loopback and it works. regardless of right or wrong. This requires more thought to be done right. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Feb 7 02:46:34 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 02:46:34 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: > The big problem with testing in the past is most of it is done with a > loopback connection. So we *still* have major questions regarding things > like flow control. rxtx talks to itself over a loopback and it works. > regardless of right or wrong. With serial communication there are gold standards. ckermit is probably a definitive 'standard.' Maybe its possible to do ping/pong tests with ckermit? Is it scriptable? There are known issues in rxtx. Probably the worst is some threading issues regarding some JREs with multiple JNI threads setting java variables. Man did I get schooled there. Just switch the c functions to returning variables and things go away. Sometimes they work fine, sometimes they blow up. Without understanding everything, somehow rhat got it right and debian (and especially gentoo) grabbed kernel patches causing all sort of harm. Its not hard to fix once you understand whats going on but nearly impossible to track with a debugger. So I have a good idea what 2.1-8 will have outside of the IDE modifications. rxtx 2.1-7 is a release for everyone to sync with. Its not even as stable as -pre17 as far as I know - I ran no test suites. I'll be chasing it too. We just had so many contributions that it was time. It seriously broke internal scheduals but thats a great thing :) The other thing I want to do in 2.1-8 is automagic baud rates. It turns out lots of shops are doing really funky baud rates for things like automobile test equipment. It is possible but it requires a fair amount of change in the native code. Is anyone looking at this? -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Feb 7 02:57:21 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 07 Feb 2006 04:57:21 -0500 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <43E85056.2090608@trusted-logic.com> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: Hi All, I agree, testing is very important. The problem I have been trying to address is related to cross-platform testing and the robust nature of the installs. Typically, I visit 3 platforms to deploy my product, windows, linux and mac. A build is performed on each platform. The idea that you can build for many platforms from one copy the source code seems attractive. This should enable synchronized deployments of identical code. The question of how to achieve this goal remains open. As Trent mentioned, this is hard. Perhaps Ant will help here (but perhaps not). Ant does seem to help with running unit tests. However, it does not help with multi-platform tests. For that you need many machines and different operating environments. Toward that end, I have created a multi-platform test that can be run from web start, located at: http://show.docjava.com:8086/book/cgij/code/jnlp/serialPort.PortTest.jnlp This is interesting because many people in the community can run the test and we can improve the test, as time permits. No, it is not a perfect solution, however, the idea does help with multi-platform tests using many machines and different operating environments. If the group has a good test for a general serial port set-ups, i would be happy to deploy it, for general evaluation using web start. And as for ANT, it is just an idea. Not all my ideas are good ones! - Doug >Hello, > >I think that the make-based build process is fine as it is, apart >from the location of the Java >source files. It is true that putting the Java source in a directory >structure that map 1-to-1 to >the Java package structure is the norm and should make it easier for >everyone to modify the Java >source, with or without an IDE. > >Ant is a good tool, but in the RXTX case I fail to see the advantage >of using it compared to the >current make-based process. As Trent said, they are more pressing >issues, like testing. > >Regards, >David > >Dmitry Markman wrote: >> if I understands the issue right >> in order to be able to use ant for c/c++ compilation >> you have to install ant's cc task >> http://ant-contrib.sourceforge.net/cc.html >> >> it looks like it should work on mac os x >> (authors claim, that it's platform independent) >> but I never tested >> >> so all you have to do it's providing right command line >> for the gcc compiler >> >> >> >> >> On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: >> >>>> rxtx_root_directory >>>> `-- src >>>> |-- main >>>> | `-- java >>>> | `-- gnu >>>> | `-- io >>>> `-- test >>>> `-- java >>>> `-- gnu >>>> `-- io >>>> >>> >>> >>>> From what I understand this will just be good. >>> >>> For me it makes no difference. So lets do the rxtx thing. Let if >>> fester for two weeks and if nobody objects, we will do it. >>> >>> I'm not doing this because I care. I'm doing this to eliminate much >>> of my inbox. >>> >>> But test... man is rxtx lacking there in the community aspect. It is >>> covered but not right. _maybe_ I can change that this year. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> (cat hurding since 1997) > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From matt.higgins at gmail.com Tue Feb 7 08:28:34 2006 From: matt.higgins at gmail.com (Matt Higgins) Date: Tue, 7 Feb 2006 10:28:34 -0500 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final Message-ID: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? import java.io.*; import java.util.*; import gnu.io.*; public class MySimpleRead implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; public static void main(String[] args) { boolean portFound = false; String defaultPort = "COM1"; if (args.length > 0) { defaultPort = args[0]; } portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; MySimpleRead reader = new MySimpleRead(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } } public MySimpleRead() { try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) { e.printStackTrace(); } try { inputStream = serialPort.getInputStream(); } catch (IOException e) { e.printStackTrace(); } try { serialPort.addEventListener(this); } catch (TooManyListenersException e) { e.printStackTrace(); } try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { e.printStackTrace(); } System.out.println("Baud is " + serialPort.getBaudRate()); System.out.println("Bits is " + serialPort.getDataBits()); System.out.println("Stop is " + serialPort.getStopBits()); System.out.println("Par is " + serialPort.getParity()); serialPort.notifyOnDataAvailable(true); readThread = new Thread(this); readThread.start(); } public void run() { // Thread.sleep(20000); //} catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { System.out.println("An event occurred " + event.getEventType()); switch (event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: byte[] readBuffer = new byte[20]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } System.out.print(new String(readBuffer)); } catch (IOException e) {} break; } } } --------------- Result on windows ------------------------------ Stable Library ============================================================== Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port:: COM1 Baud is 9600 Bits is 8 Stop is 1 Par is 0 ----------------- End Results ----------------------------------------- ------------------ Result on Linux ----------------------------------- Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 Found port: /dev/ttyS0 Baud is 9600 Bits is 8 Stop is 1 Par is 0 An event occurred 1 043100066224 ------------------ End Results --------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/a1431630/attachment-0037.html From brian at mbari.org Tue Feb 7 09:48:37 2006 From: brian at mbari.org (Brian Schlining) Date: Tue, 7 Feb 2006 08:48:37 -0800 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> Message-ID: <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> Hi Matt > The following code works fine on Linux but I never see any data > when run on Windows. This is a cut and paste from the SimpleRead > example. > I am attempting to read data from a bar code scanner. I can fire > up HyperTermianl on windows and see that the device is working > properly as I see the barcodes are scanned and echoed back to the > terminal. However when I run the app I don't see any data. It is > however associating with the com port as the informational bits > print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. Cheers Brian Schlining Software Engineer http://www.mbari.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/16d07f37/attachment-0037.html From lux at diesel-research.com Tue Feb 7 11:59:58 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 11:59:58 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139293215.3689.4.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> Message-ID: <1139338798.8145.4.camel@zd7280> Any ideas on this ? Any reason why portList.hasMoreElements() should be false even though there are devices in /dev ? On Mon, 2006-02-06 at 23:20 -0700, Kim Lux wrote: > I'm running the code below. > > portlist.hasMoreElements() is false. > > /dev has ports in it as listed below. > > What am I doing wrong ? > > > ========================================================== > // Step through the list of ports until we find one that matches > // the one we are looking for. > > portList = CommPortIdentifier.getPortIdentifiers(); > > while(portList.hasMoreElements()) > { > portID = (CommPortIdentifier) portList.nextElement(); // > if (portID.getName().equals("/dev/ttyUSB0")) > { > myTA.append("Serial port ttyUSB0 has been found\n"); > break; > }// if portID equals... > }// End of while... > ========================================================== > > ls -al /dev/tty* > crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty > crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 > crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 > crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 > crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 > ... > crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 > crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 > crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 > > > -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 12:20:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 12:20:25 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139338798.8145.4.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> Message-ID: On Tue, 7 Feb 2006, Kim Lux wrote: > > Any ideas on this ? Any reason why portList.hasMoreElements() should be > false even though there are devices in /dev ? > > > On Mon, 2006-02-06 at 23:20 -0700, Kim Lux wrote: >> I'm running the code below. >> >> portlist.hasMoreElements() is false. >> >> /dev has ports in it as listed below. >> >> What am I doing wrong ? >> >> >> ========================================================== >> // Step through the list of ports until we find one that matches >> // the one we are looking for. >> >> portList = CommPortIdentifier.getPortIdentifiers(); >> >> while(portList.hasMoreElements()) >> { >> portID = (CommPortIdentifier) portList.nextElement(); // >> if (portID.getName().equals("/dev/ttyUSB0")) >> { >> myTA.append("Serial port ttyUSB0 has been found\n"); >> break; >> }// if portID equals... >> }// End of while... >> ========================================================== >> >> ls -al /dev/tty* >> crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty >> crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 >> crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 >> crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 >> crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 >> ... >> crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 >> crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 >> crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 >> >> >> > Hi Kim What rxtx does is try to open the port and do a timed out read. If the kernel/... do not complain it's enumarted. I suspect you could do a crude test by doing something like cat /dev/ttyS0 > /dev/null If that barfs then rxtx wont enumerate the port. hmm looking at your question again, I suspect it's a lockfile problem. This is documented in INSTALL with the source. Its easy enough to test this too.. touch /var/lock/testingrxtxlockfiles && rm -f /var/lock/testingrxtxlockfiles If you are not in the right group it will bail. Root will work regardless. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 12:37:56 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 12:37:56 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> Message-ID: <1139341076.8145.11.camel@zd7280> Exactly which ports does rxtx attempt to put into the list ? /dev/* or /dev/tty* or /dev/tty[0-9[0-9] ? or /dev/ttyS* ? For the record, only /dev/ttyUSB0 is a valid port on the machine I am presently on. Will this be a problem ? On Tue, 2006-02-07 at 12:20 -0700, Trent Jarvi wrote: > This is documented in INSTALL with the source. > I was wondering where that file was. I will download source and dig it up. Thanks. -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 12:51:09 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 12:51:09 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139341076.8145.11.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: On Tue, 7 Feb 2006, Kim Lux wrote: > > Exactly which ports does rxtx attempt to put into the list ? /dev/* > or /dev/tty* or /dev/tty[0-9[0-9] ? or /dev/ttyS* ? > > For the record, only /dev/ttyUSB0 is a valid port on the machine I am > presently on. Will this be a problem ? > > > On Tue, 2006-02-07 at 12:20 -0700, Trent Jarvi wrote: >> This is documented in INSTALL with the source. >> > I was wondering where that file was. I will download source and dig it > up. > > Thanks. > Hmm I'm looking at pre17 so this may have changed. (its just what I have on this machine) if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA" // for the IPAQs }; CandidatePortPrefixes=Temp; } So you may need to add "ttyUSB" to that list. RXTX used to enumerate _everything_ see if(osName.equals("Linux-all-ports") But it became less than practical. This is all in RXTXCommDriver.java hmm I just did a cvs update. if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have to get your fingers into the code. We aim for sane defaults. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 13:06:45 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 13:06:45 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139342805.8145.22.camel@zd7280> On Tue, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > Hmm I'm looking at pre17 so this may have changed. (its just what I have > on this machine) > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA" // for the IPAQs > }; > CandidatePortPrefixes=Temp; > } > > > So you may need to add "ttyUSB" to that list. RXTX used to enumerate > _everything_ see if(osName.equals("Linux-all-ports") But it became less > than practical. > > This is all in RXTXCommDriver.java > > hmm I just did a cvs update. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have > to get your fingers into the code. We aim for sane defaults. Excellent. Thanks for taking the time. -- Kim Lux, Diesel Research Inc. From ideiglenes1 at freemail.hu Tue Feb 7 13:53:39 2006 From: ideiglenes1 at freemail.hu (--) Date: Tue, 07 Feb 2006 21:53:39 +0100 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139345619.22534.2.camel@localhost> Hi! I use this code to get all the extra Linux devices. :) if ("Linux".equals(System.getProperty("os.name"))) { System.setProperty("os.name","Linux-all-ports"); } driver = new RXTXCommDriver(); On k, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > On Tue, 7 Feb 2006, Kim Lux wrote: > > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have > to get your fingers into the code. We aim for sane defaults. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From matt.higgins at gmail.com Tue Feb 7 13:45:54 2006 From: matt.higgins at gmail.com (Matt Higgins) Date: Tue, 7 Feb 2006 15:45:54 -0500 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> Message-ID: <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> Sweet this is exactly what I needed. I was searching the archives through marc.theamisgroup they only have archives back to 1/3/05. Should have hit the mailman archive! Thanks a lot! On 2/7/06, Brian Schlining wrote: > > Hi Matt > > The following code works fine on Linux but I never see any data when run > on Windows. This is a cut and paste from the SimpleRead example. > I am attempting to read data from a bar code scanner. I can fire up > HyperTermianl on windows and see that the device is working properly as I > see the barcodes are scanned and echoed back to the terminal. However when I > run the app I don't see any data. It is however associating with the com > port as the informational bits print fine? > > > You're not the only one whose had this problem, I don't know if Trent has > addressed this is the latest release of RXTX but there is a workaround. > Here's the recent thread from the RXTX mailing list regarding this issues: > > Thanasis Delenikas tdelenik at gmail.com > Wed Jan 18 13:56:23 MST 2006 > > * Previous message: [Rxtx] Re: More close() performance fixes > * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] > > Hi all. > (I've subscribed again from my other email account). > > Trent, > > You are right. Linux *always* works, no matter what flow control you set. > Windows *works only* with hardware flow control (I haven't tested what > happens with software XON/XOFF flow control). > > I assume (but I am not certain) that even with no flow control at all, all > platforms should work. Without flow control, you have the risk of bumping > into overflow or framing errors, but that's your (the end programmer, I > mean) problem. > > >From my side, I shouldn't be working without flow control. That was a bug > too... It was some code forgotten from the old times, when I used to work > with phone emulation drivers which didn't support flow control. The > correct > way is to have some flow control enabled and that's why I suppose this is > a > low-severity bug for RxTx. > > I have no idea which platform shows the correct behaviour, since > my knowledge about Linux and the inner workings of these low-level i/o > operations is limited. > > Regards, > Thanasis Delenikas. > > > > > Message: 2 > > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > > From: Trent Jarvi > > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > > To: RXTX Developers and Users > > Message-ID: > > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > > > Hi all, > > > > > > Trent, I have found something. > > > I read your comment about flow control, so I experimented a bit. > > > > > > If you remember, in my sample program I've used no flow control at all > ( > > i.e. > > > Java constant FLOWCONTROL_NONE). > > > > > > Now, during testing, I've switch to hardware inbound flow control (i.e > . > > Java > > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > > beautifully! > > > > > > I think I will switch to H/W flow control and test things for a while, > > but > > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > > > > > Hi Thanasis, > > > > I'm fairly sure you have identified a bug. I would not worry too much > > about what Sun CommAPI w32 defaults are. I think they did more or less > > whatever the port opened with. Just a guess. Linux tries to stomp on > > ports so they are all the same. > > > > So this started out with Linux worked, Windows XP/.. did not as I > recall. > > Something is wrong in rxtx. Do I understand this right? > > > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > > > Perhaps there is something Wayne or I did not understand when we wrote > > that code. I wasnt programming back in the BBS days so modems are not > my > > thing. I have a few questions. > > > > Is the above matrix confirmed by observation? > > Linux just always worked? > > Which one _should_ work? I'm guessing modems work with hardware flow > > control. I'll have to dig around. > > > > The windows flow control changes a couple things with hardware flow > > control. Following the w32 API documentation is confusing sometimes. > > But it looks like Linux could have a bug too. > > Cheers > > Brian Schlining > Software Engineer > http://www.mbari.org > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/9c989144/attachment-0037.html From tjarvi at qbang.org Tue Feb 7 14:06:14 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 14:06:14 -0700 (MST) Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> Message-ID: >> >> You're not the only one whose had this problem, I don't know if Trent has >> addressed this is the latest release of RXTX but there is a workaround. >> Here's the recent thread from the RXTX mailing list regarding this issues: >> I have not. I expect to have access to some test equipment next month and I'll go through all of this. I really don't know whats going on and I need a gold standard. I thought maybe linux was autodetecting the flow control. Your observations would certainly be welcome. I need to talk to Russell King and see what he is doing. Until then I'd just be toying around over a loopback as usual. This is very high on the list though. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 17:25:05 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 17:25:05 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139358305.17994.2.camel@zd7280> My application now works. I installed the libraries and jar from 2.1-7 (Final). portlist.hasMoreElements is no longer false. The application finds the port for /dev/ttyUSB0. Thanks for your help, Trent (et al) Sorry I bothered you with this. Next time I will look in the source first. I didn't think it was an rxtx issue, I thought it was a Linux setup issue . On Tue, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > Hmm I'm looking at pre17 so this may have changed. (its just what I > have > on this machine) > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux > Serial Ports > "ttySA" // for the > IPAQs > }; > > CandidatePortPrefixes=Temp; > } > > > So you may need to add "ttyUSB" to that list. RXTX used to enumerate > _everything_ see if(osName.equals("Linux-all-ports") But it became > less > than practical. > > This is all in RXTXCommDriver.java > > hmm I just did a cvs update. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux > Serial Ports > "ttySA", // for the > IPAQs > "ttyUSB" // for USB > frobs > }; > > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you > have > to get your fingers into the code. We aim for sane defaults. -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 19:21:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 19:21:54 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139358305.17994.2.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> <1139358305.17994.2.camel@zd7280> Message-ID: >Sorry I bothered you with this. Next time I will look in the source >first. I didn't think it was an rxtx issue, I thought it was a Linux >setup issue . Why would you be sorry? I would have done the same. I'm glad it's working :) -- Trent Jarvi tjarvi at qbang.org From tma at mail.island.net Wed Feb 8 13:39:35 2006 From: tma at mail.island.net (Tom Alldread) Date: Wed, 08 Feb 2006 12:39:35 -0800 Subject: [Rxtx] Win32/Linux Serial Port Data Dropouts In-Reply-To: <200602060702.k167255O007882@www.qbang.org> References: <200602060702.k167255O007882@www.qbang.org> Message-ID: <43EA5707.4020200@mail.island.net> Greetings Folks at RXTX: During the last couple of months I have been alternately testing with javax.comm 2 and RXTX 2.1 under Windows XP and CommApi 3 and RXTX 2.1 under Suse 10.0 Linux. In the process I have learned a little about java multi-threading under NetBeans 5 with Profiler. My java (jdk 1.5_06) application is used for data acquisition and provides a graphical display of A-D conversion data received from a 56KBaud serial port. The actual data throughput is about 10KBaud thus it is well below the speed of the port. I use hardware RTS/CTS flow control which can stall the data acquisition sample rate if necessary. This ensures the display computer has the ability to slow the data acquisition rate should it become too busy to accept the regular data flow. Both the serial port buffer and the java read buffer are set at 16KB. Usually the data transfers into the java read buffer are less than 100 bytes unless the data acquisition is recovering from a stall. The data flow normally hesitates after each 5 KB block as a continue command is needed from the display computer to start the drawing of a new graphics display line. Separate threads have been provided for the serial port event monitoring and data processing. The serial port event thread has been given the maximum priority and data processing thread the minimum priority provided by java. Thread yield statements have been placed within all data processing while/for loops as an effort to ensure quick access to CPU cycles for the serial port event thread. I have found that short data transmissions are essentially error free but occasional dropouts occur with continuous data flow especially under Windows XP. ....................................................................................................................................................................................... Linux results: I am happy to report that RXTX 2.1 appears to work very well under Linux although I did notice some errors when the screen savers were running with my dual monitors. I believe this is a local problem associated with my dual graphics which needs further attention. The recent CommApi 3 Linux release from Sun did not work at all with my program. It seemed to send commands out OK but did not receive any data. Although the serial port event triggered the ISR, the input stream appeared filled with nulls and thus did not contain any data. As my understanding is that CommApi 3 was tested with a Red Hat distribution of Linux I wonder if this problem is distro dependent? Although somewhat off topic here I wonder if anyone reading this has had similar experience? .................................................................................................................................................................................. Windows XP results: There are problems with occasional data dropouts which become more frequent as the sampling rate is increased or if the computer becomes busy with other duties. The dropouts typically consist of a half dozen byte block of lost data. It appears the lost bytes never get added to the java input stream. There has not been any indication of garbled data, overruns or framing errors which suggests the UART communications remains solid. Using javax.comm 2 I found that the setting of SerialPort 'enableReceiveThreshold' to 40 and 'enableReceiveTimeout' of 100mS reduced the dropouts error rate significantly. I found that I could not get RXTX 2.1 to function with the aforementioned threshold and timeout settings. The javax.comm 2 interface is consequently performing better for me under Windows than RXTX 2.1. I wonder if anyone here has any suggestions as to what I might try to improve RXTX 2.1? Although my settings are the same as under Suse 10.0, RXTX 2.1 performs much better for me under Linux than any of the alternatives that I have tried under Windows XP . ............................................................................................................................................................................... I would like to establish, based on the experience of others, if I have reached the normally expected performance limit of java serial port communications? Should I expect to achieve virtually error free serial port data input from a continuous stream under Windows XP java software? I am considering changing my protocol to packets with error checking if necessary but would like to know if the dropout problems I am experiencing are typical or not before I take this rather work intensive plunge. Many thanks in advance for any help! Best Regards, Tom Alldread -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.375 / Virus Database: 267.15.2/253 - Release Date: 2006-02-07 From jlaxson at mac.com Wed Feb 8 23:56:48 2006 From: jlaxson at mac.com (John Laxson) Date: Thu, 9 Feb 2006 00:56:48 -0600 Subject: [Rxtx] PortInUseException: Unknown Application on OSX Message-ID: Hi, I've been trying to get RXTX 2.1.7 going on Mac OS X for a while here, and am running up into a wall here. I've tried with pre- compiled and the source version and get the same problem, a gnu.io.PortInUseException: Unknown Application. I have run the fixperms script included with the source distribution, and id shows me as a member of the uucp group, and permissions on /var/spool/uucp are 775 root:uucp. Running a test program (included at the bottom for clarity) lets me enumerate all the serial ports correctly, but trying to open any of them gives the PortInUseException. If it helps, when I try to open a port that's set to make an outgoing bluetooth connection, there is no delay and no connection attempt at all. Thanks, John Laxson PS: The documentation wiki on qbang.org shows 404, and has for a few days now. My test code: public static void main(String[] args) { SerialPort serialPort; try { Enumeration e = CommPortIdentifier.getPortIdentifiers(); CommPortIdentifier ident; while (e.hasMoreElements()) { ident = (CommPortIdentifier)e.nextElement(); System.out.println(ident.getName()); } ident = CommPortIdentifier.getPortIdentifier("/dev/cu.modem"); serialPort = (SerialPort) ident.open("Me", 5000); } catch (Exception e) { e.printStackTrace(); } } From rajesh.invincible at gmail.com Thu Feb 9 03:39:38 2006 From: rajesh.invincible at gmail.com (Rajesh N) Date: Thu, 9 Feb 2006 16:09:38 +0530 Subject: [Rxtx] Re: Move .java Files in gnu.io filesystem hierarchy - Maven (2) In-Reply-To: <43DF21D2.7090200@ngi.it> References: <43DF21D2.7090200@ngi.it> Message-ID: <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Can anybody tell me how to overcome these EXCEPTIONS I AM WORKING ON SERIAL COMMN IN JAVA ON LINUX. 1. " NOT ALL PARAMETERS SUPPORTED BY THE KERNEL" This i came across the following statement inmy prog. SerialP is A SerialPort object SerialP.setSerialPortParams(9600(BAUDRATE),DATABITS_8,STOPBITS_1,PARITY_NONE) 2. NullPointer Exception at Event Dispatch Now i have checked all my object references for a null reference but i found none i have put up my entire code in try catch blocks but still I AM UNABLE TO CATCH THIS EXCEPTION AND HENCE MY APPLICATION CLOSES HOW DOES THESE GO? PLEASE HELP ME IT IS URGENTTTTTTTTTTTTTTTT yours sincerely RAJESH On 1/31/06, Fabio Frumento wrote: > Hi Xavier, > > I don't know maven at all but the directory hierarchy listed buy Trent > is fine for me... > > I'll take a look to maven, it seems an interesting project > > Regards > > Fabio Frumento > > Trent Jarvi wrote: > > On Tue, 31 Jan 2006, Xavier Frisaye wrote: > > > >> Hi all, > >> > >> If you are going to rearrange the src folder, i will propose to use > >> maven 2 and follow its directory structure > >> > (http://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html). > >> > >> Maven 2 simplify java project and give a standard way to make projects > >> (http://maven.apache.org/). > >> We are using it for internal projects and we are very satisfied. > >> > >> Is anybody interested? > >> > >> I'm not an expert in maven 2 (yet) but i'm agree to help using it if > >> you choose to make so. > >> > > > > so this would be: > > > > rxtx-devel/src/main/java/gnu.io > > rxtx-devel/src/test/java/ManIwish.java > > > > I don't use IDEs very much so I'll let others comment. But I don't see > > a problem with that. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Thu Feb 9 09:50:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 9 Feb 2006 09:50:31 -0700 (MST) Subject: [Rxtx] Re: Move .java Files in gnu.io filesystem hierarchy - Maven (2) In-Reply-To: <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Message-ID: On Thu, 9 Feb 2006, Rajesh N wrote: > Can anybody tell me how to overcome these EXCEPTIONS > I AM WORKING ON SERIAL COMMN IN JAVA ON LINUX. > > 1. " NOT ALL PARAMETERS SUPPORTED BY THE KERNEL" > > This i came across the following statement inmy prog. > SerialP is A SerialPort object > SerialP.setSerialPortParams(9600(BAUDRATE),DATABITS_8,STOPBITS_1,PARITY_NONE) > Strange. The parameters you use are the same the port should open with by default. Could you paste the actual exception you are getting? I don't see that in the rxtx source. Also it would help to know the rxtx version. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Fri Feb 10 15:29:05 2006 From: lux at diesel-research.com (Kim Lux) Date: Fri, 10 Feb 2006 15:29:05 -0700 Subject: [Rxtx] One serial port object for both sending and receiving ? Message-ID: <1139610545.18177.4.camel@zd7280> Is it OK to use one SerialPort ojbect (ex Serial Port serialPort;) and use it for both sending and receiving ? For example: ======================================================================== static SerialPort serialPort = null; static OutputStream serialOut = null; static InputStream serialIn = null; // assign it to an outputStream for use try{ serialOut = serialPort.getOutputStream(); System.out.println("Serial output stream has been assigned."); }//try catch(IOException e) { System.out.println("Error: Couldn't assign output stream to serial port."); }//catch //assign it to an inputStream for use try{ serialIn = serialPort.getInputStream(); System.out.println("Serial input stream has been assigned."); }//try catch(IOException e) { System.out.println("Error: Couldn't assign input stream to serial port."); }//catch ======================================================================== -- Kim Lux, Diesel Research Inc. From lux at diesel-research.com Fri Feb 10 21:23:00 2006 From: lux at diesel-research.com (Kim Lux) Date: Fri, 10 Feb 2006 21:23:00 -0700 Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Message-ID: <1139631780.23882.10.camel@zd7280> I've got a problem receiving chars with my version of serialRead, written in an SWT GUI. I had a Java pro have a good look at my code and he can't see anything wrong with it. I can send chars fine. When I receive a char the cpu usage for the app goes to 100% and the code in the serial event handler doesn't get executed. The instructions on the Java Comm Serial API How-To for Linux page state that I must install javacomm. Is that true ? Everything builds without it and I can send chars on rxtx just fine, but I can't receive them. Could this be the problem ? I downloaded and installed javacomm. I was not able to add "Driver=gnuio.RXTXCommDriver to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 installed in /usr/java/jre1.5.0_05. I added comm.jar to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext to the library paths. Is this OK ? Does it matter that I am receiving on /dev/ttyUSB0 ? Thanks. -- Kim Lux, Diesel Research Inc. From lunareclipse03 at web.de Sat Feb 11 09:44:46 2006 From: lunareclipse03 at web.de (lunareclipse03@web.de) Date: Sat, 11 Feb 2006 17:44:46 +0100 Subject: [Rxtx] Question about Serial I/O under Win32 Message-ID: <662084330@web.de> Hello everybody, I have a strange problem with a piece of code I made for myself. No, this is not really concerning rxtx, but nevertheless I post this to the list, hoping that some of you can help me. I've written two libraries, one for linux and one for win32. The linux port works quite well, I can send / receive faxes and / or replay voice messages over the telephone line using a voice modem. But the win32 port of the library causes some trouble. If, for example, I send out a fax with a certain modem under linux, it works well. The fax is complete when it comes out of the fax machine. If I then use the same modem to send out a fax under win32, the fax coming out of the fax machine gets "stuck" halfways, but the sending modem thinks that transmission was ok and drops the connection. The answering fax machine then gives me "error while receiving." The "upper layer" java code MUST be right, because if I do the same thing under linux (using the linux library), everything is alright. Now I have to ask: Can somebody please help me out with this??!? Could it be the case that some kind of flow control or COMMTIMEOUTS setting causes this behaviour? I set flow control to RTS/CTS before sending out a fax. How can I DISABLE flow control? Or what do you think? Can something else cause this problems? Thank you all for your time and PLEASE write back soon. Regards, --Sven Ahlemann Am Waldrand 31 45721 Haltern am See Germany ______________________________________________________________ Verschicken Sie romantische, coole und witzige Bilder per SMS! Jetzt bei WEB.DE FreeMail: http://f.web.de/?mc=021193 From lux at diesel-research.com Sat Feb 11 10:06:52 2006 From: lux at diesel-research.com (Kim Lux) Date: Sat, 11 Feb 2006 10:06:52 -0700 Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: <1139631780.23882.10.camel@zd7280> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> <1139631780.23882.10.camel@zd7280> Message-ID: <1139677612.3431.5.camel@zd7280> More on this problem. I copied and pasted simpleRead into a console based Eclipse project and I've got the same result, except that cpu usage doesn't go to 100%. I'm beginning to think there is an issue in rxtx. My imports for simpleRead are: ============================ import gnu.io.*; import java.util.*; //import javax.comm.*; import java.io.*; =========================== Any ideas ? I am trying to read from /dev/ttyUSB0 using a serial to USB adapter which has worked well with minicom and gtkterm. Thanks. On Fri, 2006-02-10 at 21:23 -0700, Kim Lux wrote: > I've got a problem receiving chars with my version of serialRead, > written in an SWT GUI. > > I had a Java pro have a good look at my code and he can't see anything > wrong with it. > > I can send chars fine. When I receive a char the cpu usage for the app > goes to 100% and the code in the serial event handler doesn't get > executed. > > The instructions on the Java Comm Serial API How-To for Linux page state > that I must install javacomm. Is that true ? Everything builds without > it and I can send chars on rxtx just fine, but I can't receive them. > Could this be the problem ? > > I downloaded and installed javacomm. I was not able to add > "Driver=gnuio.RXTXCommDriver > to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not > have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 > installed in /usr/java/jre1.5.0_05. I added comm.jar > to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext > to the library paths. Is this OK ? > > Does it matter that I am receiving on /dev/ttyUSB0 ? > > Thanks. > -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Sun Feb 12 21:01:33 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:01:33 -0700 (MST) Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: <1139677612.3431.5.camel@zd7280> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> <1139631780.23882.10.camel@zd7280> <1139677612.3431.5.camel@zd7280> Message-ID: I suspect what is happening is the select() is breaking out in the native code but the driver does not have support for notifying there are X bytes available. On some traditional Unix based systems, the only way you know data is available is the fd status changes and do an FIORDCHK ioctl. Or perhaps the only thing you can know is the fd status changed. It would take reading through the kernel driver code to know for sure. So on USB, depending upon the driver, the same may need to be done or the driver improved a bit if possible to support. Polling reads will also work but don't use the event driven model of CommAPI which isnt acceptable in the long run. The 100% cpu usage can then be explained because select no longer blocks until the data is read; the eventLoop spins loose. You can put a well placed sleep but rxtx only expects those are needed when it knows data is available. This may not be a super simple thing to understand and fix. I do have ideas to get you started. I'm going to be short on time the next couple weeks. I expect to put some good time in and answer some other questions I saw around the 25th. For now, I'd look at the following and go from there with the hints I've given. JNIEXPORT jint JNICALL RXTXPort(nativeavailable)( JNIEnv *env, jobject jobj ) { int fd = get_java_var( env, jobj,"fd","I" ); int result; /* char message[80]; ENTER( "RXTXPort:nativeavailable" ); On SCO OpenServer FIONREAD always fails for serial devices, so try ioctl FIORDCHK instead; will only tell us whether bytes are available, not how many, but better than nothing. This turns out to be true on Solaris also. taj. */ #ifdef FIORDCHK /* __unixware__ __sun__ probably others */ result = ioctl(fd, FIORDCHK, 0); #else if( ioctl( fd, FIONREAD, &result ) < 0 ) { goto fail; } #endif /* FIORDCHK */ On Sat, 11 Feb 2006, Kim Lux wrote: > > More on this problem. I copied and pasted simpleRead into a console > based Eclipse project and I've got the same result, except that cpu > usage doesn't go to 100%. I'm beginning to think there is an issue in > rxtx. > > My imports for simpleRead are: > > ============================ > import gnu.io.*; > import java.util.*; > //import javax.comm.*; > import java.io.*; > =========================== > > Any ideas ? I am trying to read from /dev/ttyUSB0 using a serial to > USB adapter which has worked well with minicom and gtkterm. > > Thanks. > > > > On Fri, 2006-02-10 at 21:23 -0700, Kim Lux wrote: >> I've got a problem receiving chars with my version of serialRead, >> written in an SWT GUI. >> >> I had a Java pro have a good look at my code and he can't see anything >> wrong with it. >> >> I can send chars fine. When I receive a char the cpu usage for the app >> goes to 100% and the code in the serial event handler doesn't get >> executed. >> >> The instructions on the Java Comm Serial API How-To for Linux page state >> that I must install javacomm. Is that true ? Everything builds without >> it and I can send chars on rxtx just fine, but I can't receive them. >> Could this be the problem ? >> >> I downloaded and installed javacomm. I was not able to add >> "Driver=gnuio.RXTXCommDriver >> to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not >> have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 >> installed in /usr/java/jre1.5.0_05. I added comm.jar >> to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext >> to the library paths. Is this OK ? >> >> Does it matter that I am receiving on /dev/ttyUSB0 ? >> >> Thanks. >> > From tjarvi at qbang.org Sun Feb 12 21:03:30 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:03:30 -0700 (MST) Subject: [Rxtx] One serial port object for both sending and receiving ? In-Reply-To: <1139610545.18177.4.camel@zd7280> References: <1139610545.18177.4.camel@zd7280> Message-ID: On Fri, 10 Feb 2006, Kim Lux wrote: > > Is it OK to use one SerialPort ojbect (ex Serial Port serialPort;) and > use it for both sending and receiving ? > > For example: > > ======================================================================== > static SerialPort serialPort = null; > static OutputStream serialOut = null; > static InputStream serialIn = null; > > > > > // assign it to an outputStream for use > try{ > serialOut = serialPort.getOutputStream(); > System.out.println("Serial output stream has been assigned."); > }//try > catch(IOException e) > { > System.out.println("Error: Couldn't assign output stream to serial > port."); > }//catch > > > //assign it to an inputStream for use > try{ > serialIn = serialPort.getInputStream(); > System.out.println("Serial input stream has been assigned."); > }//try > catch(IOException e) > { > System.out.println("Error: Couldn't assign input stream to serial > port."); > }//catch This should be fine. In fact trying to do it another way will probably not work as you will run into lockfile issues. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun Feb 12 21:13:13 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:13:13 -0700 (MST) Subject: [Rxtx] Question about Serial I/O under Win32 In-Reply-To: <662084330@web.de> References: <662084330@web.de> Message-ID: On Sat, 11 Feb 2006 lunareclipse03 at web.de wrote: > Hello everybody, > > I have a strange problem with a piece of code I made for myself. No, > this is not really concerning rxtx, but nevertheless I post this to the > list, hoping that some of you can help me. I've written two libraries, > one for linux and one for win32. The linux port works quite well, I can > send / receive faxes and / or replay voice messages over the telephone > line using a voice modem. But the win32 port of the library causes some > trouble. If, for example, I send out a fax with a certain modem under > linux, it works well. The fax is complete when it comes out of the fax > machine. If I then use the same modem to send out a fax under win32, the > fax coming out of the fax machine gets "stuck" halfways, but the sending > modem thinks that transmission was ok and drops the connection. The > answering fax machine then gives me "error while receiving." The "upper > layer" java code MUST be right, because if I do the same thing under > linux (using the linux library), everything is alright. Now I have to > ask: Can somebody please help me out with this??!? Could it be the case > that some kind of flow control or COMMTIMEOUTS setting causes this > behaviour? I set flow control to RTS/CTS before sending out a fax. How > can I DISABLE flow control? Or what do you think? Can something else > cause this problems? Thank you all for your time and PLEASE write back > soon. > Hi Sven I'm not too willing to talk about flow control at the low level until I confirm some things with test equipment later. It is not clear if you are using rxtx or writing your own native code. So I'm not sure how to answer much of this :) If you are wondering how to change the flow control using rxtx from java, The BlackBox example from Sun flips this back and forth. SerialPort.java in rxtx 2.1 uses the following: SerialPort.java: public static final int FLOWCONTROL_NONE =0; SerialPort.java: public static final int FLOWCONTROL_RTSCTS_IN =1; SerialPort.java: public static final int FLOWCONTROL_RTSCTS_OUT =2; SerialPort.java: public static final int FLOWCONTROL_XONXOFF_IN =4; SerialPort.java: public static final int FLOWCONTROL_XONXOFF_OUT=8; So if you set flowcontrol to RTSCTS, you can set it to NONE to turn it off. If you are looking for how to do it in native code, the rxtx Source is SerialImp.c (unix/linux/mac os x/w32) and termios.c (w32 only with SerialImp.c) You can track the code: SerialImp.c:JNIEXPORT void JNICALL RXTXPort(setflowcontrol)( JNIEnv *env, jobject jobj, jint flowmode ) termios.c:int tcgetattr( int fd, struct termios *s_termios ) termios.c:int tcsetattr( int fd, int when, struct termios *s_termios ) There may be a problem in the rxtx flow control code though. Rather than guess, I want to test this with a gold standard. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Feb 6 00:00:16 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 00:00:16 -0700 (MST) Subject: [Rxtx] wiki delay until tomorrow night. In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: On Sun, 5 Feb 2006, Trent Jarvi wrote: > On Sun, 5 Feb 2006, Kim Lux wrote: > >> usb ? Tell me more... I need that too. > > usb is a very proper design. Thats all it is. > Maybe rxtx could help usb. But it would start with helping bring back the community that was already there. It's not something I'd love to do but maybe its the right thing to do. It would probably take 2 years to do right. But maybe thats better than what we have now. I honestly don't know what IBM is doing which could just run over everything. Just some thoughts after some fine german wine. -- Trent Jarvi tjarvi at qbang.org From gadelavega at yahoo.com.ar Mon Feb 6 02:17:05 2006 From: gadelavega at yahoo.com.ar (Gonzalo A. de la Vega) Date: Mon, 06 Feb 2006 10:17:05 +0100 Subject: [Rxtx] Serial port ownership question In-Reply-To: References: <20060205113618.30274.qmail@web53501.mail.yahoo.com> <1139157422.4553.9.camel@zd7280> <1139158698.4936.9.camel@zd7280> Message-ID: <43E71411.4050402@yahoo.com.ar> On my Fedora Core 4: ls -l /dev/ttyS* crw-rw---- 1 root uucp 4, 64 Feb 6 2006 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Feb 6 2006 /dev/ttyS1 ... and: grep "ttyUSB" /etc/udev/rules.d/50-udev.rules KERNEL=="ttyUSB*", GROUP="uucp", MODE="0660" So anyone in the "uucp" group can use serial ports. On Gentoo the group is "tty". Trent Jarvi escribi?: > > > On Sun, 5 Feb 2006, Dr. Douglas Lyon wrote: > >> I can confirm that this is the case (only root ownership of >> serial ports, under fedora 4). >> Wow, what were they thinking?! >> - DL >> >>> I've found that the newer kernels have the serial ports owned by root. >>> For example, >>> >>> $ls -al /dev/tty* >>> crw-rw-rw- 1 root root 5, 0 Feb 5 02:06 /dev/tty >>> crw-rw---- 1 root root 4, 0 Feb 5 02:06 /dev/tty0 >>> crw------- 1 root root 4, 1 Feb 5 09:07 /dev/tty1 >>> crw-rw---- 1 root tty 4, 10 Feb 5 02:06 /dev/tty10 >>> crw-rw---- 1 root tty 4, 11 Feb 5 02:06 /dev/tty11 >>> ... > > > This is just not a problem jcp or such are going to solve. Its a > platform spitwad fight. But do look at pam. In fact thats what Sun > is doing too. Maybe Linux followed their lead.. I'm not a pam guy. > I've spent 16 hours trying to understand it but your users wont :) > > Solution? I have no clue. Its two tangent mentalities from my > perspective. > > -- > Trent Jarvi > tjarvi at qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mtnvega at yahoo.com.br Mon Feb 6 05:35:43 2006 From: mtnvega at yahoo.com.br (Luiz Jr) Date: Mon, 6 Feb 2006 12:35:43 +0000 (GMT) Subject: [Rxtx] Documentation Wiki In-Reply-To: <1139157422.4553.9.camel@zd7280> Message-ID: <20060206123543.57256.qmail@web53515.mail.yahoo.com> Hello, Thank you for you answer, but so the usage of the API is pretty much like the Java Communications Api? If yes, what version of the Java Comm Api? Thank you, Luiz A. Brandao Jr Kim Lux escreveu: On Sun, 2006-02-05 at 08:36 -0300, Luiz Jr wrote: > Hello, > > I want to start using the RXTX libraries, but I would to know how, > since I can not access the documentation wiki page I just started using them yesterday. Below is how I installed the libraries, if that helps. I used snippets of code from the SimpleWrite application here to get me going. http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html Instead of "import javax.comm.*;", use "import gnu.io.*;" which is gotten from RXTXcomm.jar, which you will need to include in your project references. I am working in Eclipse. BTW: there is no way to open a port without going through the port list and finding it. Maybe sometime in the future someone (me ?) will write a method called openSerialPort that allows the user to give a port identifier, such as "/dev/tty1" and return a port ready to use. It wouldn't take much to write that and it would save users a lot of code. Hope this helps. ======================================================================= 1) Figure out which java you are running, incase there is more than one installed. $ java -version java version "1.5.0_05" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_05-b05) Java HotSpot(TM) Client VM (build 1.5.0_05-b05, mixed mode, sharing) 2) Find all the jre directories and the one from which you are currently running. kfind (jre) 3) cd to that directory plus /lib/i386 cd /usr/java/jre1.5.0_05/lib/i386 4) Copy the library files (*.so) to that directory. cp /home/krlux/Desktop/'Java Controls'/rxtx-linux/bin/* . 5) Check that the copy was successful ls librxtx* librxtxI2C.so librxtxRaw.so librxtxSerial.so librxtxParallel.so librxtxRS485.so 6) cd to the /lib/ext directory for your java. cd /usr/java/jre1.5.0_05/lib/ext 7) Copy the Jar files there cp /home/krlux/Desktop/'Java Controls'/rxtx-linux/lib/ext/* . 8) Check that it was successful ls RXTX* RXTXcomm.jar Rxtx is now installed on your machine ready to use. =================================================================== -- Kim Lux, Diesel Research Inc. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx --------------------------------- Yahoo! Acesso Gr?tis - Internet r?pida e gr?tis. Instale o discador agora! -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/544aa403/attachment-0038.html From lyon at docjava.com Mon Feb 6 05:49:34 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 06 Feb 2006 07:49:34 -0500 Subject: [Rxtx] wiki delay until tomorrow night. In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: Hi All, I have often thought about USB drivers being needed. For example, the ironman watch will not interface to a mac (windows only). It is USB. My dymo label writer has no Java driver (native only). Etc. Most cheap web cameras are USB (and Java drivers go through JAI, if it supports the camera at all). The JAI code shows how sun did the USB drivers. You have to be a member of the jai project to download the source code. https://jai.dev.java.net has the jai distro. And then you are not allowed to redistribute it. However, we can all learn from it (if so inclined). Basically: cvs -d :pserver:lyon at cvs.dev.java.net:/cvs login cvs -d :pserver:lyon at cvs.dev.java.net:/cvs checkout jai-core You will need to user your own uid and pw to get in. The ant build has over 100 warnings from sun deprecations of its own code. You might say that they were hoisted on their own Picard ;) One interesting thing is that they support several platforms: linux-amd64 64-bit Linux-AMD64 linux-i586 32-bit Linux-x86 solaris-amd64 64-bit Solaris-AMD64 solaris-i586 32-bit Solaris-x86 solaris-sparc 32-bit Solaris-SPARC solaris-sparcv9 64-bit Solaris-SPARC windows-i586 32-bit Windows-x86 Thus, ant is used to provide a multi-platform native method distro. Neat. How do they do it? check this out: And: The core download does not contain any C source code (it was all pre-built). Basically, they are just copying .so and .dll files into build directories. I would love to see the C code for this...but Sun does not post it on the https://jai.dev.java.net site. I don't know why...Perhaps I missed it. - Doug >On Sun, 5 Feb 2006, Trent Jarvi wrote: > >>On Sun, 5 Feb 2006, Kim Lux wrote: >> >>>usb ? Tell me more... I need that too. >> >>usb is a very proper design. Thats all it is. >> > >Maybe rxtx could help usb. But it would start with helping bring >back the community that was already there. > >It's not something I'd love to do but maybe its the right thing to do. > >It would probably take 2 years to do right. But maybe thats better >than what we have now. > >I honestly don't know what IBM is doing which could just run over everything. > >Just some thoughts after some fine german wine. > >-- >Trent Jarvi >tjarvi at qbang.org > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tdelenik at gmail.com Mon Feb 6 05:56:32 2006 From: tdelenik at gmail.com (Thanasis Delenikas) Date: Mon, 6 Feb 2006 14:56:32 +0200 Subject: Fwd: [Rxtx] Documentation Wiki In-Reply-To: <1139157422.4553.9.camel@zd7280> References: <20060205113618.30274.qmail@web53501.mail.yahoo.com> <1139157422.4553.9.camel@zd7280> Message-ID: <310a1a930602060456t129f1dc6p5f2b908f13ab5a0b@mail.gmail.com> Hello all, Kim, this is a snippet from the code I use. The closest to directly opening a specific port without enumeration. << ... portId = CommPortIdentifier.getPortIdentifier(getPort()); serialPort = (SerialPort) portId.open("jSMSEngine", 1971); ... >> where getPort() return the string identifier of the port, i.e. "/dev/ttyS0" or "COM1" or whatever. Thanasis. ---------- Forwarded message ---------- From: Kim Lux Date: Feb 5, 2006 6:37 PM Subject: Re: [Rxtx] Documentation Wiki To: RXTX Developers and Users BTW: there is no way to open a port without going through the port list and finding it. Maybe sometime in the future someone (me ?) will write a method called openSerialPort that allows the user to give a port identifier, such as "/dev/tty1" and return a port ready to use. It wouldn't take much to write that and it would save users a lot of code. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/182ab5b8/attachment-0038.html From tjarvi at qbang.org Mon Feb 6 11:53:57 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 11:53:57 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: On Mon, 6 Feb 2006, Dr. Douglas Lyon wrote: > Hi All, > I have often thought about USB drivers being needed. > For example, the ironman watch will not interface > to a mac (windows only). It is USB. > My dymo label writer has no Java driver (native only). > Etc. > Most cheap web cameras are USB (and Java drivers go > through JAI, if it supports the camera at all). > The JAI code shows how sun did the USB drivers. > You have to be a member of the jai project to download > the source code. > https://jai.dev.java.net has the jai distro. > And then you are not allowed to redistribute it. However, > we can all learn from it (if so inclined). Basically: > cvs -d :pserver:lyon at cvs.dev.java.net:/cvs login > cvs -d :pserver:lyon at cvs.dev.java.net:/cvs checkout jai-core > You will need to user your own uid and pw to get in. > The ant build has over 100 warnings from sun deprecations > of its own code. > > You might say that they were hoisted on their own Picard ;) > > One interesting thing is that they support several platforms: > linux-amd64 64-bit Linux-AMD64 > linux-i586 32-bit Linux-x86 > solaris-amd64 64-bit Solaris-AMD64 > solaris-i586 32-bit Solaris-x86 > solaris-sparc 32-bit Solaris-SPARC > solaris-sparcv9 64-bit Solaris-SPARC > windows-i586 32-bit Windows-x86 > Thus, ant is used to provide a multi-platform native method distro. > Neat. > How do they do it? > check this out: > > > > > > > > > > > > > And: > > > > > > > > > > The core download does not contain any C source code (it was all pre-built). > Basically, they are just copying .so and .dll files into build directories. > > I would love to see the C code for this...but Sun does not post it on the > https://jai.dev.java.net site. > > I don't know why...Perhaps I missed it. > > - Doug > > I've looked at moving rxtx to Ant builds. I think that would help IDEs a great deal. I requested a evalutation desk copy the O'Reilly Ant book for some j2ee material I was teaching. http://www.oreilly.com/catalog/anttdg/ It has a one sentence mention of JNI. So there was not luck there. I saw that there is another Ant book that does mention JNI more. I can't find it now. Ant must be able to support it with extensions. http://ant.apache.org/manual/OptionalTasks/javah.html What the auto(break :) tools do in the rxtx build is 4 things really. 1) gcc compile flags 2) ld compile flags 3) config.h 4) compile flags for customizing rxtx (lockfiles, ...) See 1 All of this information except 4 can be static once obtained. So I'm not attached to the auto tools. If I could find an example of Ant being used for JNI code, I'd be one of the first to start moving that direction. Maybe someone saw an example someplace. The other thing we have not completed discussing is the directory structure. There is interest in making rxtx more IDE friendly. I get more mail about that off the list than how to install rxtx. And I see we have Ken Thompson in da house :) He is our trusted CVS maintainer and the guy that purchased the rxtx.org domain. Old community. We will need Ken for changing the directory structure of source. I would like to open up discussion about both of these as it is more than time. The problem is I have little experience with Ant and even less with IDEs. It would be nice if we could work with Eclipse and NetBeans. http://www.netbeans.org/ (sun and some community) http://www.eclipes.org (ibm,rhat,... perhaps more community) http://maven.apache.org/what-is-maven.html (apache. It is community) borland should sortof be here too but I think thats covered in eclipse. >From what I understand so far, we should morph rxtx to support those three maybe trusting apaches lead with maven. But I use vi. I have little to no clues beyond what people have fed me. Can we agree that thats the right direction to go? -- Trent Jarvi tjarvi at qbang.org From brian at mbari.org Mon Feb 6 14:57:50 2006 From: brian at mbari.org (Brian Schlining) Date: Mon, 6 Feb 2006 13:57:50 -0800 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> > The other thing we have not completed discussing is the directory > structure. There is interest in making rxtx more IDE friendly. I > get more mail about that off the list than how to install rxtx. > > And I see we have Ken Thompson in da house :) He is our trusted > CVS maintainer and the guy that purchased the rxtx.org domain. Old > community. We will need Ken for changing the directory structure of > source. > > I would like to open up discussion about both of these as it is > more than time. The problem is I have little experience with Ant > and even less with IDEs. It would be nice if we could work with > Eclipse and NetBeans. > > http://www.netbeans.org/ (sun and some community) > http://www.eclipes.org (ibm,rhat,... perhaps more community) > http://maven.apache.org/what-is-maven.html (apache. It is community) > borland should sortof be here too but I think thats covered in > eclipse. > >> From what I understand so far, we should morph rxtx to support >> those three > maybe trusting apaches lead with maven. But I use vi. I have > little to no clues beyond what people have fed me. > Maven likes the directory structure below for Java code. (From http:// maven.apache.org/guides/getting-started/index.html) This structure works fine with ant, netbeans, and eclipse. rxtx_root_directory `-- src |-- main | `-- java | `-- gnu | `-- io `-- test `-- java `-- gnu `-- io Brian Schlining Software Engineer http://www.mbari.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/d9451eba/attachment-0038.html From tjarvi at qbang.org Mon Feb 6 15:11:45 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 15:11:45 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: > rxtx_root_directory > `-- src > |-- main > | `-- java > | `-- gnu > | `-- io > `-- test > `-- java > `-- gnu > `-- io > >From what I understand this will just be good. For me it makes no difference. So lets do the rxtx thing. Let if fester for two weeks and if nobody objects, we will do it. I'm not doing this because I care. I'm doing this to eliminate much of my inbox. But test... man is rxtx lacking there in the community aspect. It is covered but not right. _maybe_ I can change that this year. -- Trent Jarvi tjarvi at qbang.org (cat hurding since 1997) From lux at diesel-research.com Mon Feb 6 21:38:49 2006 From: lux at diesel-research.com (Kim Lux) Date: Mon, 06 Feb 2006 21:38:49 -0700 Subject: [Rxtx] How can I use Lock Files with rxtx (in FC4) ? Message-ID: <1139287129.17031.3.camel@zd7280> I am now running an rxtx application on FC4. I am getting: ========================================================= check_group_uucp(): error testing lock file creation Error details: Permission denied check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL ========================================================= $ ls -al /var/lock total 32 drwxrwxr-x 4 root lock 4096 Feb 6 16:04 . drwxr-xr-x 24 root root 4096 Nov 14 01:19 .. drwx------ 2 root root 4096 Apr 27 2005 lvm drwxr-xr-x 2 root root 4096 Feb 6 16:04 subsys How do I fix this for regulator users ? -- Kim Lux, Diesel Research Inc. From dmarkman at mac.com Mon Feb 6 22:24:44 2006 From: dmarkman at mac.com (Dmitry Markman) Date: Tue, 7 Feb 2006 00:24:44 -0500 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: if I understands the issue right in order to be able to use ant for c/c++ compilation you have to install ant's cc task http://ant-contrib.sourceforge.net/cc.html it looks like it should work on mac os x (authors claim, that it's platform independent) but I never tested so all you have to do it's providing right command line for the gcc compiler On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: >> rxtx_root_directory >> `-- src >> |-- main >> | `-- java >> | `-- gnu >> | `-- io >> `-- test >> `-- java >> `-- gnu >> `-- io >> > > >> From what I understand this will just be good. > > For me it makes no difference. So lets do the rxtx thing. Let if > fester for two weeks and if nobody objects, we will do it. > > I'm not doing this because I care. I'm doing this to eliminate > much of my inbox. > > But test... man is rxtx lacking there in the community aspect. It > is covered but not right. _maybe_ I can change that this year. > > -- > Trent Jarvi > tjarvi at qbang.org > (cat hurding since 1997) > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx Dmitry Markman From lux at diesel-research.com Mon Feb 6 23:20:15 2006 From: lux at diesel-research.com (Kim Lux) Date: Mon, 06 Feb 2006 23:20:15 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? Message-ID: <1139293215.3689.4.camel@zd7280> I'm running the code below. portlist.hasMoreElements() is false. /dev has ports in it as listed below. What am I doing wrong ? ========================================================== // Step through the list of ports until we find one that matches // the one we are looking for. portList = CommPortIdentifier.getPortIdentifiers(); while(portList.hasMoreElements()) { portID = (CommPortIdentifier) portList.nextElement(); // if (portID.getName().equals("/dev/ttyUSB0")) { myTA.append("Serial port ttyUSB0 has been found\n"); break; }// if portID equals... }// End of while... ========================================================== ls -al /dev/tty* crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 ... crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 -- Kim Lux, Diesel Research Inc. From david.garnier at trusted-logic.com Tue Feb 7 00:46:30 2006 From: david.garnier at trusted-logic.com (David Garnier) Date: Tue, 07 Feb 2006 08:46:30 +0100 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: <43E85056.2090608@trusted-logic.com> Hello, I think that the make-based build process is fine as it is, apart from the location of the Java source files. It is true that putting the Java source in a directory structure that map 1-to-1 to the Java package structure is the norm and should make it easier for everyone to modify the Java source, with or without an IDE. Ant is a good tool, but in the RXTX case I fail to see the advantage of using it compared to the current make-based process. As Trent said, they are more pressing issues, like testing. Regards, David Dmitry Markman wrote: > if I understands the issue right > in order to be able to use ant for c/c++ compilation > you have to install ant's cc task > http://ant-contrib.sourceforge.net/cc.html > > it looks like it should work on mac os x > (authors claim, that it's platform independent) > but I never tested > > so all you have to do it's providing right command line > for the gcc compiler > > > > > On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: > >>> rxtx_root_directory >>> `-- src >>> |-- main >>> | `-- java >>> | `-- gnu >>> | `-- io >>> `-- test >>> `-- java >>> `-- gnu >>> `-- io >>> >> >> >>> From what I understand this will just be good. >> >> For me it makes no difference. So lets do the rxtx thing. Let if >> fester for two weeks and if nobody objects, we will do it. >> >> I'm not doing this because I care. I'm doing this to eliminate much >> of my inbox. >> >> But test... man is rxtx lacking there in the community aspect. It is >> covered but not right. _maybe_ I can change that this year. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> (cat hurding since 1997) From tjarvi at qbang.org Tue Feb 7 01:11:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 01:11:31 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <43E85056.2090608@trusted-logic.com> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: On Tue, 7 Feb 2006, David Garnier wrote: > Hello, > > I think that the make-based build process is fine as it is, apart from the location of the Java > source files. It is true that putting the Java source in a directory structure that map 1-to-1 to > the Java package structure is the norm and should make it easier for everyone to modify the Java > source, with or without an IDE. > > Ant is a good tool, but in the RXTX case I fail to see the advantage of using it compared to the > current make-based process. As Trent said, they are more pressing issues, like testing. > Hi David I have more experience with testing rxtx than I can talk about. But let it be known, rxtx has gone trough 100's of hours of testing. We are hobby folks interested in toys but there is more. rxtx has had some of the best guidance in the industry there. This is not an easy thing. I may be able to come back in a month from the other side of the corperate fence and help. I suspect the tests could just be made public but they are in a very unusual environment that just wont work in a wider sense. This is something I'll be trying to change. At one point it was agreed we could just make the results public so this isnt just noise.. There is interest and I think its safe to mention that much. The big problem with testing in the past is most of it is done with a loopback connection. So we *still* have major questions regarding things like flow control. rxtx talks to itself over a loopback and it works. regardless of right or wrong. This requires more thought to be done right. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Feb 7 02:46:34 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 02:46:34 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: > The big problem with testing in the past is most of it is done with a > loopback connection. So we *still* have major questions regarding things > like flow control. rxtx talks to itself over a loopback and it works. > regardless of right or wrong. With serial communication there are gold standards. ckermit is probably a definitive 'standard.' Maybe its possible to do ping/pong tests with ckermit? Is it scriptable? There are known issues in rxtx. Probably the worst is some threading issues regarding some JREs with multiple JNI threads setting java variables. Man did I get schooled there. Just switch the c functions to returning variables and things go away. Sometimes they work fine, sometimes they blow up. Without understanding everything, somehow rhat got it right and debian (and especially gentoo) grabbed kernel patches causing all sort of harm. Its not hard to fix once you understand whats going on but nearly impossible to track with a debugger. So I have a good idea what 2.1-8 will have outside of the IDE modifications. rxtx 2.1-7 is a release for everyone to sync with. Its not even as stable as -pre17 as far as I know - I ran no test suites. I'll be chasing it too. We just had so many contributions that it was time. It seriously broke internal scheduals but thats a great thing :) The other thing I want to do in 2.1-8 is automagic baud rates. It turns out lots of shops are doing really funky baud rates for things like automobile test equipment. It is possible but it requires a fair amount of change in the native code. Is anyone looking at this? -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Feb 7 02:57:21 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 07 Feb 2006 04:57:21 -0500 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <43E85056.2090608@trusted-logic.com> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: Hi All, I agree, testing is very important. The problem I have been trying to address is related to cross-platform testing and the robust nature of the installs. Typically, I visit 3 platforms to deploy my product, windows, linux and mac. A build is performed on each platform. The idea that you can build for many platforms from one copy the source code seems attractive. This should enable synchronized deployments of identical code. The question of how to achieve this goal remains open. As Trent mentioned, this is hard. Perhaps Ant will help here (but perhaps not). Ant does seem to help with running unit tests. However, it does not help with multi-platform tests. For that you need many machines and different operating environments. Toward that end, I have created a multi-platform test that can be run from web start, located at: http://show.docjava.com:8086/book/cgij/code/jnlp/serialPort.PortTest.jnlp This is interesting because many people in the community can run the test and we can improve the test, as time permits. No, it is not a perfect solution, however, the idea does help with multi-platform tests using many machines and different operating environments. If the group has a good test for a general serial port set-ups, i would be happy to deploy it, for general evaluation using web start. And as for ANT, it is just an idea. Not all my ideas are good ones! - Doug >Hello, > >I think that the make-based build process is fine as it is, apart >from the location of the Java >source files. It is true that putting the Java source in a directory >structure that map 1-to-1 to >the Java package structure is the norm and should make it easier for >everyone to modify the Java >source, with or without an IDE. > >Ant is a good tool, but in the RXTX case I fail to see the advantage >of using it compared to the >current make-based process. As Trent said, they are more pressing >issues, like testing. > >Regards, >David > >Dmitry Markman wrote: >> if I understands the issue right >> in order to be able to use ant for c/c++ compilation >> you have to install ant's cc task >> http://ant-contrib.sourceforge.net/cc.html >> >> it looks like it should work on mac os x >> (authors claim, that it's platform independent) >> but I never tested >> >> so all you have to do it's providing right command line >> for the gcc compiler >> >> >> >> >> On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: >> >>>> rxtx_root_directory >>>> `-- src >>>> |-- main >>>> | `-- java >>>> | `-- gnu >>>> | `-- io >>>> `-- test >>>> `-- java >>>> `-- gnu >>>> `-- io >>>> >>> >>> >>>> From what I understand this will just be good. >>> >>> For me it makes no difference. So lets do the rxtx thing. Let if >>> fester for two weeks and if nobody objects, we will do it. >>> >>> I'm not doing this because I care. I'm doing this to eliminate much >>> of my inbox. >>> >>> But test... man is rxtx lacking there in the community aspect. It is >>> covered but not right. _maybe_ I can change that this year. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> (cat hurding since 1997) > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From matt.higgins at gmail.com Tue Feb 7 08:28:34 2006 From: matt.higgins at gmail.com (Matt Higgins) Date: Tue, 7 Feb 2006 10:28:34 -0500 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final Message-ID: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? import java.io.*; import java.util.*; import gnu.io.*; public class MySimpleRead implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; public static void main(String[] args) { boolean portFound = false; String defaultPort = "COM1"; if (args.length > 0) { defaultPort = args[0]; } portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; MySimpleRead reader = new MySimpleRead(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } } public MySimpleRead() { try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) { e.printStackTrace(); } try { inputStream = serialPort.getInputStream(); } catch (IOException e) { e.printStackTrace(); } try { serialPort.addEventListener(this); } catch (TooManyListenersException e) { e.printStackTrace(); } try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { e.printStackTrace(); } System.out.println("Baud is " + serialPort.getBaudRate()); System.out.println("Bits is " + serialPort.getDataBits()); System.out.println("Stop is " + serialPort.getStopBits()); System.out.println("Par is " + serialPort.getParity()); serialPort.notifyOnDataAvailable(true); readThread = new Thread(this); readThread.start(); } public void run() { // Thread.sleep(20000); //} catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { System.out.println("An event occurred " + event.getEventType()); switch (event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: byte[] readBuffer = new byte[20]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } System.out.print(new String(readBuffer)); } catch (IOException e) {} break; } } } --------------- Result on windows ------------------------------ Stable Library ============================================================== Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port:: COM1 Baud is 9600 Bits is 8 Stop is 1 Par is 0 ----------------- End Results ----------------------------------------- ------------------ Result on Linux ----------------------------------- Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 Found port: /dev/ttyS0 Baud is 9600 Bits is 8 Stop is 1 Par is 0 An event occurred 1 043100066224 ------------------ End Results --------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/a1431630/attachment-0038.html From brian at mbari.org Tue Feb 7 09:48:37 2006 From: brian at mbari.org (Brian Schlining) Date: Tue, 7 Feb 2006 08:48:37 -0800 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> Message-ID: <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> Hi Matt > The following code works fine on Linux but I never see any data > when run on Windows. This is a cut and paste from the SimpleRead > example. > I am attempting to read data from a bar code scanner. I can fire > up HyperTermianl on windows and see that the device is working > properly as I see the barcodes are scanned and echoed back to the > terminal. However when I run the app I don't see any data. It is > however associating with the com port as the informational bits > print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. Cheers Brian Schlining Software Engineer http://www.mbari.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/16d07f37/attachment-0038.html From lux at diesel-research.com Tue Feb 7 11:59:58 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 11:59:58 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139293215.3689.4.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> Message-ID: <1139338798.8145.4.camel@zd7280> Any ideas on this ? Any reason why portList.hasMoreElements() should be false even though there are devices in /dev ? On Mon, 2006-02-06 at 23:20 -0700, Kim Lux wrote: > I'm running the code below. > > portlist.hasMoreElements() is false. > > /dev has ports in it as listed below. > > What am I doing wrong ? > > > ========================================================== > // Step through the list of ports until we find one that matches > // the one we are looking for. > > portList = CommPortIdentifier.getPortIdentifiers(); > > while(portList.hasMoreElements()) > { > portID = (CommPortIdentifier) portList.nextElement(); // > if (portID.getName().equals("/dev/ttyUSB0")) > { > myTA.append("Serial port ttyUSB0 has been found\n"); > break; > }// if portID equals... > }// End of while... > ========================================================== > > ls -al /dev/tty* > crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty > crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 > crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 > crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 > crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 > ... > crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 > crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 > crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 > > > -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 12:20:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 12:20:25 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139338798.8145.4.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> Message-ID: On Tue, 7 Feb 2006, Kim Lux wrote: > > Any ideas on this ? Any reason why portList.hasMoreElements() should be > false even though there are devices in /dev ? > > > On Mon, 2006-02-06 at 23:20 -0700, Kim Lux wrote: >> I'm running the code below. >> >> portlist.hasMoreElements() is false. >> >> /dev has ports in it as listed below. >> >> What am I doing wrong ? >> >> >> ========================================================== >> // Step through the list of ports until we find one that matches >> // the one we are looking for. >> >> portList = CommPortIdentifier.getPortIdentifiers(); >> >> while(portList.hasMoreElements()) >> { >> portID = (CommPortIdentifier) portList.nextElement(); // >> if (portID.getName().equals("/dev/ttyUSB0")) >> { >> myTA.append("Serial port ttyUSB0 has been found\n"); >> break; >> }// if portID equals... >> }// End of while... >> ========================================================== >> >> ls -al /dev/tty* >> crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty >> crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 >> crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 >> crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 >> crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 >> ... >> crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 >> crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 >> crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 >> >> >> > Hi Kim What rxtx does is try to open the port and do a timed out read. If the kernel/... do not complain it's enumarted. I suspect you could do a crude test by doing something like cat /dev/ttyS0 > /dev/null If that barfs then rxtx wont enumerate the port. hmm looking at your question again, I suspect it's a lockfile problem. This is documented in INSTALL with the source. Its easy enough to test this too.. touch /var/lock/testingrxtxlockfiles && rm -f /var/lock/testingrxtxlockfiles If you are not in the right group it will bail. Root will work regardless. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 12:37:56 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 12:37:56 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> Message-ID: <1139341076.8145.11.camel@zd7280> Exactly which ports does rxtx attempt to put into the list ? /dev/* or /dev/tty* or /dev/tty[0-9[0-9] ? or /dev/ttyS* ? For the record, only /dev/ttyUSB0 is a valid port on the machine I am presently on. Will this be a problem ? On Tue, 2006-02-07 at 12:20 -0700, Trent Jarvi wrote: > This is documented in INSTALL with the source. > I was wondering where that file was. I will download source and dig it up. Thanks. -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 12:51:09 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 12:51:09 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139341076.8145.11.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: On Tue, 7 Feb 2006, Kim Lux wrote: > > Exactly which ports does rxtx attempt to put into the list ? /dev/* > or /dev/tty* or /dev/tty[0-9[0-9] ? or /dev/ttyS* ? > > For the record, only /dev/ttyUSB0 is a valid port on the machine I am > presently on. Will this be a problem ? > > > On Tue, 2006-02-07 at 12:20 -0700, Trent Jarvi wrote: >> This is documented in INSTALL with the source. >> > I was wondering where that file was. I will download source and dig it > up. > > Thanks. > Hmm I'm looking at pre17 so this may have changed. (its just what I have on this machine) if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA" // for the IPAQs }; CandidatePortPrefixes=Temp; } So you may need to add "ttyUSB" to that list. RXTX used to enumerate _everything_ see if(osName.equals("Linux-all-ports") But it became less than practical. This is all in RXTXCommDriver.java hmm I just did a cvs update. if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have to get your fingers into the code. We aim for sane defaults. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 13:06:45 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 13:06:45 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139342805.8145.22.camel@zd7280> On Tue, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > Hmm I'm looking at pre17 so this may have changed. (its just what I have > on this machine) > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA" // for the IPAQs > }; > CandidatePortPrefixes=Temp; > } > > > So you may need to add "ttyUSB" to that list. RXTX used to enumerate > _everything_ see if(osName.equals("Linux-all-ports") But it became less > than practical. > > This is all in RXTXCommDriver.java > > hmm I just did a cvs update. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have > to get your fingers into the code. We aim for sane defaults. Excellent. Thanks for taking the time. -- Kim Lux, Diesel Research Inc. From ideiglenes1 at freemail.hu Tue Feb 7 13:53:39 2006 From: ideiglenes1 at freemail.hu (--) Date: Tue, 07 Feb 2006 21:53:39 +0100 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139345619.22534.2.camel@localhost> Hi! I use this code to get all the extra Linux devices. :) if ("Linux".equals(System.getProperty("os.name"))) { System.setProperty("os.name","Linux-all-ports"); } driver = new RXTXCommDriver(); On k, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > On Tue, 7 Feb 2006, Kim Lux wrote: > > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have > to get your fingers into the code. We aim for sane defaults. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From matt.higgins at gmail.com Tue Feb 7 13:45:54 2006 From: matt.higgins at gmail.com (Matt Higgins) Date: Tue, 7 Feb 2006 15:45:54 -0500 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> Message-ID: <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> Sweet this is exactly what I needed. I was searching the archives through marc.theamisgroup they only have archives back to 1/3/05. Should have hit the mailman archive! Thanks a lot! On 2/7/06, Brian Schlining wrote: > > Hi Matt > > The following code works fine on Linux but I never see any data when run > on Windows. This is a cut and paste from the SimpleRead example. > I am attempting to read data from a bar code scanner. I can fire up > HyperTermianl on windows and see that the device is working properly as I > see the barcodes are scanned and echoed back to the terminal. However when I > run the app I don't see any data. It is however associating with the com > port as the informational bits print fine? > > > You're not the only one whose had this problem, I don't know if Trent has > addressed this is the latest release of RXTX but there is a workaround. > Here's the recent thread from the RXTX mailing list regarding this issues: > > Thanasis Delenikas tdelenik at gmail.com > Wed Jan 18 13:56:23 MST 2006 > > * Previous message: [Rxtx] Re: More close() performance fixes > * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] > > Hi all. > (I've subscribed again from my other email account). > > Trent, > > You are right. Linux *always* works, no matter what flow control you set. > Windows *works only* with hardware flow control (I haven't tested what > happens with software XON/XOFF flow control). > > I assume (but I am not certain) that even with no flow control at all, all > platforms should work. Without flow control, you have the risk of bumping > into overflow or framing errors, but that's your (the end programmer, I > mean) problem. > > >From my side, I shouldn't be working without flow control. That was a bug > too... It was some code forgotten from the old times, when I used to work > with phone emulation drivers which didn't support flow control. The > correct > way is to have some flow control enabled and that's why I suppose this is > a > low-severity bug for RxTx. > > I have no idea which platform shows the correct behaviour, since > my knowledge about Linux and the inner workings of these low-level i/o > operations is limited. > > Regards, > Thanasis Delenikas. > > > > > Message: 2 > > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > > From: Trent Jarvi > > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > > To: RXTX Developers and Users > > Message-ID: > > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > > > Hi all, > > > > > > Trent, I have found something. > > > I read your comment about flow control, so I experimented a bit. > > > > > > If you remember, in my sample program I've used no flow control at all > ( > > i.e. > > > Java constant FLOWCONTROL_NONE). > > > > > > Now, during testing, I've switch to hardware inbound flow control (i.e > . > > Java > > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > > beautifully! > > > > > > I think I will switch to H/W flow control and test things for a while, > > but > > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > > > > > Hi Thanasis, > > > > I'm fairly sure you have identified a bug. I would not worry too much > > about what Sun CommAPI w32 defaults are. I think they did more or less > > whatever the port opened with. Just a guess. Linux tries to stomp on > > ports so they are all the same. > > > > So this started out with Linux worked, Windows XP/.. did not as I > recall. > > Something is wrong in rxtx. Do I understand this right? > > > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > > > Perhaps there is something Wayne or I did not understand when we wrote > > that code. I wasnt programming back in the BBS days so modems are not > my > > thing. I have a few questions. > > > > Is the above matrix confirmed by observation? > > Linux just always worked? > > Which one _should_ work? I'm guessing modems work with hardware flow > > control. I'll have to dig around. > > > > The windows flow control changes a couple things with hardware flow > > control. Following the w32 API documentation is confusing sometimes. > > But it looks like Linux could have a bug too. > > Cheers > > Brian Schlining > Software Engineer > http://www.mbari.org > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/9c989144/attachment-0038.html From tjarvi at qbang.org Tue Feb 7 14:06:14 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 14:06:14 -0700 (MST) Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> Message-ID: >> >> You're not the only one whose had this problem, I don't know if Trent has >> addressed this is the latest release of RXTX but there is a workaround. >> Here's the recent thread from the RXTX mailing list regarding this issues: >> I have not. I expect to have access to some test equipment next month and I'll go through all of this. I really don't know whats going on and I need a gold standard. I thought maybe linux was autodetecting the flow control. Your observations would certainly be welcome. I need to talk to Russell King and see what he is doing. Until then I'd just be toying around over a loopback as usual. This is very high on the list though. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 17:25:05 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 17:25:05 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139358305.17994.2.camel@zd7280> My application now works. I installed the libraries and jar from 2.1-7 (Final). portlist.hasMoreElements is no longer false. The application finds the port for /dev/ttyUSB0. Thanks for your help, Trent (et al) Sorry I bothered you with this. Next time I will look in the source first. I didn't think it was an rxtx issue, I thought it was a Linux setup issue . On Tue, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > Hmm I'm looking at pre17 so this may have changed. (its just what I > have > on this machine) > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux > Serial Ports > "ttySA" // for the > IPAQs > }; > > CandidatePortPrefixes=Temp; > } > > > So you may need to add "ttyUSB" to that list. RXTX used to enumerate > _everything_ see if(osName.equals("Linux-all-ports") But it became > less > than practical. > > This is all in RXTXCommDriver.java > > hmm I just did a cvs update. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux > Serial Ports > "ttySA", // for the > IPAQs > "ttyUSB" // for USB > frobs > }; > > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you > have > to get your fingers into the code. We aim for sane defaults. -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 19:21:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 19:21:54 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139358305.17994.2.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> <1139358305.17994.2.camel@zd7280> Message-ID: >Sorry I bothered you with this. Next time I will look in the source >first. I didn't think it was an rxtx issue, I thought it was a Linux >setup issue . Why would you be sorry? I would have done the same. I'm glad it's working :) -- Trent Jarvi tjarvi at qbang.org From tma at mail.island.net Wed Feb 8 13:39:35 2006 From: tma at mail.island.net (Tom Alldread) Date: Wed, 08 Feb 2006 12:39:35 -0800 Subject: [Rxtx] Win32/Linux Serial Port Data Dropouts In-Reply-To: <200602060702.k167255O007882@www.qbang.org> References: <200602060702.k167255O007882@www.qbang.org> Message-ID: <43EA5707.4020200@mail.island.net> Greetings Folks at RXTX: During the last couple of months I have been alternately testing with javax.comm 2 and RXTX 2.1 under Windows XP and CommApi 3 and RXTX 2.1 under Suse 10.0 Linux. In the process I have learned a little about java multi-threading under NetBeans 5 with Profiler. My java (jdk 1.5_06) application is used for data acquisition and provides a graphical display of A-D conversion data received from a 56KBaud serial port. The actual data throughput is about 10KBaud thus it is well below the speed of the port. I use hardware RTS/CTS flow control which can stall the data acquisition sample rate if necessary. This ensures the display computer has the ability to slow the data acquisition rate should it become too busy to accept the regular data flow. Both the serial port buffer and the java read buffer are set at 16KB. Usually the data transfers into the java read buffer are less than 100 bytes unless the data acquisition is recovering from a stall. The data flow normally hesitates after each 5 KB block as a continue command is needed from the display computer to start the drawing of a new graphics display line. Separate threads have been provided for the serial port event monitoring and data processing. The serial port event thread has been given the maximum priority and data processing thread the minimum priority provided by java. Thread yield statements have been placed within all data processing while/for loops as an effort to ensure quick access to CPU cycles for the serial port event thread. I have found that short data transmissions are essentially error free but occasional dropouts occur with continuous data flow especially under Windows XP. ....................................................................................................................................................................................... Linux results: I am happy to report that RXTX 2.1 appears to work very well under Linux although I did notice some errors when the screen savers were running with my dual monitors. I believe this is a local problem associated with my dual graphics which needs further attention. The recent CommApi 3 Linux release from Sun did not work at all with my program. It seemed to send commands out OK but did not receive any data. Although the serial port event triggered the ISR, the input stream appeared filled with nulls and thus did not contain any data. As my understanding is that CommApi 3 was tested with a Red Hat distribution of Linux I wonder if this problem is distro dependent? Although somewhat off topic here I wonder if anyone reading this has had similar experience? .................................................................................................................................................................................. Windows XP results: There are problems with occasional data dropouts which become more frequent as the sampling rate is increased or if the computer becomes busy with other duties. The dropouts typically consist of a half dozen byte block of lost data. It appears the lost bytes never get added to the java input stream. There has not been any indication of garbled data, overruns or framing errors which suggests the UART communications remains solid. Using javax.comm 2 I found that the setting of SerialPort 'enableReceiveThreshold' to 40 and 'enableReceiveTimeout' of 100mS reduced the dropouts error rate significantly. I found that I could not get RXTX 2.1 to function with the aforementioned threshold and timeout settings. The javax.comm 2 interface is consequently performing better for me under Windows than RXTX 2.1. I wonder if anyone here has any suggestions as to what I might try to improve RXTX 2.1? Although my settings are the same as under Suse 10.0, RXTX 2.1 performs much better for me under Linux than any of the alternatives that I have tried under Windows XP . ............................................................................................................................................................................... I would like to establish, based on the experience of others, if I have reached the normally expected performance limit of java serial port communications? Should I expect to achieve virtually error free serial port data input from a continuous stream under Windows XP java software? I am considering changing my protocol to packets with error checking if necessary but would like to know if the dropout problems I am experiencing are typical or not before I take this rather work intensive plunge. Many thanks in advance for any help! Best Regards, Tom Alldread -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.375 / Virus Database: 267.15.2/253 - Release Date: 2006-02-07 From jlaxson at mac.com Wed Feb 8 23:56:48 2006 From: jlaxson at mac.com (John Laxson) Date: Thu, 9 Feb 2006 00:56:48 -0600 Subject: [Rxtx] PortInUseException: Unknown Application on OSX Message-ID: Hi, I've been trying to get RXTX 2.1.7 going on Mac OS X for a while here, and am running up into a wall here. I've tried with pre- compiled and the source version and get the same problem, a gnu.io.PortInUseException: Unknown Application. I have run the fixperms script included with the source distribution, and id shows me as a member of the uucp group, and permissions on /var/spool/uucp are 775 root:uucp. Running a test program (included at the bottom for clarity) lets me enumerate all the serial ports correctly, but trying to open any of them gives the PortInUseException. If it helps, when I try to open a port that's set to make an outgoing bluetooth connection, there is no delay and no connection attempt at all. Thanks, John Laxson PS: The documentation wiki on qbang.org shows 404, and has for a few days now. My test code: public static void main(String[] args) { SerialPort serialPort; try { Enumeration e = CommPortIdentifier.getPortIdentifiers(); CommPortIdentifier ident; while (e.hasMoreElements()) { ident = (CommPortIdentifier)e.nextElement(); System.out.println(ident.getName()); } ident = CommPortIdentifier.getPortIdentifier("/dev/cu.modem"); serialPort = (SerialPort) ident.open("Me", 5000); } catch (Exception e) { e.printStackTrace(); } } From rajesh.invincible at gmail.com Thu Feb 9 03:39:38 2006 From: rajesh.invincible at gmail.com (Rajesh N) Date: Thu, 9 Feb 2006 16:09:38 +0530 Subject: [Rxtx] Re: Move .java Files in gnu.io filesystem hierarchy - Maven (2) In-Reply-To: <43DF21D2.7090200@ngi.it> References: <43DF21D2.7090200@ngi.it> Message-ID: <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Can anybody tell me how to overcome these EXCEPTIONS I AM WORKING ON SERIAL COMMN IN JAVA ON LINUX. 1. " NOT ALL PARAMETERS SUPPORTED BY THE KERNEL" This i came across the following statement inmy prog. SerialP is A SerialPort object SerialP.setSerialPortParams(9600(BAUDRATE),DATABITS_8,STOPBITS_1,PARITY_NONE) 2. NullPointer Exception at Event Dispatch Now i have checked all my object references for a null reference but i found none i have put up my entire code in try catch blocks but still I AM UNABLE TO CATCH THIS EXCEPTION AND HENCE MY APPLICATION CLOSES HOW DOES THESE GO? PLEASE HELP ME IT IS URGENTTTTTTTTTTTTTTTT yours sincerely RAJESH On 1/31/06, Fabio Frumento wrote: > Hi Xavier, > > I don't know maven at all but the directory hierarchy listed buy Trent > is fine for me... > > I'll take a look to maven, it seems an interesting project > > Regards > > Fabio Frumento > > Trent Jarvi wrote: > > On Tue, 31 Jan 2006, Xavier Frisaye wrote: > > > >> Hi all, > >> > >> If you are going to rearrange the src folder, i will propose to use > >> maven 2 and follow its directory structure > >> > (http://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html). > >> > >> Maven 2 simplify java project and give a standard way to make projects > >> (http://maven.apache.org/). > >> We are using it for internal projects and we are very satisfied. > >> > >> Is anybody interested? > >> > >> I'm not an expert in maven 2 (yet) but i'm agree to help using it if > >> you choose to make so. > >> > > > > so this would be: > > > > rxtx-devel/src/main/java/gnu.io > > rxtx-devel/src/test/java/ManIwish.java > > > > I don't use IDEs very much so I'll let others comment. But I don't see > > a problem with that. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Thu Feb 9 09:50:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 9 Feb 2006 09:50:31 -0700 (MST) Subject: [Rxtx] Re: Move .java Files in gnu.io filesystem hierarchy - Maven (2) In-Reply-To: <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Message-ID: On Thu, 9 Feb 2006, Rajesh N wrote: > Can anybody tell me how to overcome these EXCEPTIONS > I AM WORKING ON SERIAL COMMN IN JAVA ON LINUX. > > 1. " NOT ALL PARAMETERS SUPPORTED BY THE KERNEL" > > This i came across the following statement inmy prog. > SerialP is A SerialPort object > SerialP.setSerialPortParams(9600(BAUDRATE),DATABITS_8,STOPBITS_1,PARITY_NONE) > Strange. The parameters you use are the same the port should open with by default. Could you paste the actual exception you are getting? I don't see that in the rxtx source. Also it would help to know the rxtx version. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Fri Feb 10 15:29:05 2006 From: lux at diesel-research.com (Kim Lux) Date: Fri, 10 Feb 2006 15:29:05 -0700 Subject: [Rxtx] One serial port object for both sending and receiving ? Message-ID: <1139610545.18177.4.camel@zd7280> Is it OK to use one SerialPort ojbect (ex Serial Port serialPort;) and use it for both sending and receiving ? For example: ======================================================================== static SerialPort serialPort = null; static OutputStream serialOut = null; static InputStream serialIn = null; // assign it to an outputStream for use try{ serialOut = serialPort.getOutputStream(); System.out.println("Serial output stream has been assigned."); }//try catch(IOException e) { System.out.println("Error: Couldn't assign output stream to serial port."); }//catch //assign it to an inputStream for use try{ serialIn = serialPort.getInputStream(); System.out.println("Serial input stream has been assigned."); }//try catch(IOException e) { System.out.println("Error: Couldn't assign input stream to serial port."); }//catch ======================================================================== -- Kim Lux, Diesel Research Inc. From lux at diesel-research.com Fri Feb 10 21:23:00 2006 From: lux at diesel-research.com (Kim Lux) Date: Fri, 10 Feb 2006 21:23:00 -0700 Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Message-ID: <1139631780.23882.10.camel@zd7280> I've got a problem receiving chars with my version of serialRead, written in an SWT GUI. I had a Java pro have a good look at my code and he can't see anything wrong with it. I can send chars fine. When I receive a char the cpu usage for the app goes to 100% and the code in the serial event handler doesn't get executed. The instructions on the Java Comm Serial API How-To for Linux page state that I must install javacomm. Is that true ? Everything builds without it and I can send chars on rxtx just fine, but I can't receive them. Could this be the problem ? I downloaded and installed javacomm. I was not able to add "Driver=gnuio.RXTXCommDriver to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 installed in /usr/java/jre1.5.0_05. I added comm.jar to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext to the library paths. Is this OK ? Does it matter that I am receiving on /dev/ttyUSB0 ? Thanks. -- Kim Lux, Diesel Research Inc. From lunareclipse03 at web.de Sat Feb 11 09:44:46 2006 From: lunareclipse03 at web.de (lunareclipse03@web.de) Date: Sat, 11 Feb 2006 17:44:46 +0100 Subject: [Rxtx] Question about Serial I/O under Win32 Message-ID: <662084330@web.de> Hello everybody, I have a strange problem with a piece of code I made for myself. No, this is not really concerning rxtx, but nevertheless I post this to the list, hoping that some of you can help me. I've written two libraries, one for linux and one for win32. The linux port works quite well, I can send / receive faxes and / or replay voice messages over the telephone line using a voice modem. But the win32 port of the library causes some trouble. If, for example, I send out a fax with a certain modem under linux, it works well. The fax is complete when it comes out of the fax machine. If I then use the same modem to send out a fax under win32, the fax coming out of the fax machine gets "stuck" halfways, but the sending modem thinks that transmission was ok and drops the connection. The answering fax machine then gives me "error while receiving." The "upper layer" java code MUST be right, because if I do the same thing under linux (using the linux library), everything is alright. Now I have to ask: Can somebody please help me out with this??!? Could it be the case that some kind of flow control or COMMTIMEOUTS setting causes this behaviour? I set flow control to RTS/CTS before sending out a fax. How can I DISABLE flow control? Or what do you think? Can something else cause this problems? Thank you all for your time and PLEASE write back soon. Regards, --Sven Ahlemann Am Waldrand 31 45721 Haltern am See Germany ______________________________________________________________ Verschicken Sie romantische, coole und witzige Bilder per SMS! Jetzt bei WEB.DE FreeMail: http://f.web.de/?mc=021193 From lux at diesel-research.com Sat Feb 11 10:06:52 2006 From: lux at diesel-research.com (Kim Lux) Date: Sat, 11 Feb 2006 10:06:52 -0700 Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: <1139631780.23882.10.camel@zd7280> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> <1139631780.23882.10.camel@zd7280> Message-ID: <1139677612.3431.5.camel@zd7280> More on this problem. I copied and pasted simpleRead into a console based Eclipse project and I've got the same result, except that cpu usage doesn't go to 100%. I'm beginning to think there is an issue in rxtx. My imports for simpleRead are: ============================ import gnu.io.*; import java.util.*; //import javax.comm.*; import java.io.*; =========================== Any ideas ? I am trying to read from /dev/ttyUSB0 using a serial to USB adapter which has worked well with minicom and gtkterm. Thanks. On Fri, 2006-02-10 at 21:23 -0700, Kim Lux wrote: > I've got a problem receiving chars with my version of serialRead, > written in an SWT GUI. > > I had a Java pro have a good look at my code and he can't see anything > wrong with it. > > I can send chars fine. When I receive a char the cpu usage for the app > goes to 100% and the code in the serial event handler doesn't get > executed. > > The instructions on the Java Comm Serial API How-To for Linux page state > that I must install javacomm. Is that true ? Everything builds without > it and I can send chars on rxtx just fine, but I can't receive them. > Could this be the problem ? > > I downloaded and installed javacomm. I was not able to add > "Driver=gnuio.RXTXCommDriver > to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not > have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 > installed in /usr/java/jre1.5.0_05. I added comm.jar > to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext > to the library paths. Is this OK ? > > Does it matter that I am receiving on /dev/ttyUSB0 ? > > Thanks. > -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Sun Feb 12 21:01:33 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:01:33 -0700 (MST) Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: <1139677612.3431.5.camel@zd7280> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> <1139631780.23882.10.camel@zd7280> <1139677612.3431.5.camel@zd7280> Message-ID: I suspect what is happening is the select() is breaking out in the native code but the driver does not have support for notifying there are X bytes available. On some traditional Unix based systems, the only way you know data is available is the fd status changes and do an FIORDCHK ioctl. Or perhaps the only thing you can know is the fd status changed. It would take reading through the kernel driver code to know for sure. So on USB, depending upon the driver, the same may need to be done or the driver improved a bit if possible to support. Polling reads will also work but don't use the event driven model of CommAPI which isnt acceptable in the long run. The 100% cpu usage can then be explained because select no longer blocks until the data is read; the eventLoop spins loose. You can put a well placed sleep but rxtx only expects those are needed when it knows data is available. This may not be a super simple thing to understand and fix. I do have ideas to get you started. I'm going to be short on time the next couple weeks. I expect to put some good time in and answer some other questions I saw around the 25th. For now, I'd look at the following and go from there with the hints I've given. JNIEXPORT jint JNICALL RXTXPort(nativeavailable)( JNIEnv *env, jobject jobj ) { int fd = get_java_var( env, jobj,"fd","I" ); int result; /* char message[80]; ENTER( "RXTXPort:nativeavailable" ); On SCO OpenServer FIONREAD always fails for serial devices, so try ioctl FIORDCHK instead; will only tell us whether bytes are available, not how many, but better than nothing. This turns out to be true on Solaris also. taj. */ #ifdef FIORDCHK /* __unixware__ __sun__ probably others */ result = ioctl(fd, FIORDCHK, 0); #else if( ioctl( fd, FIONREAD, &result ) < 0 ) { goto fail; } #endif /* FIORDCHK */ On Sat, 11 Feb 2006, Kim Lux wrote: > > More on this problem. I copied and pasted simpleRead into a console > based Eclipse project and I've got the same result, except that cpu > usage doesn't go to 100%. I'm beginning to think there is an issue in > rxtx. > > My imports for simpleRead are: > > ============================ > import gnu.io.*; > import java.util.*; > //import javax.comm.*; > import java.io.*; > =========================== > > Any ideas ? I am trying to read from /dev/ttyUSB0 using a serial to > USB adapter which has worked well with minicom and gtkterm. > > Thanks. > > > > On Fri, 2006-02-10 at 21:23 -0700, Kim Lux wrote: >> I've got a problem receiving chars with my version of serialRead, >> written in an SWT GUI. >> >> I had a Java pro have a good look at my code and he can't see anything >> wrong with it. >> >> I can send chars fine. When I receive a char the cpu usage for the app >> goes to 100% and the code in the serial event handler doesn't get >> executed. >> >> The instructions on the Java Comm Serial API How-To for Linux page state >> that I must install javacomm. Is that true ? Everything builds without >> it and I can send chars on rxtx just fine, but I can't receive them. >> Could this be the problem ? >> >> I downloaded and installed javacomm. I was not able to add >> "Driver=gnuio.RXTXCommDriver >> to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not >> have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 >> installed in /usr/java/jre1.5.0_05. I added comm.jar >> to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext >> to the library paths. Is this OK ? >> >> Does it matter that I am receiving on /dev/ttyUSB0 ? >> >> Thanks. >> > From tjarvi at qbang.org Sun Feb 12 21:03:30 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:03:30 -0700 (MST) Subject: [Rxtx] One serial port object for both sending and receiving ? In-Reply-To: <1139610545.18177.4.camel@zd7280> References: <1139610545.18177.4.camel@zd7280> Message-ID: On Fri, 10 Feb 2006, Kim Lux wrote: > > Is it OK to use one SerialPort ojbect (ex Serial Port serialPort;) and > use it for both sending and receiving ? > > For example: > > ======================================================================== > static SerialPort serialPort = null; > static OutputStream serialOut = null; > static InputStream serialIn = null; > > > > > // assign it to an outputStream for use > try{ > serialOut = serialPort.getOutputStream(); > System.out.println("Serial output stream has been assigned."); > }//try > catch(IOException e) > { > System.out.println("Error: Couldn't assign output stream to serial > port."); > }//catch > > > //assign it to an inputStream for use > try{ > serialIn = serialPort.getInputStream(); > System.out.println("Serial input stream has been assigned."); > }//try > catch(IOException e) > { > System.out.println("Error: Couldn't assign input stream to serial > port."); > }//catch This should be fine. In fact trying to do it another way will probably not work as you will run into lockfile issues. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun Feb 12 21:13:13 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:13:13 -0700 (MST) Subject: [Rxtx] Question about Serial I/O under Win32 In-Reply-To: <662084330@web.de> References: <662084330@web.de> Message-ID: On Sat, 11 Feb 2006 lunareclipse03 at web.de wrote: > Hello everybody, > > I have a strange problem with a piece of code I made for myself. No, > this is not really concerning rxtx, but nevertheless I post this to the > list, hoping that some of you can help me. I've written two libraries, > one for linux and one for win32. The linux port works quite well, I can > send / receive faxes and / or replay voice messages over the telephone > line using a voice modem. But the win32 port of the library causes some > trouble. If, for example, I send out a fax with a certain modem under > linux, it works well. The fax is complete when it comes out of the fax > machine. If I then use the same modem to send out a fax under win32, the > fax coming out of the fax machine gets "stuck" halfways, but the sending > modem thinks that transmission was ok and drops the connection. The > answering fax machine then gives me "error while receiving." The "upper > layer" java code MUST be right, because if I do the same thing under > linux (using the linux library), everything is alright. Now I have to > ask: Can somebody please help me out with this??!? Could it be the case > that some kind of flow control or COMMTIMEOUTS setting causes this > behaviour? I set flow control to RTS/CTS before sending out a fax. How > can I DISABLE flow control? Or what do you think? Can something else > cause this problems? Thank you all for your time and PLEASE write back > soon. > Hi Sven I'm not too willing to talk about flow control at the low level until I confirm some things with test equipment later. It is not clear if you are using rxtx or writing your own native code. So I'm not sure how to answer much of this :) If you are wondering how to change the flow control using rxtx from java, The BlackBox example from Sun flips this back and forth. SerialPort.java in rxtx 2.1 uses the following: SerialPort.java: public static final int FLOWCONTROL_NONE =0; SerialPort.java: public static final int FLOWCONTROL_RTSCTS_IN =1; SerialPort.java: public static final int FLOWCONTROL_RTSCTS_OUT =2; SerialPort.java: public static final int FLOWCONTROL_XONXOFF_IN =4; SerialPort.java: public static final int FLOWCONTROL_XONXOFF_OUT=8; So if you set flowcontrol to RTSCTS, you can set it to NONE to turn it off. If you are looking for how to do it in native code, the rxtx Source is SerialImp.c (unix/linux/mac os x/w32) and termios.c (w32 only with SerialImp.c) You can track the code: SerialImp.c:JNIEXPORT void JNICALL RXTXPort(setflowcontrol)( JNIEnv *env, jobject jobj, jint flowmode ) termios.c:int tcgetattr( int fd, struct termios *s_termios ) termios.c:int tcsetattr( int fd, int when, struct termios *s_termios ) There may be a problem in the rxtx flow control code though. Rather than guess, I want to test this with a gold standard. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Feb 6 00:00:16 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 00:00:16 -0700 (MST) Subject: [Rxtx] wiki delay until tomorrow night. In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: On Sun, 5 Feb 2006, Trent Jarvi wrote: > On Sun, 5 Feb 2006, Kim Lux wrote: > >> usb ? Tell me more... I need that too. > > usb is a very proper design. Thats all it is. > Maybe rxtx could help usb. But it would start with helping bring back the community that was already there. It's not something I'd love to do but maybe its the right thing to do. It would probably take 2 years to do right. But maybe thats better than what we have now. I honestly don't know what IBM is doing which could just run over everything. Just some thoughts after some fine german wine. -- Trent Jarvi tjarvi at qbang.org From gadelavega at yahoo.com.ar Mon Feb 6 02:17:05 2006 From: gadelavega at yahoo.com.ar (Gonzalo A. de la Vega) Date: Mon, 06 Feb 2006 10:17:05 +0100 Subject: [Rxtx] Serial port ownership question In-Reply-To: References: <20060205113618.30274.qmail@web53501.mail.yahoo.com> <1139157422.4553.9.camel@zd7280> <1139158698.4936.9.camel@zd7280> Message-ID: <43E71411.4050402@yahoo.com.ar> On my Fedora Core 4: ls -l /dev/ttyS* crw-rw---- 1 root uucp 4, 64 Feb 6 2006 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Feb 6 2006 /dev/ttyS1 ... and: grep "ttyUSB" /etc/udev/rules.d/50-udev.rules KERNEL=="ttyUSB*", GROUP="uucp", MODE="0660" So anyone in the "uucp" group can use serial ports. On Gentoo the group is "tty". Trent Jarvi escribi?: > > > On Sun, 5 Feb 2006, Dr. Douglas Lyon wrote: > >> I can confirm that this is the case (only root ownership of >> serial ports, under fedora 4). >> Wow, what were they thinking?! >> - DL >> >>> I've found that the newer kernels have the serial ports owned by root. >>> For example, >>> >>> $ls -al /dev/tty* >>> crw-rw-rw- 1 root root 5, 0 Feb 5 02:06 /dev/tty >>> crw-rw---- 1 root root 4, 0 Feb 5 02:06 /dev/tty0 >>> crw------- 1 root root 4, 1 Feb 5 09:07 /dev/tty1 >>> crw-rw---- 1 root tty 4, 10 Feb 5 02:06 /dev/tty10 >>> crw-rw---- 1 root tty 4, 11 Feb 5 02:06 /dev/tty11 >>> ... > > > This is just not a problem jcp or such are going to solve. Its a > platform spitwad fight. But do look at pam. In fact thats what Sun > is doing too. Maybe Linux followed their lead.. I'm not a pam guy. > I've spent 16 hours trying to understand it but your users wont :) > > Solution? I have no clue. Its two tangent mentalities from my > perspective. > > -- > Trent Jarvi > tjarvi at qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mtnvega at yahoo.com.br Mon Feb 6 05:35:43 2006 From: mtnvega at yahoo.com.br (Luiz Jr) Date: Mon, 6 Feb 2006 12:35:43 +0000 (GMT) Subject: [Rxtx] Documentation Wiki In-Reply-To: <1139157422.4553.9.camel@zd7280> Message-ID: <20060206123543.57256.qmail@web53515.mail.yahoo.com> Hello, Thank you for you answer, but so the usage of the API is pretty much like the Java Communications Api? If yes, what version of the Java Comm Api? Thank you, Luiz A. Brandao Jr Kim Lux escreveu: On Sun, 2006-02-05 at 08:36 -0300, Luiz Jr wrote: > Hello, > > I want to start using the RXTX libraries, but I would to know how, > since I can not access the documentation wiki page I just started using them yesterday. Below is how I installed the libraries, if that helps. I used snippets of code from the SimpleWrite application here to get me going. http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html Instead of "import javax.comm.*;", use "import gnu.io.*;" which is gotten from RXTXcomm.jar, which you will need to include in your project references. I am working in Eclipse. BTW: there is no way to open a port without going through the port list and finding it. Maybe sometime in the future someone (me ?) will write a method called openSerialPort that allows the user to give a port identifier, such as "/dev/tty1" and return a port ready to use. It wouldn't take much to write that and it would save users a lot of code. Hope this helps. ======================================================================= 1) Figure out which java you are running, incase there is more than one installed. $ java -version java version "1.5.0_05" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_05-b05) Java HotSpot(TM) Client VM (build 1.5.0_05-b05, mixed mode, sharing) 2) Find all the jre directories and the one from which you are currently running. kfind (jre) 3) cd to that directory plus /lib/i386 cd /usr/java/jre1.5.0_05/lib/i386 4) Copy the library files (*.so) to that directory. cp /home/krlux/Desktop/'Java Controls'/rxtx-linux/bin/* . 5) Check that the copy was successful ls librxtx* librxtxI2C.so librxtxRaw.so librxtxSerial.so librxtxParallel.so librxtxRS485.so 6) cd to the /lib/ext directory for your java. cd /usr/java/jre1.5.0_05/lib/ext 7) Copy the Jar files there cp /home/krlux/Desktop/'Java Controls'/rxtx-linux/lib/ext/* . 8) Check that it was successful ls RXTX* RXTXcomm.jar Rxtx is now installed on your machine ready to use. =================================================================== -- Kim Lux, Diesel Research Inc. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx --------------------------------- Yahoo! Acesso Gr?tis - Internet r?pida e gr?tis. Instale o discador agora! -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/544aa403/attachment-0039.html From lyon at docjava.com Mon Feb 6 05:49:34 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 06 Feb 2006 07:49:34 -0500 Subject: [Rxtx] wiki delay until tomorrow night. In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: Hi All, I have often thought about USB drivers being needed. For example, the ironman watch will not interface to a mac (windows only). It is USB. My dymo label writer has no Java driver (native only). Etc. Most cheap web cameras are USB (and Java drivers go through JAI, if it supports the camera at all). The JAI code shows how sun did the USB drivers. You have to be a member of the jai project to download the source code. https://jai.dev.java.net has the jai distro. And then you are not allowed to redistribute it. However, we can all learn from it (if so inclined). Basically: cvs -d :pserver:lyon at cvs.dev.java.net:/cvs login cvs -d :pserver:lyon at cvs.dev.java.net:/cvs checkout jai-core You will need to user your own uid and pw to get in. The ant build has over 100 warnings from sun deprecations of its own code. You might say that they were hoisted on their own Picard ;) One interesting thing is that they support several platforms: linux-amd64 64-bit Linux-AMD64 linux-i586 32-bit Linux-x86 solaris-amd64 64-bit Solaris-AMD64 solaris-i586 32-bit Solaris-x86 solaris-sparc 32-bit Solaris-SPARC solaris-sparcv9 64-bit Solaris-SPARC windows-i586 32-bit Windows-x86 Thus, ant is used to provide a multi-platform native method distro. Neat. How do they do it? check this out: And: The core download does not contain any C source code (it was all pre-built). Basically, they are just copying .so and .dll files into build directories. I would love to see the C code for this...but Sun does not post it on the https://jai.dev.java.net site. I don't know why...Perhaps I missed it. - Doug >On Sun, 5 Feb 2006, Trent Jarvi wrote: > >>On Sun, 5 Feb 2006, Kim Lux wrote: >> >>>usb ? Tell me more... I need that too. >> >>usb is a very proper design. Thats all it is. >> > >Maybe rxtx could help usb. But it would start with helping bring >back the community that was already there. > >It's not something I'd love to do but maybe its the right thing to do. > >It would probably take 2 years to do right. But maybe thats better >than what we have now. > >I honestly don't know what IBM is doing which could just run over everything. > >Just some thoughts after some fine german wine. > >-- >Trent Jarvi >tjarvi at qbang.org > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tdelenik at gmail.com Mon Feb 6 05:56:32 2006 From: tdelenik at gmail.com (Thanasis Delenikas) Date: Mon, 6 Feb 2006 14:56:32 +0200 Subject: Fwd: [Rxtx] Documentation Wiki In-Reply-To: <1139157422.4553.9.camel@zd7280> References: <20060205113618.30274.qmail@web53501.mail.yahoo.com> <1139157422.4553.9.camel@zd7280> Message-ID: <310a1a930602060456t129f1dc6p5f2b908f13ab5a0b@mail.gmail.com> Hello all, Kim, this is a snippet from the code I use. The closest to directly opening a specific port without enumeration. << ... portId = CommPortIdentifier.getPortIdentifier(getPort()); serialPort = (SerialPort) portId.open("jSMSEngine", 1971); ... >> where getPort() return the string identifier of the port, i.e. "/dev/ttyS0" or "COM1" or whatever. Thanasis. ---------- Forwarded message ---------- From: Kim Lux Date: Feb 5, 2006 6:37 PM Subject: Re: [Rxtx] Documentation Wiki To: RXTX Developers and Users BTW: there is no way to open a port without going through the port list and finding it. Maybe sometime in the future someone (me ?) will write a method called openSerialPort that allows the user to give a port identifier, such as "/dev/tty1" and return a port ready to use. It wouldn't take much to write that and it would save users a lot of code. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/182ab5b8/attachment-0039.html From tjarvi at qbang.org Mon Feb 6 11:53:57 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 11:53:57 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: On Mon, 6 Feb 2006, Dr. Douglas Lyon wrote: > Hi All, > I have often thought about USB drivers being needed. > For example, the ironman watch will not interface > to a mac (windows only). It is USB. > My dymo label writer has no Java driver (native only). > Etc. > Most cheap web cameras are USB (and Java drivers go > through JAI, if it supports the camera at all). > The JAI code shows how sun did the USB drivers. > You have to be a member of the jai project to download > the source code. > https://jai.dev.java.net has the jai distro. > And then you are not allowed to redistribute it. However, > we can all learn from it (if so inclined). Basically: > cvs -d :pserver:lyon at cvs.dev.java.net:/cvs login > cvs -d :pserver:lyon at cvs.dev.java.net:/cvs checkout jai-core > You will need to user your own uid and pw to get in. > The ant build has over 100 warnings from sun deprecations > of its own code. > > You might say that they were hoisted on their own Picard ;) > > One interesting thing is that they support several platforms: > linux-amd64 64-bit Linux-AMD64 > linux-i586 32-bit Linux-x86 > solaris-amd64 64-bit Solaris-AMD64 > solaris-i586 32-bit Solaris-x86 > solaris-sparc 32-bit Solaris-SPARC > solaris-sparcv9 64-bit Solaris-SPARC > windows-i586 32-bit Windows-x86 > Thus, ant is used to provide a multi-platform native method distro. > Neat. > How do they do it? > check this out: > > > > > > > > > > > > > And: > > > > > > > > > > The core download does not contain any C source code (it was all pre-built). > Basically, they are just copying .so and .dll files into build directories. > > I would love to see the C code for this...but Sun does not post it on the > https://jai.dev.java.net site. > > I don't know why...Perhaps I missed it. > > - Doug > > I've looked at moving rxtx to Ant builds. I think that would help IDEs a great deal. I requested a evalutation desk copy the O'Reilly Ant book for some j2ee material I was teaching. http://www.oreilly.com/catalog/anttdg/ It has a one sentence mention of JNI. So there was not luck there. I saw that there is another Ant book that does mention JNI more. I can't find it now. Ant must be able to support it with extensions. http://ant.apache.org/manual/OptionalTasks/javah.html What the auto(break :) tools do in the rxtx build is 4 things really. 1) gcc compile flags 2) ld compile flags 3) config.h 4) compile flags for customizing rxtx (lockfiles, ...) See 1 All of this information except 4 can be static once obtained. So I'm not attached to the auto tools. If I could find an example of Ant being used for JNI code, I'd be one of the first to start moving that direction. Maybe someone saw an example someplace. The other thing we have not completed discussing is the directory structure. There is interest in making rxtx more IDE friendly. I get more mail about that off the list than how to install rxtx. And I see we have Ken Thompson in da house :) He is our trusted CVS maintainer and the guy that purchased the rxtx.org domain. Old community. We will need Ken for changing the directory structure of source. I would like to open up discussion about both of these as it is more than time. The problem is I have little experience with Ant and even less with IDEs. It would be nice if we could work with Eclipse and NetBeans. http://www.netbeans.org/ (sun and some community) http://www.eclipes.org (ibm,rhat,... perhaps more community) http://maven.apache.org/what-is-maven.html (apache. It is community) borland should sortof be here too but I think thats covered in eclipse. >From what I understand so far, we should morph rxtx to support those three maybe trusting apaches lead with maven. But I use vi. I have little to no clues beyond what people have fed me. Can we agree that thats the right direction to go? -- Trent Jarvi tjarvi at qbang.org From brian at mbari.org Mon Feb 6 14:57:50 2006 From: brian at mbari.org (Brian Schlining) Date: Mon, 6 Feb 2006 13:57:50 -0800 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> > The other thing we have not completed discussing is the directory > structure. There is interest in making rxtx more IDE friendly. I > get more mail about that off the list than how to install rxtx. > > And I see we have Ken Thompson in da house :) He is our trusted > CVS maintainer and the guy that purchased the rxtx.org domain. Old > community. We will need Ken for changing the directory structure of > source. > > I would like to open up discussion about both of these as it is > more than time. The problem is I have little experience with Ant > and even less with IDEs. It would be nice if we could work with > Eclipse and NetBeans. > > http://www.netbeans.org/ (sun and some community) > http://www.eclipes.org (ibm,rhat,... perhaps more community) > http://maven.apache.org/what-is-maven.html (apache. It is community) > borland should sortof be here too but I think thats covered in > eclipse. > >> From what I understand so far, we should morph rxtx to support >> those three > maybe trusting apaches lead with maven. But I use vi. I have > little to no clues beyond what people have fed me. > Maven likes the directory structure below for Java code. (From http:// maven.apache.org/guides/getting-started/index.html) This structure works fine with ant, netbeans, and eclipse. rxtx_root_directory `-- src |-- main | `-- java | `-- gnu | `-- io `-- test `-- java `-- gnu `-- io Brian Schlining Software Engineer http://www.mbari.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/d9451eba/attachment-0039.html From tjarvi at qbang.org Mon Feb 6 15:11:45 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 15:11:45 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: > rxtx_root_directory > `-- src > |-- main > | `-- java > | `-- gnu > | `-- io > `-- test > `-- java > `-- gnu > `-- io > >From what I understand this will just be good. For me it makes no difference. So lets do the rxtx thing. Let if fester for two weeks and if nobody objects, we will do it. I'm not doing this because I care. I'm doing this to eliminate much of my inbox. But test... man is rxtx lacking there in the community aspect. It is covered but not right. _maybe_ I can change that this year. -- Trent Jarvi tjarvi at qbang.org (cat hurding since 1997) From lux at diesel-research.com Mon Feb 6 21:38:49 2006 From: lux at diesel-research.com (Kim Lux) Date: Mon, 06 Feb 2006 21:38:49 -0700 Subject: [Rxtx] How can I use Lock Files with rxtx (in FC4) ? Message-ID: <1139287129.17031.3.camel@zd7280> I am now running an rxtx application on FC4. I am getting: ========================================================= check_group_uucp(): error testing lock file creation Error details: Permission denied check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL ========================================================= $ ls -al /var/lock total 32 drwxrwxr-x 4 root lock 4096 Feb 6 16:04 . drwxr-xr-x 24 root root 4096 Nov 14 01:19 .. drwx------ 2 root root 4096 Apr 27 2005 lvm drwxr-xr-x 2 root root 4096 Feb 6 16:04 subsys How do I fix this for regulator users ? -- Kim Lux, Diesel Research Inc. From dmarkman at mac.com Mon Feb 6 22:24:44 2006 From: dmarkman at mac.com (Dmitry Markman) Date: Tue, 7 Feb 2006 00:24:44 -0500 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: if I understands the issue right in order to be able to use ant for c/c++ compilation you have to install ant's cc task http://ant-contrib.sourceforge.net/cc.html it looks like it should work on mac os x (authors claim, that it's platform independent) but I never tested so all you have to do it's providing right command line for the gcc compiler On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: >> rxtx_root_directory >> `-- src >> |-- main >> | `-- java >> | `-- gnu >> | `-- io >> `-- test >> `-- java >> `-- gnu >> `-- io >> > > >> From what I understand this will just be good. > > For me it makes no difference. So lets do the rxtx thing. Let if > fester for two weeks and if nobody objects, we will do it. > > I'm not doing this because I care. I'm doing this to eliminate > much of my inbox. > > But test... man is rxtx lacking there in the community aspect. It > is covered but not right. _maybe_ I can change that this year. > > -- > Trent Jarvi > tjarvi at qbang.org > (cat hurding since 1997) > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx Dmitry Markman From lux at diesel-research.com Mon Feb 6 23:20:15 2006 From: lux at diesel-research.com (Kim Lux) Date: Mon, 06 Feb 2006 23:20:15 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? Message-ID: <1139293215.3689.4.camel@zd7280> I'm running the code below. portlist.hasMoreElements() is false. /dev has ports in it as listed below. What am I doing wrong ? ========================================================== // Step through the list of ports until we find one that matches // the one we are looking for. portList = CommPortIdentifier.getPortIdentifiers(); while(portList.hasMoreElements()) { portID = (CommPortIdentifier) portList.nextElement(); // if (portID.getName().equals("/dev/ttyUSB0")) { myTA.append("Serial port ttyUSB0 has been found\n"); break; }// if portID equals... }// End of while... ========================================================== ls -al /dev/tty* crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 ... crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 -- Kim Lux, Diesel Research Inc. From david.garnier at trusted-logic.com Tue Feb 7 00:46:30 2006 From: david.garnier at trusted-logic.com (David Garnier) Date: Tue, 07 Feb 2006 08:46:30 +0100 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: <43E85056.2090608@trusted-logic.com> Hello, I think that the make-based build process is fine as it is, apart from the location of the Java source files. It is true that putting the Java source in a directory structure that map 1-to-1 to the Java package structure is the norm and should make it easier for everyone to modify the Java source, with or without an IDE. Ant is a good tool, but in the RXTX case I fail to see the advantage of using it compared to the current make-based process. As Trent said, they are more pressing issues, like testing. Regards, David Dmitry Markman wrote: > if I understands the issue right > in order to be able to use ant for c/c++ compilation > you have to install ant's cc task > http://ant-contrib.sourceforge.net/cc.html > > it looks like it should work on mac os x > (authors claim, that it's platform independent) > but I never tested > > so all you have to do it's providing right command line > for the gcc compiler > > > > > On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: > >>> rxtx_root_directory >>> `-- src >>> |-- main >>> | `-- java >>> | `-- gnu >>> | `-- io >>> `-- test >>> `-- java >>> `-- gnu >>> `-- io >>> >> >> >>> From what I understand this will just be good. >> >> For me it makes no difference. So lets do the rxtx thing. Let if >> fester for two weeks and if nobody objects, we will do it. >> >> I'm not doing this because I care. I'm doing this to eliminate much >> of my inbox. >> >> But test... man is rxtx lacking there in the community aspect. It is >> covered but not right. _maybe_ I can change that this year. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> (cat hurding since 1997) From tjarvi at qbang.org Tue Feb 7 01:11:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 01:11:31 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <43E85056.2090608@trusted-logic.com> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: On Tue, 7 Feb 2006, David Garnier wrote: > Hello, > > I think that the make-based build process is fine as it is, apart from the location of the Java > source files. It is true that putting the Java source in a directory structure that map 1-to-1 to > the Java package structure is the norm and should make it easier for everyone to modify the Java > source, with or without an IDE. > > Ant is a good tool, but in the RXTX case I fail to see the advantage of using it compared to the > current make-based process. As Trent said, they are more pressing issues, like testing. > Hi David I have more experience with testing rxtx than I can talk about. But let it be known, rxtx has gone trough 100's of hours of testing. We are hobby folks interested in toys but there is more. rxtx has had some of the best guidance in the industry there. This is not an easy thing. I may be able to come back in a month from the other side of the corperate fence and help. I suspect the tests could just be made public but they are in a very unusual environment that just wont work in a wider sense. This is something I'll be trying to change. At one point it was agreed we could just make the results public so this isnt just noise.. There is interest and I think its safe to mention that much. The big problem with testing in the past is most of it is done with a loopback connection. So we *still* have major questions regarding things like flow control. rxtx talks to itself over a loopback and it works. regardless of right or wrong. This requires more thought to be done right. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Feb 7 02:46:34 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 02:46:34 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: > The big problem with testing in the past is most of it is done with a > loopback connection. So we *still* have major questions regarding things > like flow control. rxtx talks to itself over a loopback and it works. > regardless of right or wrong. With serial communication there are gold standards. ckermit is probably a definitive 'standard.' Maybe its possible to do ping/pong tests with ckermit? Is it scriptable? There are known issues in rxtx. Probably the worst is some threading issues regarding some JREs with multiple JNI threads setting java variables. Man did I get schooled there. Just switch the c functions to returning variables and things go away. Sometimes they work fine, sometimes they blow up. Without understanding everything, somehow rhat got it right and debian (and especially gentoo) grabbed kernel patches causing all sort of harm. Its not hard to fix once you understand whats going on but nearly impossible to track with a debugger. So I have a good idea what 2.1-8 will have outside of the IDE modifications. rxtx 2.1-7 is a release for everyone to sync with. Its not even as stable as -pre17 as far as I know - I ran no test suites. I'll be chasing it too. We just had so many contributions that it was time. It seriously broke internal scheduals but thats a great thing :) The other thing I want to do in 2.1-8 is automagic baud rates. It turns out lots of shops are doing really funky baud rates for things like automobile test equipment. It is possible but it requires a fair amount of change in the native code. Is anyone looking at this? -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Feb 7 02:57:21 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 07 Feb 2006 04:57:21 -0500 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <43E85056.2090608@trusted-logic.com> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: Hi All, I agree, testing is very important. The problem I have been trying to address is related to cross-platform testing and the robust nature of the installs. Typically, I visit 3 platforms to deploy my product, windows, linux and mac. A build is performed on each platform. The idea that you can build for many platforms from one copy the source code seems attractive. This should enable synchronized deployments of identical code. The question of how to achieve this goal remains open. As Trent mentioned, this is hard. Perhaps Ant will help here (but perhaps not). Ant does seem to help with running unit tests. However, it does not help with multi-platform tests. For that you need many machines and different operating environments. Toward that end, I have created a multi-platform test that can be run from web start, located at: http://show.docjava.com:8086/book/cgij/code/jnlp/serialPort.PortTest.jnlp This is interesting because many people in the community can run the test and we can improve the test, as time permits. No, it is not a perfect solution, however, the idea does help with multi-platform tests using many machines and different operating environments. If the group has a good test for a general serial port set-ups, i would be happy to deploy it, for general evaluation using web start. And as for ANT, it is just an idea. Not all my ideas are good ones! - Doug >Hello, > >I think that the make-based build process is fine as it is, apart >from the location of the Java >source files. It is true that putting the Java source in a directory >structure that map 1-to-1 to >the Java package structure is the norm and should make it easier for >everyone to modify the Java >source, with or without an IDE. > >Ant is a good tool, but in the RXTX case I fail to see the advantage >of using it compared to the >current make-based process. As Trent said, they are more pressing >issues, like testing. > >Regards, >David > >Dmitry Markman wrote: >> if I understands the issue right >> in order to be able to use ant for c/c++ compilation >> you have to install ant's cc task >> http://ant-contrib.sourceforge.net/cc.html >> >> it looks like it should work on mac os x >> (authors claim, that it's platform independent) >> but I never tested >> >> so all you have to do it's providing right command line >> for the gcc compiler >> >> >> >> >> On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: >> >>>> rxtx_root_directory >>>> `-- src >>>> |-- main >>>> | `-- java >>>> | `-- gnu >>>> | `-- io >>>> `-- test >>>> `-- java >>>> `-- gnu >>>> `-- io >>>> >>> >>> >>>> From what I understand this will just be good. >>> >>> For me it makes no difference. So lets do the rxtx thing. Let if >>> fester for two weeks and if nobody objects, we will do it. >>> >>> I'm not doing this because I care. I'm doing this to eliminate much >>> of my inbox. >>> >>> But test... man is rxtx lacking there in the community aspect. It is >>> covered but not right. _maybe_ I can change that this year. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> (cat hurding since 1997) > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From matt.higgins at gmail.com Tue Feb 7 08:28:34 2006 From: matt.higgins at gmail.com (Matt Higgins) Date: Tue, 7 Feb 2006 10:28:34 -0500 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final Message-ID: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? import java.io.*; import java.util.*; import gnu.io.*; public class MySimpleRead implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; public static void main(String[] args) { boolean portFound = false; String defaultPort = "COM1"; if (args.length > 0) { defaultPort = args[0]; } portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; MySimpleRead reader = new MySimpleRead(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } } public MySimpleRead() { try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) { e.printStackTrace(); } try { inputStream = serialPort.getInputStream(); } catch (IOException e) { e.printStackTrace(); } try { serialPort.addEventListener(this); } catch (TooManyListenersException e) { e.printStackTrace(); } try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { e.printStackTrace(); } System.out.println("Baud is " + serialPort.getBaudRate()); System.out.println("Bits is " + serialPort.getDataBits()); System.out.println("Stop is " + serialPort.getStopBits()); System.out.println("Par is " + serialPort.getParity()); serialPort.notifyOnDataAvailable(true); readThread = new Thread(this); readThread.start(); } public void run() { // Thread.sleep(20000); //} catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { System.out.println("An event occurred " + event.getEventType()); switch (event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: byte[] readBuffer = new byte[20]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } System.out.print(new String(readBuffer)); } catch (IOException e) {} break; } } } --------------- Result on windows ------------------------------ Stable Library ============================================================== Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port:: COM1 Baud is 9600 Bits is 8 Stop is 1 Par is 0 ----------------- End Results ----------------------------------------- ------------------ Result on Linux ----------------------------------- Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 Found port: /dev/ttyS0 Baud is 9600 Bits is 8 Stop is 1 Par is 0 An event occurred 1 043100066224 ------------------ End Results --------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/a1431630/attachment-0039.html From brian at mbari.org Tue Feb 7 09:48:37 2006 From: brian at mbari.org (Brian Schlining) Date: Tue, 7 Feb 2006 08:48:37 -0800 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> Message-ID: <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> Hi Matt > The following code works fine on Linux but I never see any data > when run on Windows. This is a cut and paste from the SimpleRead > example. > I am attempting to read data from a bar code scanner. I can fire > up HyperTermianl on windows and see that the device is working > properly as I see the barcodes are scanned and echoed back to the > terminal. However when I run the app I don't see any data. It is > however associating with the com port as the informational bits > print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. Cheers Brian Schlining Software Engineer http://www.mbari.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/16d07f37/attachment-0039.html From lux at diesel-research.com Tue Feb 7 11:59:58 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 11:59:58 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139293215.3689.4.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> Message-ID: <1139338798.8145.4.camel@zd7280> Any ideas on this ? Any reason why portList.hasMoreElements() should be false even though there are devices in /dev ? On Mon, 2006-02-06 at 23:20 -0700, Kim Lux wrote: > I'm running the code below. > > portlist.hasMoreElements() is false. > > /dev has ports in it as listed below. > > What am I doing wrong ? > > > ========================================================== > // Step through the list of ports until we find one that matches > // the one we are looking for. > > portList = CommPortIdentifier.getPortIdentifiers(); > > while(portList.hasMoreElements()) > { > portID = (CommPortIdentifier) portList.nextElement(); // > if (portID.getName().equals("/dev/ttyUSB0")) > { > myTA.append("Serial port ttyUSB0 has been found\n"); > break; > }// if portID equals... > }// End of while... > ========================================================== > > ls -al /dev/tty* > crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty > crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 > crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 > crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 > crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 > ... > crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 > crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 > crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 > > > -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 12:20:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 12:20:25 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139338798.8145.4.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> Message-ID: On Tue, 7 Feb 2006, Kim Lux wrote: > > Any ideas on this ? Any reason why portList.hasMoreElements() should be > false even though there are devices in /dev ? > > > On Mon, 2006-02-06 at 23:20 -0700, Kim Lux wrote: >> I'm running the code below. >> >> portlist.hasMoreElements() is false. >> >> /dev has ports in it as listed below. >> >> What am I doing wrong ? >> >> >> ========================================================== >> // Step through the list of ports until we find one that matches >> // the one we are looking for. >> >> portList = CommPortIdentifier.getPortIdentifiers(); >> >> while(portList.hasMoreElements()) >> { >> portID = (CommPortIdentifier) portList.nextElement(); // >> if (portID.getName().equals("/dev/ttyUSB0")) >> { >> myTA.append("Serial port ttyUSB0 has been found\n"); >> break; >> }// if portID equals... >> }// End of while... >> ========================================================== >> >> ls -al /dev/tty* >> crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty >> crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 >> crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 >> crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 >> crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 >> ... >> crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 >> crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 >> crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 >> >> >> > Hi Kim What rxtx does is try to open the port and do a timed out read. If the kernel/... do not complain it's enumarted. I suspect you could do a crude test by doing something like cat /dev/ttyS0 > /dev/null If that barfs then rxtx wont enumerate the port. hmm looking at your question again, I suspect it's a lockfile problem. This is documented in INSTALL with the source. Its easy enough to test this too.. touch /var/lock/testingrxtxlockfiles && rm -f /var/lock/testingrxtxlockfiles If you are not in the right group it will bail. Root will work regardless. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 12:37:56 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 12:37:56 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> Message-ID: <1139341076.8145.11.camel@zd7280> Exactly which ports does rxtx attempt to put into the list ? /dev/* or /dev/tty* or /dev/tty[0-9[0-9] ? or /dev/ttyS* ? For the record, only /dev/ttyUSB0 is a valid port on the machine I am presently on. Will this be a problem ? On Tue, 2006-02-07 at 12:20 -0700, Trent Jarvi wrote: > This is documented in INSTALL with the source. > I was wondering where that file was. I will download source and dig it up. Thanks. -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 12:51:09 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 12:51:09 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139341076.8145.11.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: On Tue, 7 Feb 2006, Kim Lux wrote: > > Exactly which ports does rxtx attempt to put into the list ? /dev/* > or /dev/tty* or /dev/tty[0-9[0-9] ? or /dev/ttyS* ? > > For the record, only /dev/ttyUSB0 is a valid port on the machine I am > presently on. Will this be a problem ? > > > On Tue, 2006-02-07 at 12:20 -0700, Trent Jarvi wrote: >> This is documented in INSTALL with the source. >> > I was wondering where that file was. I will download source and dig it > up. > > Thanks. > Hmm I'm looking at pre17 so this may have changed. (its just what I have on this machine) if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA" // for the IPAQs }; CandidatePortPrefixes=Temp; } So you may need to add "ttyUSB" to that list. RXTX used to enumerate _everything_ see if(osName.equals("Linux-all-ports") But it became less than practical. This is all in RXTXCommDriver.java hmm I just did a cvs update. if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have to get your fingers into the code. We aim for sane defaults. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 13:06:45 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 13:06:45 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139342805.8145.22.camel@zd7280> On Tue, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > Hmm I'm looking at pre17 so this may have changed. (its just what I have > on this machine) > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA" // for the IPAQs > }; > CandidatePortPrefixes=Temp; > } > > > So you may need to add "ttyUSB" to that list. RXTX used to enumerate > _everything_ see if(osName.equals("Linux-all-ports") But it became less > than practical. > > This is all in RXTXCommDriver.java > > hmm I just did a cvs update. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have > to get your fingers into the code. We aim for sane defaults. Excellent. Thanks for taking the time. -- Kim Lux, Diesel Research Inc. From ideiglenes1 at freemail.hu Tue Feb 7 13:53:39 2006 From: ideiglenes1 at freemail.hu (--) Date: Tue, 07 Feb 2006 21:53:39 +0100 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139345619.22534.2.camel@localhost> Hi! I use this code to get all the extra Linux devices. :) if ("Linux".equals(System.getProperty("os.name"))) { System.setProperty("os.name","Linux-all-ports"); } driver = new RXTXCommDriver(); On k, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > On Tue, 7 Feb 2006, Kim Lux wrote: > > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have > to get your fingers into the code. We aim for sane defaults. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From matt.higgins at gmail.com Tue Feb 7 13:45:54 2006 From: matt.higgins at gmail.com (Matt Higgins) Date: Tue, 7 Feb 2006 15:45:54 -0500 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> Message-ID: <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> Sweet this is exactly what I needed. I was searching the archives through marc.theamisgroup they only have archives back to 1/3/05. Should have hit the mailman archive! Thanks a lot! On 2/7/06, Brian Schlining wrote: > > Hi Matt > > The following code works fine on Linux but I never see any data when run > on Windows. This is a cut and paste from the SimpleRead example. > I am attempting to read data from a bar code scanner. I can fire up > HyperTermianl on windows and see that the device is working properly as I > see the barcodes are scanned and echoed back to the terminal. However when I > run the app I don't see any data. It is however associating with the com > port as the informational bits print fine? > > > You're not the only one whose had this problem, I don't know if Trent has > addressed this is the latest release of RXTX but there is a workaround. > Here's the recent thread from the RXTX mailing list regarding this issues: > > Thanasis Delenikas tdelenik at gmail.com > Wed Jan 18 13:56:23 MST 2006 > > * Previous message: [Rxtx] Re: More close() performance fixes > * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] > > Hi all. > (I've subscribed again from my other email account). > > Trent, > > You are right. Linux *always* works, no matter what flow control you set. > Windows *works only* with hardware flow control (I haven't tested what > happens with software XON/XOFF flow control). > > I assume (but I am not certain) that even with no flow control at all, all > platforms should work. Without flow control, you have the risk of bumping > into overflow or framing errors, but that's your (the end programmer, I > mean) problem. > > >From my side, I shouldn't be working without flow control. That was a bug > too... It was some code forgotten from the old times, when I used to work > with phone emulation drivers which didn't support flow control. The > correct > way is to have some flow control enabled and that's why I suppose this is > a > low-severity bug for RxTx. > > I have no idea which platform shows the correct behaviour, since > my knowledge about Linux and the inner workings of these low-level i/o > operations is limited. > > Regards, > Thanasis Delenikas. > > > > > Message: 2 > > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > > From: Trent Jarvi > > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > > To: RXTX Developers and Users > > Message-ID: > > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > > > Hi all, > > > > > > Trent, I have found something. > > > I read your comment about flow control, so I experimented a bit. > > > > > > If you remember, in my sample program I've used no flow control at all > ( > > i.e. > > > Java constant FLOWCONTROL_NONE). > > > > > > Now, during testing, I've switch to hardware inbound flow control (i.e > . > > Java > > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > > beautifully! > > > > > > I think I will switch to H/W flow control and test things for a while, > > but > > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > > > > > Hi Thanasis, > > > > I'm fairly sure you have identified a bug. I would not worry too much > > about what Sun CommAPI w32 defaults are. I think they did more or less > > whatever the port opened with. Just a guess. Linux tries to stomp on > > ports so they are all the same. > > > > So this started out with Linux worked, Windows XP/.. did not as I > recall. > > Something is wrong in rxtx. Do I understand this right? > > > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > > > Perhaps there is something Wayne or I did not understand when we wrote > > that code. I wasnt programming back in the BBS days so modems are not > my > > thing. I have a few questions. > > > > Is the above matrix confirmed by observation? > > Linux just always worked? > > Which one _should_ work? I'm guessing modems work with hardware flow > > control. I'll have to dig around. > > > > The windows flow control changes a couple things with hardware flow > > control. Following the w32 API documentation is confusing sometimes. > > But it looks like Linux could have a bug too. > > Cheers > > Brian Schlining > Software Engineer > http://www.mbari.org > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/9c989144/attachment-0039.html From tjarvi at qbang.org Tue Feb 7 14:06:14 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 14:06:14 -0700 (MST) Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> Message-ID: >> >> You're not the only one whose had this problem, I don't know if Trent has >> addressed this is the latest release of RXTX but there is a workaround. >> Here's the recent thread from the RXTX mailing list regarding this issues: >> I have not. I expect to have access to some test equipment next month and I'll go through all of this. I really don't know whats going on and I need a gold standard. I thought maybe linux was autodetecting the flow control. Your observations would certainly be welcome. I need to talk to Russell King and see what he is doing. Until then I'd just be toying around over a loopback as usual. This is very high on the list though. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 17:25:05 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 17:25:05 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139358305.17994.2.camel@zd7280> My application now works. I installed the libraries and jar from 2.1-7 (Final). portlist.hasMoreElements is no longer false. The application finds the port for /dev/ttyUSB0. Thanks for your help, Trent (et al) Sorry I bothered you with this. Next time I will look in the source first. I didn't think it was an rxtx issue, I thought it was a Linux setup issue . On Tue, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > Hmm I'm looking at pre17 so this may have changed. (its just what I > have > on this machine) > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux > Serial Ports > "ttySA" // for the > IPAQs > }; > > CandidatePortPrefixes=Temp; > } > > > So you may need to add "ttyUSB" to that list. RXTX used to enumerate > _everything_ see if(osName.equals("Linux-all-ports") But it became > less > than practical. > > This is all in RXTXCommDriver.java > > hmm I just did a cvs update. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux > Serial Ports > "ttySA", // for the > IPAQs > "ttyUSB" // for USB > frobs > }; > > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you > have > to get your fingers into the code. We aim for sane defaults. -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 19:21:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 19:21:54 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139358305.17994.2.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> <1139358305.17994.2.camel@zd7280> Message-ID: >Sorry I bothered you with this. Next time I will look in the source >first. I didn't think it was an rxtx issue, I thought it was a Linux >setup issue . Why would you be sorry? I would have done the same. I'm glad it's working :) -- Trent Jarvi tjarvi at qbang.org From tma at mail.island.net Wed Feb 8 13:39:35 2006 From: tma at mail.island.net (Tom Alldread) Date: Wed, 08 Feb 2006 12:39:35 -0800 Subject: [Rxtx] Win32/Linux Serial Port Data Dropouts In-Reply-To: <200602060702.k167255O007882@www.qbang.org> References: <200602060702.k167255O007882@www.qbang.org> Message-ID: <43EA5707.4020200@mail.island.net> Greetings Folks at RXTX: During the last couple of months I have been alternately testing with javax.comm 2 and RXTX 2.1 under Windows XP and CommApi 3 and RXTX 2.1 under Suse 10.0 Linux. In the process I have learned a little about java multi-threading under NetBeans 5 with Profiler. My java (jdk 1.5_06) application is used for data acquisition and provides a graphical display of A-D conversion data received from a 56KBaud serial port. The actual data throughput is about 10KBaud thus it is well below the speed of the port. I use hardware RTS/CTS flow control which can stall the data acquisition sample rate if necessary. This ensures the display computer has the ability to slow the data acquisition rate should it become too busy to accept the regular data flow. Both the serial port buffer and the java read buffer are set at 16KB. Usually the data transfers into the java read buffer are less than 100 bytes unless the data acquisition is recovering from a stall. The data flow normally hesitates after each 5 KB block as a continue command is needed from the display computer to start the drawing of a new graphics display line. Separate threads have been provided for the serial port event monitoring and data processing. The serial port event thread has been given the maximum priority and data processing thread the minimum priority provided by java. Thread yield statements have been placed within all data processing while/for loops as an effort to ensure quick access to CPU cycles for the serial port event thread. I have found that short data transmissions are essentially error free but occasional dropouts occur with continuous data flow especially under Windows XP. ....................................................................................................................................................................................... Linux results: I am happy to report that RXTX 2.1 appears to work very well under Linux although I did notice some errors when the screen savers were running with my dual monitors. I believe this is a local problem associated with my dual graphics which needs further attention. The recent CommApi 3 Linux release from Sun did not work at all with my program. It seemed to send commands out OK but did not receive any data. Although the serial port event triggered the ISR, the input stream appeared filled with nulls and thus did not contain any data. As my understanding is that CommApi 3 was tested with a Red Hat distribution of Linux I wonder if this problem is distro dependent? Although somewhat off topic here I wonder if anyone reading this has had similar experience? .................................................................................................................................................................................. Windows XP results: There are problems with occasional data dropouts which become more frequent as the sampling rate is increased or if the computer becomes busy with other duties. The dropouts typically consist of a half dozen byte block of lost data. It appears the lost bytes never get added to the java input stream. There has not been any indication of garbled data, overruns or framing errors which suggests the UART communications remains solid. Using javax.comm 2 I found that the setting of SerialPort 'enableReceiveThreshold' to 40 and 'enableReceiveTimeout' of 100mS reduced the dropouts error rate significantly. I found that I could not get RXTX 2.1 to function with the aforementioned threshold and timeout settings. The javax.comm 2 interface is consequently performing better for me under Windows than RXTX 2.1. I wonder if anyone here has any suggestions as to what I might try to improve RXTX 2.1? Although my settings are the same as under Suse 10.0, RXTX 2.1 performs much better for me under Linux than any of the alternatives that I have tried under Windows XP . ............................................................................................................................................................................... I would like to establish, based on the experience of others, if I have reached the normally expected performance limit of java serial port communications? Should I expect to achieve virtually error free serial port data input from a continuous stream under Windows XP java software? I am considering changing my protocol to packets with error checking if necessary but would like to know if the dropout problems I am experiencing are typical or not before I take this rather work intensive plunge. Many thanks in advance for any help! Best Regards, Tom Alldread -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.375 / Virus Database: 267.15.2/253 - Release Date: 2006-02-07 From jlaxson at mac.com Wed Feb 8 23:56:48 2006 From: jlaxson at mac.com (John Laxson) Date: Thu, 9 Feb 2006 00:56:48 -0600 Subject: [Rxtx] PortInUseException: Unknown Application on OSX Message-ID: Hi, I've been trying to get RXTX 2.1.7 going on Mac OS X for a while here, and am running up into a wall here. I've tried with pre- compiled and the source version and get the same problem, a gnu.io.PortInUseException: Unknown Application. I have run the fixperms script included with the source distribution, and id shows me as a member of the uucp group, and permissions on /var/spool/uucp are 775 root:uucp. Running a test program (included at the bottom for clarity) lets me enumerate all the serial ports correctly, but trying to open any of them gives the PortInUseException. If it helps, when I try to open a port that's set to make an outgoing bluetooth connection, there is no delay and no connection attempt at all. Thanks, John Laxson PS: The documentation wiki on qbang.org shows 404, and has for a few days now. My test code: public static void main(String[] args) { SerialPort serialPort; try { Enumeration e = CommPortIdentifier.getPortIdentifiers(); CommPortIdentifier ident; while (e.hasMoreElements()) { ident = (CommPortIdentifier)e.nextElement(); System.out.println(ident.getName()); } ident = CommPortIdentifier.getPortIdentifier("/dev/cu.modem"); serialPort = (SerialPort) ident.open("Me", 5000); } catch (Exception e) { e.printStackTrace(); } } From rajesh.invincible at gmail.com Thu Feb 9 03:39:38 2006 From: rajesh.invincible at gmail.com (Rajesh N) Date: Thu, 9 Feb 2006 16:09:38 +0530 Subject: [Rxtx] Re: Move .java Files in gnu.io filesystem hierarchy - Maven (2) In-Reply-To: <43DF21D2.7090200@ngi.it> References: <43DF21D2.7090200@ngi.it> Message-ID: <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Can anybody tell me how to overcome these EXCEPTIONS I AM WORKING ON SERIAL COMMN IN JAVA ON LINUX. 1. " NOT ALL PARAMETERS SUPPORTED BY THE KERNEL" This i came across the following statement inmy prog. SerialP is A SerialPort object SerialP.setSerialPortParams(9600(BAUDRATE),DATABITS_8,STOPBITS_1,PARITY_NONE) 2. NullPointer Exception at Event Dispatch Now i have checked all my object references for a null reference but i found none i have put up my entire code in try catch blocks but still I AM UNABLE TO CATCH THIS EXCEPTION AND HENCE MY APPLICATION CLOSES HOW DOES THESE GO? PLEASE HELP ME IT IS URGENTTTTTTTTTTTTTTTT yours sincerely RAJESH On 1/31/06, Fabio Frumento wrote: > Hi Xavier, > > I don't know maven at all but the directory hierarchy listed buy Trent > is fine for me... > > I'll take a look to maven, it seems an interesting project > > Regards > > Fabio Frumento > > Trent Jarvi wrote: > > On Tue, 31 Jan 2006, Xavier Frisaye wrote: > > > >> Hi all, > >> > >> If you are going to rearrange the src folder, i will propose to use > >> maven 2 and follow its directory structure > >> > (http://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html). > >> > >> Maven 2 simplify java project and give a standard way to make projects > >> (http://maven.apache.org/). > >> We are using it for internal projects and we are very satisfied. > >> > >> Is anybody interested? > >> > >> I'm not an expert in maven 2 (yet) but i'm agree to help using it if > >> you choose to make so. > >> > > > > so this would be: > > > > rxtx-devel/src/main/java/gnu.io > > rxtx-devel/src/test/java/ManIwish.java > > > > I don't use IDEs very much so I'll let others comment. But I don't see > > a problem with that. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Thu Feb 9 09:50:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 9 Feb 2006 09:50:31 -0700 (MST) Subject: [Rxtx] Re: Move .java Files in gnu.io filesystem hierarchy - Maven (2) In-Reply-To: <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Message-ID: On Thu, 9 Feb 2006, Rajesh N wrote: > Can anybody tell me how to overcome these EXCEPTIONS > I AM WORKING ON SERIAL COMMN IN JAVA ON LINUX. > > 1. " NOT ALL PARAMETERS SUPPORTED BY THE KERNEL" > > This i came across the following statement inmy prog. > SerialP is A SerialPort object > SerialP.setSerialPortParams(9600(BAUDRATE),DATABITS_8,STOPBITS_1,PARITY_NONE) > Strange. The parameters you use are the same the port should open with by default. Could you paste the actual exception you are getting? I don't see that in the rxtx source. Also it would help to know the rxtx version. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Fri Feb 10 15:29:05 2006 From: lux at diesel-research.com (Kim Lux) Date: Fri, 10 Feb 2006 15:29:05 -0700 Subject: [Rxtx] One serial port object for both sending and receiving ? Message-ID: <1139610545.18177.4.camel@zd7280> Is it OK to use one SerialPort ojbect (ex Serial Port serialPort;) and use it for both sending and receiving ? For example: ======================================================================== static SerialPort serialPort = null; static OutputStream serialOut = null; static InputStream serialIn = null; // assign it to an outputStream for use try{ serialOut = serialPort.getOutputStream(); System.out.println("Serial output stream has been assigned."); }//try catch(IOException e) { System.out.println("Error: Couldn't assign output stream to serial port."); }//catch //assign it to an inputStream for use try{ serialIn = serialPort.getInputStream(); System.out.println("Serial input stream has been assigned."); }//try catch(IOException e) { System.out.println("Error: Couldn't assign input stream to serial port."); }//catch ======================================================================== -- Kim Lux, Diesel Research Inc. From lux at diesel-research.com Fri Feb 10 21:23:00 2006 From: lux at diesel-research.com (Kim Lux) Date: Fri, 10 Feb 2006 21:23:00 -0700 Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Message-ID: <1139631780.23882.10.camel@zd7280> I've got a problem receiving chars with my version of serialRead, written in an SWT GUI. I had a Java pro have a good look at my code and he can't see anything wrong with it. I can send chars fine. When I receive a char the cpu usage for the app goes to 100% and the code in the serial event handler doesn't get executed. The instructions on the Java Comm Serial API How-To for Linux page state that I must install javacomm. Is that true ? Everything builds without it and I can send chars on rxtx just fine, but I can't receive them. Could this be the problem ? I downloaded and installed javacomm. I was not able to add "Driver=gnuio.RXTXCommDriver to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 installed in /usr/java/jre1.5.0_05. I added comm.jar to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext to the library paths. Is this OK ? Does it matter that I am receiving on /dev/ttyUSB0 ? Thanks. -- Kim Lux, Diesel Research Inc. From lunareclipse03 at web.de Sat Feb 11 09:44:46 2006 From: lunareclipse03 at web.de (lunareclipse03@web.de) Date: Sat, 11 Feb 2006 17:44:46 +0100 Subject: [Rxtx] Question about Serial I/O under Win32 Message-ID: <662084330@web.de> Hello everybody, I have a strange problem with a piece of code I made for myself. No, this is not really concerning rxtx, but nevertheless I post this to the list, hoping that some of you can help me. I've written two libraries, one for linux and one for win32. The linux port works quite well, I can send / receive faxes and / or replay voice messages over the telephone line using a voice modem. But the win32 port of the library causes some trouble. If, for example, I send out a fax with a certain modem under linux, it works well. The fax is complete when it comes out of the fax machine. If I then use the same modem to send out a fax under win32, the fax coming out of the fax machine gets "stuck" halfways, but the sending modem thinks that transmission was ok and drops the connection. The answering fax machine then gives me "error while receiving." The "upper layer" java code MUST be right, because if I do the same thing under linux (using the linux library), everything is alright. Now I have to ask: Can somebody please help me out with this??!? Could it be the case that some kind of flow control or COMMTIMEOUTS setting causes this behaviour? I set flow control to RTS/CTS before sending out a fax. How can I DISABLE flow control? Or what do you think? Can something else cause this problems? Thank you all for your time and PLEASE write back soon. Regards, --Sven Ahlemann Am Waldrand 31 45721 Haltern am See Germany ______________________________________________________________ Verschicken Sie romantische, coole und witzige Bilder per SMS! Jetzt bei WEB.DE FreeMail: http://f.web.de/?mc=021193 From lux at diesel-research.com Sat Feb 11 10:06:52 2006 From: lux at diesel-research.com (Kim Lux) Date: Sat, 11 Feb 2006 10:06:52 -0700 Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: <1139631780.23882.10.camel@zd7280> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> <1139631780.23882.10.camel@zd7280> Message-ID: <1139677612.3431.5.camel@zd7280> More on this problem. I copied and pasted simpleRead into a console based Eclipse project and I've got the same result, except that cpu usage doesn't go to 100%. I'm beginning to think there is an issue in rxtx. My imports for simpleRead are: ============================ import gnu.io.*; import java.util.*; //import javax.comm.*; import java.io.*; =========================== Any ideas ? I am trying to read from /dev/ttyUSB0 using a serial to USB adapter which has worked well with minicom and gtkterm. Thanks. On Fri, 2006-02-10 at 21:23 -0700, Kim Lux wrote: > I've got a problem receiving chars with my version of serialRead, > written in an SWT GUI. > > I had a Java pro have a good look at my code and he can't see anything > wrong with it. > > I can send chars fine. When I receive a char the cpu usage for the app > goes to 100% and the code in the serial event handler doesn't get > executed. > > The instructions on the Java Comm Serial API How-To for Linux page state > that I must install javacomm. Is that true ? Everything builds without > it and I can send chars on rxtx just fine, but I can't receive them. > Could this be the problem ? > > I downloaded and installed javacomm. I was not able to add > "Driver=gnuio.RXTXCommDriver > to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not > have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 > installed in /usr/java/jre1.5.0_05. I added comm.jar > to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext > to the library paths. Is this OK ? > > Does it matter that I am receiving on /dev/ttyUSB0 ? > > Thanks. > -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Sun Feb 12 21:01:33 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:01:33 -0700 (MST) Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: <1139677612.3431.5.camel@zd7280> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> <1139631780.23882.10.camel@zd7280> <1139677612.3431.5.camel@zd7280> Message-ID: I suspect what is happening is the select() is breaking out in the native code but the driver does not have support for notifying there are X bytes available. On some traditional Unix based systems, the only way you know data is available is the fd status changes and do an FIORDCHK ioctl. Or perhaps the only thing you can know is the fd status changed. It would take reading through the kernel driver code to know for sure. So on USB, depending upon the driver, the same may need to be done or the driver improved a bit if possible to support. Polling reads will also work but don't use the event driven model of CommAPI which isnt acceptable in the long run. The 100% cpu usage can then be explained because select no longer blocks until the data is read; the eventLoop spins loose. You can put a well placed sleep but rxtx only expects those are needed when it knows data is available. This may not be a super simple thing to understand and fix. I do have ideas to get you started. I'm going to be short on time the next couple weeks. I expect to put some good time in and answer some other questions I saw around the 25th. For now, I'd look at the following and go from there with the hints I've given. JNIEXPORT jint JNICALL RXTXPort(nativeavailable)( JNIEnv *env, jobject jobj ) { int fd = get_java_var( env, jobj,"fd","I" ); int result; /* char message[80]; ENTER( "RXTXPort:nativeavailable" ); On SCO OpenServer FIONREAD always fails for serial devices, so try ioctl FIORDCHK instead; will only tell us whether bytes are available, not how many, but better than nothing. This turns out to be true on Solaris also. taj. */ #ifdef FIORDCHK /* __unixware__ __sun__ probably others */ result = ioctl(fd, FIORDCHK, 0); #else if( ioctl( fd, FIONREAD, &result ) < 0 ) { goto fail; } #endif /* FIORDCHK */ On Sat, 11 Feb 2006, Kim Lux wrote: > > More on this problem. I copied and pasted simpleRead into a console > based Eclipse project and I've got the same result, except that cpu > usage doesn't go to 100%. I'm beginning to think there is an issue in > rxtx. > > My imports for simpleRead are: > > ============================ > import gnu.io.*; > import java.util.*; > //import javax.comm.*; > import java.io.*; > =========================== > > Any ideas ? I am trying to read from /dev/ttyUSB0 using a serial to > USB adapter which has worked well with minicom and gtkterm. > > Thanks. > > > > On Fri, 2006-02-10 at 21:23 -0700, Kim Lux wrote: >> I've got a problem receiving chars with my version of serialRead, >> written in an SWT GUI. >> >> I had a Java pro have a good look at my code and he can't see anything >> wrong with it. >> >> I can send chars fine. When I receive a char the cpu usage for the app >> goes to 100% and the code in the serial event handler doesn't get >> executed. >> >> The instructions on the Java Comm Serial API How-To for Linux page state >> that I must install javacomm. Is that true ? Everything builds without >> it and I can send chars on rxtx just fine, but I can't receive them. >> Could this be the problem ? >> >> I downloaded and installed javacomm. I was not able to add >> "Driver=gnuio.RXTXCommDriver >> to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not >> have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 >> installed in /usr/java/jre1.5.0_05. I added comm.jar >> to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext >> to the library paths. Is this OK ? >> >> Does it matter that I am receiving on /dev/ttyUSB0 ? >> >> Thanks. >> > From tjarvi at qbang.org Sun Feb 12 21:03:30 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:03:30 -0700 (MST) Subject: [Rxtx] One serial port object for both sending and receiving ? In-Reply-To: <1139610545.18177.4.camel@zd7280> References: <1139610545.18177.4.camel@zd7280> Message-ID: On Fri, 10 Feb 2006, Kim Lux wrote: > > Is it OK to use one SerialPort ojbect (ex Serial Port serialPort;) and > use it for both sending and receiving ? > > For example: > > ======================================================================== > static SerialPort serialPort = null; > static OutputStream serialOut = null; > static InputStream serialIn = null; > > > > > // assign it to an outputStream for use > try{ > serialOut = serialPort.getOutputStream(); > System.out.println("Serial output stream has been assigned."); > }//try > catch(IOException e) > { > System.out.println("Error: Couldn't assign output stream to serial > port."); > }//catch > > > //assign it to an inputStream for use > try{ > serialIn = serialPort.getInputStream(); > System.out.println("Serial input stream has been assigned."); > }//try > catch(IOException e) > { > System.out.println("Error: Couldn't assign input stream to serial > port."); > }//catch This should be fine. In fact trying to do it another way will probably not work as you will run into lockfile issues. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun Feb 12 21:13:13 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:13:13 -0700 (MST) Subject: [Rxtx] Question about Serial I/O under Win32 In-Reply-To: <662084330@web.de> References: <662084330@web.de> Message-ID: On Sat, 11 Feb 2006 lunareclipse03 at web.de wrote: > Hello everybody, > > I have a strange problem with a piece of code I made for myself. No, > this is not really concerning rxtx, but nevertheless I post this to the > list, hoping that some of you can help me. I've written two libraries, > one for linux and one for win32. The linux port works quite well, I can > send / receive faxes and / or replay voice messages over the telephone > line using a voice modem. But the win32 port of the library causes some > trouble. If, for example, I send out a fax with a certain modem under > linux, it works well. The fax is complete when it comes out of the fax > machine. If I then use the same modem to send out a fax under win32, the > fax coming out of the fax machine gets "stuck" halfways, but the sending > modem thinks that transmission was ok and drops the connection. The > answering fax machine then gives me "error while receiving." The "upper > layer" java code MUST be right, because if I do the same thing under > linux (using the linux library), everything is alright. Now I have to > ask: Can somebody please help me out with this??!? Could it be the case > that some kind of flow control or COMMTIMEOUTS setting causes this > behaviour? I set flow control to RTS/CTS before sending out a fax. How > can I DISABLE flow control? Or what do you think? Can something else > cause this problems? Thank you all for your time and PLEASE write back > soon. > Hi Sven I'm not too willing to talk about flow control at the low level until I confirm some things with test equipment later. It is not clear if you are using rxtx or writing your own native code. So I'm not sure how to answer much of this :) If you are wondering how to change the flow control using rxtx from java, The BlackBox example from Sun flips this back and forth. SerialPort.java in rxtx 2.1 uses the following: SerialPort.java: public static final int FLOWCONTROL_NONE =0; SerialPort.java: public static final int FLOWCONTROL_RTSCTS_IN =1; SerialPort.java: public static final int FLOWCONTROL_RTSCTS_OUT =2; SerialPort.java: public static final int FLOWCONTROL_XONXOFF_IN =4; SerialPort.java: public static final int FLOWCONTROL_XONXOFF_OUT=8; So if you set flowcontrol to RTSCTS, you can set it to NONE to turn it off. If you are looking for how to do it in native code, the rxtx Source is SerialImp.c (unix/linux/mac os x/w32) and termios.c (w32 only with SerialImp.c) You can track the code: SerialImp.c:JNIEXPORT void JNICALL RXTXPort(setflowcontrol)( JNIEnv *env, jobject jobj, jint flowmode ) termios.c:int tcgetattr( int fd, struct termios *s_termios ) termios.c:int tcsetattr( int fd, int when, struct termios *s_termios ) There may be a problem in the rxtx flow control code though. Rather than guess, I want to test this with a gold standard. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Feb 6 00:00:16 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 00:00:16 -0700 (MST) Subject: [Rxtx] wiki delay until tomorrow night. In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: On Sun, 5 Feb 2006, Trent Jarvi wrote: > On Sun, 5 Feb 2006, Kim Lux wrote: > >> usb ? Tell me more... I need that too. > > usb is a very proper design. Thats all it is. > Maybe rxtx could help usb. But it would start with helping bring back the community that was already there. It's not something I'd love to do but maybe its the right thing to do. It would probably take 2 years to do right. But maybe thats better than what we have now. I honestly don't know what IBM is doing which could just run over everything. Just some thoughts after some fine german wine. -- Trent Jarvi tjarvi at qbang.org From gadelavega at yahoo.com.ar Mon Feb 6 02:17:05 2006 From: gadelavega at yahoo.com.ar (Gonzalo A. de la Vega) Date: Mon, 06 Feb 2006 10:17:05 +0100 Subject: [Rxtx] Serial port ownership question In-Reply-To: References: <20060205113618.30274.qmail@web53501.mail.yahoo.com> <1139157422.4553.9.camel@zd7280> <1139158698.4936.9.camel@zd7280> Message-ID: <43E71411.4050402@yahoo.com.ar> On my Fedora Core 4: ls -l /dev/ttyS* crw-rw---- 1 root uucp 4, 64 Feb 6 2006 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Feb 6 2006 /dev/ttyS1 ... and: grep "ttyUSB" /etc/udev/rules.d/50-udev.rules KERNEL=="ttyUSB*", GROUP="uucp", MODE="0660" So anyone in the "uucp" group can use serial ports. On Gentoo the group is "tty". Trent Jarvi escribi?: > > > On Sun, 5 Feb 2006, Dr. Douglas Lyon wrote: > >> I can confirm that this is the case (only root ownership of >> serial ports, under fedora 4). >> Wow, what were they thinking?! >> - DL >> >>> I've found that the newer kernels have the serial ports owned by root. >>> For example, >>> >>> $ls -al /dev/tty* >>> crw-rw-rw- 1 root root 5, 0 Feb 5 02:06 /dev/tty >>> crw-rw---- 1 root root 4, 0 Feb 5 02:06 /dev/tty0 >>> crw------- 1 root root 4, 1 Feb 5 09:07 /dev/tty1 >>> crw-rw---- 1 root tty 4, 10 Feb 5 02:06 /dev/tty10 >>> crw-rw---- 1 root tty 4, 11 Feb 5 02:06 /dev/tty11 >>> ... > > > This is just not a problem jcp or such are going to solve. Its a > platform spitwad fight. But do look at pam. In fact thats what Sun > is doing too. Maybe Linux followed their lead.. I'm not a pam guy. > I've spent 16 hours trying to understand it but your users wont :) > > Solution? I have no clue. Its two tangent mentalities from my > perspective. > > -- > Trent Jarvi > tjarvi at qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mtnvega at yahoo.com.br Mon Feb 6 05:35:43 2006 From: mtnvega at yahoo.com.br (Luiz Jr) Date: Mon, 6 Feb 2006 12:35:43 +0000 (GMT) Subject: [Rxtx] Documentation Wiki In-Reply-To: <1139157422.4553.9.camel@zd7280> Message-ID: <20060206123543.57256.qmail@web53515.mail.yahoo.com> Hello, Thank you for you answer, but so the usage of the API is pretty much like the Java Communications Api? If yes, what version of the Java Comm Api? Thank you, Luiz A. Brandao Jr Kim Lux escreveu: On Sun, 2006-02-05 at 08:36 -0300, Luiz Jr wrote: > Hello, > > I want to start using the RXTX libraries, but I would to know how, > since I can not access the documentation wiki page I just started using them yesterday. Below is how I installed the libraries, if that helps. I used snippets of code from the SimpleWrite application here to get me going. http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html Instead of "import javax.comm.*;", use "import gnu.io.*;" which is gotten from RXTXcomm.jar, which you will need to include in your project references. I am working in Eclipse. BTW: there is no way to open a port without going through the port list and finding it. Maybe sometime in the future someone (me ?) will write a method called openSerialPort that allows the user to give a port identifier, such as "/dev/tty1" and return a port ready to use. It wouldn't take much to write that and it would save users a lot of code. Hope this helps. ======================================================================= 1) Figure out which java you are running, incase there is more than one installed. $ java -version java version "1.5.0_05" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_05-b05) Java HotSpot(TM) Client VM (build 1.5.0_05-b05, mixed mode, sharing) 2) Find all the jre directories and the one from which you are currently running. kfind (jre) 3) cd to that directory plus /lib/i386 cd /usr/java/jre1.5.0_05/lib/i386 4) Copy the library files (*.so) to that directory. cp /home/krlux/Desktop/'Java Controls'/rxtx-linux/bin/* . 5) Check that the copy was successful ls librxtx* librxtxI2C.so librxtxRaw.so librxtxSerial.so librxtxParallel.so librxtxRS485.so 6) cd to the /lib/ext directory for your java. cd /usr/java/jre1.5.0_05/lib/ext 7) Copy the Jar files there cp /home/krlux/Desktop/'Java Controls'/rxtx-linux/lib/ext/* . 8) Check that it was successful ls RXTX* RXTXcomm.jar Rxtx is now installed on your machine ready to use. =================================================================== -- Kim Lux, Diesel Research Inc. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx --------------------------------- Yahoo! Acesso Gr?tis - Internet r?pida e gr?tis. Instale o discador agora! -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/544aa403/attachment-0040.html From lyon at docjava.com Mon Feb 6 05:49:34 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 06 Feb 2006 07:49:34 -0500 Subject: [Rxtx] wiki delay until tomorrow night. In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: Hi All, I have often thought about USB drivers being needed. For example, the ironman watch will not interface to a mac (windows only). It is USB. My dymo label writer has no Java driver (native only). Etc. Most cheap web cameras are USB (and Java drivers go through JAI, if it supports the camera at all). The JAI code shows how sun did the USB drivers. You have to be a member of the jai project to download the source code. https://jai.dev.java.net has the jai distro. And then you are not allowed to redistribute it. However, we can all learn from it (if so inclined). Basically: cvs -d :pserver:lyon at cvs.dev.java.net:/cvs login cvs -d :pserver:lyon at cvs.dev.java.net:/cvs checkout jai-core You will need to user your own uid and pw to get in. The ant build has over 100 warnings from sun deprecations of its own code. You might say that they were hoisted on their own Picard ;) One interesting thing is that they support several platforms: linux-amd64 64-bit Linux-AMD64 linux-i586 32-bit Linux-x86 solaris-amd64 64-bit Solaris-AMD64 solaris-i586 32-bit Solaris-x86 solaris-sparc 32-bit Solaris-SPARC solaris-sparcv9 64-bit Solaris-SPARC windows-i586 32-bit Windows-x86 Thus, ant is used to provide a multi-platform native method distro. Neat. How do they do it? check this out: And: The core download does not contain any C source code (it was all pre-built). Basically, they are just copying .so and .dll files into build directories. I would love to see the C code for this...but Sun does not post it on the https://jai.dev.java.net site. I don't know why...Perhaps I missed it. - Doug >On Sun, 5 Feb 2006, Trent Jarvi wrote: > >>On Sun, 5 Feb 2006, Kim Lux wrote: >> >>>usb ? Tell me more... I need that too. >> >>usb is a very proper design. Thats all it is. >> > >Maybe rxtx could help usb. But it would start with helping bring >back the community that was already there. > >It's not something I'd love to do but maybe its the right thing to do. > >It would probably take 2 years to do right. But maybe thats better >than what we have now. > >I honestly don't know what IBM is doing which could just run over everything. > >Just some thoughts after some fine german wine. > >-- >Trent Jarvi >tjarvi at qbang.org > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tdelenik at gmail.com Mon Feb 6 05:56:32 2006 From: tdelenik at gmail.com (Thanasis Delenikas) Date: Mon, 6 Feb 2006 14:56:32 +0200 Subject: Fwd: [Rxtx] Documentation Wiki In-Reply-To: <1139157422.4553.9.camel@zd7280> References: <20060205113618.30274.qmail@web53501.mail.yahoo.com> <1139157422.4553.9.camel@zd7280> Message-ID: <310a1a930602060456t129f1dc6p5f2b908f13ab5a0b@mail.gmail.com> Hello all, Kim, this is a snippet from the code I use. The closest to directly opening a specific port without enumeration. << ... portId = CommPortIdentifier.getPortIdentifier(getPort()); serialPort = (SerialPort) portId.open("jSMSEngine", 1971); ... >> where getPort() return the string identifier of the port, i.e. "/dev/ttyS0" or "COM1" or whatever. Thanasis. ---------- Forwarded message ---------- From: Kim Lux Date: Feb 5, 2006 6:37 PM Subject: Re: [Rxtx] Documentation Wiki To: RXTX Developers and Users BTW: there is no way to open a port without going through the port list and finding it. Maybe sometime in the future someone (me ?) will write a method called openSerialPort that allows the user to give a port identifier, such as "/dev/tty1" and return a port ready to use. It wouldn't take much to write that and it would save users a lot of code. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/182ab5b8/attachment-0040.html From tjarvi at qbang.org Mon Feb 6 11:53:57 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 11:53:57 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: On Mon, 6 Feb 2006, Dr. Douglas Lyon wrote: > Hi All, > I have often thought about USB drivers being needed. > For example, the ironman watch will not interface > to a mac (windows only). It is USB. > My dymo label writer has no Java driver (native only). > Etc. > Most cheap web cameras are USB (and Java drivers go > through JAI, if it supports the camera at all). > The JAI code shows how sun did the USB drivers. > You have to be a member of the jai project to download > the source code. > https://jai.dev.java.net has the jai distro. > And then you are not allowed to redistribute it. However, > we can all learn from it (if so inclined). Basically: > cvs -d :pserver:lyon at cvs.dev.java.net:/cvs login > cvs -d :pserver:lyon at cvs.dev.java.net:/cvs checkout jai-core > You will need to user your own uid and pw to get in. > The ant build has over 100 warnings from sun deprecations > of its own code. > > You might say that they were hoisted on their own Picard ;) > > One interesting thing is that they support several platforms: > linux-amd64 64-bit Linux-AMD64 > linux-i586 32-bit Linux-x86 > solaris-amd64 64-bit Solaris-AMD64 > solaris-i586 32-bit Solaris-x86 > solaris-sparc 32-bit Solaris-SPARC > solaris-sparcv9 64-bit Solaris-SPARC > windows-i586 32-bit Windows-x86 > Thus, ant is used to provide a multi-platform native method distro. > Neat. > How do they do it? > check this out: > > > > > > > > > > > > > And: > > > > > > > > > > The core download does not contain any C source code (it was all pre-built). > Basically, they are just copying .so and .dll files into build directories. > > I would love to see the C code for this...but Sun does not post it on the > https://jai.dev.java.net site. > > I don't know why...Perhaps I missed it. > > - Doug > > I've looked at moving rxtx to Ant builds. I think that would help IDEs a great deal. I requested a evalutation desk copy the O'Reilly Ant book for some j2ee material I was teaching. http://www.oreilly.com/catalog/anttdg/ It has a one sentence mention of JNI. So there was not luck there. I saw that there is another Ant book that does mention JNI more. I can't find it now. Ant must be able to support it with extensions. http://ant.apache.org/manual/OptionalTasks/javah.html What the auto(break :) tools do in the rxtx build is 4 things really. 1) gcc compile flags 2) ld compile flags 3) config.h 4) compile flags for customizing rxtx (lockfiles, ...) See 1 All of this information except 4 can be static once obtained. So I'm not attached to the auto tools. If I could find an example of Ant being used for JNI code, I'd be one of the first to start moving that direction. Maybe someone saw an example someplace. The other thing we have not completed discussing is the directory structure. There is interest in making rxtx more IDE friendly. I get more mail about that off the list than how to install rxtx. And I see we have Ken Thompson in da house :) He is our trusted CVS maintainer and the guy that purchased the rxtx.org domain. Old community. We will need Ken for changing the directory structure of source. I would like to open up discussion about both of these as it is more than time. The problem is I have little experience with Ant and even less with IDEs. It would be nice if we could work with Eclipse and NetBeans. http://www.netbeans.org/ (sun and some community) http://www.eclipes.org (ibm,rhat,... perhaps more community) http://maven.apache.org/what-is-maven.html (apache. It is community) borland should sortof be here too but I think thats covered in eclipse. >From what I understand so far, we should morph rxtx to support those three maybe trusting apaches lead with maven. But I use vi. I have little to no clues beyond what people have fed me. Can we agree that thats the right direction to go? -- Trent Jarvi tjarvi at qbang.org From brian at mbari.org Mon Feb 6 14:57:50 2006 From: brian at mbari.org (Brian Schlining) Date: Mon, 6 Feb 2006 13:57:50 -0800 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> > The other thing we have not completed discussing is the directory > structure. There is interest in making rxtx more IDE friendly. I > get more mail about that off the list than how to install rxtx. > > And I see we have Ken Thompson in da house :) He is our trusted > CVS maintainer and the guy that purchased the rxtx.org domain. Old > community. We will need Ken for changing the directory structure of > source. > > I would like to open up discussion about both of these as it is > more than time. The problem is I have little experience with Ant > and even less with IDEs. It would be nice if we could work with > Eclipse and NetBeans. > > http://www.netbeans.org/ (sun and some community) > http://www.eclipes.org (ibm,rhat,... perhaps more community) > http://maven.apache.org/what-is-maven.html (apache. It is community) > borland should sortof be here too but I think thats covered in > eclipse. > >> From what I understand so far, we should morph rxtx to support >> those three > maybe trusting apaches lead with maven. But I use vi. I have > little to no clues beyond what people have fed me. > Maven likes the directory structure below for Java code. (From http:// maven.apache.org/guides/getting-started/index.html) This structure works fine with ant, netbeans, and eclipse. rxtx_root_directory `-- src |-- main | `-- java | `-- gnu | `-- io `-- test `-- java `-- gnu `-- io Brian Schlining Software Engineer http://www.mbari.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/d9451eba/attachment-0040.html From tjarvi at qbang.org Mon Feb 6 15:11:45 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 15:11:45 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: > rxtx_root_directory > `-- src > |-- main > | `-- java > | `-- gnu > | `-- io > `-- test > `-- java > `-- gnu > `-- io > >From what I understand this will just be good. For me it makes no difference. So lets do the rxtx thing. Let if fester for two weeks and if nobody objects, we will do it. I'm not doing this because I care. I'm doing this to eliminate much of my inbox. But test... man is rxtx lacking there in the community aspect. It is covered but not right. _maybe_ I can change that this year. -- Trent Jarvi tjarvi at qbang.org (cat hurding since 1997) From lux at diesel-research.com Mon Feb 6 21:38:49 2006 From: lux at diesel-research.com (Kim Lux) Date: Mon, 06 Feb 2006 21:38:49 -0700 Subject: [Rxtx] How can I use Lock Files with rxtx (in FC4) ? Message-ID: <1139287129.17031.3.camel@zd7280> I am now running an rxtx application on FC4. I am getting: ========================================================= check_group_uucp(): error testing lock file creation Error details: Permission denied check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL ========================================================= $ ls -al /var/lock total 32 drwxrwxr-x 4 root lock 4096 Feb 6 16:04 . drwxr-xr-x 24 root root 4096 Nov 14 01:19 .. drwx------ 2 root root 4096 Apr 27 2005 lvm drwxr-xr-x 2 root root 4096 Feb 6 16:04 subsys How do I fix this for regulator users ? -- Kim Lux, Diesel Research Inc. From dmarkman at mac.com Mon Feb 6 22:24:44 2006 From: dmarkman at mac.com (Dmitry Markman) Date: Tue, 7 Feb 2006 00:24:44 -0500 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: if I understands the issue right in order to be able to use ant for c/c++ compilation you have to install ant's cc task http://ant-contrib.sourceforge.net/cc.html it looks like it should work on mac os x (authors claim, that it's platform independent) but I never tested so all you have to do it's providing right command line for the gcc compiler On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: >> rxtx_root_directory >> `-- src >> |-- main >> | `-- java >> | `-- gnu >> | `-- io >> `-- test >> `-- java >> `-- gnu >> `-- io >> > > >> From what I understand this will just be good. > > For me it makes no difference. So lets do the rxtx thing. Let if > fester for two weeks and if nobody objects, we will do it. > > I'm not doing this because I care. I'm doing this to eliminate > much of my inbox. > > But test... man is rxtx lacking there in the community aspect. It > is covered but not right. _maybe_ I can change that this year. > > -- > Trent Jarvi > tjarvi at qbang.org > (cat hurding since 1997) > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx Dmitry Markman From lux at diesel-research.com Mon Feb 6 23:20:15 2006 From: lux at diesel-research.com (Kim Lux) Date: Mon, 06 Feb 2006 23:20:15 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? Message-ID: <1139293215.3689.4.camel@zd7280> I'm running the code below. portlist.hasMoreElements() is false. /dev has ports in it as listed below. What am I doing wrong ? ========================================================== // Step through the list of ports until we find one that matches // the one we are looking for. portList = CommPortIdentifier.getPortIdentifiers(); while(portList.hasMoreElements()) { portID = (CommPortIdentifier) portList.nextElement(); // if (portID.getName().equals("/dev/ttyUSB0")) { myTA.append("Serial port ttyUSB0 has been found\n"); break; }// if portID equals... }// End of while... ========================================================== ls -al /dev/tty* crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 ... crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 -- Kim Lux, Diesel Research Inc. From david.garnier at trusted-logic.com Tue Feb 7 00:46:30 2006 From: david.garnier at trusted-logic.com (David Garnier) Date: Tue, 07 Feb 2006 08:46:30 +0100 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: <43E85056.2090608@trusted-logic.com> Hello, I think that the make-based build process is fine as it is, apart from the location of the Java source files. It is true that putting the Java source in a directory structure that map 1-to-1 to the Java package structure is the norm and should make it easier for everyone to modify the Java source, with or without an IDE. Ant is a good tool, but in the RXTX case I fail to see the advantage of using it compared to the current make-based process. As Trent said, they are more pressing issues, like testing. Regards, David Dmitry Markman wrote: > if I understands the issue right > in order to be able to use ant for c/c++ compilation > you have to install ant's cc task > http://ant-contrib.sourceforge.net/cc.html > > it looks like it should work on mac os x > (authors claim, that it's platform independent) > but I never tested > > so all you have to do it's providing right command line > for the gcc compiler > > > > > On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: > >>> rxtx_root_directory >>> `-- src >>> |-- main >>> | `-- java >>> | `-- gnu >>> | `-- io >>> `-- test >>> `-- java >>> `-- gnu >>> `-- io >>> >> >> >>> From what I understand this will just be good. >> >> For me it makes no difference. So lets do the rxtx thing. Let if >> fester for two weeks and if nobody objects, we will do it. >> >> I'm not doing this because I care. I'm doing this to eliminate much >> of my inbox. >> >> But test... man is rxtx lacking there in the community aspect. It is >> covered but not right. _maybe_ I can change that this year. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> (cat hurding since 1997) From tjarvi at qbang.org Tue Feb 7 01:11:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 01:11:31 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <43E85056.2090608@trusted-logic.com> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: On Tue, 7 Feb 2006, David Garnier wrote: > Hello, > > I think that the make-based build process is fine as it is, apart from the location of the Java > source files. It is true that putting the Java source in a directory structure that map 1-to-1 to > the Java package structure is the norm and should make it easier for everyone to modify the Java > source, with or without an IDE. > > Ant is a good tool, but in the RXTX case I fail to see the advantage of using it compared to the > current make-based process. As Trent said, they are more pressing issues, like testing. > Hi David I have more experience with testing rxtx than I can talk about. But let it be known, rxtx has gone trough 100's of hours of testing. We are hobby folks interested in toys but there is more. rxtx has had some of the best guidance in the industry there. This is not an easy thing. I may be able to come back in a month from the other side of the corperate fence and help. I suspect the tests could just be made public but they are in a very unusual environment that just wont work in a wider sense. This is something I'll be trying to change. At one point it was agreed we could just make the results public so this isnt just noise.. There is interest and I think its safe to mention that much. The big problem with testing in the past is most of it is done with a loopback connection. So we *still* have major questions regarding things like flow control. rxtx talks to itself over a loopback and it works. regardless of right or wrong. This requires more thought to be done right. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Feb 7 02:46:34 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 02:46:34 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: > The big problem with testing in the past is most of it is done with a > loopback connection. So we *still* have major questions regarding things > like flow control. rxtx talks to itself over a loopback and it works. > regardless of right or wrong. With serial communication there are gold standards. ckermit is probably a definitive 'standard.' Maybe its possible to do ping/pong tests with ckermit? Is it scriptable? There are known issues in rxtx. Probably the worst is some threading issues regarding some JREs with multiple JNI threads setting java variables. Man did I get schooled there. Just switch the c functions to returning variables and things go away. Sometimes they work fine, sometimes they blow up. Without understanding everything, somehow rhat got it right and debian (and especially gentoo) grabbed kernel patches causing all sort of harm. Its not hard to fix once you understand whats going on but nearly impossible to track with a debugger. So I have a good idea what 2.1-8 will have outside of the IDE modifications. rxtx 2.1-7 is a release for everyone to sync with. Its not even as stable as -pre17 as far as I know - I ran no test suites. I'll be chasing it too. We just had so many contributions that it was time. It seriously broke internal scheduals but thats a great thing :) The other thing I want to do in 2.1-8 is automagic baud rates. It turns out lots of shops are doing really funky baud rates for things like automobile test equipment. It is possible but it requires a fair amount of change in the native code. Is anyone looking at this? -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Feb 7 02:57:21 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 07 Feb 2006 04:57:21 -0500 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <43E85056.2090608@trusted-logic.com> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: Hi All, I agree, testing is very important. The problem I have been trying to address is related to cross-platform testing and the robust nature of the installs. Typically, I visit 3 platforms to deploy my product, windows, linux and mac. A build is performed on each platform. The idea that you can build for many platforms from one copy the source code seems attractive. This should enable synchronized deployments of identical code. The question of how to achieve this goal remains open. As Trent mentioned, this is hard. Perhaps Ant will help here (but perhaps not). Ant does seem to help with running unit tests. However, it does not help with multi-platform tests. For that you need many machines and different operating environments. Toward that end, I have created a multi-platform test that can be run from web start, located at: http://show.docjava.com:8086/book/cgij/code/jnlp/serialPort.PortTest.jnlp This is interesting because many people in the community can run the test and we can improve the test, as time permits. No, it is not a perfect solution, however, the idea does help with multi-platform tests using many machines and different operating environments. If the group has a good test for a general serial port set-ups, i would be happy to deploy it, for general evaluation using web start. And as for ANT, it is just an idea. Not all my ideas are good ones! - Doug >Hello, > >I think that the make-based build process is fine as it is, apart >from the location of the Java >source files. It is true that putting the Java source in a directory >structure that map 1-to-1 to >the Java package structure is the norm and should make it easier for >everyone to modify the Java >source, with or without an IDE. > >Ant is a good tool, but in the RXTX case I fail to see the advantage >of using it compared to the >current make-based process. As Trent said, they are more pressing >issues, like testing. > >Regards, >David > >Dmitry Markman wrote: >> if I understands the issue right >> in order to be able to use ant for c/c++ compilation >> you have to install ant's cc task >> http://ant-contrib.sourceforge.net/cc.html >> >> it looks like it should work on mac os x >> (authors claim, that it's platform independent) >> but I never tested >> >> so all you have to do it's providing right command line >> for the gcc compiler >> >> >> >> >> On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: >> >>>> rxtx_root_directory >>>> `-- src >>>> |-- main >>>> | `-- java >>>> | `-- gnu >>>> | `-- io >>>> `-- test >>>> `-- java >>>> `-- gnu >>>> `-- io >>>> >>> >>> >>>> From what I understand this will just be good. >>> >>> For me it makes no difference. So lets do the rxtx thing. Let if >>> fester for two weeks and if nobody objects, we will do it. >>> >>> I'm not doing this because I care. I'm doing this to eliminate much >>> of my inbox. >>> >>> But test... man is rxtx lacking there in the community aspect. It is >>> covered but not right. _maybe_ I can change that this year. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> (cat hurding since 1997) > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From matt.higgins at gmail.com Tue Feb 7 08:28:34 2006 From: matt.higgins at gmail.com (Matt Higgins) Date: Tue, 7 Feb 2006 10:28:34 -0500 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final Message-ID: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? import java.io.*; import java.util.*; import gnu.io.*; public class MySimpleRead implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; public static void main(String[] args) { boolean portFound = false; String defaultPort = "COM1"; if (args.length > 0) { defaultPort = args[0]; } portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; MySimpleRead reader = new MySimpleRead(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } } public MySimpleRead() { try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) { e.printStackTrace(); } try { inputStream = serialPort.getInputStream(); } catch (IOException e) { e.printStackTrace(); } try { serialPort.addEventListener(this); } catch (TooManyListenersException e) { e.printStackTrace(); } try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { e.printStackTrace(); } System.out.println("Baud is " + serialPort.getBaudRate()); System.out.println("Bits is " + serialPort.getDataBits()); System.out.println("Stop is " + serialPort.getStopBits()); System.out.println("Par is " + serialPort.getParity()); serialPort.notifyOnDataAvailable(true); readThread = new Thread(this); readThread.start(); } public void run() { // Thread.sleep(20000); //} catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { System.out.println("An event occurred " + event.getEventType()); switch (event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: byte[] readBuffer = new byte[20]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } System.out.print(new String(readBuffer)); } catch (IOException e) {} break; } } } --------------- Result on windows ------------------------------ Stable Library ============================================================== Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port:: COM1 Baud is 9600 Bits is 8 Stop is 1 Par is 0 ----------------- End Results ----------------------------------------- ------------------ Result on Linux ----------------------------------- Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 Found port: /dev/ttyS0 Baud is 9600 Bits is 8 Stop is 1 Par is 0 An event occurred 1 043100066224 ------------------ End Results --------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/a1431630/attachment-0040.html From brian at mbari.org Tue Feb 7 09:48:37 2006 From: brian at mbari.org (Brian Schlining) Date: Tue, 7 Feb 2006 08:48:37 -0800 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> Message-ID: <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> Hi Matt > The following code works fine on Linux but I never see any data > when run on Windows. This is a cut and paste from the SimpleRead > example. > I am attempting to read data from a bar code scanner. I can fire > up HyperTermianl on windows and see that the device is working > properly as I see the barcodes are scanned and echoed back to the > terminal. However when I run the app I don't see any data. It is > however associating with the com port as the informational bits > print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. Cheers Brian Schlining Software Engineer http://www.mbari.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/16d07f37/attachment-0040.html From lux at diesel-research.com Tue Feb 7 11:59:58 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 11:59:58 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139293215.3689.4.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> Message-ID: <1139338798.8145.4.camel@zd7280> Any ideas on this ? Any reason why portList.hasMoreElements() should be false even though there are devices in /dev ? On Mon, 2006-02-06 at 23:20 -0700, Kim Lux wrote: > I'm running the code below. > > portlist.hasMoreElements() is false. > > /dev has ports in it as listed below. > > What am I doing wrong ? > > > ========================================================== > // Step through the list of ports until we find one that matches > // the one we are looking for. > > portList = CommPortIdentifier.getPortIdentifiers(); > > while(portList.hasMoreElements()) > { > portID = (CommPortIdentifier) portList.nextElement(); // > if (portID.getName().equals("/dev/ttyUSB0")) > { > myTA.append("Serial port ttyUSB0 has been found\n"); > break; > }// if portID equals... > }// End of while... > ========================================================== > > ls -al /dev/tty* > crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty > crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 > crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 > crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 > crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 > ... > crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 > crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 > crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 > > > -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 12:20:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 12:20:25 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139338798.8145.4.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> Message-ID: On Tue, 7 Feb 2006, Kim Lux wrote: > > Any ideas on this ? Any reason why portList.hasMoreElements() should be > false even though there are devices in /dev ? > > > On Mon, 2006-02-06 at 23:20 -0700, Kim Lux wrote: >> I'm running the code below. >> >> portlist.hasMoreElements() is false. >> >> /dev has ports in it as listed below. >> >> What am I doing wrong ? >> >> >> ========================================================== >> // Step through the list of ports until we find one that matches >> // the one we are looking for. >> >> portList = CommPortIdentifier.getPortIdentifiers(); >> >> while(portList.hasMoreElements()) >> { >> portID = (CommPortIdentifier) portList.nextElement(); // >> if (portID.getName().equals("/dev/ttyUSB0")) >> { >> myTA.append("Serial port ttyUSB0 has been found\n"); >> break; >> }// if portID equals... >> }// End of while... >> ========================================================== >> >> ls -al /dev/tty* >> crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty >> crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 >> crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 >> crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 >> crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 >> ... >> crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 >> crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 >> crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 >> >> >> > Hi Kim What rxtx does is try to open the port and do a timed out read. If the kernel/... do not complain it's enumarted. I suspect you could do a crude test by doing something like cat /dev/ttyS0 > /dev/null If that barfs then rxtx wont enumerate the port. hmm looking at your question again, I suspect it's a lockfile problem. This is documented in INSTALL with the source. Its easy enough to test this too.. touch /var/lock/testingrxtxlockfiles && rm -f /var/lock/testingrxtxlockfiles If you are not in the right group it will bail. Root will work regardless. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 12:37:56 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 12:37:56 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> Message-ID: <1139341076.8145.11.camel@zd7280> Exactly which ports does rxtx attempt to put into the list ? /dev/* or /dev/tty* or /dev/tty[0-9[0-9] ? or /dev/ttyS* ? For the record, only /dev/ttyUSB0 is a valid port on the machine I am presently on. Will this be a problem ? On Tue, 2006-02-07 at 12:20 -0700, Trent Jarvi wrote: > This is documented in INSTALL with the source. > I was wondering where that file was. I will download source and dig it up. Thanks. -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 12:51:09 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 12:51:09 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139341076.8145.11.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: On Tue, 7 Feb 2006, Kim Lux wrote: > > Exactly which ports does rxtx attempt to put into the list ? /dev/* > or /dev/tty* or /dev/tty[0-9[0-9] ? or /dev/ttyS* ? > > For the record, only /dev/ttyUSB0 is a valid port on the machine I am > presently on. Will this be a problem ? > > > On Tue, 2006-02-07 at 12:20 -0700, Trent Jarvi wrote: >> This is documented in INSTALL with the source. >> > I was wondering where that file was. I will download source and dig it > up. > > Thanks. > Hmm I'm looking at pre17 so this may have changed. (its just what I have on this machine) if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA" // for the IPAQs }; CandidatePortPrefixes=Temp; } So you may need to add "ttyUSB" to that list. RXTX used to enumerate _everything_ see if(osName.equals("Linux-all-ports") But it became less than practical. This is all in RXTXCommDriver.java hmm I just did a cvs update. if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have to get your fingers into the code. We aim for sane defaults. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 13:06:45 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 13:06:45 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139342805.8145.22.camel@zd7280> On Tue, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > Hmm I'm looking at pre17 so this may have changed. (its just what I have > on this machine) > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA" // for the IPAQs > }; > CandidatePortPrefixes=Temp; > } > > > So you may need to add "ttyUSB" to that list. RXTX used to enumerate > _everything_ see if(osName.equals("Linux-all-ports") But it became less > than practical. > > This is all in RXTXCommDriver.java > > hmm I just did a cvs update. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have > to get your fingers into the code. We aim for sane defaults. Excellent. Thanks for taking the time. -- Kim Lux, Diesel Research Inc. From ideiglenes1 at freemail.hu Tue Feb 7 13:53:39 2006 From: ideiglenes1 at freemail.hu (--) Date: Tue, 07 Feb 2006 21:53:39 +0100 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139345619.22534.2.camel@localhost> Hi! I use this code to get all the extra Linux devices. :) if ("Linux".equals(System.getProperty("os.name"))) { System.setProperty("os.name","Linux-all-ports"); } driver = new RXTXCommDriver(); On k, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > On Tue, 7 Feb 2006, Kim Lux wrote: > > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have > to get your fingers into the code. We aim for sane defaults. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From matt.higgins at gmail.com Tue Feb 7 13:45:54 2006 From: matt.higgins at gmail.com (Matt Higgins) Date: Tue, 7 Feb 2006 15:45:54 -0500 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> Message-ID: <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> Sweet this is exactly what I needed. I was searching the archives through marc.theamisgroup they only have archives back to 1/3/05. Should have hit the mailman archive! Thanks a lot! On 2/7/06, Brian Schlining wrote: > > Hi Matt > > The following code works fine on Linux but I never see any data when run > on Windows. This is a cut and paste from the SimpleRead example. > I am attempting to read data from a bar code scanner. I can fire up > HyperTermianl on windows and see that the device is working properly as I > see the barcodes are scanned and echoed back to the terminal. However when I > run the app I don't see any data. It is however associating with the com > port as the informational bits print fine? > > > You're not the only one whose had this problem, I don't know if Trent has > addressed this is the latest release of RXTX but there is a workaround. > Here's the recent thread from the RXTX mailing list regarding this issues: > > Thanasis Delenikas tdelenik at gmail.com > Wed Jan 18 13:56:23 MST 2006 > > * Previous message: [Rxtx] Re: More close() performance fixes > * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] > > Hi all. > (I've subscribed again from my other email account). > > Trent, > > You are right. Linux *always* works, no matter what flow control you set. > Windows *works only* with hardware flow control (I haven't tested what > happens with software XON/XOFF flow control). > > I assume (but I am not certain) that even with no flow control at all, all > platforms should work. Without flow control, you have the risk of bumping > into overflow or framing errors, but that's your (the end programmer, I > mean) problem. > > >From my side, I shouldn't be working without flow control. That was a bug > too... It was some code forgotten from the old times, when I used to work > with phone emulation drivers which didn't support flow control. The > correct > way is to have some flow control enabled and that's why I suppose this is > a > low-severity bug for RxTx. > > I have no idea which platform shows the correct behaviour, since > my knowledge about Linux and the inner workings of these low-level i/o > operations is limited. > > Regards, > Thanasis Delenikas. > > > > > Message: 2 > > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > > From: Trent Jarvi > > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > > To: RXTX Developers and Users > > Message-ID: > > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > > > Hi all, > > > > > > Trent, I have found something. > > > I read your comment about flow control, so I experimented a bit. > > > > > > If you remember, in my sample program I've used no flow control at all > ( > > i.e. > > > Java constant FLOWCONTROL_NONE). > > > > > > Now, during testing, I've switch to hardware inbound flow control (i.e > . > > Java > > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > > beautifully! > > > > > > I think I will switch to H/W flow control and test things for a while, > > but > > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > > > > > Hi Thanasis, > > > > I'm fairly sure you have identified a bug. I would not worry too much > > about what Sun CommAPI w32 defaults are. I think they did more or less > > whatever the port opened with. Just a guess. Linux tries to stomp on > > ports so they are all the same. > > > > So this started out with Linux worked, Windows XP/.. did not as I > recall. > > Something is wrong in rxtx. Do I understand this right? > > > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > > > Perhaps there is something Wayne or I did not understand when we wrote > > that code. I wasnt programming back in the BBS days so modems are not > my > > thing. I have a few questions. > > > > Is the above matrix confirmed by observation? > > Linux just always worked? > > Which one _should_ work? I'm guessing modems work with hardware flow > > control. I'll have to dig around. > > > > The windows flow control changes a couple things with hardware flow > > control. Following the w32 API documentation is confusing sometimes. > > But it looks like Linux could have a bug too. > > Cheers > > Brian Schlining > Software Engineer > http://www.mbari.org > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/9c989144/attachment-0040.html From tjarvi at qbang.org Tue Feb 7 14:06:14 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 14:06:14 -0700 (MST) Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> Message-ID: >> >> You're not the only one whose had this problem, I don't know if Trent has >> addressed this is the latest release of RXTX but there is a workaround. >> Here's the recent thread from the RXTX mailing list regarding this issues: >> I have not. I expect to have access to some test equipment next month and I'll go through all of this. I really don't know whats going on and I need a gold standard. I thought maybe linux was autodetecting the flow control. Your observations would certainly be welcome. I need to talk to Russell King and see what he is doing. Until then I'd just be toying around over a loopback as usual. This is very high on the list though. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 17:25:05 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 17:25:05 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139358305.17994.2.camel@zd7280> My application now works. I installed the libraries and jar from 2.1-7 (Final). portlist.hasMoreElements is no longer false. The application finds the port for /dev/ttyUSB0. Thanks for your help, Trent (et al) Sorry I bothered you with this. Next time I will look in the source first. I didn't think it was an rxtx issue, I thought it was a Linux setup issue . On Tue, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > Hmm I'm looking at pre17 so this may have changed. (its just what I > have > on this machine) > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux > Serial Ports > "ttySA" // for the > IPAQs > }; > > CandidatePortPrefixes=Temp; > } > > > So you may need to add "ttyUSB" to that list. RXTX used to enumerate > _everything_ see if(osName.equals("Linux-all-ports") But it became > less > than practical. > > This is all in RXTXCommDriver.java > > hmm I just did a cvs update. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux > Serial Ports > "ttySA", // for the > IPAQs > "ttyUSB" // for USB > frobs > }; > > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you > have > to get your fingers into the code. We aim for sane defaults. -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 19:21:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 19:21:54 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139358305.17994.2.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> <1139358305.17994.2.camel@zd7280> Message-ID: >Sorry I bothered you with this. Next time I will look in the source >first. I didn't think it was an rxtx issue, I thought it was a Linux >setup issue . Why would you be sorry? I would have done the same. I'm glad it's working :) -- Trent Jarvi tjarvi at qbang.org From tma at mail.island.net Wed Feb 8 13:39:35 2006 From: tma at mail.island.net (Tom Alldread) Date: Wed, 08 Feb 2006 12:39:35 -0800 Subject: [Rxtx] Win32/Linux Serial Port Data Dropouts In-Reply-To: <200602060702.k167255O007882@www.qbang.org> References: <200602060702.k167255O007882@www.qbang.org> Message-ID: <43EA5707.4020200@mail.island.net> Greetings Folks at RXTX: During the last couple of months I have been alternately testing with javax.comm 2 and RXTX 2.1 under Windows XP and CommApi 3 and RXTX 2.1 under Suse 10.0 Linux. In the process I have learned a little about java multi-threading under NetBeans 5 with Profiler. My java (jdk 1.5_06) application is used for data acquisition and provides a graphical display of A-D conversion data received from a 56KBaud serial port. The actual data throughput is about 10KBaud thus it is well below the speed of the port. I use hardware RTS/CTS flow control which can stall the data acquisition sample rate if necessary. This ensures the display computer has the ability to slow the data acquisition rate should it become too busy to accept the regular data flow. Both the serial port buffer and the java read buffer are set at 16KB. Usually the data transfers into the java read buffer are less than 100 bytes unless the data acquisition is recovering from a stall. The data flow normally hesitates after each 5 KB block as a continue command is needed from the display computer to start the drawing of a new graphics display line. Separate threads have been provided for the serial port event monitoring and data processing. The serial port event thread has been given the maximum priority and data processing thread the minimum priority provided by java. Thread yield statements have been placed within all data processing while/for loops as an effort to ensure quick access to CPU cycles for the serial port event thread. I have found that short data transmissions are essentially error free but occasional dropouts occur with continuous data flow especially under Windows XP. ....................................................................................................................................................................................... Linux results: I am happy to report that RXTX 2.1 appears to work very well under Linux although I did notice some errors when the screen savers were running with my dual monitors. I believe this is a local problem associated with my dual graphics which needs further attention. The recent CommApi 3 Linux release from Sun did not work at all with my program. It seemed to send commands out OK but did not receive any data. Although the serial port event triggered the ISR, the input stream appeared filled with nulls and thus did not contain any data. As my understanding is that CommApi 3 was tested with a Red Hat distribution of Linux I wonder if this problem is distro dependent? Although somewhat off topic here I wonder if anyone reading this has had similar experience? .................................................................................................................................................................................. Windows XP results: There are problems with occasional data dropouts which become more frequent as the sampling rate is increased or if the computer becomes busy with other duties. The dropouts typically consist of a half dozen byte block of lost data. It appears the lost bytes never get added to the java input stream. There has not been any indication of garbled data, overruns or framing errors which suggests the UART communications remains solid. Using javax.comm 2 I found that the setting of SerialPort 'enableReceiveThreshold' to 40 and 'enableReceiveTimeout' of 100mS reduced the dropouts error rate significantly. I found that I could not get RXTX 2.1 to function with the aforementioned threshold and timeout settings. The javax.comm 2 interface is consequently performing better for me under Windows than RXTX 2.1. I wonder if anyone here has any suggestions as to what I might try to improve RXTX 2.1? Although my settings are the same as under Suse 10.0, RXTX 2.1 performs much better for me under Linux than any of the alternatives that I have tried under Windows XP . ............................................................................................................................................................................... I would like to establish, based on the experience of others, if I have reached the normally expected performance limit of java serial port communications? Should I expect to achieve virtually error free serial port data input from a continuous stream under Windows XP java software? I am considering changing my protocol to packets with error checking if necessary but would like to know if the dropout problems I am experiencing are typical or not before I take this rather work intensive plunge. Many thanks in advance for any help! Best Regards, Tom Alldread -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.375 / Virus Database: 267.15.2/253 - Release Date: 2006-02-07 From jlaxson at mac.com Wed Feb 8 23:56:48 2006 From: jlaxson at mac.com (John Laxson) Date: Thu, 9 Feb 2006 00:56:48 -0600 Subject: [Rxtx] PortInUseException: Unknown Application on OSX Message-ID: Hi, I've been trying to get RXTX 2.1.7 going on Mac OS X for a while here, and am running up into a wall here. I've tried with pre- compiled and the source version and get the same problem, a gnu.io.PortInUseException: Unknown Application. I have run the fixperms script included with the source distribution, and id shows me as a member of the uucp group, and permissions on /var/spool/uucp are 775 root:uucp. Running a test program (included at the bottom for clarity) lets me enumerate all the serial ports correctly, but trying to open any of them gives the PortInUseException. If it helps, when I try to open a port that's set to make an outgoing bluetooth connection, there is no delay and no connection attempt at all. Thanks, John Laxson PS: The documentation wiki on qbang.org shows 404, and has for a few days now. My test code: public static void main(String[] args) { SerialPort serialPort; try { Enumeration e = CommPortIdentifier.getPortIdentifiers(); CommPortIdentifier ident; while (e.hasMoreElements()) { ident = (CommPortIdentifier)e.nextElement(); System.out.println(ident.getName()); } ident = CommPortIdentifier.getPortIdentifier("/dev/cu.modem"); serialPort = (SerialPort) ident.open("Me", 5000); } catch (Exception e) { e.printStackTrace(); } } From rajesh.invincible at gmail.com Thu Feb 9 03:39:38 2006 From: rajesh.invincible at gmail.com (Rajesh N) Date: Thu, 9 Feb 2006 16:09:38 +0530 Subject: [Rxtx] Re: Move .java Files in gnu.io filesystem hierarchy - Maven (2) In-Reply-To: <43DF21D2.7090200@ngi.it> References: <43DF21D2.7090200@ngi.it> Message-ID: <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Can anybody tell me how to overcome these EXCEPTIONS I AM WORKING ON SERIAL COMMN IN JAVA ON LINUX. 1. " NOT ALL PARAMETERS SUPPORTED BY THE KERNEL" This i came across the following statement inmy prog. SerialP is A SerialPort object SerialP.setSerialPortParams(9600(BAUDRATE),DATABITS_8,STOPBITS_1,PARITY_NONE) 2. NullPointer Exception at Event Dispatch Now i have checked all my object references for a null reference but i found none i have put up my entire code in try catch blocks but still I AM UNABLE TO CATCH THIS EXCEPTION AND HENCE MY APPLICATION CLOSES HOW DOES THESE GO? PLEASE HELP ME IT IS URGENTTTTTTTTTTTTTTTT yours sincerely RAJESH On 1/31/06, Fabio Frumento wrote: > Hi Xavier, > > I don't know maven at all but the directory hierarchy listed buy Trent > is fine for me... > > I'll take a look to maven, it seems an interesting project > > Regards > > Fabio Frumento > > Trent Jarvi wrote: > > On Tue, 31 Jan 2006, Xavier Frisaye wrote: > > > >> Hi all, > >> > >> If you are going to rearrange the src folder, i will propose to use > >> maven 2 and follow its directory structure > >> > (http://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html). > >> > >> Maven 2 simplify java project and give a standard way to make projects > >> (http://maven.apache.org/). > >> We are using it for internal projects and we are very satisfied. > >> > >> Is anybody interested? > >> > >> I'm not an expert in maven 2 (yet) but i'm agree to help using it if > >> you choose to make so. > >> > > > > so this would be: > > > > rxtx-devel/src/main/java/gnu.io > > rxtx-devel/src/test/java/ManIwish.java > > > > I don't use IDEs very much so I'll let others comment. But I don't see > > a problem with that. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Thu Feb 9 09:50:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 9 Feb 2006 09:50:31 -0700 (MST) Subject: [Rxtx] Re: Move .java Files in gnu.io filesystem hierarchy - Maven (2) In-Reply-To: <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Message-ID: On Thu, 9 Feb 2006, Rajesh N wrote: > Can anybody tell me how to overcome these EXCEPTIONS > I AM WORKING ON SERIAL COMMN IN JAVA ON LINUX. > > 1. " NOT ALL PARAMETERS SUPPORTED BY THE KERNEL" > > This i came across the following statement inmy prog. > SerialP is A SerialPort object > SerialP.setSerialPortParams(9600(BAUDRATE),DATABITS_8,STOPBITS_1,PARITY_NONE) > Strange. The parameters you use are the same the port should open with by default. Could you paste the actual exception you are getting? I don't see that in the rxtx source. Also it would help to know the rxtx version. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Fri Feb 10 15:29:05 2006 From: lux at diesel-research.com (Kim Lux) Date: Fri, 10 Feb 2006 15:29:05 -0700 Subject: [Rxtx] One serial port object for both sending and receiving ? Message-ID: <1139610545.18177.4.camel@zd7280> Is it OK to use one SerialPort ojbect (ex Serial Port serialPort;) and use it for both sending and receiving ? For example: ======================================================================== static SerialPort serialPort = null; static OutputStream serialOut = null; static InputStream serialIn = null; // assign it to an outputStream for use try{ serialOut = serialPort.getOutputStream(); System.out.println("Serial output stream has been assigned."); }//try catch(IOException e) { System.out.println("Error: Couldn't assign output stream to serial port."); }//catch //assign it to an inputStream for use try{ serialIn = serialPort.getInputStream(); System.out.println("Serial input stream has been assigned."); }//try catch(IOException e) { System.out.println("Error: Couldn't assign input stream to serial port."); }//catch ======================================================================== -- Kim Lux, Diesel Research Inc. From lux at diesel-research.com Fri Feb 10 21:23:00 2006 From: lux at diesel-research.com (Kim Lux) Date: Fri, 10 Feb 2006 21:23:00 -0700 Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Message-ID: <1139631780.23882.10.camel@zd7280> I've got a problem receiving chars with my version of serialRead, written in an SWT GUI. I had a Java pro have a good look at my code and he can't see anything wrong with it. I can send chars fine. When I receive a char the cpu usage for the app goes to 100% and the code in the serial event handler doesn't get executed. The instructions on the Java Comm Serial API How-To for Linux page state that I must install javacomm. Is that true ? Everything builds without it and I can send chars on rxtx just fine, but I can't receive them. Could this be the problem ? I downloaded and installed javacomm. I was not able to add "Driver=gnuio.RXTXCommDriver to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 installed in /usr/java/jre1.5.0_05. I added comm.jar to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext to the library paths. Is this OK ? Does it matter that I am receiving on /dev/ttyUSB0 ? Thanks. -- Kim Lux, Diesel Research Inc. From lunareclipse03 at web.de Sat Feb 11 09:44:46 2006 From: lunareclipse03 at web.de (lunareclipse03@web.de) Date: Sat, 11 Feb 2006 17:44:46 +0100 Subject: [Rxtx] Question about Serial I/O under Win32 Message-ID: <662084330@web.de> Hello everybody, I have a strange problem with a piece of code I made for myself. No, this is not really concerning rxtx, but nevertheless I post this to the list, hoping that some of you can help me. I've written two libraries, one for linux and one for win32. The linux port works quite well, I can send / receive faxes and / or replay voice messages over the telephone line using a voice modem. But the win32 port of the library causes some trouble. If, for example, I send out a fax with a certain modem under linux, it works well. The fax is complete when it comes out of the fax machine. If I then use the same modem to send out a fax under win32, the fax coming out of the fax machine gets "stuck" halfways, but the sending modem thinks that transmission was ok and drops the connection. The answering fax machine then gives me "error while receiving." The "upper layer" java code MUST be right, because if I do the same thing under linux (using the linux library), everything is alright. Now I have to ask: Can somebody please help me out with this??!? Could it be the case that some kind of flow control or COMMTIMEOUTS setting causes this behaviour? I set flow control to RTS/CTS before sending out a fax. How can I DISABLE flow control? Or what do you think? Can something else cause this problems? Thank you all for your time and PLEASE write back soon. Regards, --Sven Ahlemann Am Waldrand 31 45721 Haltern am See Germany ______________________________________________________________ Verschicken Sie romantische, coole und witzige Bilder per SMS! Jetzt bei WEB.DE FreeMail: http://f.web.de/?mc=021193 From lux at diesel-research.com Sat Feb 11 10:06:52 2006 From: lux at diesel-research.com (Kim Lux) Date: Sat, 11 Feb 2006 10:06:52 -0700 Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: <1139631780.23882.10.camel@zd7280> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> <1139631780.23882.10.camel@zd7280> Message-ID: <1139677612.3431.5.camel@zd7280> More on this problem. I copied and pasted simpleRead into a console based Eclipse project and I've got the same result, except that cpu usage doesn't go to 100%. I'm beginning to think there is an issue in rxtx. My imports for simpleRead are: ============================ import gnu.io.*; import java.util.*; //import javax.comm.*; import java.io.*; =========================== Any ideas ? I am trying to read from /dev/ttyUSB0 using a serial to USB adapter which has worked well with minicom and gtkterm. Thanks. On Fri, 2006-02-10 at 21:23 -0700, Kim Lux wrote: > I've got a problem receiving chars with my version of serialRead, > written in an SWT GUI. > > I had a Java pro have a good look at my code and he can't see anything > wrong with it. > > I can send chars fine. When I receive a char the cpu usage for the app > goes to 100% and the code in the serial event handler doesn't get > executed. > > The instructions on the Java Comm Serial API How-To for Linux page state > that I must install javacomm. Is that true ? Everything builds without > it and I can send chars on rxtx just fine, but I can't receive them. > Could this be the problem ? > > I downloaded and installed javacomm. I was not able to add > "Driver=gnuio.RXTXCommDriver > to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not > have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 > installed in /usr/java/jre1.5.0_05. I added comm.jar > to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext > to the library paths. Is this OK ? > > Does it matter that I am receiving on /dev/ttyUSB0 ? > > Thanks. > -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Sun Feb 12 21:01:33 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:01:33 -0700 (MST) Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: <1139677612.3431.5.camel@zd7280> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> <1139631780.23882.10.camel@zd7280> <1139677612.3431.5.camel@zd7280> Message-ID: I suspect what is happening is the select() is breaking out in the native code but the driver does not have support for notifying there are X bytes available. On some traditional Unix based systems, the only way you know data is available is the fd status changes and do an FIORDCHK ioctl. Or perhaps the only thing you can know is the fd status changed. It would take reading through the kernel driver code to know for sure. So on USB, depending upon the driver, the same may need to be done or the driver improved a bit if possible to support. Polling reads will also work but don't use the event driven model of CommAPI which isnt acceptable in the long run. The 100% cpu usage can then be explained because select no longer blocks until the data is read; the eventLoop spins loose. You can put a well placed sleep but rxtx only expects those are needed when it knows data is available. This may not be a super simple thing to understand and fix. I do have ideas to get you started. I'm going to be short on time the next couple weeks. I expect to put some good time in and answer some other questions I saw around the 25th. For now, I'd look at the following and go from there with the hints I've given. JNIEXPORT jint JNICALL RXTXPort(nativeavailable)( JNIEnv *env, jobject jobj ) { int fd = get_java_var( env, jobj,"fd","I" ); int result; /* char message[80]; ENTER( "RXTXPort:nativeavailable" ); On SCO OpenServer FIONREAD always fails for serial devices, so try ioctl FIORDCHK instead; will only tell us whether bytes are available, not how many, but better than nothing. This turns out to be true on Solaris also. taj. */ #ifdef FIORDCHK /* __unixware__ __sun__ probably others */ result = ioctl(fd, FIORDCHK, 0); #else if( ioctl( fd, FIONREAD, &result ) < 0 ) { goto fail; } #endif /* FIORDCHK */ On Sat, 11 Feb 2006, Kim Lux wrote: > > More on this problem. I copied and pasted simpleRead into a console > based Eclipse project and I've got the same result, except that cpu > usage doesn't go to 100%. I'm beginning to think there is an issue in > rxtx. > > My imports for simpleRead are: > > ============================ > import gnu.io.*; > import java.util.*; > //import javax.comm.*; > import java.io.*; > =========================== > > Any ideas ? I am trying to read from /dev/ttyUSB0 using a serial to > USB adapter which has worked well with minicom and gtkterm. > > Thanks. > > > > On Fri, 2006-02-10 at 21:23 -0700, Kim Lux wrote: >> I've got a problem receiving chars with my version of serialRead, >> written in an SWT GUI. >> >> I had a Java pro have a good look at my code and he can't see anything >> wrong with it. >> >> I can send chars fine. When I receive a char the cpu usage for the app >> goes to 100% and the code in the serial event handler doesn't get >> executed. >> >> The instructions on the Java Comm Serial API How-To for Linux page state >> that I must install javacomm. Is that true ? Everything builds without >> it and I can send chars on rxtx just fine, but I can't receive them. >> Could this be the problem ? >> >> I downloaded and installed javacomm. I was not able to add >> "Driver=gnuio.RXTXCommDriver >> to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not >> have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 >> installed in /usr/java/jre1.5.0_05. I added comm.jar >> to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext >> to the library paths. Is this OK ? >> >> Does it matter that I am receiving on /dev/ttyUSB0 ? >> >> Thanks. >> > From tjarvi at qbang.org Sun Feb 12 21:03:30 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:03:30 -0700 (MST) Subject: [Rxtx] One serial port object for both sending and receiving ? In-Reply-To: <1139610545.18177.4.camel@zd7280> References: <1139610545.18177.4.camel@zd7280> Message-ID: On Fri, 10 Feb 2006, Kim Lux wrote: > > Is it OK to use one SerialPort ojbect (ex Serial Port serialPort;) and > use it for both sending and receiving ? > > For example: > > ======================================================================== > static SerialPort serialPort = null; > static OutputStream serialOut = null; > static InputStream serialIn = null; > > > > > // assign it to an outputStream for use > try{ > serialOut = serialPort.getOutputStream(); > System.out.println("Serial output stream has been assigned."); > }//try > catch(IOException e) > { > System.out.println("Error: Couldn't assign output stream to serial > port."); > }//catch > > > //assign it to an inputStream for use > try{ > serialIn = serialPort.getInputStream(); > System.out.println("Serial input stream has been assigned."); > }//try > catch(IOException e) > { > System.out.println("Error: Couldn't assign input stream to serial > port."); > }//catch This should be fine. In fact trying to do it another way will probably not work as you will run into lockfile issues. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun Feb 12 21:13:13 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:13:13 -0700 (MST) Subject: [Rxtx] Question about Serial I/O under Win32 In-Reply-To: <662084330@web.de> References: <662084330@web.de> Message-ID: On Sat, 11 Feb 2006 lunareclipse03 at web.de wrote: > Hello everybody, > > I have a strange problem with a piece of code I made for myself. No, > this is not really concerning rxtx, but nevertheless I post this to the > list, hoping that some of you can help me. I've written two libraries, > one for linux and one for win32. The linux port works quite well, I can > send / receive faxes and / or replay voice messages over the telephone > line using a voice modem. But the win32 port of the library causes some > trouble. If, for example, I send out a fax with a certain modem under > linux, it works well. The fax is complete when it comes out of the fax > machine. If I then use the same modem to send out a fax under win32, the > fax coming out of the fax machine gets "stuck" halfways, but the sending > modem thinks that transmission was ok and drops the connection. The > answering fax machine then gives me "error while receiving." The "upper > layer" java code MUST be right, because if I do the same thing under > linux (using the linux library), everything is alright. Now I have to > ask: Can somebody please help me out with this??!? Could it be the case > that some kind of flow control or COMMTIMEOUTS setting causes this > behaviour? I set flow control to RTS/CTS before sending out a fax. How > can I DISABLE flow control? Or what do you think? Can something else > cause this problems? Thank you all for your time and PLEASE write back > soon. > Hi Sven I'm not too willing to talk about flow control at the low level until I confirm some things with test equipment later. It is not clear if you are using rxtx or writing your own native code. So I'm not sure how to answer much of this :) If you are wondering how to change the flow control using rxtx from java, The BlackBox example from Sun flips this back and forth. SerialPort.java in rxtx 2.1 uses the following: SerialPort.java: public static final int FLOWCONTROL_NONE =0; SerialPort.java: public static final int FLOWCONTROL_RTSCTS_IN =1; SerialPort.java: public static final int FLOWCONTROL_RTSCTS_OUT =2; SerialPort.java: public static final int FLOWCONTROL_XONXOFF_IN =4; SerialPort.java: public static final int FLOWCONTROL_XONXOFF_OUT=8; So if you set flowcontrol to RTSCTS, you can set it to NONE to turn it off. If you are looking for how to do it in native code, the rxtx Source is SerialImp.c (unix/linux/mac os x/w32) and termios.c (w32 only with SerialImp.c) You can track the code: SerialImp.c:JNIEXPORT void JNICALL RXTXPort(setflowcontrol)( JNIEnv *env, jobject jobj, jint flowmode ) termios.c:int tcgetattr( int fd, struct termios *s_termios ) termios.c:int tcsetattr( int fd, int when, struct termios *s_termios ) There may be a problem in the rxtx flow control code though. Rather than guess, I want to test this with a gold standard. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Feb 6 00:00:16 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 00:00:16 -0700 (MST) Subject: [Rxtx] wiki delay until tomorrow night. In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: On Sun, 5 Feb 2006, Trent Jarvi wrote: > On Sun, 5 Feb 2006, Kim Lux wrote: > >> usb ? Tell me more... I need that too. > > usb is a very proper design. Thats all it is. > Maybe rxtx could help usb. But it would start with helping bring back the community that was already there. It's not something I'd love to do but maybe its the right thing to do. It would probably take 2 years to do right. But maybe thats better than what we have now. I honestly don't know what IBM is doing which could just run over everything. Just some thoughts after some fine german wine. -- Trent Jarvi tjarvi at qbang.org From gadelavega at yahoo.com.ar Mon Feb 6 02:17:05 2006 From: gadelavega at yahoo.com.ar (Gonzalo A. de la Vega) Date: Mon, 06 Feb 2006 10:17:05 +0100 Subject: [Rxtx] Serial port ownership question In-Reply-To: References: <20060205113618.30274.qmail@web53501.mail.yahoo.com> <1139157422.4553.9.camel@zd7280> <1139158698.4936.9.camel@zd7280> Message-ID: <43E71411.4050402@yahoo.com.ar> On my Fedora Core 4: ls -l /dev/ttyS* crw-rw---- 1 root uucp 4, 64 Feb 6 2006 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Feb 6 2006 /dev/ttyS1 ... and: grep "ttyUSB" /etc/udev/rules.d/50-udev.rules KERNEL=="ttyUSB*", GROUP="uucp", MODE="0660" So anyone in the "uucp" group can use serial ports. On Gentoo the group is "tty". Trent Jarvi escribi?: > > > On Sun, 5 Feb 2006, Dr. Douglas Lyon wrote: > >> I can confirm that this is the case (only root ownership of >> serial ports, under fedora 4). >> Wow, what were they thinking?! >> - DL >> >>> I've found that the newer kernels have the serial ports owned by root. >>> For example, >>> >>> $ls -al /dev/tty* >>> crw-rw-rw- 1 root root 5, 0 Feb 5 02:06 /dev/tty >>> crw-rw---- 1 root root 4, 0 Feb 5 02:06 /dev/tty0 >>> crw------- 1 root root 4, 1 Feb 5 09:07 /dev/tty1 >>> crw-rw---- 1 root tty 4, 10 Feb 5 02:06 /dev/tty10 >>> crw-rw---- 1 root tty 4, 11 Feb 5 02:06 /dev/tty11 >>> ... > > > This is just not a problem jcp or such are going to solve. Its a > platform spitwad fight. But do look at pam. In fact thats what Sun > is doing too. Maybe Linux followed their lead.. I'm not a pam guy. > I've spent 16 hours trying to understand it but your users wont :) > > Solution? I have no clue. Its two tangent mentalities from my > perspective. > > -- > Trent Jarvi > tjarvi at qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mtnvega at yahoo.com.br Mon Feb 6 05:35:43 2006 From: mtnvega at yahoo.com.br (Luiz Jr) Date: Mon, 6 Feb 2006 12:35:43 +0000 (GMT) Subject: [Rxtx] Documentation Wiki In-Reply-To: <1139157422.4553.9.camel@zd7280> Message-ID: <20060206123543.57256.qmail@web53515.mail.yahoo.com> Hello, Thank you for you answer, but so the usage of the API is pretty much like the Java Communications Api? If yes, what version of the Java Comm Api? Thank you, Luiz A. Brandao Jr Kim Lux escreveu: On Sun, 2006-02-05 at 08:36 -0300, Luiz Jr wrote: > Hello, > > I want to start using the RXTX libraries, but I would to know how, > since I can not access the documentation wiki page I just started using them yesterday. Below is how I installed the libraries, if that helps. I used snippets of code from the SimpleWrite application here to get me going. http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html Instead of "import javax.comm.*;", use "import gnu.io.*;" which is gotten from RXTXcomm.jar, which you will need to include in your project references. I am working in Eclipse. BTW: there is no way to open a port without going through the port list and finding it. Maybe sometime in the future someone (me ?) will write a method called openSerialPort that allows the user to give a port identifier, such as "/dev/tty1" and return a port ready to use. It wouldn't take much to write that and it would save users a lot of code. Hope this helps. ======================================================================= 1) Figure out which java you are running, incase there is more than one installed. $ java -version java version "1.5.0_05" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_05-b05) Java HotSpot(TM) Client VM (build 1.5.0_05-b05, mixed mode, sharing) 2) Find all the jre directories and the one from which you are currently running. kfind (jre) 3) cd to that directory plus /lib/i386 cd /usr/java/jre1.5.0_05/lib/i386 4) Copy the library files (*.so) to that directory. cp /home/krlux/Desktop/'Java Controls'/rxtx-linux/bin/* . 5) Check that the copy was successful ls librxtx* librxtxI2C.so librxtxRaw.so librxtxSerial.so librxtxParallel.so librxtxRS485.so 6) cd to the /lib/ext directory for your java. cd /usr/java/jre1.5.0_05/lib/ext 7) Copy the Jar files there cp /home/krlux/Desktop/'Java Controls'/rxtx-linux/lib/ext/* . 8) Check that it was successful ls RXTX* RXTXcomm.jar Rxtx is now installed on your machine ready to use. =================================================================== -- Kim Lux, Diesel Research Inc. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx --------------------------------- Yahoo! Acesso Gr?tis - Internet r?pida e gr?tis. Instale o discador agora! -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/544aa403/attachment-0041.html From lyon at docjava.com Mon Feb 6 05:49:34 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 06 Feb 2006 07:49:34 -0500 Subject: [Rxtx] wiki delay until tomorrow night. In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: Hi All, I have often thought about USB drivers being needed. For example, the ironman watch will not interface to a mac (windows only). It is USB. My dymo label writer has no Java driver (native only). Etc. Most cheap web cameras are USB (and Java drivers go through JAI, if it supports the camera at all). The JAI code shows how sun did the USB drivers. You have to be a member of the jai project to download the source code. https://jai.dev.java.net has the jai distro. And then you are not allowed to redistribute it. However, we can all learn from it (if so inclined). Basically: cvs -d :pserver:lyon at cvs.dev.java.net:/cvs login cvs -d :pserver:lyon at cvs.dev.java.net:/cvs checkout jai-core You will need to user your own uid and pw to get in. The ant build has over 100 warnings from sun deprecations of its own code. You might say that they were hoisted on their own Picard ;) One interesting thing is that they support several platforms: linux-amd64 64-bit Linux-AMD64 linux-i586 32-bit Linux-x86 solaris-amd64 64-bit Solaris-AMD64 solaris-i586 32-bit Solaris-x86 solaris-sparc 32-bit Solaris-SPARC solaris-sparcv9 64-bit Solaris-SPARC windows-i586 32-bit Windows-x86 Thus, ant is used to provide a multi-platform native method distro. Neat. How do they do it? check this out: And: The core download does not contain any C source code (it was all pre-built). Basically, they are just copying .so and .dll files into build directories. I would love to see the C code for this...but Sun does not post it on the https://jai.dev.java.net site. I don't know why...Perhaps I missed it. - Doug >On Sun, 5 Feb 2006, Trent Jarvi wrote: > >>On Sun, 5 Feb 2006, Kim Lux wrote: >> >>>usb ? Tell me more... I need that too. >> >>usb is a very proper design. Thats all it is. >> > >Maybe rxtx could help usb. But it would start with helping bring >back the community that was already there. > >It's not something I'd love to do but maybe its the right thing to do. > >It would probably take 2 years to do right. But maybe thats better >than what we have now. > >I honestly don't know what IBM is doing which could just run over everything. > >Just some thoughts after some fine german wine. > >-- >Trent Jarvi >tjarvi at qbang.org > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tdelenik at gmail.com Mon Feb 6 05:56:32 2006 From: tdelenik at gmail.com (Thanasis Delenikas) Date: Mon, 6 Feb 2006 14:56:32 +0200 Subject: Fwd: [Rxtx] Documentation Wiki In-Reply-To: <1139157422.4553.9.camel@zd7280> References: <20060205113618.30274.qmail@web53501.mail.yahoo.com> <1139157422.4553.9.camel@zd7280> Message-ID: <310a1a930602060456t129f1dc6p5f2b908f13ab5a0b@mail.gmail.com> Hello all, Kim, this is a snippet from the code I use. The closest to directly opening a specific port without enumeration. << ... portId = CommPortIdentifier.getPortIdentifier(getPort()); serialPort = (SerialPort) portId.open("jSMSEngine", 1971); ... >> where getPort() return the string identifier of the port, i.e. "/dev/ttyS0" or "COM1" or whatever. Thanasis. ---------- Forwarded message ---------- From: Kim Lux Date: Feb 5, 2006 6:37 PM Subject: Re: [Rxtx] Documentation Wiki To: RXTX Developers and Users BTW: there is no way to open a port without going through the port list and finding it. Maybe sometime in the future someone (me ?) will write a method called openSerialPort that allows the user to give a port identifier, such as "/dev/tty1" and return a port ready to use. It wouldn't take much to write that and it would save users a lot of code. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/182ab5b8/attachment-0041.html From tjarvi at qbang.org Mon Feb 6 11:53:57 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 11:53:57 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: On Mon, 6 Feb 2006, Dr. Douglas Lyon wrote: > Hi All, > I have often thought about USB drivers being needed. > For example, the ironman watch will not interface > to a mac (windows only). It is USB. > My dymo label writer has no Java driver (native only). > Etc. > Most cheap web cameras are USB (and Java drivers go > through JAI, if it supports the camera at all). > The JAI code shows how sun did the USB drivers. > You have to be a member of the jai project to download > the source code. > https://jai.dev.java.net has the jai distro. > And then you are not allowed to redistribute it. However, > we can all learn from it (if so inclined). Basically: > cvs -d :pserver:lyon at cvs.dev.java.net:/cvs login > cvs -d :pserver:lyon at cvs.dev.java.net:/cvs checkout jai-core > You will need to user your own uid and pw to get in. > The ant build has over 100 warnings from sun deprecations > of its own code. > > You might say that they were hoisted on their own Picard ;) > > One interesting thing is that they support several platforms: > linux-amd64 64-bit Linux-AMD64 > linux-i586 32-bit Linux-x86 > solaris-amd64 64-bit Solaris-AMD64 > solaris-i586 32-bit Solaris-x86 > solaris-sparc 32-bit Solaris-SPARC > solaris-sparcv9 64-bit Solaris-SPARC > windows-i586 32-bit Windows-x86 > Thus, ant is used to provide a multi-platform native method distro. > Neat. > How do they do it? > check this out: > > > > > > > > > > > > > And: > > > > > > > > > > The core download does not contain any C source code (it was all pre-built). > Basically, they are just copying .so and .dll files into build directories. > > I would love to see the C code for this...but Sun does not post it on the > https://jai.dev.java.net site. > > I don't know why...Perhaps I missed it. > > - Doug > > I've looked at moving rxtx to Ant builds. I think that would help IDEs a great deal. I requested a evalutation desk copy the O'Reilly Ant book for some j2ee material I was teaching. http://www.oreilly.com/catalog/anttdg/ It has a one sentence mention of JNI. So there was not luck there. I saw that there is another Ant book that does mention JNI more. I can't find it now. Ant must be able to support it with extensions. http://ant.apache.org/manual/OptionalTasks/javah.html What the auto(break :) tools do in the rxtx build is 4 things really. 1) gcc compile flags 2) ld compile flags 3) config.h 4) compile flags for customizing rxtx (lockfiles, ...) See 1 All of this information except 4 can be static once obtained. So I'm not attached to the auto tools. If I could find an example of Ant being used for JNI code, I'd be one of the first to start moving that direction. Maybe someone saw an example someplace. The other thing we have not completed discussing is the directory structure. There is interest in making rxtx more IDE friendly. I get more mail about that off the list than how to install rxtx. And I see we have Ken Thompson in da house :) He is our trusted CVS maintainer and the guy that purchased the rxtx.org domain. Old community. We will need Ken for changing the directory structure of source. I would like to open up discussion about both of these as it is more than time. The problem is I have little experience with Ant and even less with IDEs. It would be nice if we could work with Eclipse and NetBeans. http://www.netbeans.org/ (sun and some community) http://www.eclipes.org (ibm,rhat,... perhaps more community) http://maven.apache.org/what-is-maven.html (apache. It is community) borland should sortof be here too but I think thats covered in eclipse. >From what I understand so far, we should morph rxtx to support those three maybe trusting apaches lead with maven. But I use vi. I have little to no clues beyond what people have fed me. Can we agree that thats the right direction to go? -- Trent Jarvi tjarvi at qbang.org From brian at mbari.org Mon Feb 6 14:57:50 2006 From: brian at mbari.org (Brian Schlining) Date: Mon, 6 Feb 2006 13:57:50 -0800 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> > The other thing we have not completed discussing is the directory > structure. There is interest in making rxtx more IDE friendly. I > get more mail about that off the list than how to install rxtx. > > And I see we have Ken Thompson in da house :) He is our trusted > CVS maintainer and the guy that purchased the rxtx.org domain. Old > community. We will need Ken for changing the directory structure of > source. > > I would like to open up discussion about both of these as it is > more than time. The problem is I have little experience with Ant > and even less with IDEs. It would be nice if we could work with > Eclipse and NetBeans. > > http://www.netbeans.org/ (sun and some community) > http://www.eclipes.org (ibm,rhat,... perhaps more community) > http://maven.apache.org/what-is-maven.html (apache. It is community) > borland should sortof be here too but I think thats covered in > eclipse. > >> From what I understand so far, we should morph rxtx to support >> those three > maybe trusting apaches lead with maven. But I use vi. I have > little to no clues beyond what people have fed me. > Maven likes the directory structure below for Java code. (From http:// maven.apache.org/guides/getting-started/index.html) This structure works fine with ant, netbeans, and eclipse. rxtx_root_directory `-- src |-- main | `-- java | `-- gnu | `-- io `-- test `-- java `-- gnu `-- io Brian Schlining Software Engineer http://www.mbari.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/d9451eba/attachment-0041.html From tjarvi at qbang.org Mon Feb 6 15:11:45 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 15:11:45 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: > rxtx_root_directory > `-- src > |-- main > | `-- java > | `-- gnu > | `-- io > `-- test > `-- java > `-- gnu > `-- io > >From what I understand this will just be good. For me it makes no difference. So lets do the rxtx thing. Let if fester for two weeks and if nobody objects, we will do it. I'm not doing this because I care. I'm doing this to eliminate much of my inbox. But test... man is rxtx lacking there in the community aspect. It is covered but not right. _maybe_ I can change that this year. -- Trent Jarvi tjarvi at qbang.org (cat hurding since 1997) From lux at diesel-research.com Mon Feb 6 21:38:49 2006 From: lux at diesel-research.com (Kim Lux) Date: Mon, 06 Feb 2006 21:38:49 -0700 Subject: [Rxtx] How can I use Lock Files with rxtx (in FC4) ? Message-ID: <1139287129.17031.3.camel@zd7280> I am now running an rxtx application on FC4. I am getting: ========================================================= check_group_uucp(): error testing lock file creation Error details: Permission denied check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL ========================================================= $ ls -al /var/lock total 32 drwxrwxr-x 4 root lock 4096 Feb 6 16:04 . drwxr-xr-x 24 root root 4096 Nov 14 01:19 .. drwx------ 2 root root 4096 Apr 27 2005 lvm drwxr-xr-x 2 root root 4096 Feb 6 16:04 subsys How do I fix this for regulator users ? -- Kim Lux, Diesel Research Inc. From dmarkman at mac.com Mon Feb 6 22:24:44 2006 From: dmarkman at mac.com (Dmitry Markman) Date: Tue, 7 Feb 2006 00:24:44 -0500 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: if I understands the issue right in order to be able to use ant for c/c++ compilation you have to install ant's cc task http://ant-contrib.sourceforge.net/cc.html it looks like it should work on mac os x (authors claim, that it's platform independent) but I never tested so all you have to do it's providing right command line for the gcc compiler On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: >> rxtx_root_directory >> `-- src >> |-- main >> | `-- java >> | `-- gnu >> | `-- io >> `-- test >> `-- java >> `-- gnu >> `-- io >> > > >> From what I understand this will just be good. > > For me it makes no difference. So lets do the rxtx thing. Let if > fester for two weeks and if nobody objects, we will do it. > > I'm not doing this because I care. I'm doing this to eliminate > much of my inbox. > > But test... man is rxtx lacking there in the community aspect. It > is covered but not right. _maybe_ I can change that this year. > > -- > Trent Jarvi > tjarvi at qbang.org > (cat hurding since 1997) > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx Dmitry Markman From lux at diesel-research.com Mon Feb 6 23:20:15 2006 From: lux at diesel-research.com (Kim Lux) Date: Mon, 06 Feb 2006 23:20:15 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? Message-ID: <1139293215.3689.4.camel@zd7280> I'm running the code below. portlist.hasMoreElements() is false. /dev has ports in it as listed below. What am I doing wrong ? ========================================================== // Step through the list of ports until we find one that matches // the one we are looking for. portList = CommPortIdentifier.getPortIdentifiers(); while(portList.hasMoreElements()) { portID = (CommPortIdentifier) portList.nextElement(); // if (portID.getName().equals("/dev/ttyUSB0")) { myTA.append("Serial port ttyUSB0 has been found\n"); break; }// if portID equals... }// End of while... ========================================================== ls -al /dev/tty* crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 ... crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 -- Kim Lux, Diesel Research Inc. From david.garnier at trusted-logic.com Tue Feb 7 00:46:30 2006 From: david.garnier at trusted-logic.com (David Garnier) Date: Tue, 07 Feb 2006 08:46:30 +0100 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: <43E85056.2090608@trusted-logic.com> Hello, I think that the make-based build process is fine as it is, apart from the location of the Java source files. It is true that putting the Java source in a directory structure that map 1-to-1 to the Java package structure is the norm and should make it easier for everyone to modify the Java source, with or without an IDE. Ant is a good tool, but in the RXTX case I fail to see the advantage of using it compared to the current make-based process. As Trent said, they are more pressing issues, like testing. Regards, David Dmitry Markman wrote: > if I understands the issue right > in order to be able to use ant for c/c++ compilation > you have to install ant's cc task > http://ant-contrib.sourceforge.net/cc.html > > it looks like it should work on mac os x > (authors claim, that it's platform independent) > but I never tested > > so all you have to do it's providing right command line > for the gcc compiler > > > > > On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: > >>> rxtx_root_directory >>> `-- src >>> |-- main >>> | `-- java >>> | `-- gnu >>> | `-- io >>> `-- test >>> `-- java >>> `-- gnu >>> `-- io >>> >> >> >>> From what I understand this will just be good. >> >> For me it makes no difference. So lets do the rxtx thing. Let if >> fester for two weeks and if nobody objects, we will do it. >> >> I'm not doing this because I care. I'm doing this to eliminate much >> of my inbox. >> >> But test... man is rxtx lacking there in the community aspect. It is >> covered but not right. _maybe_ I can change that this year. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> (cat hurding since 1997) From tjarvi at qbang.org Tue Feb 7 01:11:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 01:11:31 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <43E85056.2090608@trusted-logic.com> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: On Tue, 7 Feb 2006, David Garnier wrote: > Hello, > > I think that the make-based build process is fine as it is, apart from the location of the Java > source files. It is true that putting the Java source in a directory structure that map 1-to-1 to > the Java package structure is the norm and should make it easier for everyone to modify the Java > source, with or without an IDE. > > Ant is a good tool, but in the RXTX case I fail to see the advantage of using it compared to the > current make-based process. As Trent said, they are more pressing issues, like testing. > Hi David I have more experience with testing rxtx than I can talk about. But let it be known, rxtx has gone trough 100's of hours of testing. We are hobby folks interested in toys but there is more. rxtx has had some of the best guidance in the industry there. This is not an easy thing. I may be able to come back in a month from the other side of the corperate fence and help. I suspect the tests could just be made public but they are in a very unusual environment that just wont work in a wider sense. This is something I'll be trying to change. At one point it was agreed we could just make the results public so this isnt just noise.. There is interest and I think its safe to mention that much. The big problem with testing in the past is most of it is done with a loopback connection. So we *still* have major questions regarding things like flow control. rxtx talks to itself over a loopback and it works. regardless of right or wrong. This requires more thought to be done right. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Feb 7 02:46:34 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 02:46:34 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: > The big problem with testing in the past is most of it is done with a > loopback connection. So we *still* have major questions regarding things > like flow control. rxtx talks to itself over a loopback and it works. > regardless of right or wrong. With serial communication there are gold standards. ckermit is probably a definitive 'standard.' Maybe its possible to do ping/pong tests with ckermit? Is it scriptable? There are known issues in rxtx. Probably the worst is some threading issues regarding some JREs with multiple JNI threads setting java variables. Man did I get schooled there. Just switch the c functions to returning variables and things go away. Sometimes they work fine, sometimes they blow up. Without understanding everything, somehow rhat got it right and debian (and especially gentoo) grabbed kernel patches causing all sort of harm. Its not hard to fix once you understand whats going on but nearly impossible to track with a debugger. So I have a good idea what 2.1-8 will have outside of the IDE modifications. rxtx 2.1-7 is a release for everyone to sync with. Its not even as stable as -pre17 as far as I know - I ran no test suites. I'll be chasing it too. We just had so many contributions that it was time. It seriously broke internal scheduals but thats a great thing :) The other thing I want to do in 2.1-8 is automagic baud rates. It turns out lots of shops are doing really funky baud rates for things like automobile test equipment. It is possible but it requires a fair amount of change in the native code. Is anyone looking at this? -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Feb 7 02:57:21 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 07 Feb 2006 04:57:21 -0500 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <43E85056.2090608@trusted-logic.com> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: Hi All, I agree, testing is very important. The problem I have been trying to address is related to cross-platform testing and the robust nature of the installs. Typically, I visit 3 platforms to deploy my product, windows, linux and mac. A build is performed on each platform. The idea that you can build for many platforms from one copy the source code seems attractive. This should enable synchronized deployments of identical code. The question of how to achieve this goal remains open. As Trent mentioned, this is hard. Perhaps Ant will help here (but perhaps not). Ant does seem to help with running unit tests. However, it does not help with multi-platform tests. For that you need many machines and different operating environments. Toward that end, I have created a multi-platform test that can be run from web start, located at: http://show.docjava.com:8086/book/cgij/code/jnlp/serialPort.PortTest.jnlp This is interesting because many people in the community can run the test and we can improve the test, as time permits. No, it is not a perfect solution, however, the idea does help with multi-platform tests using many machines and different operating environments. If the group has a good test for a general serial port set-ups, i would be happy to deploy it, for general evaluation using web start. And as for ANT, it is just an idea. Not all my ideas are good ones! - Doug >Hello, > >I think that the make-based build process is fine as it is, apart >from the location of the Java >source files. It is true that putting the Java source in a directory >structure that map 1-to-1 to >the Java package structure is the norm and should make it easier for >everyone to modify the Java >source, with or without an IDE. > >Ant is a good tool, but in the RXTX case I fail to see the advantage >of using it compared to the >current make-based process. As Trent said, they are more pressing >issues, like testing. > >Regards, >David > >Dmitry Markman wrote: >> if I understands the issue right >> in order to be able to use ant for c/c++ compilation >> you have to install ant's cc task >> http://ant-contrib.sourceforge.net/cc.html >> >> it looks like it should work on mac os x >> (authors claim, that it's platform independent) >> but I never tested >> >> so all you have to do it's providing right command line >> for the gcc compiler >> >> >> >> >> On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: >> >>>> rxtx_root_directory >>>> `-- src >>>> |-- main >>>> | `-- java >>>> | `-- gnu >>>> | `-- io >>>> `-- test >>>> `-- java >>>> `-- gnu >>>> `-- io >>>> >>> >>> >>>> From what I understand this will just be good. >>> >>> For me it makes no difference. So lets do the rxtx thing. Let if >>> fester for two weeks and if nobody objects, we will do it. >>> >>> I'm not doing this because I care. I'm doing this to eliminate much >>> of my inbox. >>> >>> But test... man is rxtx lacking there in the community aspect. It is >>> covered but not right. _maybe_ I can change that this year. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> (cat hurding since 1997) > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From matt.higgins at gmail.com Tue Feb 7 08:28:34 2006 From: matt.higgins at gmail.com (Matt Higgins) Date: Tue, 7 Feb 2006 10:28:34 -0500 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final Message-ID: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? import java.io.*; import java.util.*; import gnu.io.*; public class MySimpleRead implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; public static void main(String[] args) { boolean portFound = false; String defaultPort = "COM1"; if (args.length > 0) { defaultPort = args[0]; } portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; MySimpleRead reader = new MySimpleRead(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } } public MySimpleRead() { try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) { e.printStackTrace(); } try { inputStream = serialPort.getInputStream(); } catch (IOException e) { e.printStackTrace(); } try { serialPort.addEventListener(this); } catch (TooManyListenersException e) { e.printStackTrace(); } try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { e.printStackTrace(); } System.out.println("Baud is " + serialPort.getBaudRate()); System.out.println("Bits is " + serialPort.getDataBits()); System.out.println("Stop is " + serialPort.getStopBits()); System.out.println("Par is " + serialPort.getParity()); serialPort.notifyOnDataAvailable(true); readThread = new Thread(this); readThread.start(); } public void run() { // Thread.sleep(20000); //} catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { System.out.println("An event occurred " + event.getEventType()); switch (event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: byte[] readBuffer = new byte[20]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } System.out.print(new String(readBuffer)); } catch (IOException e) {} break; } } } --------------- Result on windows ------------------------------ Stable Library ============================================================== Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port:: COM1 Baud is 9600 Bits is 8 Stop is 1 Par is 0 ----------------- End Results ----------------------------------------- ------------------ Result on Linux ----------------------------------- Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 Found port: /dev/ttyS0 Baud is 9600 Bits is 8 Stop is 1 Par is 0 An event occurred 1 043100066224 ------------------ End Results --------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/a1431630/attachment-0041.html From brian at mbari.org Tue Feb 7 09:48:37 2006 From: brian at mbari.org (Brian Schlining) Date: Tue, 7 Feb 2006 08:48:37 -0800 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> Message-ID: <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> Hi Matt > The following code works fine on Linux but I never see any data > when run on Windows. This is a cut and paste from the SimpleRead > example. > I am attempting to read data from a bar code scanner. I can fire > up HyperTermianl on windows and see that the device is working > properly as I see the barcodes are scanned and echoed back to the > terminal. However when I run the app I don't see any data. It is > however associating with the com port as the informational bits > print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. Cheers Brian Schlining Software Engineer http://www.mbari.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/16d07f37/attachment-0041.html From lux at diesel-research.com Tue Feb 7 11:59:58 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 11:59:58 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139293215.3689.4.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> Message-ID: <1139338798.8145.4.camel@zd7280> Any ideas on this ? Any reason why portList.hasMoreElements() should be false even though there are devices in /dev ? On Mon, 2006-02-06 at 23:20 -0700, Kim Lux wrote: > I'm running the code below. > > portlist.hasMoreElements() is false. > > /dev has ports in it as listed below. > > What am I doing wrong ? > > > ========================================================== > // Step through the list of ports until we find one that matches > // the one we are looking for. > > portList = CommPortIdentifier.getPortIdentifiers(); > > while(portList.hasMoreElements()) > { > portID = (CommPortIdentifier) portList.nextElement(); // > if (portID.getName().equals("/dev/ttyUSB0")) > { > myTA.append("Serial port ttyUSB0 has been found\n"); > break; > }// if portID equals... > }// End of while... > ========================================================== > > ls -al /dev/tty* > crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty > crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 > crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 > crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 > crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 > ... > crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 > crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 > crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 > > > -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 12:20:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 12:20:25 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139338798.8145.4.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> Message-ID: On Tue, 7 Feb 2006, Kim Lux wrote: > > Any ideas on this ? Any reason why portList.hasMoreElements() should be > false even though there are devices in /dev ? > > > On Mon, 2006-02-06 at 23:20 -0700, Kim Lux wrote: >> I'm running the code below. >> >> portlist.hasMoreElements() is false. >> >> /dev has ports in it as listed below. >> >> What am I doing wrong ? >> >> >> ========================================================== >> // Step through the list of ports until we find one that matches >> // the one we are looking for. >> >> portList = CommPortIdentifier.getPortIdentifiers(); >> >> while(portList.hasMoreElements()) >> { >> portID = (CommPortIdentifier) portList.nextElement(); // >> if (portID.getName().equals("/dev/ttyUSB0")) >> { >> myTA.append("Serial port ttyUSB0 has been found\n"); >> break; >> }// if portID equals... >> }// End of while... >> ========================================================== >> >> ls -al /dev/tty* >> crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty >> crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 >> crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 >> crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 >> crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 >> ... >> crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 >> crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 >> crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 >> >> >> > Hi Kim What rxtx does is try to open the port and do a timed out read. If the kernel/... do not complain it's enumarted. I suspect you could do a crude test by doing something like cat /dev/ttyS0 > /dev/null If that barfs then rxtx wont enumerate the port. hmm looking at your question again, I suspect it's a lockfile problem. This is documented in INSTALL with the source. Its easy enough to test this too.. touch /var/lock/testingrxtxlockfiles && rm -f /var/lock/testingrxtxlockfiles If you are not in the right group it will bail. Root will work regardless. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 12:37:56 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 12:37:56 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> Message-ID: <1139341076.8145.11.camel@zd7280> Exactly which ports does rxtx attempt to put into the list ? /dev/* or /dev/tty* or /dev/tty[0-9[0-9] ? or /dev/ttyS* ? For the record, only /dev/ttyUSB0 is a valid port on the machine I am presently on. Will this be a problem ? On Tue, 2006-02-07 at 12:20 -0700, Trent Jarvi wrote: > This is documented in INSTALL with the source. > I was wondering where that file was. I will download source and dig it up. Thanks. -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 12:51:09 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 12:51:09 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139341076.8145.11.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: On Tue, 7 Feb 2006, Kim Lux wrote: > > Exactly which ports does rxtx attempt to put into the list ? /dev/* > or /dev/tty* or /dev/tty[0-9[0-9] ? or /dev/ttyS* ? > > For the record, only /dev/ttyUSB0 is a valid port on the machine I am > presently on. Will this be a problem ? > > > On Tue, 2006-02-07 at 12:20 -0700, Trent Jarvi wrote: >> This is documented in INSTALL with the source. >> > I was wondering where that file was. I will download source and dig it > up. > > Thanks. > Hmm I'm looking at pre17 so this may have changed. (its just what I have on this machine) if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA" // for the IPAQs }; CandidatePortPrefixes=Temp; } So you may need to add "ttyUSB" to that list. RXTX used to enumerate _everything_ see if(osName.equals("Linux-all-ports") But it became less than practical. This is all in RXTXCommDriver.java hmm I just did a cvs update. if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have to get your fingers into the code. We aim for sane defaults. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 13:06:45 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 13:06:45 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139342805.8145.22.camel@zd7280> On Tue, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > Hmm I'm looking at pre17 so this may have changed. (its just what I have > on this machine) > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA" // for the IPAQs > }; > CandidatePortPrefixes=Temp; > } > > > So you may need to add "ttyUSB" to that list. RXTX used to enumerate > _everything_ see if(osName.equals("Linux-all-ports") But it became less > than practical. > > This is all in RXTXCommDriver.java > > hmm I just did a cvs update. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have > to get your fingers into the code. We aim for sane defaults. Excellent. Thanks for taking the time. -- Kim Lux, Diesel Research Inc. From ideiglenes1 at freemail.hu Tue Feb 7 13:53:39 2006 From: ideiglenes1 at freemail.hu (--) Date: Tue, 07 Feb 2006 21:53:39 +0100 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139345619.22534.2.camel@localhost> Hi! I use this code to get all the extra Linux devices. :) if ("Linux".equals(System.getProperty("os.name"))) { System.setProperty("os.name","Linux-all-ports"); } driver = new RXTXCommDriver(); On k, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > On Tue, 7 Feb 2006, Kim Lux wrote: > > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have > to get your fingers into the code. We aim for sane defaults. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From matt.higgins at gmail.com Tue Feb 7 13:45:54 2006 From: matt.higgins at gmail.com (Matt Higgins) Date: Tue, 7 Feb 2006 15:45:54 -0500 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> Message-ID: <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> Sweet this is exactly what I needed. I was searching the archives through marc.theamisgroup they only have archives back to 1/3/05. Should have hit the mailman archive! Thanks a lot! On 2/7/06, Brian Schlining wrote: > > Hi Matt > > The following code works fine on Linux but I never see any data when run > on Windows. This is a cut and paste from the SimpleRead example. > I am attempting to read data from a bar code scanner. I can fire up > HyperTermianl on windows and see that the device is working properly as I > see the barcodes are scanned and echoed back to the terminal. However when I > run the app I don't see any data. It is however associating with the com > port as the informational bits print fine? > > > You're not the only one whose had this problem, I don't know if Trent has > addressed this is the latest release of RXTX but there is a workaround. > Here's the recent thread from the RXTX mailing list regarding this issues: > > Thanasis Delenikas tdelenik at gmail.com > Wed Jan 18 13:56:23 MST 2006 > > * Previous message: [Rxtx] Re: More close() performance fixes > * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] > > Hi all. > (I've subscribed again from my other email account). > > Trent, > > You are right. Linux *always* works, no matter what flow control you set. > Windows *works only* with hardware flow control (I haven't tested what > happens with software XON/XOFF flow control). > > I assume (but I am not certain) that even with no flow control at all, all > platforms should work. Without flow control, you have the risk of bumping > into overflow or framing errors, but that's your (the end programmer, I > mean) problem. > > >From my side, I shouldn't be working without flow control. That was a bug > too... It was some code forgotten from the old times, when I used to work > with phone emulation drivers which didn't support flow control. The > correct > way is to have some flow control enabled and that's why I suppose this is > a > low-severity bug for RxTx. > > I have no idea which platform shows the correct behaviour, since > my knowledge about Linux and the inner workings of these low-level i/o > operations is limited. > > Regards, > Thanasis Delenikas. > > > > > Message: 2 > > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > > From: Trent Jarvi > > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > > To: RXTX Developers and Users > > Message-ID: > > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > > > Hi all, > > > > > > Trent, I have found something. > > > I read your comment about flow control, so I experimented a bit. > > > > > > If you remember, in my sample program I've used no flow control at all > ( > > i.e. > > > Java constant FLOWCONTROL_NONE). > > > > > > Now, during testing, I've switch to hardware inbound flow control (i.e > . > > Java > > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > > beautifully! > > > > > > I think I will switch to H/W flow control and test things for a while, > > but > > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > > > > > Hi Thanasis, > > > > I'm fairly sure you have identified a bug. I would not worry too much > > about what Sun CommAPI w32 defaults are. I think they did more or less > > whatever the port opened with. Just a guess. Linux tries to stomp on > > ports so they are all the same. > > > > So this started out with Linux worked, Windows XP/.. did not as I > recall. > > Something is wrong in rxtx. Do I understand this right? > > > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > > > Perhaps there is something Wayne or I did not understand when we wrote > > that code. I wasnt programming back in the BBS days so modems are not > my > > thing. I have a few questions. > > > > Is the above matrix confirmed by observation? > > Linux just always worked? > > Which one _should_ work? I'm guessing modems work with hardware flow > > control. I'll have to dig around. > > > > The windows flow control changes a couple things with hardware flow > > control. Following the w32 API documentation is confusing sometimes. > > But it looks like Linux could have a bug too. > > Cheers > > Brian Schlining > Software Engineer > http://www.mbari.org > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/9c989144/attachment-0041.html From tjarvi at qbang.org Tue Feb 7 14:06:14 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 14:06:14 -0700 (MST) Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> Message-ID: >> >> You're not the only one whose had this problem, I don't know if Trent has >> addressed this is the latest release of RXTX but there is a workaround. >> Here's the recent thread from the RXTX mailing list regarding this issues: >> I have not. I expect to have access to some test equipment next month and I'll go through all of this. I really don't know whats going on and I need a gold standard. I thought maybe linux was autodetecting the flow control. Your observations would certainly be welcome. I need to talk to Russell King and see what he is doing. Until then I'd just be toying around over a loopback as usual. This is very high on the list though. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 17:25:05 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 17:25:05 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139358305.17994.2.camel@zd7280> My application now works. I installed the libraries and jar from 2.1-7 (Final). portlist.hasMoreElements is no longer false. The application finds the port for /dev/ttyUSB0. Thanks for your help, Trent (et al) Sorry I bothered you with this. Next time I will look in the source first. I didn't think it was an rxtx issue, I thought it was a Linux setup issue . On Tue, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > Hmm I'm looking at pre17 so this may have changed. (its just what I > have > on this machine) > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux > Serial Ports > "ttySA" // for the > IPAQs > }; > > CandidatePortPrefixes=Temp; > } > > > So you may need to add "ttyUSB" to that list. RXTX used to enumerate > _everything_ see if(osName.equals("Linux-all-ports") But it became > less > than practical. > > This is all in RXTXCommDriver.java > > hmm I just did a cvs update. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux > Serial Ports > "ttySA", // for the > IPAQs > "ttyUSB" // for USB > frobs > }; > > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you > have > to get your fingers into the code. We aim for sane defaults. -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 19:21:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 19:21:54 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139358305.17994.2.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> <1139358305.17994.2.camel@zd7280> Message-ID: >Sorry I bothered you with this. Next time I will look in the source >first. I didn't think it was an rxtx issue, I thought it was a Linux >setup issue . Why would you be sorry? I would have done the same. I'm glad it's working :) -- Trent Jarvi tjarvi at qbang.org From tma at mail.island.net Wed Feb 8 13:39:35 2006 From: tma at mail.island.net (Tom Alldread) Date: Wed, 08 Feb 2006 12:39:35 -0800 Subject: [Rxtx] Win32/Linux Serial Port Data Dropouts In-Reply-To: <200602060702.k167255O007882@www.qbang.org> References: <200602060702.k167255O007882@www.qbang.org> Message-ID: <43EA5707.4020200@mail.island.net> Greetings Folks at RXTX: During the last couple of months I have been alternately testing with javax.comm 2 and RXTX 2.1 under Windows XP and CommApi 3 and RXTX 2.1 under Suse 10.0 Linux. In the process I have learned a little about java multi-threading under NetBeans 5 with Profiler. My java (jdk 1.5_06) application is used for data acquisition and provides a graphical display of A-D conversion data received from a 56KBaud serial port. The actual data throughput is about 10KBaud thus it is well below the speed of the port. I use hardware RTS/CTS flow control which can stall the data acquisition sample rate if necessary. This ensures the display computer has the ability to slow the data acquisition rate should it become too busy to accept the regular data flow. Both the serial port buffer and the java read buffer are set at 16KB. Usually the data transfers into the java read buffer are less than 100 bytes unless the data acquisition is recovering from a stall. The data flow normally hesitates after each 5 KB block as a continue command is needed from the display computer to start the drawing of a new graphics display line. Separate threads have been provided for the serial port event monitoring and data processing. The serial port event thread has been given the maximum priority and data processing thread the minimum priority provided by java. Thread yield statements have been placed within all data processing while/for loops as an effort to ensure quick access to CPU cycles for the serial port event thread. I have found that short data transmissions are essentially error free but occasional dropouts occur with continuous data flow especially under Windows XP. ....................................................................................................................................................................................... Linux results: I am happy to report that RXTX 2.1 appears to work very well under Linux although I did notice some errors when the screen savers were running with my dual monitors. I believe this is a local problem associated with my dual graphics which needs further attention. The recent CommApi 3 Linux release from Sun did not work at all with my program. It seemed to send commands out OK but did not receive any data. Although the serial port event triggered the ISR, the input stream appeared filled with nulls and thus did not contain any data. As my understanding is that CommApi 3 was tested with a Red Hat distribution of Linux I wonder if this problem is distro dependent? Although somewhat off topic here I wonder if anyone reading this has had similar experience? .................................................................................................................................................................................. Windows XP results: There are problems with occasional data dropouts which become more frequent as the sampling rate is increased or if the computer becomes busy with other duties. The dropouts typically consist of a half dozen byte block of lost data. It appears the lost bytes never get added to the java input stream. There has not been any indication of garbled data, overruns or framing errors which suggests the UART communications remains solid. Using javax.comm 2 I found that the setting of SerialPort 'enableReceiveThreshold' to 40 and 'enableReceiveTimeout' of 100mS reduced the dropouts error rate significantly. I found that I could not get RXTX 2.1 to function with the aforementioned threshold and timeout settings. The javax.comm 2 interface is consequently performing better for me under Windows than RXTX 2.1. I wonder if anyone here has any suggestions as to what I might try to improve RXTX 2.1? Although my settings are the same as under Suse 10.0, RXTX 2.1 performs much better for me under Linux than any of the alternatives that I have tried under Windows XP . ............................................................................................................................................................................... I would like to establish, based on the experience of others, if I have reached the normally expected performance limit of java serial port communications? Should I expect to achieve virtually error free serial port data input from a continuous stream under Windows XP java software? I am considering changing my protocol to packets with error checking if necessary but would like to know if the dropout problems I am experiencing are typical or not before I take this rather work intensive plunge. Many thanks in advance for any help! Best Regards, Tom Alldread -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.375 / Virus Database: 267.15.2/253 - Release Date: 2006-02-07 From jlaxson at mac.com Wed Feb 8 23:56:48 2006 From: jlaxson at mac.com (John Laxson) Date: Thu, 9 Feb 2006 00:56:48 -0600 Subject: [Rxtx] PortInUseException: Unknown Application on OSX Message-ID: Hi, I've been trying to get RXTX 2.1.7 going on Mac OS X for a while here, and am running up into a wall here. I've tried with pre- compiled and the source version and get the same problem, a gnu.io.PortInUseException: Unknown Application. I have run the fixperms script included with the source distribution, and id shows me as a member of the uucp group, and permissions on /var/spool/uucp are 775 root:uucp. Running a test program (included at the bottom for clarity) lets me enumerate all the serial ports correctly, but trying to open any of them gives the PortInUseException. If it helps, when I try to open a port that's set to make an outgoing bluetooth connection, there is no delay and no connection attempt at all. Thanks, John Laxson PS: The documentation wiki on qbang.org shows 404, and has for a few days now. My test code: public static void main(String[] args) { SerialPort serialPort; try { Enumeration e = CommPortIdentifier.getPortIdentifiers(); CommPortIdentifier ident; while (e.hasMoreElements()) { ident = (CommPortIdentifier)e.nextElement(); System.out.println(ident.getName()); } ident = CommPortIdentifier.getPortIdentifier("/dev/cu.modem"); serialPort = (SerialPort) ident.open("Me", 5000); } catch (Exception e) { e.printStackTrace(); } } From rajesh.invincible at gmail.com Thu Feb 9 03:39:38 2006 From: rajesh.invincible at gmail.com (Rajesh N) Date: Thu, 9 Feb 2006 16:09:38 +0530 Subject: [Rxtx] Re: Move .java Files in gnu.io filesystem hierarchy - Maven (2) In-Reply-To: <43DF21D2.7090200@ngi.it> References: <43DF21D2.7090200@ngi.it> Message-ID: <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Can anybody tell me how to overcome these EXCEPTIONS I AM WORKING ON SERIAL COMMN IN JAVA ON LINUX. 1. " NOT ALL PARAMETERS SUPPORTED BY THE KERNEL" This i came across the following statement inmy prog. SerialP is A SerialPort object SerialP.setSerialPortParams(9600(BAUDRATE),DATABITS_8,STOPBITS_1,PARITY_NONE) 2. NullPointer Exception at Event Dispatch Now i have checked all my object references for a null reference but i found none i have put up my entire code in try catch blocks but still I AM UNABLE TO CATCH THIS EXCEPTION AND HENCE MY APPLICATION CLOSES HOW DOES THESE GO? PLEASE HELP ME IT IS URGENTTTTTTTTTTTTTTTT yours sincerely RAJESH On 1/31/06, Fabio Frumento wrote: > Hi Xavier, > > I don't know maven at all but the directory hierarchy listed buy Trent > is fine for me... > > I'll take a look to maven, it seems an interesting project > > Regards > > Fabio Frumento > > Trent Jarvi wrote: > > On Tue, 31 Jan 2006, Xavier Frisaye wrote: > > > >> Hi all, > >> > >> If you are going to rearrange the src folder, i will propose to use > >> maven 2 and follow its directory structure > >> > (http://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html). > >> > >> Maven 2 simplify java project and give a standard way to make projects > >> (http://maven.apache.org/). > >> We are using it for internal projects and we are very satisfied. > >> > >> Is anybody interested? > >> > >> I'm not an expert in maven 2 (yet) but i'm agree to help using it if > >> you choose to make so. > >> > > > > so this would be: > > > > rxtx-devel/src/main/java/gnu.io > > rxtx-devel/src/test/java/ManIwish.java > > > > I don't use IDEs very much so I'll let others comment. But I don't see > > a problem with that. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Thu Feb 9 09:50:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 9 Feb 2006 09:50:31 -0700 (MST) Subject: [Rxtx] Re: Move .java Files in gnu.io filesystem hierarchy - Maven (2) In-Reply-To: <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Message-ID: On Thu, 9 Feb 2006, Rajesh N wrote: > Can anybody tell me how to overcome these EXCEPTIONS > I AM WORKING ON SERIAL COMMN IN JAVA ON LINUX. > > 1. " NOT ALL PARAMETERS SUPPORTED BY THE KERNEL" > > This i came across the following statement inmy prog. > SerialP is A SerialPort object > SerialP.setSerialPortParams(9600(BAUDRATE),DATABITS_8,STOPBITS_1,PARITY_NONE) > Strange. The parameters you use are the same the port should open with by default. Could you paste the actual exception you are getting? I don't see that in the rxtx source. Also it would help to know the rxtx version. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Fri Feb 10 15:29:05 2006 From: lux at diesel-research.com (Kim Lux) Date: Fri, 10 Feb 2006 15:29:05 -0700 Subject: [Rxtx] One serial port object for both sending and receiving ? Message-ID: <1139610545.18177.4.camel@zd7280> Is it OK to use one SerialPort ojbect (ex Serial Port serialPort;) and use it for both sending and receiving ? For example: ======================================================================== static SerialPort serialPort = null; static OutputStream serialOut = null; static InputStream serialIn = null; // assign it to an outputStream for use try{ serialOut = serialPort.getOutputStream(); System.out.println("Serial output stream has been assigned."); }//try catch(IOException e) { System.out.println("Error: Couldn't assign output stream to serial port."); }//catch //assign it to an inputStream for use try{ serialIn = serialPort.getInputStream(); System.out.println("Serial input stream has been assigned."); }//try catch(IOException e) { System.out.println("Error: Couldn't assign input stream to serial port."); }//catch ======================================================================== -- Kim Lux, Diesel Research Inc. From lux at diesel-research.com Fri Feb 10 21:23:00 2006 From: lux at diesel-research.com (Kim Lux) Date: Fri, 10 Feb 2006 21:23:00 -0700 Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Message-ID: <1139631780.23882.10.camel@zd7280> I've got a problem receiving chars with my version of serialRead, written in an SWT GUI. I had a Java pro have a good look at my code and he can't see anything wrong with it. I can send chars fine. When I receive a char the cpu usage for the app goes to 100% and the code in the serial event handler doesn't get executed. The instructions on the Java Comm Serial API How-To for Linux page state that I must install javacomm. Is that true ? Everything builds without it and I can send chars on rxtx just fine, but I can't receive them. Could this be the problem ? I downloaded and installed javacomm. I was not able to add "Driver=gnuio.RXTXCommDriver to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 installed in /usr/java/jre1.5.0_05. I added comm.jar to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext to the library paths. Is this OK ? Does it matter that I am receiving on /dev/ttyUSB0 ? Thanks. -- Kim Lux, Diesel Research Inc. From lunareclipse03 at web.de Sat Feb 11 09:44:46 2006 From: lunareclipse03 at web.de (lunareclipse03@web.de) Date: Sat, 11 Feb 2006 17:44:46 +0100 Subject: [Rxtx] Question about Serial I/O under Win32 Message-ID: <662084330@web.de> Hello everybody, I have a strange problem with a piece of code I made for myself. No, this is not really concerning rxtx, but nevertheless I post this to the list, hoping that some of you can help me. I've written two libraries, one for linux and one for win32. The linux port works quite well, I can send / receive faxes and / or replay voice messages over the telephone line using a voice modem. But the win32 port of the library causes some trouble. If, for example, I send out a fax with a certain modem under linux, it works well. The fax is complete when it comes out of the fax machine. If I then use the same modem to send out a fax under win32, the fax coming out of the fax machine gets "stuck" halfways, but the sending modem thinks that transmission was ok and drops the connection. The answering fax machine then gives me "error while receiving." The "upper layer" java code MUST be right, because if I do the same thing under linux (using the linux library), everything is alright. Now I have to ask: Can somebody please help me out with this??!? Could it be the case that some kind of flow control or COMMTIMEOUTS setting causes this behaviour? I set flow control to RTS/CTS before sending out a fax. How can I DISABLE flow control? Or what do you think? Can something else cause this problems? Thank you all for your time and PLEASE write back soon. Regards, --Sven Ahlemann Am Waldrand 31 45721 Haltern am See Germany ______________________________________________________________ Verschicken Sie romantische, coole und witzige Bilder per SMS! Jetzt bei WEB.DE FreeMail: http://f.web.de/?mc=021193 From lux at diesel-research.com Sat Feb 11 10:06:52 2006 From: lux at diesel-research.com (Kim Lux) Date: Sat, 11 Feb 2006 10:06:52 -0700 Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: <1139631780.23882.10.camel@zd7280> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> <1139631780.23882.10.camel@zd7280> Message-ID: <1139677612.3431.5.camel@zd7280> More on this problem. I copied and pasted simpleRead into a console based Eclipse project and I've got the same result, except that cpu usage doesn't go to 100%. I'm beginning to think there is an issue in rxtx. My imports for simpleRead are: ============================ import gnu.io.*; import java.util.*; //import javax.comm.*; import java.io.*; =========================== Any ideas ? I am trying to read from /dev/ttyUSB0 using a serial to USB adapter which has worked well with minicom and gtkterm. Thanks. On Fri, 2006-02-10 at 21:23 -0700, Kim Lux wrote: > I've got a problem receiving chars with my version of serialRead, > written in an SWT GUI. > > I had a Java pro have a good look at my code and he can't see anything > wrong with it. > > I can send chars fine. When I receive a char the cpu usage for the app > goes to 100% and the code in the serial event handler doesn't get > executed. > > The instructions on the Java Comm Serial API How-To for Linux page state > that I must install javacomm. Is that true ? Everything builds without > it and I can send chars on rxtx just fine, but I can't receive them. > Could this be the problem ? > > I downloaded and installed javacomm. I was not able to add > "Driver=gnuio.RXTXCommDriver > to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not > have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 > installed in /usr/java/jre1.5.0_05. I added comm.jar > to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext > to the library paths. Is this OK ? > > Does it matter that I am receiving on /dev/ttyUSB0 ? > > Thanks. > -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Sun Feb 12 21:01:33 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:01:33 -0700 (MST) Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: <1139677612.3431.5.camel@zd7280> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> <1139631780.23882.10.camel@zd7280> <1139677612.3431.5.camel@zd7280> Message-ID: I suspect what is happening is the select() is breaking out in the native code but the driver does not have support for notifying there are X bytes available. On some traditional Unix based systems, the only way you know data is available is the fd status changes and do an FIORDCHK ioctl. Or perhaps the only thing you can know is the fd status changed. It would take reading through the kernel driver code to know for sure. So on USB, depending upon the driver, the same may need to be done or the driver improved a bit if possible to support. Polling reads will also work but don't use the event driven model of CommAPI which isnt acceptable in the long run. The 100% cpu usage can then be explained because select no longer blocks until the data is read; the eventLoop spins loose. You can put a well placed sleep but rxtx only expects those are needed when it knows data is available. This may not be a super simple thing to understand and fix. I do have ideas to get you started. I'm going to be short on time the next couple weeks. I expect to put some good time in and answer some other questions I saw around the 25th. For now, I'd look at the following and go from there with the hints I've given. JNIEXPORT jint JNICALL RXTXPort(nativeavailable)( JNIEnv *env, jobject jobj ) { int fd = get_java_var( env, jobj,"fd","I" ); int result; /* char message[80]; ENTER( "RXTXPort:nativeavailable" ); On SCO OpenServer FIONREAD always fails for serial devices, so try ioctl FIORDCHK instead; will only tell us whether bytes are available, not how many, but better than nothing. This turns out to be true on Solaris also. taj. */ #ifdef FIORDCHK /* __unixware__ __sun__ probably others */ result = ioctl(fd, FIORDCHK, 0); #else if( ioctl( fd, FIONREAD, &result ) < 0 ) { goto fail; } #endif /* FIORDCHK */ On Sat, 11 Feb 2006, Kim Lux wrote: > > More on this problem. I copied and pasted simpleRead into a console > based Eclipse project and I've got the same result, except that cpu > usage doesn't go to 100%. I'm beginning to think there is an issue in > rxtx. > > My imports for simpleRead are: > > ============================ > import gnu.io.*; > import java.util.*; > //import javax.comm.*; > import java.io.*; > =========================== > > Any ideas ? I am trying to read from /dev/ttyUSB0 using a serial to > USB adapter which has worked well with minicom and gtkterm. > > Thanks. > > > > On Fri, 2006-02-10 at 21:23 -0700, Kim Lux wrote: >> I've got a problem receiving chars with my version of serialRead, >> written in an SWT GUI. >> >> I had a Java pro have a good look at my code and he can't see anything >> wrong with it. >> >> I can send chars fine. When I receive a char the cpu usage for the app >> goes to 100% and the code in the serial event handler doesn't get >> executed. >> >> The instructions on the Java Comm Serial API How-To for Linux page state >> that I must install javacomm. Is that true ? Everything builds without >> it and I can send chars on rxtx just fine, but I can't receive them. >> Could this be the problem ? >> >> I downloaded and installed javacomm. I was not able to add >> "Driver=gnuio.RXTXCommDriver >> to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not >> have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 >> installed in /usr/java/jre1.5.0_05. I added comm.jar >> to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext >> to the library paths. Is this OK ? >> >> Does it matter that I am receiving on /dev/ttyUSB0 ? >> >> Thanks. >> > From tjarvi at qbang.org Sun Feb 12 21:03:30 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:03:30 -0700 (MST) Subject: [Rxtx] One serial port object for both sending and receiving ? In-Reply-To: <1139610545.18177.4.camel@zd7280> References: <1139610545.18177.4.camel@zd7280> Message-ID: On Fri, 10 Feb 2006, Kim Lux wrote: > > Is it OK to use one SerialPort ojbect (ex Serial Port serialPort;) and > use it for both sending and receiving ? > > For example: > > ======================================================================== > static SerialPort serialPort = null; > static OutputStream serialOut = null; > static InputStream serialIn = null; > > > > > // assign it to an outputStream for use > try{ > serialOut = serialPort.getOutputStream(); > System.out.println("Serial output stream has been assigned."); > }//try > catch(IOException e) > { > System.out.println("Error: Couldn't assign output stream to serial > port."); > }//catch > > > //assign it to an inputStream for use > try{ > serialIn = serialPort.getInputStream(); > System.out.println("Serial input stream has been assigned."); > }//try > catch(IOException e) > { > System.out.println("Error: Couldn't assign input stream to serial > port."); > }//catch This should be fine. In fact trying to do it another way will probably not work as you will run into lockfile issues. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun Feb 12 21:13:13 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:13:13 -0700 (MST) Subject: [Rxtx] Question about Serial I/O under Win32 In-Reply-To: <662084330@web.de> References: <662084330@web.de> Message-ID: On Sat, 11 Feb 2006 lunareclipse03 at web.de wrote: > Hello everybody, > > I have a strange problem with a piece of code I made for myself. No, > this is not really concerning rxtx, but nevertheless I post this to the > list, hoping that some of you can help me. I've written two libraries, > one for linux and one for win32. The linux port works quite well, I can > send / receive faxes and / or replay voice messages over the telephone > line using a voice modem. But the win32 port of the library causes some > trouble. If, for example, I send out a fax with a certain modem under > linux, it works well. The fax is complete when it comes out of the fax > machine. If I then use the same modem to send out a fax under win32, the > fax coming out of the fax machine gets "stuck" halfways, but the sending > modem thinks that transmission was ok and drops the connection. The > answering fax machine then gives me "error while receiving." The "upper > layer" java code MUST be right, because if I do the same thing under > linux (using the linux library), everything is alright. Now I have to > ask: Can somebody please help me out with this??!? Could it be the case > that some kind of flow control or COMMTIMEOUTS setting causes this > behaviour? I set flow control to RTS/CTS before sending out a fax. How > can I DISABLE flow control? Or what do you think? Can something else > cause this problems? Thank you all for your time and PLEASE write back > soon. > Hi Sven I'm not too willing to talk about flow control at the low level until I confirm some things with test equipment later. It is not clear if you are using rxtx or writing your own native code. So I'm not sure how to answer much of this :) If you are wondering how to change the flow control using rxtx from java, The BlackBox example from Sun flips this back and forth. SerialPort.java in rxtx 2.1 uses the following: SerialPort.java: public static final int FLOWCONTROL_NONE =0; SerialPort.java: public static final int FLOWCONTROL_RTSCTS_IN =1; SerialPort.java: public static final int FLOWCONTROL_RTSCTS_OUT =2; SerialPort.java: public static final int FLOWCONTROL_XONXOFF_IN =4; SerialPort.java: public static final int FLOWCONTROL_XONXOFF_OUT=8; So if you set flowcontrol to RTSCTS, you can set it to NONE to turn it off. If you are looking for how to do it in native code, the rxtx Source is SerialImp.c (unix/linux/mac os x/w32) and termios.c (w32 only with SerialImp.c) You can track the code: SerialImp.c:JNIEXPORT void JNICALL RXTXPort(setflowcontrol)( JNIEnv *env, jobject jobj, jint flowmode ) termios.c:int tcgetattr( int fd, struct termios *s_termios ) termios.c:int tcsetattr( int fd, int when, struct termios *s_termios ) There may be a problem in the rxtx flow control code though. Rather than guess, I want to test this with a gold standard. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Feb 6 00:00:16 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 00:00:16 -0700 (MST) Subject: [Rxtx] wiki delay until tomorrow night. In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: On Sun, 5 Feb 2006, Trent Jarvi wrote: > On Sun, 5 Feb 2006, Kim Lux wrote: > >> usb ? Tell me more... I need that too. > > usb is a very proper design. Thats all it is. > Maybe rxtx could help usb. But it would start with helping bring back the community that was already there. It's not something I'd love to do but maybe its the right thing to do. It would probably take 2 years to do right. But maybe thats better than what we have now. I honestly don't know what IBM is doing which could just run over everything. Just some thoughts after some fine german wine. -- Trent Jarvi tjarvi at qbang.org From gadelavega at yahoo.com.ar Mon Feb 6 02:17:05 2006 From: gadelavega at yahoo.com.ar (Gonzalo A. de la Vega) Date: Mon, 06 Feb 2006 10:17:05 +0100 Subject: [Rxtx] Serial port ownership question In-Reply-To: References: <20060205113618.30274.qmail@web53501.mail.yahoo.com> <1139157422.4553.9.camel@zd7280> <1139158698.4936.9.camel@zd7280> Message-ID: <43E71411.4050402@yahoo.com.ar> On my Fedora Core 4: ls -l /dev/ttyS* crw-rw---- 1 root uucp 4, 64 Feb 6 2006 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Feb 6 2006 /dev/ttyS1 ... and: grep "ttyUSB" /etc/udev/rules.d/50-udev.rules KERNEL=="ttyUSB*", GROUP="uucp", MODE="0660" So anyone in the "uucp" group can use serial ports. On Gentoo the group is "tty". Trent Jarvi escribi?: > > > On Sun, 5 Feb 2006, Dr. Douglas Lyon wrote: > >> I can confirm that this is the case (only root ownership of >> serial ports, under fedora 4). >> Wow, what were they thinking?! >> - DL >> >>> I've found that the newer kernels have the serial ports owned by root. >>> For example, >>> >>> $ls -al /dev/tty* >>> crw-rw-rw- 1 root root 5, 0 Feb 5 02:06 /dev/tty >>> crw-rw---- 1 root root 4, 0 Feb 5 02:06 /dev/tty0 >>> crw------- 1 root root 4, 1 Feb 5 09:07 /dev/tty1 >>> crw-rw---- 1 root tty 4, 10 Feb 5 02:06 /dev/tty10 >>> crw-rw---- 1 root tty 4, 11 Feb 5 02:06 /dev/tty11 >>> ... > > > This is just not a problem jcp or such are going to solve. Its a > platform spitwad fight. But do look at pam. In fact thats what Sun > is doing too. Maybe Linux followed their lead.. I'm not a pam guy. > I've spent 16 hours trying to understand it but your users wont :) > > Solution? I have no clue. Its two tangent mentalities from my > perspective. > > -- > Trent Jarvi > tjarvi at qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mtnvega at yahoo.com.br Mon Feb 6 05:35:43 2006 From: mtnvega at yahoo.com.br (Luiz Jr) Date: Mon, 6 Feb 2006 12:35:43 +0000 (GMT) Subject: [Rxtx] Documentation Wiki In-Reply-To: <1139157422.4553.9.camel@zd7280> Message-ID: <20060206123543.57256.qmail@web53515.mail.yahoo.com> Hello, Thank you for you answer, but so the usage of the API is pretty much like the Java Communications Api? If yes, what version of the Java Comm Api? Thank you, Luiz A. Brandao Jr Kim Lux escreveu: On Sun, 2006-02-05 at 08:36 -0300, Luiz Jr wrote: > Hello, > > I want to start using the RXTX libraries, but I would to know how, > since I can not access the documentation wiki page I just started using them yesterday. Below is how I installed the libraries, if that helps. I used snippets of code from the SimpleWrite application here to get me going. http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html Instead of "import javax.comm.*;", use "import gnu.io.*;" which is gotten from RXTXcomm.jar, which you will need to include in your project references. I am working in Eclipse. BTW: there is no way to open a port without going through the port list and finding it. Maybe sometime in the future someone (me ?) will write a method called openSerialPort that allows the user to give a port identifier, such as "/dev/tty1" and return a port ready to use. It wouldn't take much to write that and it would save users a lot of code. Hope this helps. ======================================================================= 1) Figure out which java you are running, incase there is more than one installed. $ java -version java version "1.5.0_05" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_05-b05) Java HotSpot(TM) Client VM (build 1.5.0_05-b05, mixed mode, sharing) 2) Find all the jre directories and the one from which you are currently running. kfind (jre) 3) cd to that directory plus /lib/i386 cd /usr/java/jre1.5.0_05/lib/i386 4) Copy the library files (*.so) to that directory. cp /home/krlux/Desktop/'Java Controls'/rxtx-linux/bin/* . 5) Check that the copy was successful ls librxtx* librxtxI2C.so librxtxRaw.so librxtxSerial.so librxtxParallel.so librxtxRS485.so 6) cd to the /lib/ext directory for your java. cd /usr/java/jre1.5.0_05/lib/ext 7) Copy the Jar files there cp /home/krlux/Desktop/'Java Controls'/rxtx-linux/lib/ext/* . 8) Check that it was successful ls RXTX* RXTXcomm.jar Rxtx is now installed on your machine ready to use. =================================================================== -- Kim Lux, Diesel Research Inc. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx --------------------------------- Yahoo! Acesso Gr?tis - Internet r?pida e gr?tis. Instale o discador agora! -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/544aa403/attachment-0042.html From lyon at docjava.com Mon Feb 6 05:49:34 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 06 Feb 2006 07:49:34 -0500 Subject: [Rxtx] wiki delay until tomorrow night. In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: Hi All, I have often thought about USB drivers being needed. For example, the ironman watch will not interface to a mac (windows only). It is USB. My dymo label writer has no Java driver (native only). Etc. Most cheap web cameras are USB (and Java drivers go through JAI, if it supports the camera at all). The JAI code shows how sun did the USB drivers. You have to be a member of the jai project to download the source code. https://jai.dev.java.net has the jai distro. And then you are not allowed to redistribute it. However, we can all learn from it (if so inclined). Basically: cvs -d :pserver:lyon at cvs.dev.java.net:/cvs login cvs -d :pserver:lyon at cvs.dev.java.net:/cvs checkout jai-core You will need to user your own uid and pw to get in. The ant build has over 100 warnings from sun deprecations of its own code. You might say that they were hoisted on their own Picard ;) One interesting thing is that they support several platforms: linux-amd64 64-bit Linux-AMD64 linux-i586 32-bit Linux-x86 solaris-amd64 64-bit Solaris-AMD64 solaris-i586 32-bit Solaris-x86 solaris-sparc 32-bit Solaris-SPARC solaris-sparcv9 64-bit Solaris-SPARC windows-i586 32-bit Windows-x86 Thus, ant is used to provide a multi-platform native method distro. Neat. How do they do it? check this out: And: The core download does not contain any C source code (it was all pre-built). Basically, they are just copying .so and .dll files into build directories. I would love to see the C code for this...but Sun does not post it on the https://jai.dev.java.net site. I don't know why...Perhaps I missed it. - Doug >On Sun, 5 Feb 2006, Trent Jarvi wrote: > >>On Sun, 5 Feb 2006, Kim Lux wrote: >> >>>usb ? Tell me more... I need that too. >> >>usb is a very proper design. Thats all it is. >> > >Maybe rxtx could help usb. But it would start with helping bring >back the community that was already there. > >It's not something I'd love to do but maybe its the right thing to do. > >It would probably take 2 years to do right. But maybe thats better >than what we have now. > >I honestly don't know what IBM is doing which could just run over everything. > >Just some thoughts after some fine german wine. > >-- >Trent Jarvi >tjarvi at qbang.org > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tdelenik at gmail.com Mon Feb 6 05:56:32 2006 From: tdelenik at gmail.com (Thanasis Delenikas) Date: Mon, 6 Feb 2006 14:56:32 +0200 Subject: Fwd: [Rxtx] Documentation Wiki In-Reply-To: <1139157422.4553.9.camel@zd7280> References: <20060205113618.30274.qmail@web53501.mail.yahoo.com> <1139157422.4553.9.camel@zd7280> Message-ID: <310a1a930602060456t129f1dc6p5f2b908f13ab5a0b@mail.gmail.com> Hello all, Kim, this is a snippet from the code I use. The closest to directly opening a specific port without enumeration. << ... portId = CommPortIdentifier.getPortIdentifier(getPort()); serialPort = (SerialPort) portId.open("jSMSEngine", 1971); ... >> where getPort() return the string identifier of the port, i.e. "/dev/ttyS0" or "COM1" or whatever. Thanasis. ---------- Forwarded message ---------- From: Kim Lux Date: Feb 5, 2006 6:37 PM Subject: Re: [Rxtx] Documentation Wiki To: RXTX Developers and Users BTW: there is no way to open a port without going through the port list and finding it. Maybe sometime in the future someone (me ?) will write a method called openSerialPort that allows the user to give a port identifier, such as "/dev/tty1" and return a port ready to use. It wouldn't take much to write that and it would save users a lot of code. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/182ab5b8/attachment-0042.html From tjarvi at qbang.org Mon Feb 6 11:53:57 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 11:53:57 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: On Mon, 6 Feb 2006, Dr. Douglas Lyon wrote: > Hi All, > I have often thought about USB drivers being needed. > For example, the ironman watch will not interface > to a mac (windows only). It is USB. > My dymo label writer has no Java driver (native only). > Etc. > Most cheap web cameras are USB (and Java drivers go > through JAI, if it supports the camera at all). > The JAI code shows how sun did the USB drivers. > You have to be a member of the jai project to download > the source code. > https://jai.dev.java.net has the jai distro. > And then you are not allowed to redistribute it. However, > we can all learn from it (if so inclined). Basically: > cvs -d :pserver:lyon at cvs.dev.java.net:/cvs login > cvs -d :pserver:lyon at cvs.dev.java.net:/cvs checkout jai-core > You will need to user your own uid and pw to get in. > The ant build has over 100 warnings from sun deprecations > of its own code. > > You might say that they were hoisted on their own Picard ;) > > One interesting thing is that they support several platforms: > linux-amd64 64-bit Linux-AMD64 > linux-i586 32-bit Linux-x86 > solaris-amd64 64-bit Solaris-AMD64 > solaris-i586 32-bit Solaris-x86 > solaris-sparc 32-bit Solaris-SPARC > solaris-sparcv9 64-bit Solaris-SPARC > windows-i586 32-bit Windows-x86 > Thus, ant is used to provide a multi-platform native method distro. > Neat. > How do they do it? > check this out: > > > > > > > > > > > > > And: > > > > > > > > > > The core download does not contain any C source code (it was all pre-built). > Basically, they are just copying .so and .dll files into build directories. > > I would love to see the C code for this...but Sun does not post it on the > https://jai.dev.java.net site. > > I don't know why...Perhaps I missed it. > > - Doug > > I've looked at moving rxtx to Ant builds. I think that would help IDEs a great deal. I requested a evalutation desk copy the O'Reilly Ant book for some j2ee material I was teaching. http://www.oreilly.com/catalog/anttdg/ It has a one sentence mention of JNI. So there was not luck there. I saw that there is another Ant book that does mention JNI more. I can't find it now. Ant must be able to support it with extensions. http://ant.apache.org/manual/OptionalTasks/javah.html What the auto(break :) tools do in the rxtx build is 4 things really. 1) gcc compile flags 2) ld compile flags 3) config.h 4) compile flags for customizing rxtx (lockfiles, ...) See 1 All of this information except 4 can be static once obtained. So I'm not attached to the auto tools. If I could find an example of Ant being used for JNI code, I'd be one of the first to start moving that direction. Maybe someone saw an example someplace. The other thing we have not completed discussing is the directory structure. There is interest in making rxtx more IDE friendly. I get more mail about that off the list than how to install rxtx. And I see we have Ken Thompson in da house :) He is our trusted CVS maintainer and the guy that purchased the rxtx.org domain. Old community. We will need Ken for changing the directory structure of source. I would like to open up discussion about both of these as it is more than time. The problem is I have little experience with Ant and even less with IDEs. It would be nice if we could work with Eclipse and NetBeans. http://www.netbeans.org/ (sun and some community) http://www.eclipes.org (ibm,rhat,... perhaps more community) http://maven.apache.org/what-is-maven.html (apache. It is community) borland should sortof be here too but I think thats covered in eclipse. >From what I understand so far, we should morph rxtx to support those three maybe trusting apaches lead with maven. But I use vi. I have little to no clues beyond what people have fed me. Can we agree that thats the right direction to go? -- Trent Jarvi tjarvi at qbang.org From brian at mbari.org Mon Feb 6 14:57:50 2006 From: brian at mbari.org (Brian Schlining) Date: Mon, 6 Feb 2006 13:57:50 -0800 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> > The other thing we have not completed discussing is the directory > structure. There is interest in making rxtx more IDE friendly. I > get more mail about that off the list than how to install rxtx. > > And I see we have Ken Thompson in da house :) He is our trusted > CVS maintainer and the guy that purchased the rxtx.org domain. Old > community. We will need Ken for changing the directory structure of > source. > > I would like to open up discussion about both of these as it is > more than time. The problem is I have little experience with Ant > and even less with IDEs. It would be nice if we could work with > Eclipse and NetBeans. > > http://www.netbeans.org/ (sun and some community) > http://www.eclipes.org (ibm,rhat,... perhaps more community) > http://maven.apache.org/what-is-maven.html (apache. It is community) > borland should sortof be here too but I think thats covered in > eclipse. > >> From what I understand so far, we should morph rxtx to support >> those three > maybe trusting apaches lead with maven. But I use vi. I have > little to no clues beyond what people have fed me. > Maven likes the directory structure below for Java code. (From http:// maven.apache.org/guides/getting-started/index.html) This structure works fine with ant, netbeans, and eclipse. rxtx_root_directory `-- src |-- main | `-- java | `-- gnu | `-- io `-- test `-- java `-- gnu `-- io Brian Schlining Software Engineer http://www.mbari.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/d9451eba/attachment-0042.html From tjarvi at qbang.org Mon Feb 6 15:11:45 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 15:11:45 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: > rxtx_root_directory > `-- src > |-- main > | `-- java > | `-- gnu > | `-- io > `-- test > `-- java > `-- gnu > `-- io > >From what I understand this will just be good. For me it makes no difference. So lets do the rxtx thing. Let if fester for two weeks and if nobody objects, we will do it. I'm not doing this because I care. I'm doing this to eliminate much of my inbox. But test... man is rxtx lacking there in the community aspect. It is covered but not right. _maybe_ I can change that this year. -- Trent Jarvi tjarvi at qbang.org (cat hurding since 1997) From lux at diesel-research.com Mon Feb 6 21:38:49 2006 From: lux at diesel-research.com (Kim Lux) Date: Mon, 06 Feb 2006 21:38:49 -0700 Subject: [Rxtx] How can I use Lock Files with rxtx (in FC4) ? Message-ID: <1139287129.17031.3.camel@zd7280> I am now running an rxtx application on FC4. I am getting: ========================================================= check_group_uucp(): error testing lock file creation Error details: Permission denied check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL ========================================================= $ ls -al /var/lock total 32 drwxrwxr-x 4 root lock 4096 Feb 6 16:04 . drwxr-xr-x 24 root root 4096 Nov 14 01:19 .. drwx------ 2 root root 4096 Apr 27 2005 lvm drwxr-xr-x 2 root root 4096 Feb 6 16:04 subsys How do I fix this for regulator users ? -- Kim Lux, Diesel Research Inc. From dmarkman at mac.com Mon Feb 6 22:24:44 2006 From: dmarkman at mac.com (Dmitry Markman) Date: Tue, 7 Feb 2006 00:24:44 -0500 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: if I understands the issue right in order to be able to use ant for c/c++ compilation you have to install ant's cc task http://ant-contrib.sourceforge.net/cc.html it looks like it should work on mac os x (authors claim, that it's platform independent) but I never tested so all you have to do it's providing right command line for the gcc compiler On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: >> rxtx_root_directory >> `-- src >> |-- main >> | `-- java >> | `-- gnu >> | `-- io >> `-- test >> `-- java >> `-- gnu >> `-- io >> > > >> From what I understand this will just be good. > > For me it makes no difference. So lets do the rxtx thing. Let if > fester for two weeks and if nobody objects, we will do it. > > I'm not doing this because I care. I'm doing this to eliminate > much of my inbox. > > But test... man is rxtx lacking there in the community aspect. It > is covered but not right. _maybe_ I can change that this year. > > -- > Trent Jarvi > tjarvi at qbang.org > (cat hurding since 1997) > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx Dmitry Markman From lux at diesel-research.com Mon Feb 6 23:20:15 2006 From: lux at diesel-research.com (Kim Lux) Date: Mon, 06 Feb 2006 23:20:15 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? Message-ID: <1139293215.3689.4.camel@zd7280> I'm running the code below. portlist.hasMoreElements() is false. /dev has ports in it as listed below. What am I doing wrong ? ========================================================== // Step through the list of ports until we find one that matches // the one we are looking for. portList = CommPortIdentifier.getPortIdentifiers(); while(portList.hasMoreElements()) { portID = (CommPortIdentifier) portList.nextElement(); // if (portID.getName().equals("/dev/ttyUSB0")) { myTA.append("Serial port ttyUSB0 has been found\n"); break; }// if portID equals... }// End of while... ========================================================== ls -al /dev/tty* crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 ... crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 -- Kim Lux, Diesel Research Inc. From david.garnier at trusted-logic.com Tue Feb 7 00:46:30 2006 From: david.garnier at trusted-logic.com (David Garnier) Date: Tue, 07 Feb 2006 08:46:30 +0100 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: <43E85056.2090608@trusted-logic.com> Hello, I think that the make-based build process is fine as it is, apart from the location of the Java source files. It is true that putting the Java source in a directory structure that map 1-to-1 to the Java package structure is the norm and should make it easier for everyone to modify the Java source, with or without an IDE. Ant is a good tool, but in the RXTX case I fail to see the advantage of using it compared to the current make-based process. As Trent said, they are more pressing issues, like testing. Regards, David Dmitry Markman wrote: > if I understands the issue right > in order to be able to use ant for c/c++ compilation > you have to install ant's cc task > http://ant-contrib.sourceforge.net/cc.html > > it looks like it should work on mac os x > (authors claim, that it's platform independent) > but I never tested > > so all you have to do it's providing right command line > for the gcc compiler > > > > > On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: > >>> rxtx_root_directory >>> `-- src >>> |-- main >>> | `-- java >>> | `-- gnu >>> | `-- io >>> `-- test >>> `-- java >>> `-- gnu >>> `-- io >>> >> >> >>> From what I understand this will just be good. >> >> For me it makes no difference. So lets do the rxtx thing. Let if >> fester for two weeks and if nobody objects, we will do it. >> >> I'm not doing this because I care. I'm doing this to eliminate much >> of my inbox. >> >> But test... man is rxtx lacking there in the community aspect. It is >> covered but not right. _maybe_ I can change that this year. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> (cat hurding since 1997) From tjarvi at qbang.org Tue Feb 7 01:11:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 01:11:31 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <43E85056.2090608@trusted-logic.com> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: On Tue, 7 Feb 2006, David Garnier wrote: > Hello, > > I think that the make-based build process is fine as it is, apart from the location of the Java > source files. It is true that putting the Java source in a directory structure that map 1-to-1 to > the Java package structure is the norm and should make it easier for everyone to modify the Java > source, with or without an IDE. > > Ant is a good tool, but in the RXTX case I fail to see the advantage of using it compared to the > current make-based process. As Trent said, they are more pressing issues, like testing. > Hi David I have more experience with testing rxtx than I can talk about. But let it be known, rxtx has gone trough 100's of hours of testing. We are hobby folks interested in toys but there is more. rxtx has had some of the best guidance in the industry there. This is not an easy thing. I may be able to come back in a month from the other side of the corperate fence and help. I suspect the tests could just be made public but they are in a very unusual environment that just wont work in a wider sense. This is something I'll be trying to change. At one point it was agreed we could just make the results public so this isnt just noise.. There is interest and I think its safe to mention that much. The big problem with testing in the past is most of it is done with a loopback connection. So we *still* have major questions regarding things like flow control. rxtx talks to itself over a loopback and it works. regardless of right or wrong. This requires more thought to be done right. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Feb 7 02:46:34 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 02:46:34 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: > The big problem with testing in the past is most of it is done with a > loopback connection. So we *still* have major questions regarding things > like flow control. rxtx talks to itself over a loopback and it works. > regardless of right or wrong. With serial communication there are gold standards. ckermit is probably a definitive 'standard.' Maybe its possible to do ping/pong tests with ckermit? Is it scriptable? There are known issues in rxtx. Probably the worst is some threading issues regarding some JREs with multiple JNI threads setting java variables. Man did I get schooled there. Just switch the c functions to returning variables and things go away. Sometimes they work fine, sometimes they blow up. Without understanding everything, somehow rhat got it right and debian (and especially gentoo) grabbed kernel patches causing all sort of harm. Its not hard to fix once you understand whats going on but nearly impossible to track with a debugger. So I have a good idea what 2.1-8 will have outside of the IDE modifications. rxtx 2.1-7 is a release for everyone to sync with. Its not even as stable as -pre17 as far as I know - I ran no test suites. I'll be chasing it too. We just had so many contributions that it was time. It seriously broke internal scheduals but thats a great thing :) The other thing I want to do in 2.1-8 is automagic baud rates. It turns out lots of shops are doing really funky baud rates for things like automobile test equipment. It is possible but it requires a fair amount of change in the native code. Is anyone looking at this? -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Feb 7 02:57:21 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 07 Feb 2006 04:57:21 -0500 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <43E85056.2090608@trusted-logic.com> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: Hi All, I agree, testing is very important. The problem I have been trying to address is related to cross-platform testing and the robust nature of the installs. Typically, I visit 3 platforms to deploy my product, windows, linux and mac. A build is performed on each platform. The idea that you can build for many platforms from one copy the source code seems attractive. This should enable synchronized deployments of identical code. The question of how to achieve this goal remains open. As Trent mentioned, this is hard. Perhaps Ant will help here (but perhaps not). Ant does seem to help with running unit tests. However, it does not help with multi-platform tests. For that you need many machines and different operating environments. Toward that end, I have created a multi-platform test that can be run from web start, located at: http://show.docjava.com:8086/book/cgij/code/jnlp/serialPort.PortTest.jnlp This is interesting because many people in the community can run the test and we can improve the test, as time permits. No, it is not a perfect solution, however, the idea does help with multi-platform tests using many machines and different operating environments. If the group has a good test for a general serial port set-ups, i would be happy to deploy it, for general evaluation using web start. And as for ANT, it is just an idea. Not all my ideas are good ones! - Doug >Hello, > >I think that the make-based build process is fine as it is, apart >from the location of the Java >source files. It is true that putting the Java source in a directory >structure that map 1-to-1 to >the Java package structure is the norm and should make it easier for >everyone to modify the Java >source, with or without an IDE. > >Ant is a good tool, but in the RXTX case I fail to see the advantage >of using it compared to the >current make-based process. As Trent said, they are more pressing >issues, like testing. > >Regards, >David > >Dmitry Markman wrote: >> if I understands the issue right >> in order to be able to use ant for c/c++ compilation >> you have to install ant's cc task >> http://ant-contrib.sourceforge.net/cc.html >> >> it looks like it should work on mac os x >> (authors claim, that it's platform independent) >> but I never tested >> >> so all you have to do it's providing right command line >> for the gcc compiler >> >> >> >> >> On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: >> >>>> rxtx_root_directory >>>> `-- src >>>> |-- main >>>> | `-- java >>>> | `-- gnu >>>> | `-- io >>>> `-- test >>>> `-- java >>>> `-- gnu >>>> `-- io >>>> >>> >>> >>>> From what I understand this will just be good. >>> >>> For me it makes no difference. So lets do the rxtx thing. Let if >>> fester for two weeks and if nobody objects, we will do it. >>> >>> I'm not doing this because I care. I'm doing this to eliminate much >>> of my inbox. >>> >>> But test... man is rxtx lacking there in the community aspect. It is >>> covered but not right. _maybe_ I can change that this year. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> (cat hurding since 1997) > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From matt.higgins at gmail.com Tue Feb 7 08:28:34 2006 From: matt.higgins at gmail.com (Matt Higgins) Date: Tue, 7 Feb 2006 10:28:34 -0500 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final Message-ID: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? import java.io.*; import java.util.*; import gnu.io.*; public class MySimpleRead implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; public static void main(String[] args) { boolean portFound = false; String defaultPort = "COM1"; if (args.length > 0) { defaultPort = args[0]; } portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; MySimpleRead reader = new MySimpleRead(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } } public MySimpleRead() { try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) { e.printStackTrace(); } try { inputStream = serialPort.getInputStream(); } catch (IOException e) { e.printStackTrace(); } try { serialPort.addEventListener(this); } catch (TooManyListenersException e) { e.printStackTrace(); } try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { e.printStackTrace(); } System.out.println("Baud is " + serialPort.getBaudRate()); System.out.println("Bits is " + serialPort.getDataBits()); System.out.println("Stop is " + serialPort.getStopBits()); System.out.println("Par is " + serialPort.getParity()); serialPort.notifyOnDataAvailable(true); readThread = new Thread(this); readThread.start(); } public void run() { // Thread.sleep(20000); //} catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { System.out.println("An event occurred " + event.getEventType()); switch (event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: byte[] readBuffer = new byte[20]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } System.out.print(new String(readBuffer)); } catch (IOException e) {} break; } } } --------------- Result on windows ------------------------------ Stable Library ============================================================== Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port:: COM1 Baud is 9600 Bits is 8 Stop is 1 Par is 0 ----------------- End Results ----------------------------------------- ------------------ Result on Linux ----------------------------------- Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 Found port: /dev/ttyS0 Baud is 9600 Bits is 8 Stop is 1 Par is 0 An event occurred 1 043100066224 ------------------ End Results --------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/a1431630/attachment-0042.html From brian at mbari.org Tue Feb 7 09:48:37 2006 From: brian at mbari.org (Brian Schlining) Date: Tue, 7 Feb 2006 08:48:37 -0800 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> Message-ID: <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> Hi Matt > The following code works fine on Linux but I never see any data > when run on Windows. This is a cut and paste from the SimpleRead > example. > I am attempting to read data from a bar code scanner. I can fire > up HyperTermianl on windows and see that the device is working > properly as I see the barcodes are scanned and echoed back to the > terminal. However when I run the app I don't see any data. It is > however associating with the com port as the informational bits > print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. Cheers Brian Schlining Software Engineer http://www.mbari.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/16d07f37/attachment-0042.html From lux at diesel-research.com Tue Feb 7 11:59:58 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 11:59:58 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139293215.3689.4.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> Message-ID: <1139338798.8145.4.camel@zd7280> Any ideas on this ? Any reason why portList.hasMoreElements() should be false even though there are devices in /dev ? On Mon, 2006-02-06 at 23:20 -0700, Kim Lux wrote: > I'm running the code below. > > portlist.hasMoreElements() is false. > > /dev has ports in it as listed below. > > What am I doing wrong ? > > > ========================================================== > // Step through the list of ports until we find one that matches > // the one we are looking for. > > portList = CommPortIdentifier.getPortIdentifiers(); > > while(portList.hasMoreElements()) > { > portID = (CommPortIdentifier) portList.nextElement(); // > if (portID.getName().equals("/dev/ttyUSB0")) > { > myTA.append("Serial port ttyUSB0 has been found\n"); > break; > }// if portID equals... > }// End of while... > ========================================================== > > ls -al /dev/tty* > crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty > crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 > crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 > crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 > crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 > ... > crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 > crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 > crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 > > > -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 12:20:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 12:20:25 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139338798.8145.4.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> Message-ID: On Tue, 7 Feb 2006, Kim Lux wrote: > > Any ideas on this ? Any reason why portList.hasMoreElements() should be > false even though there are devices in /dev ? > > > On Mon, 2006-02-06 at 23:20 -0700, Kim Lux wrote: >> I'm running the code below. >> >> portlist.hasMoreElements() is false. >> >> /dev has ports in it as listed below. >> >> What am I doing wrong ? >> >> >> ========================================================== >> // Step through the list of ports until we find one that matches >> // the one we are looking for. >> >> portList = CommPortIdentifier.getPortIdentifiers(); >> >> while(portList.hasMoreElements()) >> { >> portID = (CommPortIdentifier) portList.nextElement(); // >> if (portID.getName().equals("/dev/ttyUSB0")) >> { >> myTA.append("Serial port ttyUSB0 has been found\n"); >> break; >> }// if portID equals... >> }// End of while... >> ========================================================== >> >> ls -al /dev/tty* >> crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty >> crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 >> crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 >> crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 >> crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 >> ... >> crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 >> crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 >> crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 >> >> >> > Hi Kim What rxtx does is try to open the port and do a timed out read. If the kernel/... do not complain it's enumarted. I suspect you could do a crude test by doing something like cat /dev/ttyS0 > /dev/null If that barfs then rxtx wont enumerate the port. hmm looking at your question again, I suspect it's a lockfile problem. This is documented in INSTALL with the source. Its easy enough to test this too.. touch /var/lock/testingrxtxlockfiles && rm -f /var/lock/testingrxtxlockfiles If you are not in the right group it will bail. Root will work regardless. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 12:37:56 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 12:37:56 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> Message-ID: <1139341076.8145.11.camel@zd7280> Exactly which ports does rxtx attempt to put into the list ? /dev/* or /dev/tty* or /dev/tty[0-9[0-9] ? or /dev/ttyS* ? For the record, only /dev/ttyUSB0 is a valid port on the machine I am presently on. Will this be a problem ? On Tue, 2006-02-07 at 12:20 -0700, Trent Jarvi wrote: > This is documented in INSTALL with the source. > I was wondering where that file was. I will download source and dig it up. Thanks. -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 12:51:09 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 12:51:09 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139341076.8145.11.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: On Tue, 7 Feb 2006, Kim Lux wrote: > > Exactly which ports does rxtx attempt to put into the list ? /dev/* > or /dev/tty* or /dev/tty[0-9[0-9] ? or /dev/ttyS* ? > > For the record, only /dev/ttyUSB0 is a valid port on the machine I am > presently on. Will this be a problem ? > > > On Tue, 2006-02-07 at 12:20 -0700, Trent Jarvi wrote: >> This is documented in INSTALL with the source. >> > I was wondering where that file was. I will download source and dig it > up. > > Thanks. > Hmm I'm looking at pre17 so this may have changed. (its just what I have on this machine) if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA" // for the IPAQs }; CandidatePortPrefixes=Temp; } So you may need to add "ttyUSB" to that list. RXTX used to enumerate _everything_ see if(osName.equals("Linux-all-ports") But it became less than practical. This is all in RXTXCommDriver.java hmm I just did a cvs update. if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have to get your fingers into the code. We aim for sane defaults. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 13:06:45 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 13:06:45 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139342805.8145.22.camel@zd7280> On Tue, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > Hmm I'm looking at pre17 so this may have changed. (its just what I have > on this machine) > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA" // for the IPAQs > }; > CandidatePortPrefixes=Temp; > } > > > So you may need to add "ttyUSB" to that list. RXTX used to enumerate > _everything_ see if(osName.equals("Linux-all-ports") But it became less > than practical. > > This is all in RXTXCommDriver.java > > hmm I just did a cvs update. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have > to get your fingers into the code. We aim for sane defaults. Excellent. Thanks for taking the time. -- Kim Lux, Diesel Research Inc. From ideiglenes1 at freemail.hu Tue Feb 7 13:53:39 2006 From: ideiglenes1 at freemail.hu (--) Date: Tue, 07 Feb 2006 21:53:39 +0100 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139345619.22534.2.camel@localhost> Hi! I use this code to get all the extra Linux devices. :) if ("Linux".equals(System.getProperty("os.name"))) { System.setProperty("os.name","Linux-all-ports"); } driver = new RXTXCommDriver(); On k, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > On Tue, 7 Feb 2006, Kim Lux wrote: > > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have > to get your fingers into the code. We aim for sane defaults. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From matt.higgins at gmail.com Tue Feb 7 13:45:54 2006 From: matt.higgins at gmail.com (Matt Higgins) Date: Tue, 7 Feb 2006 15:45:54 -0500 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> Message-ID: <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> Sweet this is exactly what I needed. I was searching the archives through marc.theamisgroup they only have archives back to 1/3/05. Should have hit the mailman archive! Thanks a lot! On 2/7/06, Brian Schlining wrote: > > Hi Matt > > The following code works fine on Linux but I never see any data when run > on Windows. This is a cut and paste from the SimpleRead example. > I am attempting to read data from a bar code scanner. I can fire up > HyperTermianl on windows and see that the device is working properly as I > see the barcodes are scanned and echoed back to the terminal. However when I > run the app I don't see any data. It is however associating with the com > port as the informational bits print fine? > > > You're not the only one whose had this problem, I don't know if Trent has > addressed this is the latest release of RXTX but there is a workaround. > Here's the recent thread from the RXTX mailing list regarding this issues: > > Thanasis Delenikas tdelenik at gmail.com > Wed Jan 18 13:56:23 MST 2006 > > * Previous message: [Rxtx] Re: More close() performance fixes > * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] > > Hi all. > (I've subscribed again from my other email account). > > Trent, > > You are right. Linux *always* works, no matter what flow control you set. > Windows *works only* with hardware flow control (I haven't tested what > happens with software XON/XOFF flow control). > > I assume (but I am not certain) that even with no flow control at all, all > platforms should work. Without flow control, you have the risk of bumping > into overflow or framing errors, but that's your (the end programmer, I > mean) problem. > > >From my side, I shouldn't be working without flow control. That was a bug > too... It was some code forgotten from the old times, when I used to work > with phone emulation drivers which didn't support flow control. The > correct > way is to have some flow control enabled and that's why I suppose this is > a > low-severity bug for RxTx. > > I have no idea which platform shows the correct behaviour, since > my knowledge about Linux and the inner workings of these low-level i/o > operations is limited. > > Regards, > Thanasis Delenikas. > > > > > Message: 2 > > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > > From: Trent Jarvi > > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > > To: RXTX Developers and Users > > Message-ID: > > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > > > Hi all, > > > > > > Trent, I have found something. > > > I read your comment about flow control, so I experimented a bit. > > > > > > If you remember, in my sample program I've used no flow control at all > ( > > i.e. > > > Java constant FLOWCONTROL_NONE). > > > > > > Now, during testing, I've switch to hardware inbound flow control (i.e > . > > Java > > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > > beautifully! > > > > > > I think I will switch to H/W flow control and test things for a while, > > but > > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > > > > > Hi Thanasis, > > > > I'm fairly sure you have identified a bug. I would not worry too much > > about what Sun CommAPI w32 defaults are. I think they did more or less > > whatever the port opened with. Just a guess. Linux tries to stomp on > > ports so they are all the same. > > > > So this started out with Linux worked, Windows XP/.. did not as I > recall. > > Something is wrong in rxtx. Do I understand this right? > > > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > > > Perhaps there is something Wayne or I did not understand when we wrote > > that code. I wasnt programming back in the BBS days so modems are not > my > > thing. I have a few questions. > > > > Is the above matrix confirmed by observation? > > Linux just always worked? > > Which one _should_ work? I'm guessing modems work with hardware flow > > control. I'll have to dig around. > > > > The windows flow control changes a couple things with hardware flow > > control. Following the w32 API documentation is confusing sometimes. > > But it looks like Linux could have a bug too. > > Cheers > > Brian Schlining > Software Engineer > http://www.mbari.org > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/9c989144/attachment-0042.html From tjarvi at qbang.org Tue Feb 7 14:06:14 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 14:06:14 -0700 (MST) Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> Message-ID: >> >> You're not the only one whose had this problem, I don't know if Trent has >> addressed this is the latest release of RXTX but there is a workaround. >> Here's the recent thread from the RXTX mailing list regarding this issues: >> I have not. I expect to have access to some test equipment next month and I'll go through all of this. I really don't know whats going on and I need a gold standard. I thought maybe linux was autodetecting the flow control. Your observations would certainly be welcome. I need to talk to Russell King and see what he is doing. Until then I'd just be toying around over a loopback as usual. This is very high on the list though. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 17:25:05 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 17:25:05 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139358305.17994.2.camel@zd7280> My application now works. I installed the libraries and jar from 2.1-7 (Final). portlist.hasMoreElements is no longer false. The application finds the port for /dev/ttyUSB0. Thanks for your help, Trent (et al) Sorry I bothered you with this. Next time I will look in the source first. I didn't think it was an rxtx issue, I thought it was a Linux setup issue . On Tue, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > Hmm I'm looking at pre17 so this may have changed. (its just what I > have > on this machine) > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux > Serial Ports > "ttySA" // for the > IPAQs > }; > > CandidatePortPrefixes=Temp; > } > > > So you may need to add "ttyUSB" to that list. RXTX used to enumerate > _everything_ see if(osName.equals("Linux-all-ports") But it became > less > than practical. > > This is all in RXTXCommDriver.java > > hmm I just did a cvs update. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux > Serial Ports > "ttySA", // for the > IPAQs > "ttyUSB" // for USB > frobs > }; > > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you > have > to get your fingers into the code. We aim for sane defaults. -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 19:21:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 19:21:54 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139358305.17994.2.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> <1139358305.17994.2.camel@zd7280> Message-ID: >Sorry I bothered you with this. Next time I will look in the source >first. I didn't think it was an rxtx issue, I thought it was a Linux >setup issue . Why would you be sorry? I would have done the same. I'm glad it's working :) -- Trent Jarvi tjarvi at qbang.org From tma at mail.island.net Wed Feb 8 13:39:35 2006 From: tma at mail.island.net (Tom Alldread) Date: Wed, 08 Feb 2006 12:39:35 -0800 Subject: [Rxtx] Win32/Linux Serial Port Data Dropouts In-Reply-To: <200602060702.k167255O007882@www.qbang.org> References: <200602060702.k167255O007882@www.qbang.org> Message-ID: <43EA5707.4020200@mail.island.net> Greetings Folks at RXTX: During the last couple of months I have been alternately testing with javax.comm 2 and RXTX 2.1 under Windows XP and CommApi 3 and RXTX 2.1 under Suse 10.0 Linux. In the process I have learned a little about java multi-threading under NetBeans 5 with Profiler. My java (jdk 1.5_06) application is used for data acquisition and provides a graphical display of A-D conversion data received from a 56KBaud serial port. The actual data throughput is about 10KBaud thus it is well below the speed of the port. I use hardware RTS/CTS flow control which can stall the data acquisition sample rate if necessary. This ensures the display computer has the ability to slow the data acquisition rate should it become too busy to accept the regular data flow. Both the serial port buffer and the java read buffer are set at 16KB. Usually the data transfers into the java read buffer are less than 100 bytes unless the data acquisition is recovering from a stall. The data flow normally hesitates after each 5 KB block as a continue command is needed from the display computer to start the drawing of a new graphics display line. Separate threads have been provided for the serial port event monitoring and data processing. The serial port event thread has been given the maximum priority and data processing thread the minimum priority provided by java. Thread yield statements have been placed within all data processing while/for loops as an effort to ensure quick access to CPU cycles for the serial port event thread. I have found that short data transmissions are essentially error free but occasional dropouts occur with continuous data flow especially under Windows XP. ....................................................................................................................................................................................... Linux results: I am happy to report that RXTX 2.1 appears to work very well under Linux although I did notice some errors when the screen savers were running with my dual monitors. I believe this is a local problem associated with my dual graphics which needs further attention. The recent CommApi 3 Linux release from Sun did not work at all with my program. It seemed to send commands out OK but did not receive any data. Although the serial port event triggered the ISR, the input stream appeared filled with nulls and thus did not contain any data. As my understanding is that CommApi 3 was tested with a Red Hat distribution of Linux I wonder if this problem is distro dependent? Although somewhat off topic here I wonder if anyone reading this has had similar experience? .................................................................................................................................................................................. Windows XP results: There are problems with occasional data dropouts which become more frequent as the sampling rate is increased or if the computer becomes busy with other duties. The dropouts typically consist of a half dozen byte block of lost data. It appears the lost bytes never get added to the java input stream. There has not been any indication of garbled data, overruns or framing errors which suggests the UART communications remains solid. Using javax.comm 2 I found that the setting of SerialPort 'enableReceiveThreshold' to 40 and 'enableReceiveTimeout' of 100mS reduced the dropouts error rate significantly. I found that I could not get RXTX 2.1 to function with the aforementioned threshold and timeout settings. The javax.comm 2 interface is consequently performing better for me under Windows than RXTX 2.1. I wonder if anyone here has any suggestions as to what I might try to improve RXTX 2.1? Although my settings are the same as under Suse 10.0, RXTX 2.1 performs much better for me under Linux than any of the alternatives that I have tried under Windows XP . ............................................................................................................................................................................... I would like to establish, based on the experience of others, if I have reached the normally expected performance limit of java serial port communications? Should I expect to achieve virtually error free serial port data input from a continuous stream under Windows XP java software? I am considering changing my protocol to packets with error checking if necessary but would like to know if the dropout problems I am experiencing are typical or not before I take this rather work intensive plunge. Many thanks in advance for any help! Best Regards, Tom Alldread -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.375 / Virus Database: 267.15.2/253 - Release Date: 2006-02-07 From jlaxson at mac.com Wed Feb 8 23:56:48 2006 From: jlaxson at mac.com (John Laxson) Date: Thu, 9 Feb 2006 00:56:48 -0600 Subject: [Rxtx] PortInUseException: Unknown Application on OSX Message-ID: Hi, I've been trying to get RXTX 2.1.7 going on Mac OS X for a while here, and am running up into a wall here. I've tried with pre- compiled and the source version and get the same problem, a gnu.io.PortInUseException: Unknown Application. I have run the fixperms script included with the source distribution, and id shows me as a member of the uucp group, and permissions on /var/spool/uucp are 775 root:uucp. Running a test program (included at the bottom for clarity) lets me enumerate all the serial ports correctly, but trying to open any of them gives the PortInUseException. If it helps, when I try to open a port that's set to make an outgoing bluetooth connection, there is no delay and no connection attempt at all. Thanks, John Laxson PS: The documentation wiki on qbang.org shows 404, and has for a few days now. My test code: public static void main(String[] args) { SerialPort serialPort; try { Enumeration e = CommPortIdentifier.getPortIdentifiers(); CommPortIdentifier ident; while (e.hasMoreElements()) { ident = (CommPortIdentifier)e.nextElement(); System.out.println(ident.getName()); } ident = CommPortIdentifier.getPortIdentifier("/dev/cu.modem"); serialPort = (SerialPort) ident.open("Me", 5000); } catch (Exception e) { e.printStackTrace(); } } From rajesh.invincible at gmail.com Thu Feb 9 03:39:38 2006 From: rajesh.invincible at gmail.com (Rajesh N) Date: Thu, 9 Feb 2006 16:09:38 +0530 Subject: [Rxtx] Re: Move .java Files in gnu.io filesystem hierarchy - Maven (2) In-Reply-To: <43DF21D2.7090200@ngi.it> References: <43DF21D2.7090200@ngi.it> Message-ID: <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Can anybody tell me how to overcome these EXCEPTIONS I AM WORKING ON SERIAL COMMN IN JAVA ON LINUX. 1. " NOT ALL PARAMETERS SUPPORTED BY THE KERNEL" This i came across the following statement inmy prog. SerialP is A SerialPort object SerialP.setSerialPortParams(9600(BAUDRATE),DATABITS_8,STOPBITS_1,PARITY_NONE) 2. NullPointer Exception at Event Dispatch Now i have checked all my object references for a null reference but i found none i have put up my entire code in try catch blocks but still I AM UNABLE TO CATCH THIS EXCEPTION AND HENCE MY APPLICATION CLOSES HOW DOES THESE GO? PLEASE HELP ME IT IS URGENTTTTTTTTTTTTTTTT yours sincerely RAJESH On 1/31/06, Fabio Frumento wrote: > Hi Xavier, > > I don't know maven at all but the directory hierarchy listed buy Trent > is fine for me... > > I'll take a look to maven, it seems an interesting project > > Regards > > Fabio Frumento > > Trent Jarvi wrote: > > On Tue, 31 Jan 2006, Xavier Frisaye wrote: > > > >> Hi all, > >> > >> If you are going to rearrange the src folder, i will propose to use > >> maven 2 and follow its directory structure > >> > (http://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html). > >> > >> Maven 2 simplify java project and give a standard way to make projects > >> (http://maven.apache.org/). > >> We are using it for internal projects and we are very satisfied. > >> > >> Is anybody interested? > >> > >> I'm not an expert in maven 2 (yet) but i'm agree to help using it if > >> you choose to make so. > >> > > > > so this would be: > > > > rxtx-devel/src/main/java/gnu.io > > rxtx-devel/src/test/java/ManIwish.java > > > > I don't use IDEs very much so I'll let others comment. But I don't see > > a problem with that. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Thu Feb 9 09:50:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 9 Feb 2006 09:50:31 -0700 (MST) Subject: [Rxtx] Re: Move .java Files in gnu.io filesystem hierarchy - Maven (2) In-Reply-To: <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Message-ID: On Thu, 9 Feb 2006, Rajesh N wrote: > Can anybody tell me how to overcome these EXCEPTIONS > I AM WORKING ON SERIAL COMMN IN JAVA ON LINUX. > > 1. " NOT ALL PARAMETERS SUPPORTED BY THE KERNEL" > > This i came across the following statement inmy prog. > SerialP is A SerialPort object > SerialP.setSerialPortParams(9600(BAUDRATE),DATABITS_8,STOPBITS_1,PARITY_NONE) > Strange. The parameters you use are the same the port should open with by default. Could you paste the actual exception you are getting? I don't see that in the rxtx source. Also it would help to know the rxtx version. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Fri Feb 10 15:29:05 2006 From: lux at diesel-research.com (Kim Lux) Date: Fri, 10 Feb 2006 15:29:05 -0700 Subject: [Rxtx] One serial port object for both sending and receiving ? Message-ID: <1139610545.18177.4.camel@zd7280> Is it OK to use one SerialPort ojbect (ex Serial Port serialPort;) and use it for both sending and receiving ? For example: ======================================================================== static SerialPort serialPort = null; static OutputStream serialOut = null; static InputStream serialIn = null; // assign it to an outputStream for use try{ serialOut = serialPort.getOutputStream(); System.out.println("Serial output stream has been assigned."); }//try catch(IOException e) { System.out.println("Error: Couldn't assign output stream to serial port."); }//catch //assign it to an inputStream for use try{ serialIn = serialPort.getInputStream(); System.out.println("Serial input stream has been assigned."); }//try catch(IOException e) { System.out.println("Error: Couldn't assign input stream to serial port."); }//catch ======================================================================== -- Kim Lux, Diesel Research Inc. From lux at diesel-research.com Fri Feb 10 21:23:00 2006 From: lux at diesel-research.com (Kim Lux) Date: Fri, 10 Feb 2006 21:23:00 -0700 Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Message-ID: <1139631780.23882.10.camel@zd7280> I've got a problem receiving chars with my version of serialRead, written in an SWT GUI. I had a Java pro have a good look at my code and he can't see anything wrong with it. I can send chars fine. When I receive a char the cpu usage for the app goes to 100% and the code in the serial event handler doesn't get executed. The instructions on the Java Comm Serial API How-To for Linux page state that I must install javacomm. Is that true ? Everything builds without it and I can send chars on rxtx just fine, but I can't receive them. Could this be the problem ? I downloaded and installed javacomm. I was not able to add "Driver=gnuio.RXTXCommDriver to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 installed in /usr/java/jre1.5.0_05. I added comm.jar to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext to the library paths. Is this OK ? Does it matter that I am receiving on /dev/ttyUSB0 ? Thanks. -- Kim Lux, Diesel Research Inc. From lunareclipse03 at web.de Sat Feb 11 09:44:46 2006 From: lunareclipse03 at web.de (lunareclipse03@web.de) Date: Sat, 11 Feb 2006 17:44:46 +0100 Subject: [Rxtx] Question about Serial I/O under Win32 Message-ID: <662084330@web.de> Hello everybody, I have a strange problem with a piece of code I made for myself. No, this is not really concerning rxtx, but nevertheless I post this to the list, hoping that some of you can help me. I've written two libraries, one for linux and one for win32. The linux port works quite well, I can send / receive faxes and / or replay voice messages over the telephone line using a voice modem. But the win32 port of the library causes some trouble. If, for example, I send out a fax with a certain modem under linux, it works well. The fax is complete when it comes out of the fax machine. If I then use the same modem to send out a fax under win32, the fax coming out of the fax machine gets "stuck" halfways, but the sending modem thinks that transmission was ok and drops the connection. The answering fax machine then gives me "error while receiving." The "upper layer" java code MUST be right, because if I do the same thing under linux (using the linux library), everything is alright. Now I have to ask: Can somebody please help me out with this??!? Could it be the case that some kind of flow control or COMMTIMEOUTS setting causes this behaviour? I set flow control to RTS/CTS before sending out a fax. How can I DISABLE flow control? Or what do you think? Can something else cause this problems? Thank you all for your time and PLEASE write back soon. Regards, --Sven Ahlemann Am Waldrand 31 45721 Haltern am See Germany ______________________________________________________________ Verschicken Sie romantische, coole und witzige Bilder per SMS! Jetzt bei WEB.DE FreeMail: http://f.web.de/?mc=021193 From lux at diesel-research.com Sat Feb 11 10:06:52 2006 From: lux at diesel-research.com (Kim Lux) Date: Sat, 11 Feb 2006 10:06:52 -0700 Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: <1139631780.23882.10.camel@zd7280> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> <1139631780.23882.10.camel@zd7280> Message-ID: <1139677612.3431.5.camel@zd7280> More on this problem. I copied and pasted simpleRead into a console based Eclipse project and I've got the same result, except that cpu usage doesn't go to 100%. I'm beginning to think there is an issue in rxtx. My imports for simpleRead are: ============================ import gnu.io.*; import java.util.*; //import javax.comm.*; import java.io.*; =========================== Any ideas ? I am trying to read from /dev/ttyUSB0 using a serial to USB adapter which has worked well with minicom and gtkterm. Thanks. On Fri, 2006-02-10 at 21:23 -0700, Kim Lux wrote: > I've got a problem receiving chars with my version of serialRead, > written in an SWT GUI. > > I had a Java pro have a good look at my code and he can't see anything > wrong with it. > > I can send chars fine. When I receive a char the cpu usage for the app > goes to 100% and the code in the serial event handler doesn't get > executed. > > The instructions on the Java Comm Serial API How-To for Linux page state > that I must install javacomm. Is that true ? Everything builds without > it and I can send chars on rxtx just fine, but I can't receive them. > Could this be the problem ? > > I downloaded and installed javacomm. I was not able to add > "Driver=gnuio.RXTXCommDriver > to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not > have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 > installed in /usr/java/jre1.5.0_05. I added comm.jar > to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext > to the library paths. Is this OK ? > > Does it matter that I am receiving on /dev/ttyUSB0 ? > > Thanks. > -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Sun Feb 12 21:01:33 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:01:33 -0700 (MST) Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: <1139677612.3431.5.camel@zd7280> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> <1139631780.23882.10.camel@zd7280> <1139677612.3431.5.camel@zd7280> Message-ID: I suspect what is happening is the select() is breaking out in the native code but the driver does not have support for notifying there are X bytes available. On some traditional Unix based systems, the only way you know data is available is the fd status changes and do an FIORDCHK ioctl. Or perhaps the only thing you can know is the fd status changed. It would take reading through the kernel driver code to know for sure. So on USB, depending upon the driver, the same may need to be done or the driver improved a bit if possible to support. Polling reads will also work but don't use the event driven model of CommAPI which isnt acceptable in the long run. The 100% cpu usage can then be explained because select no longer blocks until the data is read; the eventLoop spins loose. You can put a well placed sleep but rxtx only expects those are needed when it knows data is available. This may not be a super simple thing to understand and fix. I do have ideas to get you started. I'm going to be short on time the next couple weeks. I expect to put some good time in and answer some other questions I saw around the 25th. For now, I'd look at the following and go from there with the hints I've given. JNIEXPORT jint JNICALL RXTXPort(nativeavailable)( JNIEnv *env, jobject jobj ) { int fd = get_java_var( env, jobj,"fd","I" ); int result; /* char message[80]; ENTER( "RXTXPort:nativeavailable" ); On SCO OpenServer FIONREAD always fails for serial devices, so try ioctl FIORDCHK instead; will only tell us whether bytes are available, not how many, but better than nothing. This turns out to be true on Solaris also. taj. */ #ifdef FIORDCHK /* __unixware__ __sun__ probably others */ result = ioctl(fd, FIORDCHK, 0); #else if( ioctl( fd, FIONREAD, &result ) < 0 ) { goto fail; } #endif /* FIORDCHK */ On Sat, 11 Feb 2006, Kim Lux wrote: > > More on this problem. I copied and pasted simpleRead into a console > based Eclipse project and I've got the same result, except that cpu > usage doesn't go to 100%. I'm beginning to think there is an issue in > rxtx. > > My imports for simpleRead are: > > ============================ > import gnu.io.*; > import java.util.*; > //import javax.comm.*; > import java.io.*; > =========================== > > Any ideas ? I am trying to read from /dev/ttyUSB0 using a serial to > USB adapter which has worked well with minicom and gtkterm. > > Thanks. > > > > On Fri, 2006-02-10 at 21:23 -0700, Kim Lux wrote: >> I've got a problem receiving chars with my version of serialRead, >> written in an SWT GUI. >> >> I had a Java pro have a good look at my code and he can't see anything >> wrong with it. >> >> I can send chars fine. When I receive a char the cpu usage for the app >> goes to 100% and the code in the serial event handler doesn't get >> executed. >> >> The instructions on the Java Comm Serial API How-To for Linux page state >> that I must install javacomm. Is that true ? Everything builds without >> it and I can send chars on rxtx just fine, but I can't receive them. >> Could this be the problem ? >> >> I downloaded and installed javacomm. I was not able to add >> "Driver=gnuio.RXTXCommDriver >> to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not >> have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 >> installed in /usr/java/jre1.5.0_05. I added comm.jar >> to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext >> to the library paths. Is this OK ? >> >> Does it matter that I am receiving on /dev/ttyUSB0 ? >> >> Thanks. >> > From tjarvi at qbang.org Sun Feb 12 21:03:30 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:03:30 -0700 (MST) Subject: [Rxtx] One serial port object for both sending and receiving ? In-Reply-To: <1139610545.18177.4.camel@zd7280> References: <1139610545.18177.4.camel@zd7280> Message-ID: On Fri, 10 Feb 2006, Kim Lux wrote: > > Is it OK to use one SerialPort ojbect (ex Serial Port serialPort;) and > use it for both sending and receiving ? > > For example: > > ======================================================================== > static SerialPort serialPort = null; > static OutputStream serialOut = null; > static InputStream serialIn = null; > > > > > // assign it to an outputStream for use > try{ > serialOut = serialPort.getOutputStream(); > System.out.println("Serial output stream has been assigned."); > }//try > catch(IOException e) > { > System.out.println("Error: Couldn't assign output stream to serial > port."); > }//catch > > > //assign it to an inputStream for use > try{ > serialIn = serialPort.getInputStream(); > System.out.println("Serial input stream has been assigned."); > }//try > catch(IOException e) > { > System.out.println("Error: Couldn't assign input stream to serial > port."); > }//catch This should be fine. In fact trying to do it another way will probably not work as you will run into lockfile issues. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun Feb 12 21:13:13 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:13:13 -0700 (MST) Subject: [Rxtx] Question about Serial I/O under Win32 In-Reply-To: <662084330@web.de> References: <662084330@web.de> Message-ID: On Sat, 11 Feb 2006 lunareclipse03 at web.de wrote: > Hello everybody, > > I have a strange problem with a piece of code I made for myself. No, > this is not really concerning rxtx, but nevertheless I post this to the > list, hoping that some of you can help me. I've written two libraries, > one for linux and one for win32. The linux port works quite well, I can > send / receive faxes and / or replay voice messages over the telephone > line using a voice modem. But the win32 port of the library causes some > trouble. If, for example, I send out a fax with a certain modem under > linux, it works well. The fax is complete when it comes out of the fax > machine. If I then use the same modem to send out a fax under win32, the > fax coming out of the fax machine gets "stuck" halfways, but the sending > modem thinks that transmission was ok and drops the connection. The > answering fax machine then gives me "error while receiving." The "upper > layer" java code MUST be right, because if I do the same thing under > linux (using the linux library), everything is alright. Now I have to > ask: Can somebody please help me out with this??!? Could it be the case > that some kind of flow control or COMMTIMEOUTS setting causes this > behaviour? I set flow control to RTS/CTS before sending out a fax. How > can I DISABLE flow control? Or what do you think? Can something else > cause this problems? Thank you all for your time and PLEASE write back > soon. > Hi Sven I'm not too willing to talk about flow control at the low level until I confirm some things with test equipment later. It is not clear if you are using rxtx or writing your own native code. So I'm not sure how to answer much of this :) If you are wondering how to change the flow control using rxtx from java, The BlackBox example from Sun flips this back and forth. SerialPort.java in rxtx 2.1 uses the following: SerialPort.java: public static final int FLOWCONTROL_NONE =0; SerialPort.java: public static final int FLOWCONTROL_RTSCTS_IN =1; SerialPort.java: public static final int FLOWCONTROL_RTSCTS_OUT =2; SerialPort.java: public static final int FLOWCONTROL_XONXOFF_IN =4; SerialPort.java: public static final int FLOWCONTROL_XONXOFF_OUT=8; So if you set flowcontrol to RTSCTS, you can set it to NONE to turn it off. If you are looking for how to do it in native code, the rxtx Source is SerialImp.c (unix/linux/mac os x/w32) and termios.c (w32 only with SerialImp.c) You can track the code: SerialImp.c:JNIEXPORT void JNICALL RXTXPort(setflowcontrol)( JNIEnv *env, jobject jobj, jint flowmode ) termios.c:int tcgetattr( int fd, struct termios *s_termios ) termios.c:int tcsetattr( int fd, int when, struct termios *s_termios ) There may be a problem in the rxtx flow control code though. Rather than guess, I want to test this with a gold standard. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Feb 6 00:00:16 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 00:00:16 -0700 (MST) Subject: [Rxtx] wiki delay until tomorrow night. In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: On Sun, 5 Feb 2006, Trent Jarvi wrote: > On Sun, 5 Feb 2006, Kim Lux wrote: > >> usb ? Tell me more... I need that too. > > usb is a very proper design. Thats all it is. > Maybe rxtx could help usb. But it would start with helping bring back the community that was already there. It's not something I'd love to do but maybe its the right thing to do. It would probably take 2 years to do right. But maybe thats better than what we have now. I honestly don't know what IBM is doing which could just run over everything. Just some thoughts after some fine german wine. -- Trent Jarvi tjarvi at qbang.org From gadelavega at yahoo.com.ar Mon Feb 6 02:17:05 2006 From: gadelavega at yahoo.com.ar (Gonzalo A. de la Vega) Date: Mon, 06 Feb 2006 10:17:05 +0100 Subject: [Rxtx] Serial port ownership question In-Reply-To: References: <20060205113618.30274.qmail@web53501.mail.yahoo.com> <1139157422.4553.9.camel@zd7280> <1139158698.4936.9.camel@zd7280> Message-ID: <43E71411.4050402@yahoo.com.ar> On my Fedora Core 4: ls -l /dev/ttyS* crw-rw---- 1 root uucp 4, 64 Feb 6 2006 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Feb 6 2006 /dev/ttyS1 ... and: grep "ttyUSB" /etc/udev/rules.d/50-udev.rules KERNEL=="ttyUSB*", GROUP="uucp", MODE="0660" So anyone in the "uucp" group can use serial ports. On Gentoo the group is "tty". Trent Jarvi escribi?: > > > On Sun, 5 Feb 2006, Dr. Douglas Lyon wrote: > >> I can confirm that this is the case (only root ownership of >> serial ports, under fedora 4). >> Wow, what were they thinking?! >> - DL >> >>> I've found that the newer kernels have the serial ports owned by root. >>> For example, >>> >>> $ls -al /dev/tty* >>> crw-rw-rw- 1 root root 5, 0 Feb 5 02:06 /dev/tty >>> crw-rw---- 1 root root 4, 0 Feb 5 02:06 /dev/tty0 >>> crw------- 1 root root 4, 1 Feb 5 09:07 /dev/tty1 >>> crw-rw---- 1 root tty 4, 10 Feb 5 02:06 /dev/tty10 >>> crw-rw---- 1 root tty 4, 11 Feb 5 02:06 /dev/tty11 >>> ... > > > This is just not a problem jcp or such are going to solve. Its a > platform spitwad fight. But do look at pam. In fact thats what Sun > is doing too. Maybe Linux followed their lead.. I'm not a pam guy. > I've spent 16 hours trying to understand it but your users wont :) > > Solution? I have no clue. Its two tangent mentalities from my > perspective. > > -- > Trent Jarvi > tjarvi at qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mtnvega at yahoo.com.br Mon Feb 6 05:35:43 2006 From: mtnvega at yahoo.com.br (Luiz Jr) Date: Mon, 6 Feb 2006 12:35:43 +0000 (GMT) Subject: [Rxtx] Documentation Wiki In-Reply-To: <1139157422.4553.9.camel@zd7280> Message-ID: <20060206123543.57256.qmail@web53515.mail.yahoo.com> Hello, Thank you for you answer, but so the usage of the API is pretty much like the Java Communications Api? If yes, what version of the Java Comm Api? Thank you, Luiz A. Brandao Jr Kim Lux escreveu: On Sun, 2006-02-05 at 08:36 -0300, Luiz Jr wrote: > Hello, > > I want to start using the RXTX libraries, but I would to know how, > since I can not access the documentation wiki page I just started using them yesterday. Below is how I installed the libraries, if that helps. I used snippets of code from the SimpleWrite application here to get me going. http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html Instead of "import javax.comm.*;", use "import gnu.io.*;" which is gotten from RXTXcomm.jar, which you will need to include in your project references. I am working in Eclipse. BTW: there is no way to open a port without going through the port list and finding it. Maybe sometime in the future someone (me ?) will write a method called openSerialPort that allows the user to give a port identifier, such as "/dev/tty1" and return a port ready to use. It wouldn't take much to write that and it would save users a lot of code. Hope this helps. ======================================================================= 1) Figure out which java you are running, incase there is more than one installed. $ java -version java version "1.5.0_05" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_05-b05) Java HotSpot(TM) Client VM (build 1.5.0_05-b05, mixed mode, sharing) 2) Find all the jre directories and the one from which you are currently running. kfind (jre) 3) cd to that directory plus /lib/i386 cd /usr/java/jre1.5.0_05/lib/i386 4) Copy the library files (*.so) to that directory. cp /home/krlux/Desktop/'Java Controls'/rxtx-linux/bin/* . 5) Check that the copy was successful ls librxtx* librxtxI2C.so librxtxRaw.so librxtxSerial.so librxtxParallel.so librxtxRS485.so 6) cd to the /lib/ext directory for your java. cd /usr/java/jre1.5.0_05/lib/ext 7) Copy the Jar files there cp /home/krlux/Desktop/'Java Controls'/rxtx-linux/lib/ext/* . 8) Check that it was successful ls RXTX* RXTXcomm.jar Rxtx is now installed on your machine ready to use. =================================================================== -- Kim Lux, Diesel Research Inc. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx --------------------------------- Yahoo! Acesso Gr?tis - Internet r?pida e gr?tis. Instale o discador agora! -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/544aa403/attachment-0043.html From lyon at docjava.com Mon Feb 6 05:49:34 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 06 Feb 2006 07:49:34 -0500 Subject: [Rxtx] wiki delay until tomorrow night. In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: Hi All, I have often thought about USB drivers being needed. For example, the ironman watch will not interface to a mac (windows only). It is USB. My dymo label writer has no Java driver (native only). Etc. Most cheap web cameras are USB (and Java drivers go through JAI, if it supports the camera at all). The JAI code shows how sun did the USB drivers. You have to be a member of the jai project to download the source code. https://jai.dev.java.net has the jai distro. And then you are not allowed to redistribute it. However, we can all learn from it (if so inclined). Basically: cvs -d :pserver:lyon at cvs.dev.java.net:/cvs login cvs -d :pserver:lyon at cvs.dev.java.net:/cvs checkout jai-core You will need to user your own uid and pw to get in. The ant build has over 100 warnings from sun deprecations of its own code. You might say that they were hoisted on their own Picard ;) One interesting thing is that they support several platforms: linux-amd64 64-bit Linux-AMD64 linux-i586 32-bit Linux-x86 solaris-amd64 64-bit Solaris-AMD64 solaris-i586 32-bit Solaris-x86 solaris-sparc 32-bit Solaris-SPARC solaris-sparcv9 64-bit Solaris-SPARC windows-i586 32-bit Windows-x86 Thus, ant is used to provide a multi-platform native method distro. Neat. How do they do it? check this out: And: The core download does not contain any C source code (it was all pre-built). Basically, they are just copying .so and .dll files into build directories. I would love to see the C code for this...but Sun does not post it on the https://jai.dev.java.net site. I don't know why...Perhaps I missed it. - Doug >On Sun, 5 Feb 2006, Trent Jarvi wrote: > >>On Sun, 5 Feb 2006, Kim Lux wrote: >> >>>usb ? Tell me more... I need that too. >> >>usb is a very proper design. Thats all it is. >> > >Maybe rxtx could help usb. But it would start with helping bring >back the community that was already there. > >It's not something I'd love to do but maybe its the right thing to do. > >It would probably take 2 years to do right. But maybe thats better >than what we have now. > >I honestly don't know what IBM is doing which could just run over everything. > >Just some thoughts after some fine german wine. > >-- >Trent Jarvi >tjarvi at qbang.org > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tdelenik at gmail.com Mon Feb 6 05:56:32 2006 From: tdelenik at gmail.com (Thanasis Delenikas) Date: Mon, 6 Feb 2006 14:56:32 +0200 Subject: Fwd: [Rxtx] Documentation Wiki In-Reply-To: <1139157422.4553.9.camel@zd7280> References: <20060205113618.30274.qmail@web53501.mail.yahoo.com> <1139157422.4553.9.camel@zd7280> Message-ID: <310a1a930602060456t129f1dc6p5f2b908f13ab5a0b@mail.gmail.com> Hello all, Kim, this is a snippet from the code I use. The closest to directly opening a specific port without enumeration. << ... portId = CommPortIdentifier.getPortIdentifier(getPort()); serialPort = (SerialPort) portId.open("jSMSEngine", 1971); ... >> where getPort() return the string identifier of the port, i.e. "/dev/ttyS0" or "COM1" or whatever. Thanasis. ---------- Forwarded message ---------- From: Kim Lux Date: Feb 5, 2006 6:37 PM Subject: Re: [Rxtx] Documentation Wiki To: RXTX Developers and Users BTW: there is no way to open a port without going through the port list and finding it. Maybe sometime in the future someone (me ?) will write a method called openSerialPort that allows the user to give a port identifier, such as "/dev/tty1" and return a port ready to use. It wouldn't take much to write that and it would save users a lot of code. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/182ab5b8/attachment-0043.html From tjarvi at qbang.org Mon Feb 6 11:53:57 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 11:53:57 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: On Mon, 6 Feb 2006, Dr. Douglas Lyon wrote: > Hi All, > I have often thought about USB drivers being needed. > For example, the ironman watch will not interface > to a mac (windows only). It is USB. > My dymo label writer has no Java driver (native only). > Etc. > Most cheap web cameras are USB (and Java drivers go > through JAI, if it supports the camera at all). > The JAI code shows how sun did the USB drivers. > You have to be a member of the jai project to download > the source code. > https://jai.dev.java.net has the jai distro. > And then you are not allowed to redistribute it. However, > we can all learn from it (if so inclined). Basically: > cvs -d :pserver:lyon at cvs.dev.java.net:/cvs login > cvs -d :pserver:lyon at cvs.dev.java.net:/cvs checkout jai-core > You will need to user your own uid and pw to get in. > The ant build has over 100 warnings from sun deprecations > of its own code. > > You might say that they were hoisted on their own Picard ;) > > One interesting thing is that they support several platforms: > linux-amd64 64-bit Linux-AMD64 > linux-i586 32-bit Linux-x86 > solaris-amd64 64-bit Solaris-AMD64 > solaris-i586 32-bit Solaris-x86 > solaris-sparc 32-bit Solaris-SPARC > solaris-sparcv9 64-bit Solaris-SPARC > windows-i586 32-bit Windows-x86 > Thus, ant is used to provide a multi-platform native method distro. > Neat. > How do they do it? > check this out: > > > > > > > > > > > > > And: > > > > > > > > > > The core download does not contain any C source code (it was all pre-built). > Basically, they are just copying .so and .dll files into build directories. > > I would love to see the C code for this...but Sun does not post it on the > https://jai.dev.java.net site. > > I don't know why...Perhaps I missed it. > > - Doug > > I've looked at moving rxtx to Ant builds. I think that would help IDEs a great deal. I requested a evalutation desk copy the O'Reilly Ant book for some j2ee material I was teaching. http://www.oreilly.com/catalog/anttdg/ It has a one sentence mention of JNI. So there was not luck there. I saw that there is another Ant book that does mention JNI more. I can't find it now. Ant must be able to support it with extensions. http://ant.apache.org/manual/OptionalTasks/javah.html What the auto(break :) tools do in the rxtx build is 4 things really. 1) gcc compile flags 2) ld compile flags 3) config.h 4) compile flags for customizing rxtx (lockfiles, ...) See 1 All of this information except 4 can be static once obtained. So I'm not attached to the auto tools. If I could find an example of Ant being used for JNI code, I'd be one of the first to start moving that direction. Maybe someone saw an example someplace. The other thing we have not completed discussing is the directory structure. There is interest in making rxtx more IDE friendly. I get more mail about that off the list than how to install rxtx. And I see we have Ken Thompson in da house :) He is our trusted CVS maintainer and the guy that purchased the rxtx.org domain. Old community. We will need Ken for changing the directory structure of source. I would like to open up discussion about both of these as it is more than time. The problem is I have little experience with Ant and even less with IDEs. It would be nice if we could work with Eclipse and NetBeans. http://www.netbeans.org/ (sun and some community) http://www.eclipes.org (ibm,rhat,... perhaps more community) http://maven.apache.org/what-is-maven.html (apache. It is community) borland should sortof be here too but I think thats covered in eclipse. >From what I understand so far, we should morph rxtx to support those three maybe trusting apaches lead with maven. But I use vi. I have little to no clues beyond what people have fed me. Can we agree that thats the right direction to go? -- Trent Jarvi tjarvi at qbang.org From brian at mbari.org Mon Feb 6 14:57:50 2006 From: brian at mbari.org (Brian Schlining) Date: Mon, 6 Feb 2006 13:57:50 -0800 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> > The other thing we have not completed discussing is the directory > structure. There is interest in making rxtx more IDE friendly. I > get more mail about that off the list than how to install rxtx. > > And I see we have Ken Thompson in da house :) He is our trusted > CVS maintainer and the guy that purchased the rxtx.org domain. Old > community. We will need Ken for changing the directory structure of > source. > > I would like to open up discussion about both of these as it is > more than time. The problem is I have little experience with Ant > and even less with IDEs. It would be nice if we could work with > Eclipse and NetBeans. > > http://www.netbeans.org/ (sun and some community) > http://www.eclipes.org (ibm,rhat,... perhaps more community) > http://maven.apache.org/what-is-maven.html (apache. It is community) > borland should sortof be here too but I think thats covered in > eclipse. > >> From what I understand so far, we should morph rxtx to support >> those three > maybe trusting apaches lead with maven. But I use vi. I have > little to no clues beyond what people have fed me. > Maven likes the directory structure below for Java code. (From http:// maven.apache.org/guides/getting-started/index.html) This structure works fine with ant, netbeans, and eclipse. rxtx_root_directory `-- src |-- main | `-- java | `-- gnu | `-- io `-- test `-- java `-- gnu `-- io Brian Schlining Software Engineer http://www.mbari.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/d9451eba/attachment-0043.html From tjarvi at qbang.org Mon Feb 6 15:11:45 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 15:11:45 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: > rxtx_root_directory > `-- src > |-- main > | `-- java > | `-- gnu > | `-- io > `-- test > `-- java > `-- gnu > `-- io > >From what I understand this will just be good. For me it makes no difference. So lets do the rxtx thing. Let if fester for two weeks and if nobody objects, we will do it. I'm not doing this because I care. I'm doing this to eliminate much of my inbox. But test... man is rxtx lacking there in the community aspect. It is covered but not right. _maybe_ I can change that this year. -- Trent Jarvi tjarvi at qbang.org (cat hurding since 1997) From lux at diesel-research.com Mon Feb 6 21:38:49 2006 From: lux at diesel-research.com (Kim Lux) Date: Mon, 06 Feb 2006 21:38:49 -0700 Subject: [Rxtx] How can I use Lock Files with rxtx (in FC4) ? Message-ID: <1139287129.17031.3.camel@zd7280> I am now running an rxtx application on FC4. I am getting: ========================================================= check_group_uucp(): error testing lock file creation Error details: Permission denied check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL ========================================================= $ ls -al /var/lock total 32 drwxrwxr-x 4 root lock 4096 Feb 6 16:04 . drwxr-xr-x 24 root root 4096 Nov 14 01:19 .. drwx------ 2 root root 4096 Apr 27 2005 lvm drwxr-xr-x 2 root root 4096 Feb 6 16:04 subsys How do I fix this for regulator users ? -- Kim Lux, Diesel Research Inc. From dmarkman at mac.com Mon Feb 6 22:24:44 2006 From: dmarkman at mac.com (Dmitry Markman) Date: Tue, 7 Feb 2006 00:24:44 -0500 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: if I understands the issue right in order to be able to use ant for c/c++ compilation you have to install ant's cc task http://ant-contrib.sourceforge.net/cc.html it looks like it should work on mac os x (authors claim, that it's platform independent) but I never tested so all you have to do it's providing right command line for the gcc compiler On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: >> rxtx_root_directory >> `-- src >> |-- main >> | `-- java >> | `-- gnu >> | `-- io >> `-- test >> `-- java >> `-- gnu >> `-- io >> > > >> From what I understand this will just be good. > > For me it makes no difference. So lets do the rxtx thing. Let if > fester for two weeks and if nobody objects, we will do it. > > I'm not doing this because I care. I'm doing this to eliminate > much of my inbox. > > But test... man is rxtx lacking there in the community aspect. It > is covered but not right. _maybe_ I can change that this year. > > -- > Trent Jarvi > tjarvi at qbang.org > (cat hurding since 1997) > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx Dmitry Markman From lux at diesel-research.com Mon Feb 6 23:20:15 2006 From: lux at diesel-research.com (Kim Lux) Date: Mon, 06 Feb 2006 23:20:15 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? Message-ID: <1139293215.3689.4.camel@zd7280> I'm running the code below. portlist.hasMoreElements() is false. /dev has ports in it as listed below. What am I doing wrong ? ========================================================== // Step through the list of ports until we find one that matches // the one we are looking for. portList = CommPortIdentifier.getPortIdentifiers(); while(portList.hasMoreElements()) { portID = (CommPortIdentifier) portList.nextElement(); // if (portID.getName().equals("/dev/ttyUSB0")) { myTA.append("Serial port ttyUSB0 has been found\n"); break; }// if portID equals... }// End of while... ========================================================== ls -al /dev/tty* crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 ... crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 -- Kim Lux, Diesel Research Inc. From david.garnier at trusted-logic.com Tue Feb 7 00:46:30 2006 From: david.garnier at trusted-logic.com (David Garnier) Date: Tue, 07 Feb 2006 08:46:30 +0100 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: <43E85056.2090608@trusted-logic.com> Hello, I think that the make-based build process is fine as it is, apart from the location of the Java source files. It is true that putting the Java source in a directory structure that map 1-to-1 to the Java package structure is the norm and should make it easier for everyone to modify the Java source, with or without an IDE. Ant is a good tool, but in the RXTX case I fail to see the advantage of using it compared to the current make-based process. As Trent said, they are more pressing issues, like testing. Regards, David Dmitry Markman wrote: > if I understands the issue right > in order to be able to use ant for c/c++ compilation > you have to install ant's cc task > http://ant-contrib.sourceforge.net/cc.html > > it looks like it should work on mac os x > (authors claim, that it's platform independent) > but I never tested > > so all you have to do it's providing right command line > for the gcc compiler > > > > > On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: > >>> rxtx_root_directory >>> `-- src >>> |-- main >>> | `-- java >>> | `-- gnu >>> | `-- io >>> `-- test >>> `-- java >>> `-- gnu >>> `-- io >>> >> >> >>> From what I understand this will just be good. >> >> For me it makes no difference. So lets do the rxtx thing. Let if >> fester for two weeks and if nobody objects, we will do it. >> >> I'm not doing this because I care. I'm doing this to eliminate much >> of my inbox. >> >> But test... man is rxtx lacking there in the community aspect. It is >> covered but not right. _maybe_ I can change that this year. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> (cat hurding since 1997) From tjarvi at qbang.org Tue Feb 7 01:11:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 01:11:31 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <43E85056.2090608@trusted-logic.com> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: On Tue, 7 Feb 2006, David Garnier wrote: > Hello, > > I think that the make-based build process is fine as it is, apart from the location of the Java > source files. It is true that putting the Java source in a directory structure that map 1-to-1 to > the Java package structure is the norm and should make it easier for everyone to modify the Java > source, with or without an IDE. > > Ant is a good tool, but in the RXTX case I fail to see the advantage of using it compared to the > current make-based process. As Trent said, they are more pressing issues, like testing. > Hi David I have more experience with testing rxtx than I can talk about. But let it be known, rxtx has gone trough 100's of hours of testing. We are hobby folks interested in toys but there is more. rxtx has had some of the best guidance in the industry there. This is not an easy thing. I may be able to come back in a month from the other side of the corperate fence and help. I suspect the tests could just be made public but they are in a very unusual environment that just wont work in a wider sense. This is something I'll be trying to change. At one point it was agreed we could just make the results public so this isnt just noise.. There is interest and I think its safe to mention that much. The big problem with testing in the past is most of it is done with a loopback connection. So we *still* have major questions regarding things like flow control. rxtx talks to itself over a loopback and it works. regardless of right or wrong. This requires more thought to be done right. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Feb 7 02:46:34 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 02:46:34 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: > The big problem with testing in the past is most of it is done with a > loopback connection. So we *still* have major questions regarding things > like flow control. rxtx talks to itself over a loopback and it works. > regardless of right or wrong. With serial communication there are gold standards. ckermit is probably a definitive 'standard.' Maybe its possible to do ping/pong tests with ckermit? Is it scriptable? There are known issues in rxtx. Probably the worst is some threading issues regarding some JREs with multiple JNI threads setting java variables. Man did I get schooled there. Just switch the c functions to returning variables and things go away. Sometimes they work fine, sometimes they blow up. Without understanding everything, somehow rhat got it right and debian (and especially gentoo) grabbed kernel patches causing all sort of harm. Its not hard to fix once you understand whats going on but nearly impossible to track with a debugger. So I have a good idea what 2.1-8 will have outside of the IDE modifications. rxtx 2.1-7 is a release for everyone to sync with. Its not even as stable as -pre17 as far as I know - I ran no test suites. I'll be chasing it too. We just had so many contributions that it was time. It seriously broke internal scheduals but thats a great thing :) The other thing I want to do in 2.1-8 is automagic baud rates. It turns out lots of shops are doing really funky baud rates for things like automobile test equipment. It is possible but it requires a fair amount of change in the native code. Is anyone looking at this? -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Feb 7 02:57:21 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 07 Feb 2006 04:57:21 -0500 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <43E85056.2090608@trusted-logic.com> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: Hi All, I agree, testing is very important. The problem I have been trying to address is related to cross-platform testing and the robust nature of the installs. Typically, I visit 3 platforms to deploy my product, windows, linux and mac. A build is performed on each platform. The idea that you can build for many platforms from one copy the source code seems attractive. This should enable synchronized deployments of identical code. The question of how to achieve this goal remains open. As Trent mentioned, this is hard. Perhaps Ant will help here (but perhaps not). Ant does seem to help with running unit tests. However, it does not help with multi-platform tests. For that you need many machines and different operating environments. Toward that end, I have created a multi-platform test that can be run from web start, located at: http://show.docjava.com:8086/book/cgij/code/jnlp/serialPort.PortTest.jnlp This is interesting because many people in the community can run the test and we can improve the test, as time permits. No, it is not a perfect solution, however, the idea does help with multi-platform tests using many machines and different operating environments. If the group has a good test for a general serial port set-ups, i would be happy to deploy it, for general evaluation using web start. And as for ANT, it is just an idea. Not all my ideas are good ones! - Doug >Hello, > >I think that the make-based build process is fine as it is, apart >from the location of the Java >source files. It is true that putting the Java source in a directory >structure that map 1-to-1 to >the Java package structure is the norm and should make it easier for >everyone to modify the Java >source, with or without an IDE. > >Ant is a good tool, but in the RXTX case I fail to see the advantage >of using it compared to the >current make-based process. As Trent said, they are more pressing >issues, like testing. > >Regards, >David > >Dmitry Markman wrote: >> if I understands the issue right >> in order to be able to use ant for c/c++ compilation >> you have to install ant's cc task >> http://ant-contrib.sourceforge.net/cc.html >> >> it looks like it should work on mac os x >> (authors claim, that it's platform independent) >> but I never tested >> >> so all you have to do it's providing right command line >> for the gcc compiler >> >> >> >> >> On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: >> >>>> rxtx_root_directory >>>> `-- src >>>> |-- main >>>> | `-- java >>>> | `-- gnu >>>> | `-- io >>>> `-- test >>>> `-- java >>>> `-- gnu >>>> `-- io >>>> >>> >>> >>>> From what I understand this will just be good. >>> >>> For me it makes no difference. So lets do the rxtx thing. Let if >>> fester for two weeks and if nobody objects, we will do it. >>> >>> I'm not doing this because I care. I'm doing this to eliminate much >>> of my inbox. >>> >>> But test... man is rxtx lacking there in the community aspect. It is >>> covered but not right. _maybe_ I can change that this year. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> (cat hurding since 1997) > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From matt.higgins at gmail.com Tue Feb 7 08:28:34 2006 From: matt.higgins at gmail.com (Matt Higgins) Date: Tue, 7 Feb 2006 10:28:34 -0500 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final Message-ID: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? import java.io.*; import java.util.*; import gnu.io.*; public class MySimpleRead implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; public static void main(String[] args) { boolean portFound = false; String defaultPort = "COM1"; if (args.length > 0) { defaultPort = args[0]; } portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; MySimpleRead reader = new MySimpleRead(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } } public MySimpleRead() { try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) { e.printStackTrace(); } try { inputStream = serialPort.getInputStream(); } catch (IOException e) { e.printStackTrace(); } try { serialPort.addEventListener(this); } catch (TooManyListenersException e) { e.printStackTrace(); } try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { e.printStackTrace(); } System.out.println("Baud is " + serialPort.getBaudRate()); System.out.println("Bits is " + serialPort.getDataBits()); System.out.println("Stop is " + serialPort.getStopBits()); System.out.println("Par is " + serialPort.getParity()); serialPort.notifyOnDataAvailable(true); readThread = new Thread(this); readThread.start(); } public void run() { // Thread.sleep(20000); //} catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { System.out.println("An event occurred " + event.getEventType()); switch (event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: byte[] readBuffer = new byte[20]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } System.out.print(new String(readBuffer)); } catch (IOException e) {} break; } } } --------------- Result on windows ------------------------------ Stable Library ============================================================== Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port:: COM1 Baud is 9600 Bits is 8 Stop is 1 Par is 0 ----------------- End Results ----------------------------------------- ------------------ Result on Linux ----------------------------------- Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 Found port: /dev/ttyS0 Baud is 9600 Bits is 8 Stop is 1 Par is 0 An event occurred 1 043100066224 ------------------ End Results --------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/a1431630/attachment-0043.html From brian at mbari.org Tue Feb 7 09:48:37 2006 From: brian at mbari.org (Brian Schlining) Date: Tue, 7 Feb 2006 08:48:37 -0800 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> Message-ID: <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> Hi Matt > The following code works fine on Linux but I never see any data > when run on Windows. This is a cut and paste from the SimpleRead > example. > I am attempting to read data from a bar code scanner. I can fire > up HyperTermianl on windows and see that the device is working > properly as I see the barcodes are scanned and echoed back to the > terminal. However when I run the app I don't see any data. It is > however associating with the com port as the informational bits > print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. Cheers Brian Schlining Software Engineer http://www.mbari.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/16d07f37/attachment-0043.html From lux at diesel-research.com Tue Feb 7 11:59:58 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 11:59:58 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139293215.3689.4.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> Message-ID: <1139338798.8145.4.camel@zd7280> Any ideas on this ? Any reason why portList.hasMoreElements() should be false even though there are devices in /dev ? On Mon, 2006-02-06 at 23:20 -0700, Kim Lux wrote: > I'm running the code below. > > portlist.hasMoreElements() is false. > > /dev has ports in it as listed below. > > What am I doing wrong ? > > > ========================================================== > // Step through the list of ports until we find one that matches > // the one we are looking for. > > portList = CommPortIdentifier.getPortIdentifiers(); > > while(portList.hasMoreElements()) > { > portID = (CommPortIdentifier) portList.nextElement(); // > if (portID.getName().equals("/dev/ttyUSB0")) > { > myTA.append("Serial port ttyUSB0 has been found\n"); > break; > }// if portID equals... > }// End of while... > ========================================================== > > ls -al /dev/tty* > crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty > crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 > crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 > crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 > crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 > ... > crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 > crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 > crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 > > > -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 12:20:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 12:20:25 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139338798.8145.4.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> Message-ID: On Tue, 7 Feb 2006, Kim Lux wrote: > > Any ideas on this ? Any reason why portList.hasMoreElements() should be > false even though there are devices in /dev ? > > > On Mon, 2006-02-06 at 23:20 -0700, Kim Lux wrote: >> I'm running the code below. >> >> portlist.hasMoreElements() is false. >> >> /dev has ports in it as listed below. >> >> What am I doing wrong ? >> >> >> ========================================================== >> // Step through the list of ports until we find one that matches >> // the one we are looking for. >> >> portList = CommPortIdentifier.getPortIdentifiers(); >> >> while(portList.hasMoreElements()) >> { >> portID = (CommPortIdentifier) portList.nextElement(); // >> if (portID.getName().equals("/dev/ttyUSB0")) >> { >> myTA.append("Serial port ttyUSB0 has been found\n"); >> break; >> }// if portID equals... >> }// End of while... >> ========================================================== >> >> ls -al /dev/tty* >> crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty >> crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 >> crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 >> crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 >> crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 >> ... >> crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 >> crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 >> crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 >> >> >> > Hi Kim What rxtx does is try to open the port and do a timed out read. If the kernel/... do not complain it's enumarted. I suspect you could do a crude test by doing something like cat /dev/ttyS0 > /dev/null If that barfs then rxtx wont enumerate the port. hmm looking at your question again, I suspect it's a lockfile problem. This is documented in INSTALL with the source. Its easy enough to test this too.. touch /var/lock/testingrxtxlockfiles && rm -f /var/lock/testingrxtxlockfiles If you are not in the right group it will bail. Root will work regardless. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 12:37:56 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 12:37:56 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> Message-ID: <1139341076.8145.11.camel@zd7280> Exactly which ports does rxtx attempt to put into the list ? /dev/* or /dev/tty* or /dev/tty[0-9[0-9] ? or /dev/ttyS* ? For the record, only /dev/ttyUSB0 is a valid port on the machine I am presently on. Will this be a problem ? On Tue, 2006-02-07 at 12:20 -0700, Trent Jarvi wrote: > This is documented in INSTALL with the source. > I was wondering where that file was. I will download source and dig it up. Thanks. -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 12:51:09 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 12:51:09 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139341076.8145.11.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: On Tue, 7 Feb 2006, Kim Lux wrote: > > Exactly which ports does rxtx attempt to put into the list ? /dev/* > or /dev/tty* or /dev/tty[0-9[0-9] ? or /dev/ttyS* ? > > For the record, only /dev/ttyUSB0 is a valid port on the machine I am > presently on. Will this be a problem ? > > > On Tue, 2006-02-07 at 12:20 -0700, Trent Jarvi wrote: >> This is documented in INSTALL with the source. >> > I was wondering where that file was. I will download source and dig it > up. > > Thanks. > Hmm I'm looking at pre17 so this may have changed. (its just what I have on this machine) if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA" // for the IPAQs }; CandidatePortPrefixes=Temp; } So you may need to add "ttyUSB" to that list. RXTX used to enumerate _everything_ see if(osName.equals("Linux-all-ports") But it became less than practical. This is all in RXTXCommDriver.java hmm I just did a cvs update. if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have to get your fingers into the code. We aim for sane defaults. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 13:06:45 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 13:06:45 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139342805.8145.22.camel@zd7280> On Tue, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > Hmm I'm looking at pre17 so this may have changed. (its just what I have > on this machine) > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA" // for the IPAQs > }; > CandidatePortPrefixes=Temp; > } > > > So you may need to add "ttyUSB" to that list. RXTX used to enumerate > _everything_ see if(osName.equals("Linux-all-ports") But it became less > than practical. > > This is all in RXTXCommDriver.java > > hmm I just did a cvs update. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have > to get your fingers into the code. We aim for sane defaults. Excellent. Thanks for taking the time. -- Kim Lux, Diesel Research Inc. From ideiglenes1 at freemail.hu Tue Feb 7 13:53:39 2006 From: ideiglenes1 at freemail.hu (--) Date: Tue, 07 Feb 2006 21:53:39 +0100 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139345619.22534.2.camel@localhost> Hi! I use this code to get all the extra Linux devices. :) if ("Linux".equals(System.getProperty("os.name"))) { System.setProperty("os.name","Linux-all-ports"); } driver = new RXTXCommDriver(); On k, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > On Tue, 7 Feb 2006, Kim Lux wrote: > > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have > to get your fingers into the code. We aim for sane defaults. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From matt.higgins at gmail.com Tue Feb 7 13:45:54 2006 From: matt.higgins at gmail.com (Matt Higgins) Date: Tue, 7 Feb 2006 15:45:54 -0500 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> Message-ID: <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> Sweet this is exactly what I needed. I was searching the archives through marc.theamisgroup they only have archives back to 1/3/05. Should have hit the mailman archive! Thanks a lot! On 2/7/06, Brian Schlining wrote: > > Hi Matt > > The following code works fine on Linux but I never see any data when run > on Windows. This is a cut and paste from the SimpleRead example. > I am attempting to read data from a bar code scanner. I can fire up > HyperTermianl on windows and see that the device is working properly as I > see the barcodes are scanned and echoed back to the terminal. However when I > run the app I don't see any data. It is however associating with the com > port as the informational bits print fine? > > > You're not the only one whose had this problem, I don't know if Trent has > addressed this is the latest release of RXTX but there is a workaround. > Here's the recent thread from the RXTX mailing list regarding this issues: > > Thanasis Delenikas tdelenik at gmail.com > Wed Jan 18 13:56:23 MST 2006 > > * Previous message: [Rxtx] Re: More close() performance fixes > * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] > > Hi all. > (I've subscribed again from my other email account). > > Trent, > > You are right. Linux *always* works, no matter what flow control you set. > Windows *works only* with hardware flow control (I haven't tested what > happens with software XON/XOFF flow control). > > I assume (but I am not certain) that even with no flow control at all, all > platforms should work. Without flow control, you have the risk of bumping > into overflow or framing errors, but that's your (the end programmer, I > mean) problem. > > >From my side, I shouldn't be working without flow control. That was a bug > too... It was some code forgotten from the old times, when I used to work > with phone emulation drivers which didn't support flow control. The > correct > way is to have some flow control enabled and that's why I suppose this is > a > low-severity bug for RxTx. > > I have no idea which platform shows the correct behaviour, since > my knowledge about Linux and the inner workings of these low-level i/o > operations is limited. > > Regards, > Thanasis Delenikas. > > > > > Message: 2 > > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > > From: Trent Jarvi > > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > > To: RXTX Developers and Users > > Message-ID: > > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > > > Hi all, > > > > > > Trent, I have found something. > > > I read your comment about flow control, so I experimented a bit. > > > > > > If you remember, in my sample program I've used no flow control at all > ( > > i.e. > > > Java constant FLOWCONTROL_NONE). > > > > > > Now, during testing, I've switch to hardware inbound flow control (i.e > . > > Java > > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > > beautifully! > > > > > > I think I will switch to H/W flow control and test things for a while, > > but > > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > > > > > Hi Thanasis, > > > > I'm fairly sure you have identified a bug. I would not worry too much > > about what Sun CommAPI w32 defaults are. I think they did more or less > > whatever the port opened with. Just a guess. Linux tries to stomp on > > ports so they are all the same. > > > > So this started out with Linux worked, Windows XP/.. did not as I > recall. > > Something is wrong in rxtx. Do I understand this right? > > > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > > > Perhaps there is something Wayne or I did not understand when we wrote > > that code. I wasnt programming back in the BBS days so modems are not > my > > thing. I have a few questions. > > > > Is the above matrix confirmed by observation? > > Linux just always worked? > > Which one _should_ work? I'm guessing modems work with hardware flow > > control. I'll have to dig around. > > > > The windows flow control changes a couple things with hardware flow > > control. Following the w32 API documentation is confusing sometimes. > > But it looks like Linux could have a bug too. > > Cheers > > Brian Schlining > Software Engineer > http://www.mbari.org > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/9c989144/attachment-0043.html From tjarvi at qbang.org Tue Feb 7 14:06:14 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 14:06:14 -0700 (MST) Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> Message-ID: >> >> You're not the only one whose had this problem, I don't know if Trent has >> addressed this is the latest release of RXTX but there is a workaround. >> Here's the recent thread from the RXTX mailing list regarding this issues: >> I have not. I expect to have access to some test equipment next month and I'll go through all of this. I really don't know whats going on and I need a gold standard. I thought maybe linux was autodetecting the flow control. Your observations would certainly be welcome. I need to talk to Russell King and see what he is doing. Until then I'd just be toying around over a loopback as usual. This is very high on the list though. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 17:25:05 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 17:25:05 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139358305.17994.2.camel@zd7280> My application now works. I installed the libraries and jar from 2.1-7 (Final). portlist.hasMoreElements is no longer false. The application finds the port for /dev/ttyUSB0. Thanks for your help, Trent (et al) Sorry I bothered you with this. Next time I will look in the source first. I didn't think it was an rxtx issue, I thought it was a Linux setup issue . On Tue, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > Hmm I'm looking at pre17 so this may have changed. (its just what I > have > on this machine) > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux > Serial Ports > "ttySA" // for the > IPAQs > }; > > CandidatePortPrefixes=Temp; > } > > > So you may need to add "ttyUSB" to that list. RXTX used to enumerate > _everything_ see if(osName.equals("Linux-all-ports") But it became > less > than practical. > > This is all in RXTXCommDriver.java > > hmm I just did a cvs update. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux > Serial Ports > "ttySA", // for the > IPAQs > "ttyUSB" // for USB > frobs > }; > > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you > have > to get your fingers into the code. We aim for sane defaults. -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 19:21:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 19:21:54 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139358305.17994.2.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> <1139358305.17994.2.camel@zd7280> Message-ID: >Sorry I bothered you with this. Next time I will look in the source >first. I didn't think it was an rxtx issue, I thought it was a Linux >setup issue . Why would you be sorry? I would have done the same. I'm glad it's working :) -- Trent Jarvi tjarvi at qbang.org From tma at mail.island.net Wed Feb 8 13:39:35 2006 From: tma at mail.island.net (Tom Alldread) Date: Wed, 08 Feb 2006 12:39:35 -0800 Subject: [Rxtx] Win32/Linux Serial Port Data Dropouts In-Reply-To: <200602060702.k167255O007882@www.qbang.org> References: <200602060702.k167255O007882@www.qbang.org> Message-ID: <43EA5707.4020200@mail.island.net> Greetings Folks at RXTX: During the last couple of months I have been alternately testing with javax.comm 2 and RXTX 2.1 under Windows XP and CommApi 3 and RXTX 2.1 under Suse 10.0 Linux. In the process I have learned a little about java multi-threading under NetBeans 5 with Profiler. My java (jdk 1.5_06) application is used for data acquisition and provides a graphical display of A-D conversion data received from a 56KBaud serial port. The actual data throughput is about 10KBaud thus it is well below the speed of the port. I use hardware RTS/CTS flow control which can stall the data acquisition sample rate if necessary. This ensures the display computer has the ability to slow the data acquisition rate should it become too busy to accept the regular data flow. Both the serial port buffer and the java read buffer are set at 16KB. Usually the data transfers into the java read buffer are less than 100 bytes unless the data acquisition is recovering from a stall. The data flow normally hesitates after each 5 KB block as a continue command is needed from the display computer to start the drawing of a new graphics display line. Separate threads have been provided for the serial port event monitoring and data processing. The serial port event thread has been given the maximum priority and data processing thread the minimum priority provided by java. Thread yield statements have been placed within all data processing while/for loops as an effort to ensure quick access to CPU cycles for the serial port event thread. I have found that short data transmissions are essentially error free but occasional dropouts occur with continuous data flow especially under Windows XP. ....................................................................................................................................................................................... Linux results: I am happy to report that RXTX 2.1 appears to work very well under Linux although I did notice some errors when the screen savers were running with my dual monitors. I believe this is a local problem associated with my dual graphics which needs further attention. The recent CommApi 3 Linux release from Sun did not work at all with my program. It seemed to send commands out OK but did not receive any data. Although the serial port event triggered the ISR, the input stream appeared filled with nulls and thus did not contain any data. As my understanding is that CommApi 3 was tested with a Red Hat distribution of Linux I wonder if this problem is distro dependent? Although somewhat off topic here I wonder if anyone reading this has had similar experience? .................................................................................................................................................................................. Windows XP results: There are problems with occasional data dropouts which become more frequent as the sampling rate is increased or if the computer becomes busy with other duties. The dropouts typically consist of a half dozen byte block of lost data. It appears the lost bytes never get added to the java input stream. There has not been any indication of garbled data, overruns or framing errors which suggests the UART communications remains solid. Using javax.comm 2 I found that the setting of SerialPort 'enableReceiveThreshold' to 40 and 'enableReceiveTimeout' of 100mS reduced the dropouts error rate significantly. I found that I could not get RXTX 2.1 to function with the aforementioned threshold and timeout settings. The javax.comm 2 interface is consequently performing better for me under Windows than RXTX 2.1. I wonder if anyone here has any suggestions as to what I might try to improve RXTX 2.1? Although my settings are the same as under Suse 10.0, RXTX 2.1 performs much better for me under Linux than any of the alternatives that I have tried under Windows XP . ............................................................................................................................................................................... I would like to establish, based on the experience of others, if I have reached the normally expected performance limit of java serial port communications? Should I expect to achieve virtually error free serial port data input from a continuous stream under Windows XP java software? I am considering changing my protocol to packets with error checking if necessary but would like to know if the dropout problems I am experiencing are typical or not before I take this rather work intensive plunge. Many thanks in advance for any help! Best Regards, Tom Alldread -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.375 / Virus Database: 267.15.2/253 - Release Date: 2006-02-07 From jlaxson at mac.com Wed Feb 8 23:56:48 2006 From: jlaxson at mac.com (John Laxson) Date: Thu, 9 Feb 2006 00:56:48 -0600 Subject: [Rxtx] PortInUseException: Unknown Application on OSX Message-ID: Hi, I've been trying to get RXTX 2.1.7 going on Mac OS X for a while here, and am running up into a wall here. I've tried with pre- compiled and the source version and get the same problem, a gnu.io.PortInUseException: Unknown Application. I have run the fixperms script included with the source distribution, and id shows me as a member of the uucp group, and permissions on /var/spool/uucp are 775 root:uucp. Running a test program (included at the bottom for clarity) lets me enumerate all the serial ports correctly, but trying to open any of them gives the PortInUseException. If it helps, when I try to open a port that's set to make an outgoing bluetooth connection, there is no delay and no connection attempt at all. Thanks, John Laxson PS: The documentation wiki on qbang.org shows 404, and has for a few days now. My test code: public static void main(String[] args) { SerialPort serialPort; try { Enumeration e = CommPortIdentifier.getPortIdentifiers(); CommPortIdentifier ident; while (e.hasMoreElements()) { ident = (CommPortIdentifier)e.nextElement(); System.out.println(ident.getName()); } ident = CommPortIdentifier.getPortIdentifier("/dev/cu.modem"); serialPort = (SerialPort) ident.open("Me", 5000); } catch (Exception e) { e.printStackTrace(); } } From rajesh.invincible at gmail.com Thu Feb 9 03:39:38 2006 From: rajesh.invincible at gmail.com (Rajesh N) Date: Thu, 9 Feb 2006 16:09:38 +0530 Subject: [Rxtx] Re: Move .java Files in gnu.io filesystem hierarchy - Maven (2) In-Reply-To: <43DF21D2.7090200@ngi.it> References: <43DF21D2.7090200@ngi.it> Message-ID: <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Can anybody tell me how to overcome these EXCEPTIONS I AM WORKING ON SERIAL COMMN IN JAVA ON LINUX. 1. " NOT ALL PARAMETERS SUPPORTED BY THE KERNEL" This i came across the following statement inmy prog. SerialP is A SerialPort object SerialP.setSerialPortParams(9600(BAUDRATE),DATABITS_8,STOPBITS_1,PARITY_NONE) 2. NullPointer Exception at Event Dispatch Now i have checked all my object references for a null reference but i found none i have put up my entire code in try catch blocks but still I AM UNABLE TO CATCH THIS EXCEPTION AND HENCE MY APPLICATION CLOSES HOW DOES THESE GO? PLEASE HELP ME IT IS URGENTTTTTTTTTTTTTTTT yours sincerely RAJESH On 1/31/06, Fabio Frumento wrote: > Hi Xavier, > > I don't know maven at all but the directory hierarchy listed buy Trent > is fine for me... > > I'll take a look to maven, it seems an interesting project > > Regards > > Fabio Frumento > > Trent Jarvi wrote: > > On Tue, 31 Jan 2006, Xavier Frisaye wrote: > > > >> Hi all, > >> > >> If you are going to rearrange the src folder, i will propose to use > >> maven 2 and follow its directory structure > >> > (http://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html). > >> > >> Maven 2 simplify java project and give a standard way to make projects > >> (http://maven.apache.org/). > >> We are using it for internal projects and we are very satisfied. > >> > >> Is anybody interested? > >> > >> I'm not an expert in maven 2 (yet) but i'm agree to help using it if > >> you choose to make so. > >> > > > > so this would be: > > > > rxtx-devel/src/main/java/gnu.io > > rxtx-devel/src/test/java/ManIwish.java > > > > I don't use IDEs very much so I'll let others comment. But I don't see > > a problem with that. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Thu Feb 9 09:50:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 9 Feb 2006 09:50:31 -0700 (MST) Subject: [Rxtx] Re: Move .java Files in gnu.io filesystem hierarchy - Maven (2) In-Reply-To: <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Message-ID: On Thu, 9 Feb 2006, Rajesh N wrote: > Can anybody tell me how to overcome these EXCEPTIONS > I AM WORKING ON SERIAL COMMN IN JAVA ON LINUX. > > 1. " NOT ALL PARAMETERS SUPPORTED BY THE KERNEL" > > This i came across the following statement inmy prog. > SerialP is A SerialPort object > SerialP.setSerialPortParams(9600(BAUDRATE),DATABITS_8,STOPBITS_1,PARITY_NONE) > Strange. The parameters you use are the same the port should open with by default. Could you paste the actual exception you are getting? I don't see that in the rxtx source. Also it would help to know the rxtx version. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Fri Feb 10 15:29:05 2006 From: lux at diesel-research.com (Kim Lux) Date: Fri, 10 Feb 2006 15:29:05 -0700 Subject: [Rxtx] One serial port object for both sending and receiving ? Message-ID: <1139610545.18177.4.camel@zd7280> Is it OK to use one SerialPort ojbect (ex Serial Port serialPort;) and use it for both sending and receiving ? For example: ======================================================================== static SerialPort serialPort = null; static OutputStream serialOut = null; static InputStream serialIn = null; // assign it to an outputStream for use try{ serialOut = serialPort.getOutputStream(); System.out.println("Serial output stream has been assigned."); }//try catch(IOException e) { System.out.println("Error: Couldn't assign output stream to serial port."); }//catch //assign it to an inputStream for use try{ serialIn = serialPort.getInputStream(); System.out.println("Serial input stream has been assigned."); }//try catch(IOException e) { System.out.println("Error: Couldn't assign input stream to serial port."); }//catch ======================================================================== -- Kim Lux, Diesel Research Inc. From lux at diesel-research.com Fri Feb 10 21:23:00 2006 From: lux at diesel-research.com (Kim Lux) Date: Fri, 10 Feb 2006 21:23:00 -0700 Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Message-ID: <1139631780.23882.10.camel@zd7280> I've got a problem receiving chars with my version of serialRead, written in an SWT GUI. I had a Java pro have a good look at my code and he can't see anything wrong with it. I can send chars fine. When I receive a char the cpu usage for the app goes to 100% and the code in the serial event handler doesn't get executed. The instructions on the Java Comm Serial API How-To for Linux page state that I must install javacomm. Is that true ? Everything builds without it and I can send chars on rxtx just fine, but I can't receive them. Could this be the problem ? I downloaded and installed javacomm. I was not able to add "Driver=gnuio.RXTXCommDriver to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 installed in /usr/java/jre1.5.0_05. I added comm.jar to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext to the library paths. Is this OK ? Does it matter that I am receiving on /dev/ttyUSB0 ? Thanks. -- Kim Lux, Diesel Research Inc. From lunareclipse03 at web.de Sat Feb 11 09:44:46 2006 From: lunareclipse03 at web.de (lunareclipse03@web.de) Date: Sat, 11 Feb 2006 17:44:46 +0100 Subject: [Rxtx] Question about Serial I/O under Win32 Message-ID: <662084330@web.de> Hello everybody, I have a strange problem with a piece of code I made for myself. No, this is not really concerning rxtx, but nevertheless I post this to the list, hoping that some of you can help me. I've written two libraries, one for linux and one for win32. The linux port works quite well, I can send / receive faxes and / or replay voice messages over the telephone line using a voice modem. But the win32 port of the library causes some trouble. If, for example, I send out a fax with a certain modem under linux, it works well. The fax is complete when it comes out of the fax machine. If I then use the same modem to send out a fax under win32, the fax coming out of the fax machine gets "stuck" halfways, but the sending modem thinks that transmission was ok and drops the connection. The answering fax machine then gives me "error while receiving." The "upper layer" java code MUST be right, because if I do the same thing under linux (using the linux library), everything is alright. Now I have to ask: Can somebody please help me out with this??!? Could it be the case that some kind of flow control or COMMTIMEOUTS setting causes this behaviour? I set flow control to RTS/CTS before sending out a fax. How can I DISABLE flow control? Or what do you think? Can something else cause this problems? Thank you all for your time and PLEASE write back soon. Regards, --Sven Ahlemann Am Waldrand 31 45721 Haltern am See Germany ______________________________________________________________ Verschicken Sie romantische, coole und witzige Bilder per SMS! Jetzt bei WEB.DE FreeMail: http://f.web.de/?mc=021193 From lux at diesel-research.com Sat Feb 11 10:06:52 2006 From: lux at diesel-research.com (Kim Lux) Date: Sat, 11 Feb 2006 10:06:52 -0700 Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: <1139631780.23882.10.camel@zd7280> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> <1139631780.23882.10.camel@zd7280> Message-ID: <1139677612.3431.5.camel@zd7280> More on this problem. I copied and pasted simpleRead into a console based Eclipse project and I've got the same result, except that cpu usage doesn't go to 100%. I'm beginning to think there is an issue in rxtx. My imports for simpleRead are: ============================ import gnu.io.*; import java.util.*; //import javax.comm.*; import java.io.*; =========================== Any ideas ? I am trying to read from /dev/ttyUSB0 using a serial to USB adapter which has worked well with minicom and gtkterm. Thanks. On Fri, 2006-02-10 at 21:23 -0700, Kim Lux wrote: > I've got a problem receiving chars with my version of serialRead, > written in an SWT GUI. > > I had a Java pro have a good look at my code and he can't see anything > wrong with it. > > I can send chars fine. When I receive a char the cpu usage for the app > goes to 100% and the code in the serial event handler doesn't get > executed. > > The instructions on the Java Comm Serial API How-To for Linux page state > that I must install javacomm. Is that true ? Everything builds without > it and I can send chars on rxtx just fine, but I can't receive them. > Could this be the problem ? > > I downloaded and installed javacomm. I was not able to add > "Driver=gnuio.RXTXCommDriver > to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not > have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 > installed in /usr/java/jre1.5.0_05. I added comm.jar > to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext > to the library paths. Is this OK ? > > Does it matter that I am receiving on /dev/ttyUSB0 ? > > Thanks. > -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Sun Feb 12 21:01:33 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:01:33 -0700 (MST) Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: <1139677612.3431.5.camel@zd7280> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> <1139631780.23882.10.camel@zd7280> <1139677612.3431.5.camel@zd7280> Message-ID: I suspect what is happening is the select() is breaking out in the native code but the driver does not have support for notifying there are X bytes available. On some traditional Unix based systems, the only way you know data is available is the fd status changes and do an FIORDCHK ioctl. Or perhaps the only thing you can know is the fd status changed. It would take reading through the kernel driver code to know for sure. So on USB, depending upon the driver, the same may need to be done or the driver improved a bit if possible to support. Polling reads will also work but don't use the event driven model of CommAPI which isnt acceptable in the long run. The 100% cpu usage can then be explained because select no longer blocks until the data is read; the eventLoop spins loose. You can put a well placed sleep but rxtx only expects those are needed when it knows data is available. This may not be a super simple thing to understand and fix. I do have ideas to get you started. I'm going to be short on time the next couple weeks. I expect to put some good time in and answer some other questions I saw around the 25th. For now, I'd look at the following and go from there with the hints I've given. JNIEXPORT jint JNICALL RXTXPort(nativeavailable)( JNIEnv *env, jobject jobj ) { int fd = get_java_var( env, jobj,"fd","I" ); int result; /* char message[80]; ENTER( "RXTXPort:nativeavailable" ); On SCO OpenServer FIONREAD always fails for serial devices, so try ioctl FIORDCHK instead; will only tell us whether bytes are available, not how many, but better than nothing. This turns out to be true on Solaris also. taj. */ #ifdef FIORDCHK /* __unixware__ __sun__ probably others */ result = ioctl(fd, FIORDCHK, 0); #else if( ioctl( fd, FIONREAD, &result ) < 0 ) { goto fail; } #endif /* FIORDCHK */ On Sat, 11 Feb 2006, Kim Lux wrote: > > More on this problem. I copied and pasted simpleRead into a console > based Eclipse project and I've got the same result, except that cpu > usage doesn't go to 100%. I'm beginning to think there is an issue in > rxtx. > > My imports for simpleRead are: > > ============================ > import gnu.io.*; > import java.util.*; > //import javax.comm.*; > import java.io.*; > =========================== > > Any ideas ? I am trying to read from /dev/ttyUSB0 using a serial to > USB adapter which has worked well with minicom and gtkterm. > > Thanks. > > > > On Fri, 2006-02-10 at 21:23 -0700, Kim Lux wrote: >> I've got a problem receiving chars with my version of serialRead, >> written in an SWT GUI. >> >> I had a Java pro have a good look at my code and he can't see anything >> wrong with it. >> >> I can send chars fine. When I receive a char the cpu usage for the app >> goes to 100% and the code in the serial event handler doesn't get >> executed. >> >> The instructions on the Java Comm Serial API How-To for Linux page state >> that I must install javacomm. Is that true ? Everything builds without >> it and I can send chars on rxtx just fine, but I can't receive them. >> Could this be the problem ? >> >> I downloaded and installed javacomm. I was not able to add >> "Driver=gnuio.RXTXCommDriver >> to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not >> have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 >> installed in /usr/java/jre1.5.0_05. I added comm.jar >> to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext >> to the library paths. Is this OK ? >> >> Does it matter that I am receiving on /dev/ttyUSB0 ? >> >> Thanks. >> > From tjarvi at qbang.org Sun Feb 12 21:03:30 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:03:30 -0700 (MST) Subject: [Rxtx] One serial port object for both sending and receiving ? In-Reply-To: <1139610545.18177.4.camel@zd7280> References: <1139610545.18177.4.camel@zd7280> Message-ID: On Fri, 10 Feb 2006, Kim Lux wrote: > > Is it OK to use one SerialPort ojbect (ex Serial Port serialPort;) and > use it for both sending and receiving ? > > For example: > > ======================================================================== > static SerialPort serialPort = null; > static OutputStream serialOut = null; > static InputStream serialIn = null; > > > > > // assign it to an outputStream for use > try{ > serialOut = serialPort.getOutputStream(); > System.out.println("Serial output stream has been assigned."); > }//try > catch(IOException e) > { > System.out.println("Error: Couldn't assign output stream to serial > port."); > }//catch > > > //assign it to an inputStream for use > try{ > serialIn = serialPort.getInputStream(); > System.out.println("Serial input stream has been assigned."); > }//try > catch(IOException e) > { > System.out.println("Error: Couldn't assign input stream to serial > port."); > }//catch This should be fine. In fact trying to do it another way will probably not work as you will run into lockfile issues. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun Feb 12 21:13:13 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:13:13 -0700 (MST) Subject: [Rxtx] Question about Serial I/O under Win32 In-Reply-To: <662084330@web.de> References: <662084330@web.de> Message-ID: On Sat, 11 Feb 2006 lunareclipse03 at web.de wrote: > Hello everybody, > > I have a strange problem with a piece of code I made for myself. No, > this is not really concerning rxtx, but nevertheless I post this to the > list, hoping that some of you can help me. I've written two libraries, > one for linux and one for win32. The linux port works quite well, I can > send / receive faxes and / or replay voice messages over the telephone > line using a voice modem. But the win32 port of the library causes some > trouble. If, for example, I send out a fax with a certain modem under > linux, it works well. The fax is complete when it comes out of the fax > machine. If I then use the same modem to send out a fax under win32, the > fax coming out of the fax machine gets "stuck" halfways, but the sending > modem thinks that transmission was ok and drops the connection. The > answering fax machine then gives me "error while receiving." The "upper > layer" java code MUST be right, because if I do the same thing under > linux (using the linux library), everything is alright. Now I have to > ask: Can somebody please help me out with this??!? Could it be the case > that some kind of flow control or COMMTIMEOUTS setting causes this > behaviour? I set flow control to RTS/CTS before sending out a fax. How > can I DISABLE flow control? Or what do you think? Can something else > cause this problems? Thank you all for your time and PLEASE write back > soon. > Hi Sven I'm not too willing to talk about flow control at the low level until I confirm some things with test equipment later. It is not clear if you are using rxtx or writing your own native code. So I'm not sure how to answer much of this :) If you are wondering how to change the flow control using rxtx from java, The BlackBox example from Sun flips this back and forth. SerialPort.java in rxtx 2.1 uses the following: SerialPort.java: public static final int FLOWCONTROL_NONE =0; SerialPort.java: public static final int FLOWCONTROL_RTSCTS_IN =1; SerialPort.java: public static final int FLOWCONTROL_RTSCTS_OUT =2; SerialPort.java: public static final int FLOWCONTROL_XONXOFF_IN =4; SerialPort.java: public static final int FLOWCONTROL_XONXOFF_OUT=8; So if you set flowcontrol to RTSCTS, you can set it to NONE to turn it off. If you are looking for how to do it in native code, the rxtx Source is SerialImp.c (unix/linux/mac os x/w32) and termios.c (w32 only with SerialImp.c) You can track the code: SerialImp.c:JNIEXPORT void JNICALL RXTXPort(setflowcontrol)( JNIEnv *env, jobject jobj, jint flowmode ) termios.c:int tcgetattr( int fd, struct termios *s_termios ) termios.c:int tcsetattr( int fd, int when, struct termios *s_termios ) There may be a problem in the rxtx flow control code though. Rather than guess, I want to test this with a gold standard. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Feb 6 00:00:16 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 00:00:16 -0700 (MST) Subject: [Rxtx] wiki delay until tomorrow night. In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: On Sun, 5 Feb 2006, Trent Jarvi wrote: > On Sun, 5 Feb 2006, Kim Lux wrote: > >> usb ? Tell me more... I need that too. > > usb is a very proper design. Thats all it is. > Maybe rxtx could help usb. But it would start with helping bring back the community that was already there. It's not something I'd love to do but maybe its the right thing to do. It would probably take 2 years to do right. But maybe thats better than what we have now. I honestly don't know what IBM is doing which could just run over everything. Just some thoughts after some fine german wine. -- Trent Jarvi tjarvi at qbang.org From gadelavega at yahoo.com.ar Mon Feb 6 02:17:05 2006 From: gadelavega at yahoo.com.ar (Gonzalo A. de la Vega) Date: Mon, 06 Feb 2006 10:17:05 +0100 Subject: [Rxtx] Serial port ownership question In-Reply-To: References: <20060205113618.30274.qmail@web53501.mail.yahoo.com> <1139157422.4553.9.camel@zd7280> <1139158698.4936.9.camel@zd7280> Message-ID: <43E71411.4050402@yahoo.com.ar> On my Fedora Core 4: ls -l /dev/ttyS* crw-rw---- 1 root uucp 4, 64 Feb 6 2006 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Feb 6 2006 /dev/ttyS1 ... and: grep "ttyUSB" /etc/udev/rules.d/50-udev.rules KERNEL=="ttyUSB*", GROUP="uucp", MODE="0660" So anyone in the "uucp" group can use serial ports. On Gentoo the group is "tty". Trent Jarvi escribi?: > > > On Sun, 5 Feb 2006, Dr. Douglas Lyon wrote: > >> I can confirm that this is the case (only root ownership of >> serial ports, under fedora 4). >> Wow, what were they thinking?! >> - DL >> >>> I've found that the newer kernels have the serial ports owned by root. >>> For example, >>> >>> $ls -al /dev/tty* >>> crw-rw-rw- 1 root root 5, 0 Feb 5 02:06 /dev/tty >>> crw-rw---- 1 root root 4, 0 Feb 5 02:06 /dev/tty0 >>> crw------- 1 root root 4, 1 Feb 5 09:07 /dev/tty1 >>> crw-rw---- 1 root tty 4, 10 Feb 5 02:06 /dev/tty10 >>> crw-rw---- 1 root tty 4, 11 Feb 5 02:06 /dev/tty11 >>> ... > > > This is just not a problem jcp or such are going to solve. Its a > platform spitwad fight. But do look at pam. In fact thats what Sun > is doing too. Maybe Linux followed their lead.. I'm not a pam guy. > I've spent 16 hours trying to understand it but your users wont :) > > Solution? I have no clue. Its two tangent mentalities from my > perspective. > > -- > Trent Jarvi > tjarvi at qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mtnvega at yahoo.com.br Mon Feb 6 05:35:43 2006 From: mtnvega at yahoo.com.br (Luiz Jr) Date: Mon, 6 Feb 2006 12:35:43 +0000 (GMT) Subject: [Rxtx] Documentation Wiki In-Reply-To: <1139157422.4553.9.camel@zd7280> Message-ID: <20060206123543.57256.qmail@web53515.mail.yahoo.com> Hello, Thank you for you answer, but so the usage of the API is pretty much like the Java Communications Api? If yes, what version of the Java Comm Api? Thank you, Luiz A. Brandao Jr Kim Lux escreveu: On Sun, 2006-02-05 at 08:36 -0300, Luiz Jr wrote: > Hello, > > I want to start using the RXTX libraries, but I would to know how, > since I can not access the documentation wiki page I just started using them yesterday. Below is how I installed the libraries, if that helps. I used snippets of code from the SimpleWrite application here to get me going. http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html Instead of "import javax.comm.*;", use "import gnu.io.*;" which is gotten from RXTXcomm.jar, which you will need to include in your project references. I am working in Eclipse. BTW: there is no way to open a port without going through the port list and finding it. Maybe sometime in the future someone (me ?) will write a method called openSerialPort that allows the user to give a port identifier, such as "/dev/tty1" and return a port ready to use. It wouldn't take much to write that and it would save users a lot of code. Hope this helps. ======================================================================= 1) Figure out which java you are running, incase there is more than one installed. $ java -version java version "1.5.0_05" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_05-b05) Java HotSpot(TM) Client VM (build 1.5.0_05-b05, mixed mode, sharing) 2) Find all the jre directories and the one from which you are currently running. kfind (jre) 3) cd to that directory plus /lib/i386 cd /usr/java/jre1.5.0_05/lib/i386 4) Copy the library files (*.so) to that directory. cp /home/krlux/Desktop/'Java Controls'/rxtx-linux/bin/* . 5) Check that the copy was successful ls librxtx* librxtxI2C.so librxtxRaw.so librxtxSerial.so librxtxParallel.so librxtxRS485.so 6) cd to the /lib/ext directory for your java. cd /usr/java/jre1.5.0_05/lib/ext 7) Copy the Jar files there cp /home/krlux/Desktop/'Java Controls'/rxtx-linux/lib/ext/* . 8) Check that it was successful ls RXTX* RXTXcomm.jar Rxtx is now installed on your machine ready to use. =================================================================== -- Kim Lux, Diesel Research Inc. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx --------------------------------- Yahoo! Acesso Gr?tis - Internet r?pida e gr?tis. Instale o discador agora! -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/544aa403/attachment-0044.html From lyon at docjava.com Mon Feb 6 05:49:34 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 06 Feb 2006 07:49:34 -0500 Subject: [Rxtx] wiki delay until tomorrow night. In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: Hi All, I have often thought about USB drivers being needed. For example, the ironman watch will not interface to a mac (windows only). It is USB. My dymo label writer has no Java driver (native only). Etc. Most cheap web cameras are USB (and Java drivers go through JAI, if it supports the camera at all). The JAI code shows how sun did the USB drivers. You have to be a member of the jai project to download the source code. https://jai.dev.java.net has the jai distro. And then you are not allowed to redistribute it. However, we can all learn from it (if so inclined). Basically: cvs -d :pserver:lyon at cvs.dev.java.net:/cvs login cvs -d :pserver:lyon at cvs.dev.java.net:/cvs checkout jai-core You will need to user your own uid and pw to get in. The ant build has over 100 warnings from sun deprecations of its own code. You might say that they were hoisted on their own Picard ;) One interesting thing is that they support several platforms: linux-amd64 64-bit Linux-AMD64 linux-i586 32-bit Linux-x86 solaris-amd64 64-bit Solaris-AMD64 solaris-i586 32-bit Solaris-x86 solaris-sparc 32-bit Solaris-SPARC solaris-sparcv9 64-bit Solaris-SPARC windows-i586 32-bit Windows-x86 Thus, ant is used to provide a multi-platform native method distro. Neat. How do they do it? check this out: And: The core download does not contain any C source code (it was all pre-built). Basically, they are just copying .so and .dll files into build directories. I would love to see the C code for this...but Sun does not post it on the https://jai.dev.java.net site. I don't know why...Perhaps I missed it. - Doug >On Sun, 5 Feb 2006, Trent Jarvi wrote: > >>On Sun, 5 Feb 2006, Kim Lux wrote: >> >>>usb ? Tell me more... I need that too. >> >>usb is a very proper design. Thats all it is. >> > >Maybe rxtx could help usb. But it would start with helping bring >back the community that was already there. > >It's not something I'd love to do but maybe its the right thing to do. > >It would probably take 2 years to do right. But maybe thats better >than what we have now. > >I honestly don't know what IBM is doing which could just run over everything. > >Just some thoughts after some fine german wine. > >-- >Trent Jarvi >tjarvi at qbang.org > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tdelenik at gmail.com Mon Feb 6 05:56:32 2006 From: tdelenik at gmail.com (Thanasis Delenikas) Date: Mon, 6 Feb 2006 14:56:32 +0200 Subject: Fwd: [Rxtx] Documentation Wiki In-Reply-To: <1139157422.4553.9.camel@zd7280> References: <20060205113618.30274.qmail@web53501.mail.yahoo.com> <1139157422.4553.9.camel@zd7280> Message-ID: <310a1a930602060456t129f1dc6p5f2b908f13ab5a0b@mail.gmail.com> Hello all, Kim, this is a snippet from the code I use. The closest to directly opening a specific port without enumeration. << ... portId = CommPortIdentifier.getPortIdentifier(getPort()); serialPort = (SerialPort) portId.open("jSMSEngine", 1971); ... >> where getPort() return the string identifier of the port, i.e. "/dev/ttyS0" or "COM1" or whatever. Thanasis. ---------- Forwarded message ---------- From: Kim Lux Date: Feb 5, 2006 6:37 PM Subject: Re: [Rxtx] Documentation Wiki To: RXTX Developers and Users BTW: there is no way to open a port without going through the port list and finding it. Maybe sometime in the future someone (me ?) will write a method called openSerialPort that allows the user to give a port identifier, such as "/dev/tty1" and return a port ready to use. It wouldn't take much to write that and it would save users a lot of code. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/182ab5b8/attachment-0044.html From tjarvi at qbang.org Mon Feb 6 11:53:57 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 11:53:57 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: On Mon, 6 Feb 2006, Dr. Douglas Lyon wrote: > Hi All, > I have often thought about USB drivers being needed. > For example, the ironman watch will not interface > to a mac (windows only). It is USB. > My dymo label writer has no Java driver (native only). > Etc. > Most cheap web cameras are USB (and Java drivers go > through JAI, if it supports the camera at all). > The JAI code shows how sun did the USB drivers. > You have to be a member of the jai project to download > the source code. > https://jai.dev.java.net has the jai distro. > And then you are not allowed to redistribute it. However, > we can all learn from it (if so inclined). Basically: > cvs -d :pserver:lyon at cvs.dev.java.net:/cvs login > cvs -d :pserver:lyon at cvs.dev.java.net:/cvs checkout jai-core > You will need to user your own uid and pw to get in. > The ant build has over 100 warnings from sun deprecations > of its own code. > > You might say that they were hoisted on their own Picard ;) > > One interesting thing is that they support several platforms: > linux-amd64 64-bit Linux-AMD64 > linux-i586 32-bit Linux-x86 > solaris-amd64 64-bit Solaris-AMD64 > solaris-i586 32-bit Solaris-x86 > solaris-sparc 32-bit Solaris-SPARC > solaris-sparcv9 64-bit Solaris-SPARC > windows-i586 32-bit Windows-x86 > Thus, ant is used to provide a multi-platform native method distro. > Neat. > How do they do it? > check this out: > > > > > > > > > > > > > And: > > > > > > > > > > The core download does not contain any C source code (it was all pre-built). > Basically, they are just copying .so and .dll files into build directories. > > I would love to see the C code for this...but Sun does not post it on the > https://jai.dev.java.net site. > > I don't know why...Perhaps I missed it. > > - Doug > > I've looked at moving rxtx to Ant builds. I think that would help IDEs a great deal. I requested a evalutation desk copy the O'Reilly Ant book for some j2ee material I was teaching. http://www.oreilly.com/catalog/anttdg/ It has a one sentence mention of JNI. So there was not luck there. I saw that there is another Ant book that does mention JNI more. I can't find it now. Ant must be able to support it with extensions. http://ant.apache.org/manual/OptionalTasks/javah.html What the auto(break :) tools do in the rxtx build is 4 things really. 1) gcc compile flags 2) ld compile flags 3) config.h 4) compile flags for customizing rxtx (lockfiles, ...) See 1 All of this information except 4 can be static once obtained. So I'm not attached to the auto tools. If I could find an example of Ant being used for JNI code, I'd be one of the first to start moving that direction. Maybe someone saw an example someplace. The other thing we have not completed discussing is the directory structure. There is interest in making rxtx more IDE friendly. I get more mail about that off the list than how to install rxtx. And I see we have Ken Thompson in da house :) He is our trusted CVS maintainer and the guy that purchased the rxtx.org domain. Old community. We will need Ken for changing the directory structure of source. I would like to open up discussion about both of these as it is more than time. The problem is I have little experience with Ant and even less with IDEs. It would be nice if we could work with Eclipse and NetBeans. http://www.netbeans.org/ (sun and some community) http://www.eclipes.org (ibm,rhat,... perhaps more community) http://maven.apache.org/what-is-maven.html (apache. It is community) borland should sortof be here too but I think thats covered in eclipse. >From what I understand so far, we should morph rxtx to support those three maybe trusting apaches lead with maven. But I use vi. I have little to no clues beyond what people have fed me. Can we agree that thats the right direction to go? -- Trent Jarvi tjarvi at qbang.org From brian at mbari.org Mon Feb 6 14:57:50 2006 From: brian at mbari.org (Brian Schlining) Date: Mon, 6 Feb 2006 13:57:50 -0800 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> > The other thing we have not completed discussing is the directory > structure. There is interest in making rxtx more IDE friendly. I > get more mail about that off the list than how to install rxtx. > > And I see we have Ken Thompson in da house :) He is our trusted > CVS maintainer and the guy that purchased the rxtx.org domain. Old > community. We will need Ken for changing the directory structure of > source. > > I would like to open up discussion about both of these as it is > more than time. The problem is I have little experience with Ant > and even less with IDEs. It would be nice if we could work with > Eclipse and NetBeans. > > http://www.netbeans.org/ (sun and some community) > http://www.eclipes.org (ibm,rhat,... perhaps more community) > http://maven.apache.org/what-is-maven.html (apache. It is community) > borland should sortof be here too but I think thats covered in > eclipse. > >> From what I understand so far, we should morph rxtx to support >> those three > maybe trusting apaches lead with maven. But I use vi. I have > little to no clues beyond what people have fed me. > Maven likes the directory structure below for Java code. (From http:// maven.apache.org/guides/getting-started/index.html) This structure works fine with ant, netbeans, and eclipse. rxtx_root_directory `-- src |-- main | `-- java | `-- gnu | `-- io `-- test `-- java `-- gnu `-- io Brian Schlining Software Engineer http://www.mbari.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/d9451eba/attachment-0044.html From tjarvi at qbang.org Mon Feb 6 15:11:45 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 15:11:45 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: > rxtx_root_directory > `-- src > |-- main > | `-- java > | `-- gnu > | `-- io > `-- test > `-- java > `-- gnu > `-- io > >From what I understand this will just be good. For me it makes no difference. So lets do the rxtx thing. Let if fester for two weeks and if nobody objects, we will do it. I'm not doing this because I care. I'm doing this to eliminate much of my inbox. But test... man is rxtx lacking there in the community aspect. It is covered but not right. _maybe_ I can change that this year. -- Trent Jarvi tjarvi at qbang.org (cat hurding since 1997) From lux at diesel-research.com Mon Feb 6 21:38:49 2006 From: lux at diesel-research.com (Kim Lux) Date: Mon, 06 Feb 2006 21:38:49 -0700 Subject: [Rxtx] How can I use Lock Files with rxtx (in FC4) ? Message-ID: <1139287129.17031.3.camel@zd7280> I am now running an rxtx application on FC4. I am getting: ========================================================= check_group_uucp(): error testing lock file creation Error details: Permission denied check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL ========================================================= $ ls -al /var/lock total 32 drwxrwxr-x 4 root lock 4096 Feb 6 16:04 . drwxr-xr-x 24 root root 4096 Nov 14 01:19 .. drwx------ 2 root root 4096 Apr 27 2005 lvm drwxr-xr-x 2 root root 4096 Feb 6 16:04 subsys How do I fix this for regulator users ? -- Kim Lux, Diesel Research Inc. From dmarkman at mac.com Mon Feb 6 22:24:44 2006 From: dmarkman at mac.com (Dmitry Markman) Date: Tue, 7 Feb 2006 00:24:44 -0500 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: if I understands the issue right in order to be able to use ant for c/c++ compilation you have to install ant's cc task http://ant-contrib.sourceforge.net/cc.html it looks like it should work on mac os x (authors claim, that it's platform independent) but I never tested so all you have to do it's providing right command line for the gcc compiler On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: >> rxtx_root_directory >> `-- src >> |-- main >> | `-- java >> | `-- gnu >> | `-- io >> `-- test >> `-- java >> `-- gnu >> `-- io >> > > >> From what I understand this will just be good. > > For me it makes no difference. So lets do the rxtx thing. Let if > fester for two weeks and if nobody objects, we will do it. > > I'm not doing this because I care. I'm doing this to eliminate > much of my inbox. > > But test... man is rxtx lacking there in the community aspect. It > is covered but not right. _maybe_ I can change that this year. > > -- > Trent Jarvi > tjarvi at qbang.org > (cat hurding since 1997) > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx Dmitry Markman From lux at diesel-research.com Mon Feb 6 23:20:15 2006 From: lux at diesel-research.com (Kim Lux) Date: Mon, 06 Feb 2006 23:20:15 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? Message-ID: <1139293215.3689.4.camel@zd7280> I'm running the code below. portlist.hasMoreElements() is false. /dev has ports in it as listed below. What am I doing wrong ? ========================================================== // Step through the list of ports until we find one that matches // the one we are looking for. portList = CommPortIdentifier.getPortIdentifiers(); while(portList.hasMoreElements()) { portID = (CommPortIdentifier) portList.nextElement(); // if (portID.getName().equals("/dev/ttyUSB0")) { myTA.append("Serial port ttyUSB0 has been found\n"); break; }// if portID equals... }// End of while... ========================================================== ls -al /dev/tty* crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 ... crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 -- Kim Lux, Diesel Research Inc. From david.garnier at trusted-logic.com Tue Feb 7 00:46:30 2006 From: david.garnier at trusted-logic.com (David Garnier) Date: Tue, 07 Feb 2006 08:46:30 +0100 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: <43E85056.2090608@trusted-logic.com> Hello, I think that the make-based build process is fine as it is, apart from the location of the Java source files. It is true that putting the Java source in a directory structure that map 1-to-1 to the Java package structure is the norm and should make it easier for everyone to modify the Java source, with or without an IDE. Ant is a good tool, but in the RXTX case I fail to see the advantage of using it compared to the current make-based process. As Trent said, they are more pressing issues, like testing. Regards, David Dmitry Markman wrote: > if I understands the issue right > in order to be able to use ant for c/c++ compilation > you have to install ant's cc task > http://ant-contrib.sourceforge.net/cc.html > > it looks like it should work on mac os x > (authors claim, that it's platform independent) > but I never tested > > so all you have to do it's providing right command line > for the gcc compiler > > > > > On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: > >>> rxtx_root_directory >>> `-- src >>> |-- main >>> | `-- java >>> | `-- gnu >>> | `-- io >>> `-- test >>> `-- java >>> `-- gnu >>> `-- io >>> >> >> >>> From what I understand this will just be good. >> >> For me it makes no difference. So lets do the rxtx thing. Let if >> fester for two weeks and if nobody objects, we will do it. >> >> I'm not doing this because I care. I'm doing this to eliminate much >> of my inbox. >> >> But test... man is rxtx lacking there in the community aspect. It is >> covered but not right. _maybe_ I can change that this year. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> (cat hurding since 1997) From tjarvi at qbang.org Tue Feb 7 01:11:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 01:11:31 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <43E85056.2090608@trusted-logic.com> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: On Tue, 7 Feb 2006, David Garnier wrote: > Hello, > > I think that the make-based build process is fine as it is, apart from the location of the Java > source files. It is true that putting the Java source in a directory structure that map 1-to-1 to > the Java package structure is the norm and should make it easier for everyone to modify the Java > source, with or without an IDE. > > Ant is a good tool, but in the RXTX case I fail to see the advantage of using it compared to the > current make-based process. As Trent said, they are more pressing issues, like testing. > Hi David I have more experience with testing rxtx than I can talk about. But let it be known, rxtx has gone trough 100's of hours of testing. We are hobby folks interested in toys but there is more. rxtx has had some of the best guidance in the industry there. This is not an easy thing. I may be able to come back in a month from the other side of the corperate fence and help. I suspect the tests could just be made public but they are in a very unusual environment that just wont work in a wider sense. This is something I'll be trying to change. At one point it was agreed we could just make the results public so this isnt just noise.. There is interest and I think its safe to mention that much. The big problem with testing in the past is most of it is done with a loopback connection. So we *still* have major questions regarding things like flow control. rxtx talks to itself over a loopback and it works. regardless of right or wrong. This requires more thought to be done right. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Feb 7 02:46:34 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 02:46:34 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: > The big problem with testing in the past is most of it is done with a > loopback connection. So we *still* have major questions regarding things > like flow control. rxtx talks to itself over a loopback and it works. > regardless of right or wrong. With serial communication there are gold standards. ckermit is probably a definitive 'standard.' Maybe its possible to do ping/pong tests with ckermit? Is it scriptable? There are known issues in rxtx. Probably the worst is some threading issues regarding some JREs with multiple JNI threads setting java variables. Man did I get schooled there. Just switch the c functions to returning variables and things go away. Sometimes they work fine, sometimes they blow up. Without understanding everything, somehow rhat got it right and debian (and especially gentoo) grabbed kernel patches causing all sort of harm. Its not hard to fix once you understand whats going on but nearly impossible to track with a debugger. So I have a good idea what 2.1-8 will have outside of the IDE modifications. rxtx 2.1-7 is a release for everyone to sync with. Its not even as stable as -pre17 as far as I know - I ran no test suites. I'll be chasing it too. We just had so many contributions that it was time. It seriously broke internal scheduals but thats a great thing :) The other thing I want to do in 2.1-8 is automagic baud rates. It turns out lots of shops are doing really funky baud rates for things like automobile test equipment. It is possible but it requires a fair amount of change in the native code. Is anyone looking at this? -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Feb 7 02:57:21 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 07 Feb 2006 04:57:21 -0500 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <43E85056.2090608@trusted-logic.com> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: Hi All, I agree, testing is very important. The problem I have been trying to address is related to cross-platform testing and the robust nature of the installs. Typically, I visit 3 platforms to deploy my product, windows, linux and mac. A build is performed on each platform. The idea that you can build for many platforms from one copy the source code seems attractive. This should enable synchronized deployments of identical code. The question of how to achieve this goal remains open. As Trent mentioned, this is hard. Perhaps Ant will help here (but perhaps not). Ant does seem to help with running unit tests. However, it does not help with multi-platform tests. For that you need many machines and different operating environments. Toward that end, I have created a multi-platform test that can be run from web start, located at: http://show.docjava.com:8086/book/cgij/code/jnlp/serialPort.PortTest.jnlp This is interesting because many people in the community can run the test and we can improve the test, as time permits. No, it is not a perfect solution, however, the idea does help with multi-platform tests using many machines and different operating environments. If the group has a good test for a general serial port set-ups, i would be happy to deploy it, for general evaluation using web start. And as for ANT, it is just an idea. Not all my ideas are good ones! - Doug >Hello, > >I think that the make-based build process is fine as it is, apart >from the location of the Java >source files. It is true that putting the Java source in a directory >structure that map 1-to-1 to >the Java package structure is the norm and should make it easier for >everyone to modify the Java >source, with or without an IDE. > >Ant is a good tool, but in the RXTX case I fail to see the advantage >of using it compared to the >current make-based process. As Trent said, they are more pressing >issues, like testing. > >Regards, >David > >Dmitry Markman wrote: >> if I understands the issue right >> in order to be able to use ant for c/c++ compilation >> you have to install ant's cc task >> http://ant-contrib.sourceforge.net/cc.html >> >> it looks like it should work on mac os x >> (authors claim, that it's platform independent) >> but I never tested >> >> so all you have to do it's providing right command line >> for the gcc compiler >> >> >> >> >> On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: >> >>>> rxtx_root_directory >>>> `-- src >>>> |-- main >>>> | `-- java >>>> | `-- gnu >>>> | `-- io >>>> `-- test >>>> `-- java >>>> `-- gnu >>>> `-- io >>>> >>> >>> >>>> From what I understand this will just be good. >>> >>> For me it makes no difference. So lets do the rxtx thing. Let if >>> fester for two weeks and if nobody objects, we will do it. >>> >>> I'm not doing this because I care. I'm doing this to eliminate much >>> of my inbox. >>> >>> But test... man is rxtx lacking there in the community aspect. It is >>> covered but not right. _maybe_ I can change that this year. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> (cat hurding since 1997) > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From matt.higgins at gmail.com Tue Feb 7 08:28:34 2006 From: matt.higgins at gmail.com (Matt Higgins) Date: Tue, 7 Feb 2006 10:28:34 -0500 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final Message-ID: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? import java.io.*; import java.util.*; import gnu.io.*; public class MySimpleRead implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; public static void main(String[] args) { boolean portFound = false; String defaultPort = "COM1"; if (args.length > 0) { defaultPort = args[0]; } portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; MySimpleRead reader = new MySimpleRead(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } } public MySimpleRead() { try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) { e.printStackTrace(); } try { inputStream = serialPort.getInputStream(); } catch (IOException e) { e.printStackTrace(); } try { serialPort.addEventListener(this); } catch (TooManyListenersException e) { e.printStackTrace(); } try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { e.printStackTrace(); } System.out.println("Baud is " + serialPort.getBaudRate()); System.out.println("Bits is " + serialPort.getDataBits()); System.out.println("Stop is " + serialPort.getStopBits()); System.out.println("Par is " + serialPort.getParity()); serialPort.notifyOnDataAvailable(true); readThread = new Thread(this); readThread.start(); } public void run() { // Thread.sleep(20000); //} catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { System.out.println("An event occurred " + event.getEventType()); switch (event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: byte[] readBuffer = new byte[20]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } System.out.print(new String(readBuffer)); } catch (IOException e) {} break; } } } --------------- Result on windows ------------------------------ Stable Library ============================================================== Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port:: COM1 Baud is 9600 Bits is 8 Stop is 1 Par is 0 ----------------- End Results ----------------------------------------- ------------------ Result on Linux ----------------------------------- Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 Found port: /dev/ttyS0 Baud is 9600 Bits is 8 Stop is 1 Par is 0 An event occurred 1 043100066224 ------------------ End Results --------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/a1431630/attachment-0044.html From brian at mbari.org Tue Feb 7 09:48:37 2006 From: brian at mbari.org (Brian Schlining) Date: Tue, 7 Feb 2006 08:48:37 -0800 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> Message-ID: <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> Hi Matt > The following code works fine on Linux but I never see any data > when run on Windows. This is a cut and paste from the SimpleRead > example. > I am attempting to read data from a bar code scanner. I can fire > up HyperTermianl on windows and see that the device is working > properly as I see the barcodes are scanned and echoed back to the > terminal. However when I run the app I don't see any data. It is > however associating with the com port as the informational bits > print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. Cheers Brian Schlining Software Engineer http://www.mbari.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/16d07f37/attachment-0044.html From lux at diesel-research.com Tue Feb 7 11:59:58 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 11:59:58 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139293215.3689.4.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> Message-ID: <1139338798.8145.4.camel@zd7280> Any ideas on this ? Any reason why portList.hasMoreElements() should be false even though there are devices in /dev ? On Mon, 2006-02-06 at 23:20 -0700, Kim Lux wrote: > I'm running the code below. > > portlist.hasMoreElements() is false. > > /dev has ports in it as listed below. > > What am I doing wrong ? > > > ========================================================== > // Step through the list of ports until we find one that matches > // the one we are looking for. > > portList = CommPortIdentifier.getPortIdentifiers(); > > while(portList.hasMoreElements()) > { > portID = (CommPortIdentifier) portList.nextElement(); // > if (portID.getName().equals("/dev/ttyUSB0")) > { > myTA.append("Serial port ttyUSB0 has been found\n"); > break; > }// if portID equals... > }// End of while... > ========================================================== > > ls -al /dev/tty* > crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty > crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 > crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 > crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 > crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 > ... > crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 > crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 > crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 > > > -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 12:20:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 12:20:25 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139338798.8145.4.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> Message-ID: On Tue, 7 Feb 2006, Kim Lux wrote: > > Any ideas on this ? Any reason why portList.hasMoreElements() should be > false even though there are devices in /dev ? > > > On Mon, 2006-02-06 at 23:20 -0700, Kim Lux wrote: >> I'm running the code below. >> >> portlist.hasMoreElements() is false. >> >> /dev has ports in it as listed below. >> >> What am I doing wrong ? >> >> >> ========================================================== >> // Step through the list of ports until we find one that matches >> // the one we are looking for. >> >> portList = CommPortIdentifier.getPortIdentifiers(); >> >> while(portList.hasMoreElements()) >> { >> portID = (CommPortIdentifier) portList.nextElement(); // >> if (portID.getName().equals("/dev/ttyUSB0")) >> { >> myTA.append("Serial port ttyUSB0 has been found\n"); >> break; >> }// if portID equals... >> }// End of while... >> ========================================================== >> >> ls -al /dev/tty* >> crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty >> crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 >> crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 >> crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 >> crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 >> ... >> crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 >> crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 >> crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 >> >> >> > Hi Kim What rxtx does is try to open the port and do a timed out read. If the kernel/... do not complain it's enumarted. I suspect you could do a crude test by doing something like cat /dev/ttyS0 > /dev/null If that barfs then rxtx wont enumerate the port. hmm looking at your question again, I suspect it's a lockfile problem. This is documented in INSTALL with the source. Its easy enough to test this too.. touch /var/lock/testingrxtxlockfiles && rm -f /var/lock/testingrxtxlockfiles If you are not in the right group it will bail. Root will work regardless. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 12:37:56 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 12:37:56 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> Message-ID: <1139341076.8145.11.camel@zd7280> Exactly which ports does rxtx attempt to put into the list ? /dev/* or /dev/tty* or /dev/tty[0-9[0-9] ? or /dev/ttyS* ? For the record, only /dev/ttyUSB0 is a valid port on the machine I am presently on. Will this be a problem ? On Tue, 2006-02-07 at 12:20 -0700, Trent Jarvi wrote: > This is documented in INSTALL with the source. > I was wondering where that file was. I will download source and dig it up. Thanks. -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 12:51:09 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 12:51:09 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139341076.8145.11.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: On Tue, 7 Feb 2006, Kim Lux wrote: > > Exactly which ports does rxtx attempt to put into the list ? /dev/* > or /dev/tty* or /dev/tty[0-9[0-9] ? or /dev/ttyS* ? > > For the record, only /dev/ttyUSB0 is a valid port on the machine I am > presently on. Will this be a problem ? > > > On Tue, 2006-02-07 at 12:20 -0700, Trent Jarvi wrote: >> This is documented in INSTALL with the source. >> > I was wondering where that file was. I will download source and dig it > up. > > Thanks. > Hmm I'm looking at pre17 so this may have changed. (its just what I have on this machine) if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA" // for the IPAQs }; CandidatePortPrefixes=Temp; } So you may need to add "ttyUSB" to that list. RXTX used to enumerate _everything_ see if(osName.equals("Linux-all-ports") But it became less than practical. This is all in RXTXCommDriver.java hmm I just did a cvs update. if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have to get your fingers into the code. We aim for sane defaults. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 13:06:45 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 13:06:45 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139342805.8145.22.camel@zd7280> On Tue, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > Hmm I'm looking at pre17 so this may have changed. (its just what I have > on this machine) > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA" // for the IPAQs > }; > CandidatePortPrefixes=Temp; > } > > > So you may need to add "ttyUSB" to that list. RXTX used to enumerate > _everything_ see if(osName.equals("Linux-all-ports") But it became less > than practical. > > This is all in RXTXCommDriver.java > > hmm I just did a cvs update. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have > to get your fingers into the code. We aim for sane defaults. Excellent. Thanks for taking the time. -- Kim Lux, Diesel Research Inc. From ideiglenes1 at freemail.hu Tue Feb 7 13:53:39 2006 From: ideiglenes1 at freemail.hu (--) Date: Tue, 07 Feb 2006 21:53:39 +0100 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139345619.22534.2.camel@localhost> Hi! I use this code to get all the extra Linux devices. :) if ("Linux".equals(System.getProperty("os.name"))) { System.setProperty("os.name","Linux-all-ports"); } driver = new RXTXCommDriver(); On k, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > On Tue, 7 Feb 2006, Kim Lux wrote: > > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have > to get your fingers into the code. We aim for sane defaults. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From matt.higgins at gmail.com Tue Feb 7 13:45:54 2006 From: matt.higgins at gmail.com (Matt Higgins) Date: Tue, 7 Feb 2006 15:45:54 -0500 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> Message-ID: <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> Sweet this is exactly what I needed. I was searching the archives through marc.theamisgroup they only have archives back to 1/3/05. Should have hit the mailman archive! Thanks a lot! On 2/7/06, Brian Schlining wrote: > > Hi Matt > > The following code works fine on Linux but I never see any data when run > on Windows. This is a cut and paste from the SimpleRead example. > I am attempting to read data from a bar code scanner. I can fire up > HyperTermianl on windows and see that the device is working properly as I > see the barcodes are scanned and echoed back to the terminal. However when I > run the app I don't see any data. It is however associating with the com > port as the informational bits print fine? > > > You're not the only one whose had this problem, I don't know if Trent has > addressed this is the latest release of RXTX but there is a workaround. > Here's the recent thread from the RXTX mailing list regarding this issues: > > Thanasis Delenikas tdelenik at gmail.com > Wed Jan 18 13:56:23 MST 2006 > > * Previous message: [Rxtx] Re: More close() performance fixes > * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] > > Hi all. > (I've subscribed again from my other email account). > > Trent, > > You are right. Linux *always* works, no matter what flow control you set. > Windows *works only* with hardware flow control (I haven't tested what > happens with software XON/XOFF flow control). > > I assume (but I am not certain) that even with no flow control at all, all > platforms should work. Without flow control, you have the risk of bumping > into overflow or framing errors, but that's your (the end programmer, I > mean) problem. > > >From my side, I shouldn't be working without flow control. That was a bug > too... It was some code forgotten from the old times, when I used to work > with phone emulation drivers which didn't support flow control. The > correct > way is to have some flow control enabled and that's why I suppose this is > a > low-severity bug for RxTx. > > I have no idea which platform shows the correct behaviour, since > my knowledge about Linux and the inner workings of these low-level i/o > operations is limited. > > Regards, > Thanasis Delenikas. > > > > > Message: 2 > > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > > From: Trent Jarvi > > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > > To: RXTX Developers and Users > > Message-ID: > > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > > > Hi all, > > > > > > Trent, I have found something. > > > I read your comment about flow control, so I experimented a bit. > > > > > > If you remember, in my sample program I've used no flow control at all > ( > > i.e. > > > Java constant FLOWCONTROL_NONE). > > > > > > Now, during testing, I've switch to hardware inbound flow control (i.e > . > > Java > > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > > beautifully! > > > > > > I think I will switch to H/W flow control and test things for a while, > > but > > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > > > > > Hi Thanasis, > > > > I'm fairly sure you have identified a bug. I would not worry too much > > about what Sun CommAPI w32 defaults are. I think they did more or less > > whatever the port opened with. Just a guess. Linux tries to stomp on > > ports so they are all the same. > > > > So this started out with Linux worked, Windows XP/.. did not as I > recall. > > Something is wrong in rxtx. Do I understand this right? > > > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > > > Perhaps there is something Wayne or I did not understand when we wrote > > that code. I wasnt programming back in the BBS days so modems are not > my > > thing. I have a few questions. > > > > Is the above matrix confirmed by observation? > > Linux just always worked? > > Which one _should_ work? I'm guessing modems work with hardware flow > > control. I'll have to dig around. > > > > The windows flow control changes a couple things with hardware flow > > control. Following the w32 API documentation is confusing sometimes. > > But it looks like Linux could have a bug too. > > Cheers > > Brian Schlining > Software Engineer > http://www.mbari.org > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/9c989144/attachment-0044.html From tjarvi at qbang.org Tue Feb 7 14:06:14 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 14:06:14 -0700 (MST) Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> Message-ID: >> >> You're not the only one whose had this problem, I don't know if Trent has >> addressed this is the latest release of RXTX but there is a workaround. >> Here's the recent thread from the RXTX mailing list regarding this issues: >> I have not. I expect to have access to some test equipment next month and I'll go through all of this. I really don't know whats going on and I need a gold standard. I thought maybe linux was autodetecting the flow control. Your observations would certainly be welcome. I need to talk to Russell King and see what he is doing. Until then I'd just be toying around over a loopback as usual. This is very high on the list though. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 17:25:05 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 17:25:05 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139358305.17994.2.camel@zd7280> My application now works. I installed the libraries and jar from 2.1-7 (Final). portlist.hasMoreElements is no longer false. The application finds the port for /dev/ttyUSB0. Thanks for your help, Trent (et al) Sorry I bothered you with this. Next time I will look in the source first. I didn't think it was an rxtx issue, I thought it was a Linux setup issue . On Tue, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > Hmm I'm looking at pre17 so this may have changed. (its just what I > have > on this machine) > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux > Serial Ports > "ttySA" // for the > IPAQs > }; > > CandidatePortPrefixes=Temp; > } > > > So you may need to add "ttyUSB" to that list. RXTX used to enumerate > _everything_ see if(osName.equals("Linux-all-ports") But it became > less > than practical. > > This is all in RXTXCommDriver.java > > hmm I just did a cvs update. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux > Serial Ports > "ttySA", // for the > IPAQs > "ttyUSB" // for USB > frobs > }; > > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you > have > to get your fingers into the code. We aim for sane defaults. -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 19:21:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 19:21:54 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139358305.17994.2.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> <1139358305.17994.2.camel@zd7280> Message-ID: >Sorry I bothered you with this. Next time I will look in the source >first. I didn't think it was an rxtx issue, I thought it was a Linux >setup issue . Why would you be sorry? I would have done the same. I'm glad it's working :) -- Trent Jarvi tjarvi at qbang.org From tma at mail.island.net Wed Feb 8 13:39:35 2006 From: tma at mail.island.net (Tom Alldread) Date: Wed, 08 Feb 2006 12:39:35 -0800 Subject: [Rxtx] Win32/Linux Serial Port Data Dropouts In-Reply-To: <200602060702.k167255O007882@www.qbang.org> References: <200602060702.k167255O007882@www.qbang.org> Message-ID: <43EA5707.4020200@mail.island.net> Greetings Folks at RXTX: During the last couple of months I have been alternately testing with javax.comm 2 and RXTX 2.1 under Windows XP and CommApi 3 and RXTX 2.1 under Suse 10.0 Linux. In the process I have learned a little about java multi-threading under NetBeans 5 with Profiler. My java (jdk 1.5_06) application is used for data acquisition and provides a graphical display of A-D conversion data received from a 56KBaud serial port. The actual data throughput is about 10KBaud thus it is well below the speed of the port. I use hardware RTS/CTS flow control which can stall the data acquisition sample rate if necessary. This ensures the display computer has the ability to slow the data acquisition rate should it become too busy to accept the regular data flow. Both the serial port buffer and the java read buffer are set at 16KB. Usually the data transfers into the java read buffer are less than 100 bytes unless the data acquisition is recovering from a stall. The data flow normally hesitates after each 5 KB block as a continue command is needed from the display computer to start the drawing of a new graphics display line. Separate threads have been provided for the serial port event monitoring and data processing. The serial port event thread has been given the maximum priority and data processing thread the minimum priority provided by java. Thread yield statements have been placed within all data processing while/for loops as an effort to ensure quick access to CPU cycles for the serial port event thread. I have found that short data transmissions are essentially error free but occasional dropouts occur with continuous data flow especially under Windows XP. ....................................................................................................................................................................................... Linux results: I am happy to report that RXTX 2.1 appears to work very well under Linux although I did notice some errors when the screen savers were running with my dual monitors. I believe this is a local problem associated with my dual graphics which needs further attention. The recent CommApi 3 Linux release from Sun did not work at all with my program. It seemed to send commands out OK but did not receive any data. Although the serial port event triggered the ISR, the input stream appeared filled with nulls and thus did not contain any data. As my understanding is that CommApi 3 was tested with a Red Hat distribution of Linux I wonder if this problem is distro dependent? Although somewhat off topic here I wonder if anyone reading this has had similar experience? .................................................................................................................................................................................. Windows XP results: There are problems with occasional data dropouts which become more frequent as the sampling rate is increased or if the computer becomes busy with other duties. The dropouts typically consist of a half dozen byte block of lost data. It appears the lost bytes never get added to the java input stream. There has not been any indication of garbled data, overruns or framing errors which suggests the UART communications remains solid. Using javax.comm 2 I found that the setting of SerialPort 'enableReceiveThreshold' to 40 and 'enableReceiveTimeout' of 100mS reduced the dropouts error rate significantly. I found that I could not get RXTX 2.1 to function with the aforementioned threshold and timeout settings. The javax.comm 2 interface is consequently performing better for me under Windows than RXTX 2.1. I wonder if anyone here has any suggestions as to what I might try to improve RXTX 2.1? Although my settings are the same as under Suse 10.0, RXTX 2.1 performs much better for me under Linux than any of the alternatives that I have tried under Windows XP . ............................................................................................................................................................................... I would like to establish, based on the experience of others, if I have reached the normally expected performance limit of java serial port communications? Should I expect to achieve virtually error free serial port data input from a continuous stream under Windows XP java software? I am considering changing my protocol to packets with error checking if necessary but would like to know if the dropout problems I am experiencing are typical or not before I take this rather work intensive plunge. Many thanks in advance for any help! Best Regards, Tom Alldread -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.375 / Virus Database: 267.15.2/253 - Release Date: 2006-02-07 From jlaxson at mac.com Wed Feb 8 23:56:48 2006 From: jlaxson at mac.com (John Laxson) Date: Thu, 9 Feb 2006 00:56:48 -0600 Subject: [Rxtx] PortInUseException: Unknown Application on OSX Message-ID: Hi, I've been trying to get RXTX 2.1.7 going on Mac OS X for a while here, and am running up into a wall here. I've tried with pre- compiled and the source version and get the same problem, a gnu.io.PortInUseException: Unknown Application. I have run the fixperms script included with the source distribution, and id shows me as a member of the uucp group, and permissions on /var/spool/uucp are 775 root:uucp. Running a test program (included at the bottom for clarity) lets me enumerate all the serial ports correctly, but trying to open any of them gives the PortInUseException. If it helps, when I try to open a port that's set to make an outgoing bluetooth connection, there is no delay and no connection attempt at all. Thanks, John Laxson PS: The documentation wiki on qbang.org shows 404, and has for a few days now. My test code: public static void main(String[] args) { SerialPort serialPort; try { Enumeration e = CommPortIdentifier.getPortIdentifiers(); CommPortIdentifier ident; while (e.hasMoreElements()) { ident = (CommPortIdentifier)e.nextElement(); System.out.println(ident.getName()); } ident = CommPortIdentifier.getPortIdentifier("/dev/cu.modem"); serialPort = (SerialPort) ident.open("Me", 5000); } catch (Exception e) { e.printStackTrace(); } } From rajesh.invincible at gmail.com Thu Feb 9 03:39:38 2006 From: rajesh.invincible at gmail.com (Rajesh N) Date: Thu, 9 Feb 2006 16:09:38 +0530 Subject: [Rxtx] Re: Move .java Files in gnu.io filesystem hierarchy - Maven (2) In-Reply-To: <43DF21D2.7090200@ngi.it> References: <43DF21D2.7090200@ngi.it> Message-ID: <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Can anybody tell me how to overcome these EXCEPTIONS I AM WORKING ON SERIAL COMMN IN JAVA ON LINUX. 1. " NOT ALL PARAMETERS SUPPORTED BY THE KERNEL" This i came across the following statement inmy prog. SerialP is A SerialPort object SerialP.setSerialPortParams(9600(BAUDRATE),DATABITS_8,STOPBITS_1,PARITY_NONE) 2. NullPointer Exception at Event Dispatch Now i have checked all my object references for a null reference but i found none i have put up my entire code in try catch blocks but still I AM UNABLE TO CATCH THIS EXCEPTION AND HENCE MY APPLICATION CLOSES HOW DOES THESE GO? PLEASE HELP ME IT IS URGENTTTTTTTTTTTTTTTT yours sincerely RAJESH On 1/31/06, Fabio Frumento wrote: > Hi Xavier, > > I don't know maven at all but the directory hierarchy listed buy Trent > is fine for me... > > I'll take a look to maven, it seems an interesting project > > Regards > > Fabio Frumento > > Trent Jarvi wrote: > > On Tue, 31 Jan 2006, Xavier Frisaye wrote: > > > >> Hi all, > >> > >> If you are going to rearrange the src folder, i will propose to use > >> maven 2 and follow its directory structure > >> > (http://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html). > >> > >> Maven 2 simplify java project and give a standard way to make projects > >> (http://maven.apache.org/). > >> We are using it for internal projects and we are very satisfied. > >> > >> Is anybody interested? > >> > >> I'm not an expert in maven 2 (yet) but i'm agree to help using it if > >> you choose to make so. > >> > > > > so this would be: > > > > rxtx-devel/src/main/java/gnu.io > > rxtx-devel/src/test/java/ManIwish.java > > > > I don't use IDEs very much so I'll let others comment. But I don't see > > a problem with that. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Thu Feb 9 09:50:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 9 Feb 2006 09:50:31 -0700 (MST) Subject: [Rxtx] Re: Move .java Files in gnu.io filesystem hierarchy - Maven (2) In-Reply-To: <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Message-ID: On Thu, 9 Feb 2006, Rajesh N wrote: > Can anybody tell me how to overcome these EXCEPTIONS > I AM WORKING ON SERIAL COMMN IN JAVA ON LINUX. > > 1. " NOT ALL PARAMETERS SUPPORTED BY THE KERNEL" > > This i came across the following statement inmy prog. > SerialP is A SerialPort object > SerialP.setSerialPortParams(9600(BAUDRATE),DATABITS_8,STOPBITS_1,PARITY_NONE) > Strange. The parameters you use are the same the port should open with by default. Could you paste the actual exception you are getting? I don't see that in the rxtx source. Also it would help to know the rxtx version. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Fri Feb 10 15:29:05 2006 From: lux at diesel-research.com (Kim Lux) Date: Fri, 10 Feb 2006 15:29:05 -0700 Subject: [Rxtx] One serial port object for both sending and receiving ? Message-ID: <1139610545.18177.4.camel@zd7280> Is it OK to use one SerialPort ojbect (ex Serial Port serialPort;) and use it for both sending and receiving ? For example: ======================================================================== static SerialPort serialPort = null; static OutputStream serialOut = null; static InputStream serialIn = null; // assign it to an outputStream for use try{ serialOut = serialPort.getOutputStream(); System.out.println("Serial output stream has been assigned."); }//try catch(IOException e) { System.out.println("Error: Couldn't assign output stream to serial port."); }//catch //assign it to an inputStream for use try{ serialIn = serialPort.getInputStream(); System.out.println("Serial input stream has been assigned."); }//try catch(IOException e) { System.out.println("Error: Couldn't assign input stream to serial port."); }//catch ======================================================================== -- Kim Lux, Diesel Research Inc. From lux at diesel-research.com Fri Feb 10 21:23:00 2006 From: lux at diesel-research.com (Kim Lux) Date: Fri, 10 Feb 2006 21:23:00 -0700 Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Message-ID: <1139631780.23882.10.camel@zd7280> I've got a problem receiving chars with my version of serialRead, written in an SWT GUI. I had a Java pro have a good look at my code and he can't see anything wrong with it. I can send chars fine. When I receive a char the cpu usage for the app goes to 100% and the code in the serial event handler doesn't get executed. The instructions on the Java Comm Serial API How-To for Linux page state that I must install javacomm. Is that true ? Everything builds without it and I can send chars on rxtx just fine, but I can't receive them. Could this be the problem ? I downloaded and installed javacomm. I was not able to add "Driver=gnuio.RXTXCommDriver to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 installed in /usr/java/jre1.5.0_05. I added comm.jar to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext to the library paths. Is this OK ? Does it matter that I am receiving on /dev/ttyUSB0 ? Thanks. -- Kim Lux, Diesel Research Inc. From lunareclipse03 at web.de Sat Feb 11 09:44:46 2006 From: lunareclipse03 at web.de (lunareclipse03@web.de) Date: Sat, 11 Feb 2006 17:44:46 +0100 Subject: [Rxtx] Question about Serial I/O under Win32 Message-ID: <662084330@web.de> Hello everybody, I have a strange problem with a piece of code I made for myself. No, this is not really concerning rxtx, but nevertheless I post this to the list, hoping that some of you can help me. I've written two libraries, one for linux and one for win32. The linux port works quite well, I can send / receive faxes and / or replay voice messages over the telephone line using a voice modem. But the win32 port of the library causes some trouble. If, for example, I send out a fax with a certain modem under linux, it works well. The fax is complete when it comes out of the fax machine. If I then use the same modem to send out a fax under win32, the fax coming out of the fax machine gets "stuck" halfways, but the sending modem thinks that transmission was ok and drops the connection. The answering fax machine then gives me "error while receiving." The "upper layer" java code MUST be right, because if I do the same thing under linux (using the linux library), everything is alright. Now I have to ask: Can somebody please help me out with this??!? Could it be the case that some kind of flow control or COMMTIMEOUTS setting causes this behaviour? I set flow control to RTS/CTS before sending out a fax. How can I DISABLE flow control? Or what do you think? Can something else cause this problems? Thank you all for your time and PLEASE write back soon. Regards, --Sven Ahlemann Am Waldrand 31 45721 Haltern am See Germany ______________________________________________________________ Verschicken Sie romantische, coole und witzige Bilder per SMS! Jetzt bei WEB.DE FreeMail: http://f.web.de/?mc=021193 From lux at diesel-research.com Sat Feb 11 10:06:52 2006 From: lux at diesel-research.com (Kim Lux) Date: Sat, 11 Feb 2006 10:06:52 -0700 Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: <1139631780.23882.10.camel@zd7280> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> <1139631780.23882.10.camel@zd7280> Message-ID: <1139677612.3431.5.camel@zd7280> More on this problem. I copied and pasted simpleRead into a console based Eclipse project and I've got the same result, except that cpu usage doesn't go to 100%. I'm beginning to think there is an issue in rxtx. My imports for simpleRead are: ============================ import gnu.io.*; import java.util.*; //import javax.comm.*; import java.io.*; =========================== Any ideas ? I am trying to read from /dev/ttyUSB0 using a serial to USB adapter which has worked well with minicom and gtkterm. Thanks. On Fri, 2006-02-10 at 21:23 -0700, Kim Lux wrote: > I've got a problem receiving chars with my version of serialRead, > written in an SWT GUI. > > I had a Java pro have a good look at my code and he can't see anything > wrong with it. > > I can send chars fine. When I receive a char the cpu usage for the app > goes to 100% and the code in the serial event handler doesn't get > executed. > > The instructions on the Java Comm Serial API How-To for Linux page state > that I must install javacomm. Is that true ? Everything builds without > it and I can send chars on rxtx just fine, but I can't receive them. > Could this be the problem ? > > I downloaded and installed javacomm. I was not able to add > "Driver=gnuio.RXTXCommDriver > to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not > have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 > installed in /usr/java/jre1.5.0_05. I added comm.jar > to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext > to the library paths. Is this OK ? > > Does it matter that I am receiving on /dev/ttyUSB0 ? > > Thanks. > -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Sun Feb 12 21:01:33 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:01:33 -0700 (MST) Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: <1139677612.3431.5.camel@zd7280> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> <1139631780.23882.10.camel@zd7280> <1139677612.3431.5.camel@zd7280> Message-ID: I suspect what is happening is the select() is breaking out in the native code but the driver does not have support for notifying there are X bytes available. On some traditional Unix based systems, the only way you know data is available is the fd status changes and do an FIORDCHK ioctl. Or perhaps the only thing you can know is the fd status changed. It would take reading through the kernel driver code to know for sure. So on USB, depending upon the driver, the same may need to be done or the driver improved a bit if possible to support. Polling reads will also work but don't use the event driven model of CommAPI which isnt acceptable in the long run. The 100% cpu usage can then be explained because select no longer blocks until the data is read; the eventLoop spins loose. You can put a well placed sleep but rxtx only expects those are needed when it knows data is available. This may not be a super simple thing to understand and fix. I do have ideas to get you started. I'm going to be short on time the next couple weeks. I expect to put some good time in and answer some other questions I saw around the 25th. For now, I'd look at the following and go from there with the hints I've given. JNIEXPORT jint JNICALL RXTXPort(nativeavailable)( JNIEnv *env, jobject jobj ) { int fd = get_java_var( env, jobj,"fd","I" ); int result; /* char message[80]; ENTER( "RXTXPort:nativeavailable" ); On SCO OpenServer FIONREAD always fails for serial devices, so try ioctl FIORDCHK instead; will only tell us whether bytes are available, not how many, but better than nothing. This turns out to be true on Solaris also. taj. */ #ifdef FIORDCHK /* __unixware__ __sun__ probably others */ result = ioctl(fd, FIORDCHK, 0); #else if( ioctl( fd, FIONREAD, &result ) < 0 ) { goto fail; } #endif /* FIORDCHK */ On Sat, 11 Feb 2006, Kim Lux wrote: > > More on this problem. I copied and pasted simpleRead into a console > based Eclipse project and I've got the same result, except that cpu > usage doesn't go to 100%. I'm beginning to think there is an issue in > rxtx. > > My imports for simpleRead are: > > ============================ > import gnu.io.*; > import java.util.*; > //import javax.comm.*; > import java.io.*; > =========================== > > Any ideas ? I am trying to read from /dev/ttyUSB0 using a serial to > USB adapter which has worked well with minicom and gtkterm. > > Thanks. > > > > On Fri, 2006-02-10 at 21:23 -0700, Kim Lux wrote: >> I've got a problem receiving chars with my version of serialRead, >> written in an SWT GUI. >> >> I had a Java pro have a good look at my code and he can't see anything >> wrong with it. >> >> I can send chars fine. When I receive a char the cpu usage for the app >> goes to 100% and the code in the serial event handler doesn't get >> executed. >> >> The instructions on the Java Comm Serial API How-To for Linux page state >> that I must install javacomm. Is that true ? Everything builds without >> it and I can send chars on rxtx just fine, but I can't receive them. >> Could this be the problem ? >> >> I downloaded and installed javacomm. I was not able to add >> "Driver=gnuio.RXTXCommDriver >> to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not >> have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 >> installed in /usr/java/jre1.5.0_05. I added comm.jar >> to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext >> to the library paths. Is this OK ? >> >> Does it matter that I am receiving on /dev/ttyUSB0 ? >> >> Thanks. >> > From tjarvi at qbang.org Sun Feb 12 21:03:30 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:03:30 -0700 (MST) Subject: [Rxtx] One serial port object for both sending and receiving ? In-Reply-To: <1139610545.18177.4.camel@zd7280> References: <1139610545.18177.4.camel@zd7280> Message-ID: On Fri, 10 Feb 2006, Kim Lux wrote: > > Is it OK to use one SerialPort ojbect (ex Serial Port serialPort;) and > use it for both sending and receiving ? > > For example: > > ======================================================================== > static SerialPort serialPort = null; > static OutputStream serialOut = null; > static InputStream serialIn = null; > > > > > // assign it to an outputStream for use > try{ > serialOut = serialPort.getOutputStream(); > System.out.println("Serial output stream has been assigned."); > }//try > catch(IOException e) > { > System.out.println("Error: Couldn't assign output stream to serial > port."); > }//catch > > > //assign it to an inputStream for use > try{ > serialIn = serialPort.getInputStream(); > System.out.println("Serial input stream has been assigned."); > }//try > catch(IOException e) > { > System.out.println("Error: Couldn't assign input stream to serial > port."); > }//catch This should be fine. In fact trying to do it another way will probably not work as you will run into lockfile issues. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun Feb 12 21:13:13 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:13:13 -0700 (MST) Subject: [Rxtx] Question about Serial I/O under Win32 In-Reply-To: <662084330@web.de> References: <662084330@web.de> Message-ID: On Sat, 11 Feb 2006 lunareclipse03 at web.de wrote: > Hello everybody, > > I have a strange problem with a piece of code I made for myself. No, > this is not really concerning rxtx, but nevertheless I post this to the > list, hoping that some of you can help me. I've written two libraries, > one for linux and one for win32. The linux port works quite well, I can > send / receive faxes and / or replay voice messages over the telephone > line using a voice modem. But the win32 port of the library causes some > trouble. If, for example, I send out a fax with a certain modem under > linux, it works well. The fax is complete when it comes out of the fax > machine. If I then use the same modem to send out a fax under win32, the > fax coming out of the fax machine gets "stuck" halfways, but the sending > modem thinks that transmission was ok and drops the connection. The > answering fax machine then gives me "error while receiving." The "upper > layer" java code MUST be right, because if I do the same thing under > linux (using the linux library), everything is alright. Now I have to > ask: Can somebody please help me out with this??!? Could it be the case > that some kind of flow control or COMMTIMEOUTS setting causes this > behaviour? I set flow control to RTS/CTS before sending out a fax. How > can I DISABLE flow control? Or what do you think? Can something else > cause this problems? Thank you all for your time and PLEASE write back > soon. > Hi Sven I'm not too willing to talk about flow control at the low level until I confirm some things with test equipment later. It is not clear if you are using rxtx or writing your own native code. So I'm not sure how to answer much of this :) If you are wondering how to change the flow control using rxtx from java, The BlackBox example from Sun flips this back and forth. SerialPort.java in rxtx 2.1 uses the following: SerialPort.java: public static final int FLOWCONTROL_NONE =0; SerialPort.java: public static final int FLOWCONTROL_RTSCTS_IN =1; SerialPort.java: public static final int FLOWCONTROL_RTSCTS_OUT =2; SerialPort.java: public static final int FLOWCONTROL_XONXOFF_IN =4; SerialPort.java: public static final int FLOWCONTROL_XONXOFF_OUT=8; So if you set flowcontrol to RTSCTS, you can set it to NONE to turn it off. If you are looking for how to do it in native code, the rxtx Source is SerialImp.c (unix/linux/mac os x/w32) and termios.c (w32 only with SerialImp.c) You can track the code: SerialImp.c:JNIEXPORT void JNICALL RXTXPort(setflowcontrol)( JNIEnv *env, jobject jobj, jint flowmode ) termios.c:int tcgetattr( int fd, struct termios *s_termios ) termios.c:int tcsetattr( int fd, int when, struct termios *s_termios ) There may be a problem in the rxtx flow control code though. Rather than guess, I want to test this with a gold standard. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Feb 6 00:00:16 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 00:00:16 -0700 (MST) Subject: [Rxtx] wiki delay until tomorrow night. In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: On Sun, 5 Feb 2006, Trent Jarvi wrote: > On Sun, 5 Feb 2006, Kim Lux wrote: > >> usb ? Tell me more... I need that too. > > usb is a very proper design. Thats all it is. > Maybe rxtx could help usb. But it would start with helping bring back the community that was already there. It's not something I'd love to do but maybe its the right thing to do. It would probably take 2 years to do right. But maybe thats better than what we have now. I honestly don't know what IBM is doing which could just run over everything. Just some thoughts after some fine german wine. -- Trent Jarvi tjarvi at qbang.org From gadelavega at yahoo.com.ar Mon Feb 6 02:17:05 2006 From: gadelavega at yahoo.com.ar (Gonzalo A. de la Vega) Date: Mon, 06 Feb 2006 10:17:05 +0100 Subject: [Rxtx] Serial port ownership question In-Reply-To: References: <20060205113618.30274.qmail@web53501.mail.yahoo.com> <1139157422.4553.9.camel@zd7280> <1139158698.4936.9.camel@zd7280> Message-ID: <43E71411.4050402@yahoo.com.ar> On my Fedora Core 4: ls -l /dev/ttyS* crw-rw---- 1 root uucp 4, 64 Feb 6 2006 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Feb 6 2006 /dev/ttyS1 ... and: grep "ttyUSB" /etc/udev/rules.d/50-udev.rules KERNEL=="ttyUSB*", GROUP="uucp", MODE="0660" So anyone in the "uucp" group can use serial ports. On Gentoo the group is "tty". Trent Jarvi escribi?: > > > On Sun, 5 Feb 2006, Dr. Douglas Lyon wrote: > >> I can confirm that this is the case (only root ownership of >> serial ports, under fedora 4). >> Wow, what were they thinking?! >> - DL >> >>> I've found that the newer kernels have the serial ports owned by root. >>> For example, >>> >>> $ls -al /dev/tty* >>> crw-rw-rw- 1 root root 5, 0 Feb 5 02:06 /dev/tty >>> crw-rw---- 1 root root 4, 0 Feb 5 02:06 /dev/tty0 >>> crw------- 1 root root 4, 1 Feb 5 09:07 /dev/tty1 >>> crw-rw---- 1 root tty 4, 10 Feb 5 02:06 /dev/tty10 >>> crw-rw---- 1 root tty 4, 11 Feb 5 02:06 /dev/tty11 >>> ... > > > This is just not a problem jcp or such are going to solve. Its a > platform spitwad fight. But do look at pam. In fact thats what Sun > is doing too. Maybe Linux followed their lead.. I'm not a pam guy. > I've spent 16 hours trying to understand it but your users wont :) > > Solution? I have no clue. Its two tangent mentalities from my > perspective. > > -- > Trent Jarvi > tjarvi at qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mtnvega at yahoo.com.br Mon Feb 6 05:35:43 2006 From: mtnvega at yahoo.com.br (Luiz Jr) Date: Mon, 6 Feb 2006 12:35:43 +0000 (GMT) Subject: [Rxtx] Documentation Wiki In-Reply-To: <1139157422.4553.9.camel@zd7280> Message-ID: <20060206123543.57256.qmail@web53515.mail.yahoo.com> Hello, Thank you for you answer, but so the usage of the API is pretty much like the Java Communications Api? If yes, what version of the Java Comm Api? Thank you, Luiz A. Brandao Jr Kim Lux escreveu: On Sun, 2006-02-05 at 08:36 -0300, Luiz Jr wrote: > Hello, > > I want to start using the RXTX libraries, but I would to know how, > since I can not access the documentation wiki page I just started using them yesterday. Below is how I installed the libraries, if that helps. I used snippets of code from the SimpleWrite application here to get me going. http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html Instead of "import javax.comm.*;", use "import gnu.io.*;" which is gotten from RXTXcomm.jar, which you will need to include in your project references. I am working in Eclipse. BTW: there is no way to open a port without going through the port list and finding it. Maybe sometime in the future someone (me ?) will write a method called openSerialPort that allows the user to give a port identifier, such as "/dev/tty1" and return a port ready to use. It wouldn't take much to write that and it would save users a lot of code. Hope this helps. ======================================================================= 1) Figure out which java you are running, incase there is more than one installed. $ java -version java version "1.5.0_05" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_05-b05) Java HotSpot(TM) Client VM (build 1.5.0_05-b05, mixed mode, sharing) 2) Find all the jre directories and the one from which you are currently running. kfind (jre) 3) cd to that directory plus /lib/i386 cd /usr/java/jre1.5.0_05/lib/i386 4) Copy the library files (*.so) to that directory. cp /home/krlux/Desktop/'Java Controls'/rxtx-linux/bin/* . 5) Check that the copy was successful ls librxtx* librxtxI2C.so librxtxRaw.so librxtxSerial.so librxtxParallel.so librxtxRS485.so 6) cd to the /lib/ext directory for your java. cd /usr/java/jre1.5.0_05/lib/ext 7) Copy the Jar files there cp /home/krlux/Desktop/'Java Controls'/rxtx-linux/lib/ext/* . 8) Check that it was successful ls RXTX* RXTXcomm.jar Rxtx is now installed on your machine ready to use. =================================================================== -- Kim Lux, Diesel Research Inc. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx --------------------------------- Yahoo! Acesso Gr?tis - Internet r?pida e gr?tis. Instale o discador agora! -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/544aa403/attachment-0045.html From lyon at docjava.com Mon Feb 6 05:49:34 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 06 Feb 2006 07:49:34 -0500 Subject: [Rxtx] wiki delay until tomorrow night. In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: Hi All, I have often thought about USB drivers being needed. For example, the ironman watch will not interface to a mac (windows only). It is USB. My dymo label writer has no Java driver (native only). Etc. Most cheap web cameras are USB (and Java drivers go through JAI, if it supports the camera at all). The JAI code shows how sun did the USB drivers. You have to be a member of the jai project to download the source code. https://jai.dev.java.net has the jai distro. And then you are not allowed to redistribute it. However, we can all learn from it (if so inclined). Basically: cvs -d :pserver:lyon at cvs.dev.java.net:/cvs login cvs -d :pserver:lyon at cvs.dev.java.net:/cvs checkout jai-core You will need to user your own uid and pw to get in. The ant build has over 100 warnings from sun deprecations of its own code. You might say that they were hoisted on their own Picard ;) One interesting thing is that they support several platforms: linux-amd64 64-bit Linux-AMD64 linux-i586 32-bit Linux-x86 solaris-amd64 64-bit Solaris-AMD64 solaris-i586 32-bit Solaris-x86 solaris-sparc 32-bit Solaris-SPARC solaris-sparcv9 64-bit Solaris-SPARC windows-i586 32-bit Windows-x86 Thus, ant is used to provide a multi-platform native method distro. Neat. How do they do it? check this out: And: The core download does not contain any C source code (it was all pre-built). Basically, they are just copying .so and .dll files into build directories. I would love to see the C code for this...but Sun does not post it on the https://jai.dev.java.net site. I don't know why...Perhaps I missed it. - Doug >On Sun, 5 Feb 2006, Trent Jarvi wrote: > >>On Sun, 5 Feb 2006, Kim Lux wrote: >> >>>usb ? Tell me more... I need that too. >> >>usb is a very proper design. Thats all it is. >> > >Maybe rxtx could help usb. But it would start with helping bring >back the community that was already there. > >It's not something I'd love to do but maybe its the right thing to do. > >It would probably take 2 years to do right. But maybe thats better >than what we have now. > >I honestly don't know what IBM is doing which could just run over everything. > >Just some thoughts after some fine german wine. > >-- >Trent Jarvi >tjarvi at qbang.org > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tdelenik at gmail.com Mon Feb 6 05:56:32 2006 From: tdelenik at gmail.com (Thanasis Delenikas) Date: Mon, 6 Feb 2006 14:56:32 +0200 Subject: Fwd: [Rxtx] Documentation Wiki In-Reply-To: <1139157422.4553.9.camel@zd7280> References: <20060205113618.30274.qmail@web53501.mail.yahoo.com> <1139157422.4553.9.camel@zd7280> Message-ID: <310a1a930602060456t129f1dc6p5f2b908f13ab5a0b@mail.gmail.com> Hello all, Kim, this is a snippet from the code I use. The closest to directly opening a specific port without enumeration. << ... portId = CommPortIdentifier.getPortIdentifier(getPort()); serialPort = (SerialPort) portId.open("jSMSEngine", 1971); ... >> where getPort() return the string identifier of the port, i.e. "/dev/ttyS0" or "COM1" or whatever. Thanasis. ---------- Forwarded message ---------- From: Kim Lux Date: Feb 5, 2006 6:37 PM Subject: Re: [Rxtx] Documentation Wiki To: RXTX Developers and Users BTW: there is no way to open a port without going through the port list and finding it. Maybe sometime in the future someone (me ?) will write a method called openSerialPort that allows the user to give a port identifier, such as "/dev/tty1" and return a port ready to use. It wouldn't take much to write that and it would save users a lot of code. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/182ab5b8/attachment-0045.html From tjarvi at qbang.org Mon Feb 6 11:53:57 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 11:53:57 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: On Mon, 6 Feb 2006, Dr. Douglas Lyon wrote: > Hi All, > I have often thought about USB drivers being needed. > For example, the ironman watch will not interface > to a mac (windows only). It is USB. > My dymo label writer has no Java driver (native only). > Etc. > Most cheap web cameras are USB (and Java drivers go > through JAI, if it supports the camera at all). > The JAI code shows how sun did the USB drivers. > You have to be a member of the jai project to download > the source code. > https://jai.dev.java.net has the jai distro. > And then you are not allowed to redistribute it. However, > we can all learn from it (if so inclined). Basically: > cvs -d :pserver:lyon at cvs.dev.java.net:/cvs login > cvs -d :pserver:lyon at cvs.dev.java.net:/cvs checkout jai-core > You will need to user your own uid and pw to get in. > The ant build has over 100 warnings from sun deprecations > of its own code. > > You might say that they were hoisted on their own Picard ;) > > One interesting thing is that they support several platforms: > linux-amd64 64-bit Linux-AMD64 > linux-i586 32-bit Linux-x86 > solaris-amd64 64-bit Solaris-AMD64 > solaris-i586 32-bit Solaris-x86 > solaris-sparc 32-bit Solaris-SPARC > solaris-sparcv9 64-bit Solaris-SPARC > windows-i586 32-bit Windows-x86 > Thus, ant is used to provide a multi-platform native method distro. > Neat. > How do they do it? > check this out: > > > > > > > > > > > > > And: > > > > > > > > > > The core download does not contain any C source code (it was all pre-built). > Basically, they are just copying .so and .dll files into build directories. > > I would love to see the C code for this...but Sun does not post it on the > https://jai.dev.java.net site. > > I don't know why...Perhaps I missed it. > > - Doug > > I've looked at moving rxtx to Ant builds. I think that would help IDEs a great deal. I requested a evalutation desk copy the O'Reilly Ant book for some j2ee material I was teaching. http://www.oreilly.com/catalog/anttdg/ It has a one sentence mention of JNI. So there was not luck there. I saw that there is another Ant book that does mention JNI more. I can't find it now. Ant must be able to support it with extensions. http://ant.apache.org/manual/OptionalTasks/javah.html What the auto(break :) tools do in the rxtx build is 4 things really. 1) gcc compile flags 2) ld compile flags 3) config.h 4) compile flags for customizing rxtx (lockfiles, ...) See 1 All of this information except 4 can be static once obtained. So I'm not attached to the auto tools. If I could find an example of Ant being used for JNI code, I'd be one of the first to start moving that direction. Maybe someone saw an example someplace. The other thing we have not completed discussing is the directory structure. There is interest in making rxtx more IDE friendly. I get more mail about that off the list than how to install rxtx. And I see we have Ken Thompson in da house :) He is our trusted CVS maintainer and the guy that purchased the rxtx.org domain. Old community. We will need Ken for changing the directory structure of source. I would like to open up discussion about both of these as it is more than time. The problem is I have little experience with Ant and even less with IDEs. It would be nice if we could work with Eclipse and NetBeans. http://www.netbeans.org/ (sun and some community) http://www.eclipes.org (ibm,rhat,... perhaps more community) http://maven.apache.org/what-is-maven.html (apache. It is community) borland should sortof be here too but I think thats covered in eclipse. >From what I understand so far, we should morph rxtx to support those three maybe trusting apaches lead with maven. But I use vi. I have little to no clues beyond what people have fed me. Can we agree that thats the right direction to go? -- Trent Jarvi tjarvi at qbang.org From brian at mbari.org Mon Feb 6 14:57:50 2006 From: brian at mbari.org (Brian Schlining) Date: Mon, 6 Feb 2006 13:57:50 -0800 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> > The other thing we have not completed discussing is the directory > structure. There is interest in making rxtx more IDE friendly. I > get more mail about that off the list than how to install rxtx. > > And I see we have Ken Thompson in da house :) He is our trusted > CVS maintainer and the guy that purchased the rxtx.org domain. Old > community. We will need Ken for changing the directory structure of > source. > > I would like to open up discussion about both of these as it is > more than time. The problem is I have little experience with Ant > and even less with IDEs. It would be nice if we could work with > Eclipse and NetBeans. > > http://www.netbeans.org/ (sun and some community) > http://www.eclipes.org (ibm,rhat,... perhaps more community) > http://maven.apache.org/what-is-maven.html (apache. It is community) > borland should sortof be here too but I think thats covered in > eclipse. > >> From what I understand so far, we should morph rxtx to support >> those three > maybe trusting apaches lead with maven. But I use vi. I have > little to no clues beyond what people have fed me. > Maven likes the directory structure below for Java code. (From http:// maven.apache.org/guides/getting-started/index.html) This structure works fine with ant, netbeans, and eclipse. rxtx_root_directory `-- src |-- main | `-- java | `-- gnu | `-- io `-- test `-- java `-- gnu `-- io Brian Schlining Software Engineer http://www.mbari.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/d9451eba/attachment-0045.html From tjarvi at qbang.org Mon Feb 6 15:11:45 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 15:11:45 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: > rxtx_root_directory > `-- src > |-- main > | `-- java > | `-- gnu > | `-- io > `-- test > `-- java > `-- gnu > `-- io > >From what I understand this will just be good. For me it makes no difference. So lets do the rxtx thing. Let if fester for two weeks and if nobody objects, we will do it. I'm not doing this because I care. I'm doing this to eliminate much of my inbox. But test... man is rxtx lacking there in the community aspect. It is covered but not right. _maybe_ I can change that this year. -- Trent Jarvi tjarvi at qbang.org (cat hurding since 1997) From lux at diesel-research.com Mon Feb 6 21:38:49 2006 From: lux at diesel-research.com (Kim Lux) Date: Mon, 06 Feb 2006 21:38:49 -0700 Subject: [Rxtx] How can I use Lock Files with rxtx (in FC4) ? Message-ID: <1139287129.17031.3.camel@zd7280> I am now running an rxtx application on FC4. I am getting: ========================================================= check_group_uucp(): error testing lock file creation Error details: Permission denied check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL ========================================================= $ ls -al /var/lock total 32 drwxrwxr-x 4 root lock 4096 Feb 6 16:04 . drwxr-xr-x 24 root root 4096 Nov 14 01:19 .. drwx------ 2 root root 4096 Apr 27 2005 lvm drwxr-xr-x 2 root root 4096 Feb 6 16:04 subsys How do I fix this for regulator users ? -- Kim Lux, Diesel Research Inc. From dmarkman at mac.com Mon Feb 6 22:24:44 2006 From: dmarkman at mac.com (Dmitry Markman) Date: Tue, 7 Feb 2006 00:24:44 -0500 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: if I understands the issue right in order to be able to use ant for c/c++ compilation you have to install ant's cc task http://ant-contrib.sourceforge.net/cc.html it looks like it should work on mac os x (authors claim, that it's platform independent) but I never tested so all you have to do it's providing right command line for the gcc compiler On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: >> rxtx_root_directory >> `-- src >> |-- main >> | `-- java >> | `-- gnu >> | `-- io >> `-- test >> `-- java >> `-- gnu >> `-- io >> > > >> From what I understand this will just be good. > > For me it makes no difference. So lets do the rxtx thing. Let if > fester for two weeks and if nobody objects, we will do it. > > I'm not doing this because I care. I'm doing this to eliminate > much of my inbox. > > But test... man is rxtx lacking there in the community aspect. It > is covered but not right. _maybe_ I can change that this year. > > -- > Trent Jarvi > tjarvi at qbang.org > (cat hurding since 1997) > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx Dmitry Markman From lux at diesel-research.com Mon Feb 6 23:20:15 2006 From: lux at diesel-research.com (Kim Lux) Date: Mon, 06 Feb 2006 23:20:15 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? Message-ID: <1139293215.3689.4.camel@zd7280> I'm running the code below. portlist.hasMoreElements() is false. /dev has ports in it as listed below. What am I doing wrong ? ========================================================== // Step through the list of ports until we find one that matches // the one we are looking for. portList = CommPortIdentifier.getPortIdentifiers(); while(portList.hasMoreElements()) { portID = (CommPortIdentifier) portList.nextElement(); // if (portID.getName().equals("/dev/ttyUSB0")) { myTA.append("Serial port ttyUSB0 has been found\n"); break; }// if portID equals... }// End of while... ========================================================== ls -al /dev/tty* crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 ... crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 -- Kim Lux, Diesel Research Inc. From david.garnier at trusted-logic.com Tue Feb 7 00:46:30 2006 From: david.garnier at trusted-logic.com (David Garnier) Date: Tue, 07 Feb 2006 08:46:30 +0100 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: <43E85056.2090608@trusted-logic.com> Hello, I think that the make-based build process is fine as it is, apart from the location of the Java source files. It is true that putting the Java source in a directory structure that map 1-to-1 to the Java package structure is the norm and should make it easier for everyone to modify the Java source, with or without an IDE. Ant is a good tool, but in the RXTX case I fail to see the advantage of using it compared to the current make-based process. As Trent said, they are more pressing issues, like testing. Regards, David Dmitry Markman wrote: > if I understands the issue right > in order to be able to use ant for c/c++ compilation > you have to install ant's cc task > http://ant-contrib.sourceforge.net/cc.html > > it looks like it should work on mac os x > (authors claim, that it's platform independent) > but I never tested > > so all you have to do it's providing right command line > for the gcc compiler > > > > > On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: > >>> rxtx_root_directory >>> `-- src >>> |-- main >>> | `-- java >>> | `-- gnu >>> | `-- io >>> `-- test >>> `-- java >>> `-- gnu >>> `-- io >>> >> >> >>> From what I understand this will just be good. >> >> For me it makes no difference. So lets do the rxtx thing. Let if >> fester for two weeks and if nobody objects, we will do it. >> >> I'm not doing this because I care. I'm doing this to eliminate much >> of my inbox. >> >> But test... man is rxtx lacking there in the community aspect. It is >> covered but not right. _maybe_ I can change that this year. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> (cat hurding since 1997) From tjarvi at qbang.org Tue Feb 7 01:11:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 01:11:31 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <43E85056.2090608@trusted-logic.com> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: On Tue, 7 Feb 2006, David Garnier wrote: > Hello, > > I think that the make-based build process is fine as it is, apart from the location of the Java > source files. It is true that putting the Java source in a directory structure that map 1-to-1 to > the Java package structure is the norm and should make it easier for everyone to modify the Java > source, with or without an IDE. > > Ant is a good tool, but in the RXTX case I fail to see the advantage of using it compared to the > current make-based process. As Trent said, they are more pressing issues, like testing. > Hi David I have more experience with testing rxtx than I can talk about. But let it be known, rxtx has gone trough 100's of hours of testing. We are hobby folks interested in toys but there is more. rxtx has had some of the best guidance in the industry there. This is not an easy thing. I may be able to come back in a month from the other side of the corperate fence and help. I suspect the tests could just be made public but they are in a very unusual environment that just wont work in a wider sense. This is something I'll be trying to change. At one point it was agreed we could just make the results public so this isnt just noise.. There is interest and I think its safe to mention that much. The big problem with testing in the past is most of it is done with a loopback connection. So we *still* have major questions regarding things like flow control. rxtx talks to itself over a loopback and it works. regardless of right or wrong. This requires more thought to be done right. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Feb 7 02:46:34 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 02:46:34 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: > The big problem with testing in the past is most of it is done with a > loopback connection. So we *still* have major questions regarding things > like flow control. rxtx talks to itself over a loopback and it works. > regardless of right or wrong. With serial communication there are gold standards. ckermit is probably a definitive 'standard.' Maybe its possible to do ping/pong tests with ckermit? Is it scriptable? There are known issues in rxtx. Probably the worst is some threading issues regarding some JREs with multiple JNI threads setting java variables. Man did I get schooled there. Just switch the c functions to returning variables and things go away. Sometimes they work fine, sometimes they blow up. Without understanding everything, somehow rhat got it right and debian (and especially gentoo) grabbed kernel patches causing all sort of harm. Its not hard to fix once you understand whats going on but nearly impossible to track with a debugger. So I have a good idea what 2.1-8 will have outside of the IDE modifications. rxtx 2.1-7 is a release for everyone to sync with. Its not even as stable as -pre17 as far as I know - I ran no test suites. I'll be chasing it too. We just had so many contributions that it was time. It seriously broke internal scheduals but thats a great thing :) The other thing I want to do in 2.1-8 is automagic baud rates. It turns out lots of shops are doing really funky baud rates for things like automobile test equipment. It is possible but it requires a fair amount of change in the native code. Is anyone looking at this? -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Feb 7 02:57:21 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 07 Feb 2006 04:57:21 -0500 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <43E85056.2090608@trusted-logic.com> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: Hi All, I agree, testing is very important. The problem I have been trying to address is related to cross-platform testing and the robust nature of the installs. Typically, I visit 3 platforms to deploy my product, windows, linux and mac. A build is performed on each platform. The idea that you can build for many platforms from one copy the source code seems attractive. This should enable synchronized deployments of identical code. The question of how to achieve this goal remains open. As Trent mentioned, this is hard. Perhaps Ant will help here (but perhaps not). Ant does seem to help with running unit tests. However, it does not help with multi-platform tests. For that you need many machines and different operating environments. Toward that end, I have created a multi-platform test that can be run from web start, located at: http://show.docjava.com:8086/book/cgij/code/jnlp/serialPort.PortTest.jnlp This is interesting because many people in the community can run the test and we can improve the test, as time permits. No, it is not a perfect solution, however, the idea does help with multi-platform tests using many machines and different operating environments. If the group has a good test for a general serial port set-ups, i would be happy to deploy it, for general evaluation using web start. And as for ANT, it is just an idea. Not all my ideas are good ones! - Doug >Hello, > >I think that the make-based build process is fine as it is, apart >from the location of the Java >source files. It is true that putting the Java source in a directory >structure that map 1-to-1 to >the Java package structure is the norm and should make it easier for >everyone to modify the Java >source, with or without an IDE. > >Ant is a good tool, but in the RXTX case I fail to see the advantage >of using it compared to the >current make-based process. As Trent said, they are more pressing >issues, like testing. > >Regards, >David > >Dmitry Markman wrote: >> if I understands the issue right >> in order to be able to use ant for c/c++ compilation >> you have to install ant's cc task >> http://ant-contrib.sourceforge.net/cc.html >> >> it looks like it should work on mac os x >> (authors claim, that it's platform independent) >> but I never tested >> >> so all you have to do it's providing right command line >> for the gcc compiler >> >> >> >> >> On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: >> >>>> rxtx_root_directory >>>> `-- src >>>> |-- main >>>> | `-- java >>>> | `-- gnu >>>> | `-- io >>>> `-- test >>>> `-- java >>>> `-- gnu >>>> `-- io >>>> >>> >>> >>>> From what I understand this will just be good. >>> >>> For me it makes no difference. So lets do the rxtx thing. Let if >>> fester for two weeks and if nobody objects, we will do it. >>> >>> I'm not doing this because I care. I'm doing this to eliminate much >>> of my inbox. >>> >>> But test... man is rxtx lacking there in the community aspect. It is >>> covered but not right. _maybe_ I can change that this year. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> (cat hurding since 1997) > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From matt.higgins at gmail.com Tue Feb 7 08:28:34 2006 From: matt.higgins at gmail.com (Matt Higgins) Date: Tue, 7 Feb 2006 10:28:34 -0500 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final Message-ID: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? import java.io.*; import java.util.*; import gnu.io.*; public class MySimpleRead implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; public static void main(String[] args) { boolean portFound = false; String defaultPort = "COM1"; if (args.length > 0) { defaultPort = args[0]; } portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; MySimpleRead reader = new MySimpleRead(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } } public MySimpleRead() { try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) { e.printStackTrace(); } try { inputStream = serialPort.getInputStream(); } catch (IOException e) { e.printStackTrace(); } try { serialPort.addEventListener(this); } catch (TooManyListenersException e) { e.printStackTrace(); } try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { e.printStackTrace(); } System.out.println("Baud is " + serialPort.getBaudRate()); System.out.println("Bits is " + serialPort.getDataBits()); System.out.println("Stop is " + serialPort.getStopBits()); System.out.println("Par is " + serialPort.getParity()); serialPort.notifyOnDataAvailable(true); readThread = new Thread(this); readThread.start(); } public void run() { // Thread.sleep(20000); //} catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { System.out.println("An event occurred " + event.getEventType()); switch (event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: byte[] readBuffer = new byte[20]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } System.out.print(new String(readBuffer)); } catch (IOException e) {} break; } } } --------------- Result on windows ------------------------------ Stable Library ============================================================== Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port:: COM1 Baud is 9600 Bits is 8 Stop is 1 Par is 0 ----------------- End Results ----------------------------------------- ------------------ Result on Linux ----------------------------------- Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 Found port: /dev/ttyS0 Baud is 9600 Bits is 8 Stop is 1 Par is 0 An event occurred 1 043100066224 ------------------ End Results --------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/a1431630/attachment-0045.html From brian at mbari.org Tue Feb 7 09:48:37 2006 From: brian at mbari.org (Brian Schlining) Date: Tue, 7 Feb 2006 08:48:37 -0800 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> Message-ID: <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> Hi Matt > The following code works fine on Linux but I never see any data > when run on Windows. This is a cut and paste from the SimpleRead > example. > I am attempting to read data from a bar code scanner. I can fire > up HyperTermianl on windows and see that the device is working > properly as I see the barcodes are scanned and echoed back to the > terminal. However when I run the app I don't see any data. It is > however associating with the com port as the informational bits > print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. Cheers Brian Schlining Software Engineer http://www.mbari.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/16d07f37/attachment-0045.html From lux at diesel-research.com Tue Feb 7 11:59:58 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 11:59:58 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139293215.3689.4.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> Message-ID: <1139338798.8145.4.camel@zd7280> Any ideas on this ? Any reason why portList.hasMoreElements() should be false even though there are devices in /dev ? On Mon, 2006-02-06 at 23:20 -0700, Kim Lux wrote: > I'm running the code below. > > portlist.hasMoreElements() is false. > > /dev has ports in it as listed below. > > What am I doing wrong ? > > > ========================================================== > // Step through the list of ports until we find one that matches > // the one we are looking for. > > portList = CommPortIdentifier.getPortIdentifiers(); > > while(portList.hasMoreElements()) > { > portID = (CommPortIdentifier) portList.nextElement(); // > if (portID.getName().equals("/dev/ttyUSB0")) > { > myTA.append("Serial port ttyUSB0 has been found\n"); > break; > }// if portID equals... > }// End of while... > ========================================================== > > ls -al /dev/tty* > crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty > crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 > crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 > crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 > crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 > ... > crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 > crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 > crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 > > > -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 12:20:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 12:20:25 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139338798.8145.4.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> Message-ID: On Tue, 7 Feb 2006, Kim Lux wrote: > > Any ideas on this ? Any reason why portList.hasMoreElements() should be > false even though there are devices in /dev ? > > > On Mon, 2006-02-06 at 23:20 -0700, Kim Lux wrote: >> I'm running the code below. >> >> portlist.hasMoreElements() is false. >> >> /dev has ports in it as listed below. >> >> What am I doing wrong ? >> >> >> ========================================================== >> // Step through the list of ports until we find one that matches >> // the one we are looking for. >> >> portList = CommPortIdentifier.getPortIdentifiers(); >> >> while(portList.hasMoreElements()) >> { >> portID = (CommPortIdentifier) portList.nextElement(); // >> if (portID.getName().equals("/dev/ttyUSB0")) >> { >> myTA.append("Serial port ttyUSB0 has been found\n"); >> break; >> }// if portID equals... >> }// End of while... >> ========================================================== >> >> ls -al /dev/tty* >> crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty >> crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 >> crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 >> crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 >> crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 >> ... >> crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 >> crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 >> crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 >> >> >> > Hi Kim What rxtx does is try to open the port and do a timed out read. If the kernel/... do not complain it's enumarted. I suspect you could do a crude test by doing something like cat /dev/ttyS0 > /dev/null If that barfs then rxtx wont enumerate the port. hmm looking at your question again, I suspect it's a lockfile problem. This is documented in INSTALL with the source. Its easy enough to test this too.. touch /var/lock/testingrxtxlockfiles && rm -f /var/lock/testingrxtxlockfiles If you are not in the right group it will bail. Root will work regardless. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 12:37:56 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 12:37:56 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> Message-ID: <1139341076.8145.11.camel@zd7280> Exactly which ports does rxtx attempt to put into the list ? /dev/* or /dev/tty* or /dev/tty[0-9[0-9] ? or /dev/ttyS* ? For the record, only /dev/ttyUSB0 is a valid port on the machine I am presently on. Will this be a problem ? On Tue, 2006-02-07 at 12:20 -0700, Trent Jarvi wrote: > This is documented in INSTALL with the source. > I was wondering where that file was. I will download source and dig it up. Thanks. -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 12:51:09 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 12:51:09 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139341076.8145.11.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: On Tue, 7 Feb 2006, Kim Lux wrote: > > Exactly which ports does rxtx attempt to put into the list ? /dev/* > or /dev/tty* or /dev/tty[0-9[0-9] ? or /dev/ttyS* ? > > For the record, only /dev/ttyUSB0 is a valid port on the machine I am > presently on. Will this be a problem ? > > > On Tue, 2006-02-07 at 12:20 -0700, Trent Jarvi wrote: >> This is documented in INSTALL with the source. >> > I was wondering where that file was. I will download source and dig it > up. > > Thanks. > Hmm I'm looking at pre17 so this may have changed. (its just what I have on this machine) if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA" // for the IPAQs }; CandidatePortPrefixes=Temp; } So you may need to add "ttyUSB" to that list. RXTX used to enumerate _everything_ see if(osName.equals("Linux-all-ports") But it became less than practical. This is all in RXTXCommDriver.java hmm I just did a cvs update. if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have to get your fingers into the code. We aim for sane defaults. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 13:06:45 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 13:06:45 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139342805.8145.22.camel@zd7280> On Tue, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > Hmm I'm looking at pre17 so this may have changed. (its just what I have > on this machine) > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA" // for the IPAQs > }; > CandidatePortPrefixes=Temp; > } > > > So you may need to add "ttyUSB" to that list. RXTX used to enumerate > _everything_ see if(osName.equals("Linux-all-ports") But it became less > than practical. > > This is all in RXTXCommDriver.java > > hmm I just did a cvs update. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have > to get your fingers into the code. We aim for sane defaults. Excellent. Thanks for taking the time. -- Kim Lux, Diesel Research Inc. From ideiglenes1 at freemail.hu Tue Feb 7 13:53:39 2006 From: ideiglenes1 at freemail.hu (--) Date: Tue, 07 Feb 2006 21:53:39 +0100 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139345619.22534.2.camel@localhost> Hi! I use this code to get all the extra Linux devices. :) if ("Linux".equals(System.getProperty("os.name"))) { System.setProperty("os.name","Linux-all-ports"); } driver = new RXTXCommDriver(); On k, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > On Tue, 7 Feb 2006, Kim Lux wrote: > > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have > to get your fingers into the code. We aim for sane defaults. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From matt.higgins at gmail.com Tue Feb 7 13:45:54 2006 From: matt.higgins at gmail.com (Matt Higgins) Date: Tue, 7 Feb 2006 15:45:54 -0500 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> Message-ID: <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> Sweet this is exactly what I needed. I was searching the archives through marc.theamisgroup they only have archives back to 1/3/05. Should have hit the mailman archive! Thanks a lot! On 2/7/06, Brian Schlining wrote: > > Hi Matt > > The following code works fine on Linux but I never see any data when run > on Windows. This is a cut and paste from the SimpleRead example. > I am attempting to read data from a bar code scanner. I can fire up > HyperTermianl on windows and see that the device is working properly as I > see the barcodes are scanned and echoed back to the terminal. However when I > run the app I don't see any data. It is however associating with the com > port as the informational bits print fine? > > > You're not the only one whose had this problem, I don't know if Trent has > addressed this is the latest release of RXTX but there is a workaround. > Here's the recent thread from the RXTX mailing list regarding this issues: > > Thanasis Delenikas tdelenik at gmail.com > Wed Jan 18 13:56:23 MST 2006 > > * Previous message: [Rxtx] Re: More close() performance fixes > * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] > > Hi all. > (I've subscribed again from my other email account). > > Trent, > > You are right. Linux *always* works, no matter what flow control you set. > Windows *works only* with hardware flow control (I haven't tested what > happens with software XON/XOFF flow control). > > I assume (but I am not certain) that even with no flow control at all, all > platforms should work. Without flow control, you have the risk of bumping > into overflow or framing errors, but that's your (the end programmer, I > mean) problem. > > >From my side, I shouldn't be working without flow control. That was a bug > too... It was some code forgotten from the old times, when I used to work > with phone emulation drivers which didn't support flow control. The > correct > way is to have some flow control enabled and that's why I suppose this is > a > low-severity bug for RxTx. > > I have no idea which platform shows the correct behaviour, since > my knowledge about Linux and the inner workings of these low-level i/o > operations is limited. > > Regards, > Thanasis Delenikas. > > > > > Message: 2 > > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > > From: Trent Jarvi > > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > > To: RXTX Developers and Users > > Message-ID: > > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > > > Hi all, > > > > > > Trent, I have found something. > > > I read your comment about flow control, so I experimented a bit. > > > > > > If you remember, in my sample program I've used no flow control at all > ( > > i.e. > > > Java constant FLOWCONTROL_NONE). > > > > > > Now, during testing, I've switch to hardware inbound flow control (i.e > . > > Java > > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > > beautifully! > > > > > > I think I will switch to H/W flow control and test things for a while, > > but > > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > > > > > Hi Thanasis, > > > > I'm fairly sure you have identified a bug. I would not worry too much > > about what Sun CommAPI w32 defaults are. I think they did more or less > > whatever the port opened with. Just a guess. Linux tries to stomp on > > ports so they are all the same. > > > > So this started out with Linux worked, Windows XP/.. did not as I > recall. > > Something is wrong in rxtx. Do I understand this right? > > > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > > > Perhaps there is something Wayne or I did not understand when we wrote > > that code. I wasnt programming back in the BBS days so modems are not > my > > thing. I have a few questions. > > > > Is the above matrix confirmed by observation? > > Linux just always worked? > > Which one _should_ work? I'm guessing modems work with hardware flow > > control. I'll have to dig around. > > > > The windows flow control changes a couple things with hardware flow > > control. Following the w32 API documentation is confusing sometimes. > > But it looks like Linux could have a bug too. > > Cheers > > Brian Schlining > Software Engineer > http://www.mbari.org > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/9c989144/attachment-0045.html From tjarvi at qbang.org Tue Feb 7 14:06:14 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 14:06:14 -0700 (MST) Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> Message-ID: >> >> You're not the only one whose had this problem, I don't know if Trent has >> addressed this is the latest release of RXTX but there is a workaround. >> Here's the recent thread from the RXTX mailing list regarding this issues: >> I have not. I expect to have access to some test equipment next month and I'll go through all of this. I really don't know whats going on and I need a gold standard. I thought maybe linux was autodetecting the flow control. Your observations would certainly be welcome. I need to talk to Russell King and see what he is doing. Until then I'd just be toying around over a loopback as usual. This is very high on the list though. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 17:25:05 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 17:25:05 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139358305.17994.2.camel@zd7280> My application now works. I installed the libraries and jar from 2.1-7 (Final). portlist.hasMoreElements is no longer false. The application finds the port for /dev/ttyUSB0. Thanks for your help, Trent (et al) Sorry I bothered you with this. Next time I will look in the source first. I didn't think it was an rxtx issue, I thought it was a Linux setup issue . On Tue, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > Hmm I'm looking at pre17 so this may have changed. (its just what I > have > on this machine) > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux > Serial Ports > "ttySA" // for the > IPAQs > }; > > CandidatePortPrefixes=Temp; > } > > > So you may need to add "ttyUSB" to that list. RXTX used to enumerate > _everything_ see if(osName.equals("Linux-all-ports") But it became > less > than practical. > > This is all in RXTXCommDriver.java > > hmm I just did a cvs update. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux > Serial Ports > "ttySA", // for the > IPAQs > "ttyUSB" // for USB > frobs > }; > > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you > have > to get your fingers into the code. We aim for sane defaults. -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 19:21:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 19:21:54 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139358305.17994.2.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> <1139358305.17994.2.camel@zd7280> Message-ID: >Sorry I bothered you with this. Next time I will look in the source >first. I didn't think it was an rxtx issue, I thought it was a Linux >setup issue . Why would you be sorry? I would have done the same. I'm glad it's working :) -- Trent Jarvi tjarvi at qbang.org From tma at mail.island.net Wed Feb 8 13:39:35 2006 From: tma at mail.island.net (Tom Alldread) Date: Wed, 08 Feb 2006 12:39:35 -0800 Subject: [Rxtx] Win32/Linux Serial Port Data Dropouts In-Reply-To: <200602060702.k167255O007882@www.qbang.org> References: <200602060702.k167255O007882@www.qbang.org> Message-ID: <43EA5707.4020200@mail.island.net> Greetings Folks at RXTX: During the last couple of months I have been alternately testing with javax.comm 2 and RXTX 2.1 under Windows XP and CommApi 3 and RXTX 2.1 under Suse 10.0 Linux. In the process I have learned a little about java multi-threading under NetBeans 5 with Profiler. My java (jdk 1.5_06) application is used for data acquisition and provides a graphical display of A-D conversion data received from a 56KBaud serial port. The actual data throughput is about 10KBaud thus it is well below the speed of the port. I use hardware RTS/CTS flow control which can stall the data acquisition sample rate if necessary. This ensures the display computer has the ability to slow the data acquisition rate should it become too busy to accept the regular data flow. Both the serial port buffer and the java read buffer are set at 16KB. Usually the data transfers into the java read buffer are less than 100 bytes unless the data acquisition is recovering from a stall. The data flow normally hesitates after each 5 KB block as a continue command is needed from the display computer to start the drawing of a new graphics display line. Separate threads have been provided for the serial port event monitoring and data processing. The serial port event thread has been given the maximum priority and data processing thread the minimum priority provided by java. Thread yield statements have been placed within all data processing while/for loops as an effort to ensure quick access to CPU cycles for the serial port event thread. I have found that short data transmissions are essentially error free but occasional dropouts occur with continuous data flow especially under Windows XP. ....................................................................................................................................................................................... Linux results: I am happy to report that RXTX 2.1 appears to work very well under Linux although I did notice some errors when the screen savers were running with my dual monitors. I believe this is a local problem associated with my dual graphics which needs further attention. The recent CommApi 3 Linux release from Sun did not work at all with my program. It seemed to send commands out OK but did not receive any data. Although the serial port event triggered the ISR, the input stream appeared filled with nulls and thus did not contain any data. As my understanding is that CommApi 3 was tested with a Red Hat distribution of Linux I wonder if this problem is distro dependent? Although somewhat off topic here I wonder if anyone reading this has had similar experience? .................................................................................................................................................................................. Windows XP results: There are problems with occasional data dropouts which become more frequent as the sampling rate is increased or if the computer becomes busy with other duties. The dropouts typically consist of a half dozen byte block of lost data. It appears the lost bytes never get added to the java input stream. There has not been any indication of garbled data, overruns or framing errors which suggests the UART communications remains solid. Using javax.comm 2 I found that the setting of SerialPort 'enableReceiveThreshold' to 40 and 'enableReceiveTimeout' of 100mS reduced the dropouts error rate significantly. I found that I could not get RXTX 2.1 to function with the aforementioned threshold and timeout settings. The javax.comm 2 interface is consequently performing better for me under Windows than RXTX 2.1. I wonder if anyone here has any suggestions as to what I might try to improve RXTX 2.1? Although my settings are the same as under Suse 10.0, RXTX 2.1 performs much better for me under Linux than any of the alternatives that I have tried under Windows XP . ............................................................................................................................................................................... I would like to establish, based on the experience of others, if I have reached the normally expected performance limit of java serial port communications? Should I expect to achieve virtually error free serial port data input from a continuous stream under Windows XP java software? I am considering changing my protocol to packets with error checking if necessary but would like to know if the dropout problems I am experiencing are typical or not before I take this rather work intensive plunge. Many thanks in advance for any help! Best Regards, Tom Alldread -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.375 / Virus Database: 267.15.2/253 - Release Date: 2006-02-07 From jlaxson at mac.com Wed Feb 8 23:56:48 2006 From: jlaxson at mac.com (John Laxson) Date: Thu, 9 Feb 2006 00:56:48 -0600 Subject: [Rxtx] PortInUseException: Unknown Application on OSX Message-ID: Hi, I've been trying to get RXTX 2.1.7 going on Mac OS X for a while here, and am running up into a wall here. I've tried with pre- compiled and the source version and get the same problem, a gnu.io.PortInUseException: Unknown Application. I have run the fixperms script included with the source distribution, and id shows me as a member of the uucp group, and permissions on /var/spool/uucp are 775 root:uucp. Running a test program (included at the bottom for clarity) lets me enumerate all the serial ports correctly, but trying to open any of them gives the PortInUseException. If it helps, when I try to open a port that's set to make an outgoing bluetooth connection, there is no delay and no connection attempt at all. Thanks, John Laxson PS: The documentation wiki on qbang.org shows 404, and has for a few days now. My test code: public static void main(String[] args) { SerialPort serialPort; try { Enumeration e = CommPortIdentifier.getPortIdentifiers(); CommPortIdentifier ident; while (e.hasMoreElements()) { ident = (CommPortIdentifier)e.nextElement(); System.out.println(ident.getName()); } ident = CommPortIdentifier.getPortIdentifier("/dev/cu.modem"); serialPort = (SerialPort) ident.open("Me", 5000); } catch (Exception e) { e.printStackTrace(); } } From rajesh.invincible at gmail.com Thu Feb 9 03:39:38 2006 From: rajesh.invincible at gmail.com (Rajesh N) Date: Thu, 9 Feb 2006 16:09:38 +0530 Subject: [Rxtx] Re: Move .java Files in gnu.io filesystem hierarchy - Maven (2) In-Reply-To: <43DF21D2.7090200@ngi.it> References: <43DF21D2.7090200@ngi.it> Message-ID: <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Can anybody tell me how to overcome these EXCEPTIONS I AM WORKING ON SERIAL COMMN IN JAVA ON LINUX. 1. " NOT ALL PARAMETERS SUPPORTED BY THE KERNEL" This i came across the following statement inmy prog. SerialP is A SerialPort object SerialP.setSerialPortParams(9600(BAUDRATE),DATABITS_8,STOPBITS_1,PARITY_NONE) 2. NullPointer Exception at Event Dispatch Now i have checked all my object references for a null reference but i found none i have put up my entire code in try catch blocks but still I AM UNABLE TO CATCH THIS EXCEPTION AND HENCE MY APPLICATION CLOSES HOW DOES THESE GO? PLEASE HELP ME IT IS URGENTTTTTTTTTTTTTTTT yours sincerely RAJESH On 1/31/06, Fabio Frumento wrote: > Hi Xavier, > > I don't know maven at all but the directory hierarchy listed buy Trent > is fine for me... > > I'll take a look to maven, it seems an interesting project > > Regards > > Fabio Frumento > > Trent Jarvi wrote: > > On Tue, 31 Jan 2006, Xavier Frisaye wrote: > > > >> Hi all, > >> > >> If you are going to rearrange the src folder, i will propose to use > >> maven 2 and follow its directory structure > >> > (http://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html). > >> > >> Maven 2 simplify java project and give a standard way to make projects > >> (http://maven.apache.org/). > >> We are using it for internal projects and we are very satisfied. > >> > >> Is anybody interested? > >> > >> I'm not an expert in maven 2 (yet) but i'm agree to help using it if > >> you choose to make so. > >> > > > > so this would be: > > > > rxtx-devel/src/main/java/gnu.io > > rxtx-devel/src/test/java/ManIwish.java > > > > I don't use IDEs very much so I'll let others comment. But I don't see > > a problem with that. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Thu Feb 9 09:50:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 9 Feb 2006 09:50:31 -0700 (MST) Subject: [Rxtx] Re: Move .java Files in gnu.io filesystem hierarchy - Maven (2) In-Reply-To: <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Message-ID: On Thu, 9 Feb 2006, Rajesh N wrote: > Can anybody tell me how to overcome these EXCEPTIONS > I AM WORKING ON SERIAL COMMN IN JAVA ON LINUX. > > 1. " NOT ALL PARAMETERS SUPPORTED BY THE KERNEL" > > This i came across the following statement inmy prog. > SerialP is A SerialPort object > SerialP.setSerialPortParams(9600(BAUDRATE),DATABITS_8,STOPBITS_1,PARITY_NONE) > Strange. The parameters you use are the same the port should open with by default. Could you paste the actual exception you are getting? I don't see that in the rxtx source. Also it would help to know the rxtx version. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Fri Feb 10 15:29:05 2006 From: lux at diesel-research.com (Kim Lux) Date: Fri, 10 Feb 2006 15:29:05 -0700 Subject: [Rxtx] One serial port object for both sending and receiving ? Message-ID: <1139610545.18177.4.camel@zd7280> Is it OK to use one SerialPort ojbect (ex Serial Port serialPort;) and use it for both sending and receiving ? For example: ======================================================================== static SerialPort serialPort = null; static OutputStream serialOut = null; static InputStream serialIn = null; // assign it to an outputStream for use try{ serialOut = serialPort.getOutputStream(); System.out.println("Serial output stream has been assigned."); }//try catch(IOException e) { System.out.println("Error: Couldn't assign output stream to serial port."); }//catch //assign it to an inputStream for use try{ serialIn = serialPort.getInputStream(); System.out.println("Serial input stream has been assigned."); }//try catch(IOException e) { System.out.println("Error: Couldn't assign input stream to serial port."); }//catch ======================================================================== -- Kim Lux, Diesel Research Inc. From lux at diesel-research.com Fri Feb 10 21:23:00 2006 From: lux at diesel-research.com (Kim Lux) Date: Fri, 10 Feb 2006 21:23:00 -0700 Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Message-ID: <1139631780.23882.10.camel@zd7280> I've got a problem receiving chars with my version of serialRead, written in an SWT GUI. I had a Java pro have a good look at my code and he can't see anything wrong with it. I can send chars fine. When I receive a char the cpu usage for the app goes to 100% and the code in the serial event handler doesn't get executed. The instructions on the Java Comm Serial API How-To for Linux page state that I must install javacomm. Is that true ? Everything builds without it and I can send chars on rxtx just fine, but I can't receive them. Could this be the problem ? I downloaded and installed javacomm. I was not able to add "Driver=gnuio.RXTXCommDriver to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 installed in /usr/java/jre1.5.0_05. I added comm.jar to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext to the library paths. Is this OK ? Does it matter that I am receiving on /dev/ttyUSB0 ? Thanks. -- Kim Lux, Diesel Research Inc. From lunareclipse03 at web.de Sat Feb 11 09:44:46 2006 From: lunareclipse03 at web.de (lunareclipse03@web.de) Date: Sat, 11 Feb 2006 17:44:46 +0100 Subject: [Rxtx] Question about Serial I/O under Win32 Message-ID: <662084330@web.de> Hello everybody, I have a strange problem with a piece of code I made for myself. No, this is not really concerning rxtx, but nevertheless I post this to the list, hoping that some of you can help me. I've written two libraries, one for linux and one for win32. The linux port works quite well, I can send / receive faxes and / or replay voice messages over the telephone line using a voice modem. But the win32 port of the library causes some trouble. If, for example, I send out a fax with a certain modem under linux, it works well. The fax is complete when it comes out of the fax machine. If I then use the same modem to send out a fax under win32, the fax coming out of the fax machine gets "stuck" halfways, but the sending modem thinks that transmission was ok and drops the connection. The answering fax machine then gives me "error while receiving." The "upper layer" java code MUST be right, because if I do the same thing under linux (using the linux library), everything is alright. Now I have to ask: Can somebody please help me out with this??!? Could it be the case that some kind of flow control or COMMTIMEOUTS setting causes this behaviour? I set flow control to RTS/CTS before sending out a fax. How can I DISABLE flow control? Or what do you think? Can something else cause this problems? Thank you all for your time and PLEASE write back soon. Regards, --Sven Ahlemann Am Waldrand 31 45721 Haltern am See Germany ______________________________________________________________ Verschicken Sie romantische, coole und witzige Bilder per SMS! Jetzt bei WEB.DE FreeMail: http://f.web.de/?mc=021193 From lux at diesel-research.com Sat Feb 11 10:06:52 2006 From: lux at diesel-research.com (Kim Lux) Date: Sat, 11 Feb 2006 10:06:52 -0700 Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: <1139631780.23882.10.camel@zd7280> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> <1139631780.23882.10.camel@zd7280> Message-ID: <1139677612.3431.5.camel@zd7280> More on this problem. I copied and pasted simpleRead into a console based Eclipse project and I've got the same result, except that cpu usage doesn't go to 100%. I'm beginning to think there is an issue in rxtx. My imports for simpleRead are: ============================ import gnu.io.*; import java.util.*; //import javax.comm.*; import java.io.*; =========================== Any ideas ? I am trying to read from /dev/ttyUSB0 using a serial to USB adapter which has worked well with minicom and gtkterm. Thanks. On Fri, 2006-02-10 at 21:23 -0700, Kim Lux wrote: > I've got a problem receiving chars with my version of serialRead, > written in an SWT GUI. > > I had a Java pro have a good look at my code and he can't see anything > wrong with it. > > I can send chars fine. When I receive a char the cpu usage for the app > goes to 100% and the code in the serial event handler doesn't get > executed. > > The instructions on the Java Comm Serial API How-To for Linux page state > that I must install javacomm. Is that true ? Everything builds without > it and I can send chars on rxtx just fine, but I can't receive them. > Could this be the problem ? > > I downloaded and installed javacomm. I was not able to add > "Driver=gnuio.RXTXCommDriver > to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not > have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 > installed in /usr/java/jre1.5.0_05. I added comm.jar > to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext > to the library paths. Is this OK ? > > Does it matter that I am receiving on /dev/ttyUSB0 ? > > Thanks. > -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Sun Feb 12 21:01:33 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:01:33 -0700 (MST) Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: <1139677612.3431.5.camel@zd7280> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> <1139631780.23882.10.camel@zd7280> <1139677612.3431.5.camel@zd7280> Message-ID: I suspect what is happening is the select() is breaking out in the native code but the driver does not have support for notifying there are X bytes available. On some traditional Unix based systems, the only way you know data is available is the fd status changes and do an FIORDCHK ioctl. Or perhaps the only thing you can know is the fd status changed. It would take reading through the kernel driver code to know for sure. So on USB, depending upon the driver, the same may need to be done or the driver improved a bit if possible to support. Polling reads will also work but don't use the event driven model of CommAPI which isnt acceptable in the long run. The 100% cpu usage can then be explained because select no longer blocks until the data is read; the eventLoop spins loose. You can put a well placed sleep but rxtx only expects those are needed when it knows data is available. This may not be a super simple thing to understand and fix. I do have ideas to get you started. I'm going to be short on time the next couple weeks. I expect to put some good time in and answer some other questions I saw around the 25th. For now, I'd look at the following and go from there with the hints I've given. JNIEXPORT jint JNICALL RXTXPort(nativeavailable)( JNIEnv *env, jobject jobj ) { int fd = get_java_var( env, jobj,"fd","I" ); int result; /* char message[80]; ENTER( "RXTXPort:nativeavailable" ); On SCO OpenServer FIONREAD always fails for serial devices, so try ioctl FIORDCHK instead; will only tell us whether bytes are available, not how many, but better than nothing. This turns out to be true on Solaris also. taj. */ #ifdef FIORDCHK /* __unixware__ __sun__ probably others */ result = ioctl(fd, FIORDCHK, 0); #else if( ioctl( fd, FIONREAD, &result ) < 0 ) { goto fail; } #endif /* FIORDCHK */ On Sat, 11 Feb 2006, Kim Lux wrote: > > More on this problem. I copied and pasted simpleRead into a console > based Eclipse project and I've got the same result, except that cpu > usage doesn't go to 100%. I'm beginning to think there is an issue in > rxtx. > > My imports for simpleRead are: > > ============================ > import gnu.io.*; > import java.util.*; > //import javax.comm.*; > import java.io.*; > =========================== > > Any ideas ? I am trying to read from /dev/ttyUSB0 using a serial to > USB adapter which has worked well with minicom and gtkterm. > > Thanks. > > > > On Fri, 2006-02-10 at 21:23 -0700, Kim Lux wrote: >> I've got a problem receiving chars with my version of serialRead, >> written in an SWT GUI. >> >> I had a Java pro have a good look at my code and he can't see anything >> wrong with it. >> >> I can send chars fine. When I receive a char the cpu usage for the app >> goes to 100% and the code in the serial event handler doesn't get >> executed. >> >> The instructions on the Java Comm Serial API How-To for Linux page state >> that I must install javacomm. Is that true ? Everything builds without >> it and I can send chars on rxtx just fine, but I can't receive them. >> Could this be the problem ? >> >> I downloaded and installed javacomm. I was not able to add >> "Driver=gnuio.RXTXCommDriver >> to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not >> have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 >> installed in /usr/java/jre1.5.0_05. I added comm.jar >> to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext >> to the library paths. Is this OK ? >> >> Does it matter that I am receiving on /dev/ttyUSB0 ? >> >> Thanks. >> > From tjarvi at qbang.org Sun Feb 12 21:03:30 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:03:30 -0700 (MST) Subject: [Rxtx] One serial port object for both sending and receiving ? In-Reply-To: <1139610545.18177.4.camel@zd7280> References: <1139610545.18177.4.camel@zd7280> Message-ID: On Fri, 10 Feb 2006, Kim Lux wrote: > > Is it OK to use one SerialPort ojbect (ex Serial Port serialPort;) and > use it for both sending and receiving ? > > For example: > > ======================================================================== > static SerialPort serialPort = null; > static OutputStream serialOut = null; > static InputStream serialIn = null; > > > > > // assign it to an outputStream for use > try{ > serialOut = serialPort.getOutputStream(); > System.out.println("Serial output stream has been assigned."); > }//try > catch(IOException e) > { > System.out.println("Error: Couldn't assign output stream to serial > port."); > }//catch > > > //assign it to an inputStream for use > try{ > serialIn = serialPort.getInputStream(); > System.out.println("Serial input stream has been assigned."); > }//try > catch(IOException e) > { > System.out.println("Error: Couldn't assign input stream to serial > port."); > }//catch This should be fine. In fact trying to do it another way will probably not work as you will run into lockfile issues. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun Feb 12 21:13:13 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:13:13 -0700 (MST) Subject: [Rxtx] Question about Serial I/O under Win32 In-Reply-To: <662084330@web.de> References: <662084330@web.de> Message-ID: On Sat, 11 Feb 2006 lunareclipse03 at web.de wrote: > Hello everybody, > > I have a strange problem with a piece of code I made for myself. No, > this is not really concerning rxtx, but nevertheless I post this to the > list, hoping that some of you can help me. I've written two libraries, > one for linux and one for win32. The linux port works quite well, I can > send / receive faxes and / or replay voice messages over the telephone > line using a voice modem. But the win32 port of the library causes some > trouble. If, for example, I send out a fax with a certain modem under > linux, it works well. The fax is complete when it comes out of the fax > machine. If I then use the same modem to send out a fax under win32, the > fax coming out of the fax machine gets "stuck" halfways, but the sending > modem thinks that transmission was ok and drops the connection. The > answering fax machine then gives me "error while receiving." The "upper > layer" java code MUST be right, because if I do the same thing under > linux (using the linux library), everything is alright. Now I have to > ask: Can somebody please help me out with this??!? Could it be the case > that some kind of flow control or COMMTIMEOUTS setting causes this > behaviour? I set flow control to RTS/CTS before sending out a fax. How > can I DISABLE flow control? Or what do you think? Can something else > cause this problems? Thank you all for your time and PLEASE write back > soon. > Hi Sven I'm not too willing to talk about flow control at the low level until I confirm some things with test equipment later. It is not clear if you are using rxtx or writing your own native code. So I'm not sure how to answer much of this :) If you are wondering how to change the flow control using rxtx from java, The BlackBox example from Sun flips this back and forth. SerialPort.java in rxtx 2.1 uses the following: SerialPort.java: public static final int FLOWCONTROL_NONE =0; SerialPort.java: public static final int FLOWCONTROL_RTSCTS_IN =1; SerialPort.java: public static final int FLOWCONTROL_RTSCTS_OUT =2; SerialPort.java: public static final int FLOWCONTROL_XONXOFF_IN =4; SerialPort.java: public static final int FLOWCONTROL_XONXOFF_OUT=8; So if you set flowcontrol to RTSCTS, you can set it to NONE to turn it off. If you are looking for how to do it in native code, the rxtx Source is SerialImp.c (unix/linux/mac os x/w32) and termios.c (w32 only with SerialImp.c) You can track the code: SerialImp.c:JNIEXPORT void JNICALL RXTXPort(setflowcontrol)( JNIEnv *env, jobject jobj, jint flowmode ) termios.c:int tcgetattr( int fd, struct termios *s_termios ) termios.c:int tcsetattr( int fd, int when, struct termios *s_termios ) There may be a problem in the rxtx flow control code though. Rather than guess, I want to test this with a gold standard. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Feb 6 00:00:16 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 00:00:16 -0700 (MST) Subject: [Rxtx] wiki delay until tomorrow night. In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: On Sun, 5 Feb 2006, Trent Jarvi wrote: > On Sun, 5 Feb 2006, Kim Lux wrote: > >> usb ? Tell me more... I need that too. > > usb is a very proper design. Thats all it is. > Maybe rxtx could help usb. But it would start with helping bring back the community that was already there. It's not something I'd love to do but maybe its the right thing to do. It would probably take 2 years to do right. But maybe thats better than what we have now. I honestly don't know what IBM is doing which could just run over everything. Just some thoughts after some fine german wine. -- Trent Jarvi tjarvi at qbang.org From gadelavega at yahoo.com.ar Mon Feb 6 02:17:05 2006 From: gadelavega at yahoo.com.ar (Gonzalo A. de la Vega) Date: Mon, 06 Feb 2006 10:17:05 +0100 Subject: [Rxtx] Serial port ownership question In-Reply-To: References: <20060205113618.30274.qmail@web53501.mail.yahoo.com> <1139157422.4553.9.camel@zd7280> <1139158698.4936.9.camel@zd7280> Message-ID: <43E71411.4050402@yahoo.com.ar> On my Fedora Core 4: ls -l /dev/ttyS* crw-rw---- 1 root uucp 4, 64 Feb 6 2006 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Feb 6 2006 /dev/ttyS1 ... and: grep "ttyUSB" /etc/udev/rules.d/50-udev.rules KERNEL=="ttyUSB*", GROUP="uucp", MODE="0660" So anyone in the "uucp" group can use serial ports. On Gentoo the group is "tty". Trent Jarvi escribi?: > > > On Sun, 5 Feb 2006, Dr. Douglas Lyon wrote: > >> I can confirm that this is the case (only root ownership of >> serial ports, under fedora 4). >> Wow, what were they thinking?! >> - DL >> >>> I've found that the newer kernels have the serial ports owned by root. >>> For example, >>> >>> $ls -al /dev/tty* >>> crw-rw-rw- 1 root root 5, 0 Feb 5 02:06 /dev/tty >>> crw-rw---- 1 root root 4, 0 Feb 5 02:06 /dev/tty0 >>> crw------- 1 root root 4, 1 Feb 5 09:07 /dev/tty1 >>> crw-rw---- 1 root tty 4, 10 Feb 5 02:06 /dev/tty10 >>> crw-rw---- 1 root tty 4, 11 Feb 5 02:06 /dev/tty11 >>> ... > > > This is just not a problem jcp or such are going to solve. Its a > platform spitwad fight. But do look at pam. In fact thats what Sun > is doing too. Maybe Linux followed their lead.. I'm not a pam guy. > I've spent 16 hours trying to understand it but your users wont :) > > Solution? I have no clue. Its two tangent mentalities from my > perspective. > > -- > Trent Jarvi > tjarvi at qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mtnvega at yahoo.com.br Mon Feb 6 05:35:43 2006 From: mtnvega at yahoo.com.br (Luiz Jr) Date: Mon, 6 Feb 2006 12:35:43 +0000 (GMT) Subject: [Rxtx] Documentation Wiki In-Reply-To: <1139157422.4553.9.camel@zd7280> Message-ID: <20060206123543.57256.qmail@web53515.mail.yahoo.com> Hello, Thank you for you answer, but so the usage of the API is pretty much like the Java Communications Api? If yes, what version of the Java Comm Api? Thank you, Luiz A. Brandao Jr Kim Lux escreveu: On Sun, 2006-02-05 at 08:36 -0300, Luiz Jr wrote: > Hello, > > I want to start using the RXTX libraries, but I would to know how, > since I can not access the documentation wiki page I just started using them yesterday. Below is how I installed the libraries, if that helps. I used snippets of code from the SimpleWrite application here to get me going. http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html Instead of "import javax.comm.*;", use "import gnu.io.*;" which is gotten from RXTXcomm.jar, which you will need to include in your project references. I am working in Eclipse. BTW: there is no way to open a port without going through the port list and finding it. Maybe sometime in the future someone (me ?) will write a method called openSerialPort that allows the user to give a port identifier, such as "/dev/tty1" and return a port ready to use. It wouldn't take much to write that and it would save users a lot of code. Hope this helps. ======================================================================= 1) Figure out which java you are running, incase there is more than one installed. $ java -version java version "1.5.0_05" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_05-b05) Java HotSpot(TM) Client VM (build 1.5.0_05-b05, mixed mode, sharing) 2) Find all the jre directories and the one from which you are currently running. kfind (jre) 3) cd to that directory plus /lib/i386 cd /usr/java/jre1.5.0_05/lib/i386 4) Copy the library files (*.so) to that directory. cp /home/krlux/Desktop/'Java Controls'/rxtx-linux/bin/* . 5) Check that the copy was successful ls librxtx* librxtxI2C.so librxtxRaw.so librxtxSerial.so librxtxParallel.so librxtxRS485.so 6) cd to the /lib/ext directory for your java. cd /usr/java/jre1.5.0_05/lib/ext 7) Copy the Jar files there cp /home/krlux/Desktop/'Java Controls'/rxtx-linux/lib/ext/* . 8) Check that it was successful ls RXTX* RXTXcomm.jar Rxtx is now installed on your machine ready to use. =================================================================== -- Kim Lux, Diesel Research Inc. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx --------------------------------- Yahoo! Acesso Gr?tis - Internet r?pida e gr?tis. Instale o discador agora! -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/544aa403/attachment-0046.html From lyon at docjava.com Mon Feb 6 05:49:34 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 06 Feb 2006 07:49:34 -0500 Subject: [Rxtx] wiki delay until tomorrow night. In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: Hi All, I have often thought about USB drivers being needed. For example, the ironman watch will not interface to a mac (windows only). It is USB. My dymo label writer has no Java driver (native only). Etc. Most cheap web cameras are USB (and Java drivers go through JAI, if it supports the camera at all). The JAI code shows how sun did the USB drivers. You have to be a member of the jai project to download the source code. https://jai.dev.java.net has the jai distro. And then you are not allowed to redistribute it. However, we can all learn from it (if so inclined). Basically: cvs -d :pserver:lyon at cvs.dev.java.net:/cvs login cvs -d :pserver:lyon at cvs.dev.java.net:/cvs checkout jai-core You will need to user your own uid and pw to get in. The ant build has over 100 warnings from sun deprecations of its own code. You might say that they were hoisted on their own Picard ;) One interesting thing is that they support several platforms: linux-amd64 64-bit Linux-AMD64 linux-i586 32-bit Linux-x86 solaris-amd64 64-bit Solaris-AMD64 solaris-i586 32-bit Solaris-x86 solaris-sparc 32-bit Solaris-SPARC solaris-sparcv9 64-bit Solaris-SPARC windows-i586 32-bit Windows-x86 Thus, ant is used to provide a multi-platform native method distro. Neat. How do they do it? check this out: And: The core download does not contain any C source code (it was all pre-built). Basically, they are just copying .so and .dll files into build directories. I would love to see the C code for this...but Sun does not post it on the https://jai.dev.java.net site. I don't know why...Perhaps I missed it. - Doug >On Sun, 5 Feb 2006, Trent Jarvi wrote: > >>On Sun, 5 Feb 2006, Kim Lux wrote: >> >>>usb ? Tell me more... I need that too. >> >>usb is a very proper design. Thats all it is. >> > >Maybe rxtx could help usb. But it would start with helping bring >back the community that was already there. > >It's not something I'd love to do but maybe its the right thing to do. > >It would probably take 2 years to do right. But maybe thats better >than what we have now. > >I honestly don't know what IBM is doing which could just run over everything. > >Just some thoughts after some fine german wine. > >-- >Trent Jarvi >tjarvi at qbang.org > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tdelenik at gmail.com Mon Feb 6 05:56:32 2006 From: tdelenik at gmail.com (Thanasis Delenikas) Date: Mon, 6 Feb 2006 14:56:32 +0200 Subject: Fwd: [Rxtx] Documentation Wiki In-Reply-To: <1139157422.4553.9.camel@zd7280> References: <20060205113618.30274.qmail@web53501.mail.yahoo.com> <1139157422.4553.9.camel@zd7280> Message-ID: <310a1a930602060456t129f1dc6p5f2b908f13ab5a0b@mail.gmail.com> Hello all, Kim, this is a snippet from the code I use. The closest to directly opening a specific port without enumeration. << ... portId = CommPortIdentifier.getPortIdentifier(getPort()); serialPort = (SerialPort) portId.open("jSMSEngine", 1971); ... >> where getPort() return the string identifier of the port, i.e. "/dev/ttyS0" or "COM1" or whatever. Thanasis. ---------- Forwarded message ---------- From: Kim Lux Date: Feb 5, 2006 6:37 PM Subject: Re: [Rxtx] Documentation Wiki To: RXTX Developers and Users BTW: there is no way to open a port without going through the port list and finding it. Maybe sometime in the future someone (me ?) will write a method called openSerialPort that allows the user to give a port identifier, such as "/dev/tty1" and return a port ready to use. It wouldn't take much to write that and it would save users a lot of code. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/182ab5b8/attachment-0046.html From tjarvi at qbang.org Mon Feb 6 11:53:57 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 11:53:57 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: On Mon, 6 Feb 2006, Dr. Douglas Lyon wrote: > Hi All, > I have often thought about USB drivers being needed. > For example, the ironman watch will not interface > to a mac (windows only). It is USB. > My dymo label writer has no Java driver (native only). > Etc. > Most cheap web cameras are USB (and Java drivers go > through JAI, if it supports the camera at all). > The JAI code shows how sun did the USB drivers. > You have to be a member of the jai project to download > the source code. > https://jai.dev.java.net has the jai distro. > And then you are not allowed to redistribute it. However, > we can all learn from it (if so inclined). Basically: > cvs -d :pserver:lyon at cvs.dev.java.net:/cvs login > cvs -d :pserver:lyon at cvs.dev.java.net:/cvs checkout jai-core > You will need to user your own uid and pw to get in. > The ant build has over 100 warnings from sun deprecations > of its own code. > > You might say that they were hoisted on their own Picard ;) > > One interesting thing is that they support several platforms: > linux-amd64 64-bit Linux-AMD64 > linux-i586 32-bit Linux-x86 > solaris-amd64 64-bit Solaris-AMD64 > solaris-i586 32-bit Solaris-x86 > solaris-sparc 32-bit Solaris-SPARC > solaris-sparcv9 64-bit Solaris-SPARC > windows-i586 32-bit Windows-x86 > Thus, ant is used to provide a multi-platform native method distro. > Neat. > How do they do it? > check this out: > > > > > > > > > > > > > And: > > > > > > > > > > The core download does not contain any C source code (it was all pre-built). > Basically, they are just copying .so and .dll files into build directories. > > I would love to see the C code for this...but Sun does not post it on the > https://jai.dev.java.net site. > > I don't know why...Perhaps I missed it. > > - Doug > > I've looked at moving rxtx to Ant builds. I think that would help IDEs a great deal. I requested a evalutation desk copy the O'Reilly Ant book for some j2ee material I was teaching. http://www.oreilly.com/catalog/anttdg/ It has a one sentence mention of JNI. So there was not luck there. I saw that there is another Ant book that does mention JNI more. I can't find it now. Ant must be able to support it with extensions. http://ant.apache.org/manual/OptionalTasks/javah.html What the auto(break :) tools do in the rxtx build is 4 things really. 1) gcc compile flags 2) ld compile flags 3) config.h 4) compile flags for customizing rxtx (lockfiles, ...) See 1 All of this information except 4 can be static once obtained. So I'm not attached to the auto tools. If I could find an example of Ant being used for JNI code, I'd be one of the first to start moving that direction. Maybe someone saw an example someplace. The other thing we have not completed discussing is the directory structure. There is interest in making rxtx more IDE friendly. I get more mail about that off the list than how to install rxtx. And I see we have Ken Thompson in da house :) He is our trusted CVS maintainer and the guy that purchased the rxtx.org domain. Old community. We will need Ken for changing the directory structure of source. I would like to open up discussion about both of these as it is more than time. The problem is I have little experience with Ant and even less with IDEs. It would be nice if we could work with Eclipse and NetBeans. http://www.netbeans.org/ (sun and some community) http://www.eclipes.org (ibm,rhat,... perhaps more community) http://maven.apache.org/what-is-maven.html (apache. It is community) borland should sortof be here too but I think thats covered in eclipse. >From what I understand so far, we should morph rxtx to support those three maybe trusting apaches lead with maven. But I use vi. I have little to no clues beyond what people have fed me. Can we agree that thats the right direction to go? -- Trent Jarvi tjarvi at qbang.org From brian at mbari.org Mon Feb 6 14:57:50 2006 From: brian at mbari.org (Brian Schlining) Date: Mon, 6 Feb 2006 13:57:50 -0800 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> > The other thing we have not completed discussing is the directory > structure. There is interest in making rxtx more IDE friendly. I > get more mail about that off the list than how to install rxtx. > > And I see we have Ken Thompson in da house :) He is our trusted > CVS maintainer and the guy that purchased the rxtx.org domain. Old > community. We will need Ken for changing the directory structure of > source. > > I would like to open up discussion about both of these as it is > more than time. The problem is I have little experience with Ant > and even less with IDEs. It would be nice if we could work with > Eclipse and NetBeans. > > http://www.netbeans.org/ (sun and some community) > http://www.eclipes.org (ibm,rhat,... perhaps more community) > http://maven.apache.org/what-is-maven.html (apache. It is community) > borland should sortof be here too but I think thats covered in > eclipse. > >> From what I understand so far, we should morph rxtx to support >> those three > maybe trusting apaches lead with maven. But I use vi. I have > little to no clues beyond what people have fed me. > Maven likes the directory structure below for Java code. (From http:// maven.apache.org/guides/getting-started/index.html) This structure works fine with ant, netbeans, and eclipse. rxtx_root_directory `-- src |-- main | `-- java | `-- gnu | `-- io `-- test `-- java `-- gnu `-- io Brian Schlining Software Engineer http://www.mbari.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/d9451eba/attachment-0046.html From tjarvi at qbang.org Mon Feb 6 15:11:45 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 15:11:45 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: > rxtx_root_directory > `-- src > |-- main > | `-- java > | `-- gnu > | `-- io > `-- test > `-- java > `-- gnu > `-- io > >From what I understand this will just be good. For me it makes no difference. So lets do the rxtx thing. Let if fester for two weeks and if nobody objects, we will do it. I'm not doing this because I care. I'm doing this to eliminate much of my inbox. But test... man is rxtx lacking there in the community aspect. It is covered but not right. _maybe_ I can change that this year. -- Trent Jarvi tjarvi at qbang.org (cat hurding since 1997) From lux at diesel-research.com Mon Feb 6 21:38:49 2006 From: lux at diesel-research.com (Kim Lux) Date: Mon, 06 Feb 2006 21:38:49 -0700 Subject: [Rxtx] How can I use Lock Files with rxtx (in FC4) ? Message-ID: <1139287129.17031.3.camel@zd7280> I am now running an rxtx application on FC4. I am getting: ========================================================= check_group_uucp(): error testing lock file creation Error details: Permission denied check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL ========================================================= $ ls -al /var/lock total 32 drwxrwxr-x 4 root lock 4096 Feb 6 16:04 . drwxr-xr-x 24 root root 4096 Nov 14 01:19 .. drwx------ 2 root root 4096 Apr 27 2005 lvm drwxr-xr-x 2 root root 4096 Feb 6 16:04 subsys How do I fix this for regulator users ? -- Kim Lux, Diesel Research Inc. From dmarkman at mac.com Mon Feb 6 22:24:44 2006 From: dmarkman at mac.com (Dmitry Markman) Date: Tue, 7 Feb 2006 00:24:44 -0500 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: if I understands the issue right in order to be able to use ant for c/c++ compilation you have to install ant's cc task http://ant-contrib.sourceforge.net/cc.html it looks like it should work on mac os x (authors claim, that it's platform independent) but I never tested so all you have to do it's providing right command line for the gcc compiler On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: >> rxtx_root_directory >> `-- src >> |-- main >> | `-- java >> | `-- gnu >> | `-- io >> `-- test >> `-- java >> `-- gnu >> `-- io >> > > >> From what I understand this will just be good. > > For me it makes no difference. So lets do the rxtx thing. Let if > fester for two weeks and if nobody objects, we will do it. > > I'm not doing this because I care. I'm doing this to eliminate > much of my inbox. > > But test... man is rxtx lacking there in the community aspect. It > is covered but not right. _maybe_ I can change that this year. > > -- > Trent Jarvi > tjarvi at qbang.org > (cat hurding since 1997) > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx Dmitry Markman From lux at diesel-research.com Mon Feb 6 23:20:15 2006 From: lux at diesel-research.com (Kim Lux) Date: Mon, 06 Feb 2006 23:20:15 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? Message-ID: <1139293215.3689.4.camel@zd7280> I'm running the code below. portlist.hasMoreElements() is false. /dev has ports in it as listed below. What am I doing wrong ? ========================================================== // Step through the list of ports until we find one that matches // the one we are looking for. portList = CommPortIdentifier.getPortIdentifiers(); while(portList.hasMoreElements()) { portID = (CommPortIdentifier) portList.nextElement(); // if (portID.getName().equals("/dev/ttyUSB0")) { myTA.append("Serial port ttyUSB0 has been found\n"); break; }// if portID equals... }// End of while... ========================================================== ls -al /dev/tty* crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 ... crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 -- Kim Lux, Diesel Research Inc. From david.garnier at trusted-logic.com Tue Feb 7 00:46:30 2006 From: david.garnier at trusted-logic.com (David Garnier) Date: Tue, 07 Feb 2006 08:46:30 +0100 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: <43E85056.2090608@trusted-logic.com> Hello, I think that the make-based build process is fine as it is, apart from the location of the Java source files. It is true that putting the Java source in a directory structure that map 1-to-1 to the Java package structure is the norm and should make it easier for everyone to modify the Java source, with or without an IDE. Ant is a good tool, but in the RXTX case I fail to see the advantage of using it compared to the current make-based process. As Trent said, they are more pressing issues, like testing. Regards, David Dmitry Markman wrote: > if I understands the issue right > in order to be able to use ant for c/c++ compilation > you have to install ant's cc task > http://ant-contrib.sourceforge.net/cc.html > > it looks like it should work on mac os x > (authors claim, that it's platform independent) > but I never tested > > so all you have to do it's providing right command line > for the gcc compiler > > > > > On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: > >>> rxtx_root_directory >>> `-- src >>> |-- main >>> | `-- java >>> | `-- gnu >>> | `-- io >>> `-- test >>> `-- java >>> `-- gnu >>> `-- io >>> >> >> >>> From what I understand this will just be good. >> >> For me it makes no difference. So lets do the rxtx thing. Let if >> fester for two weeks and if nobody objects, we will do it. >> >> I'm not doing this because I care. I'm doing this to eliminate much >> of my inbox. >> >> But test... man is rxtx lacking there in the community aspect. It is >> covered but not right. _maybe_ I can change that this year. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> (cat hurding since 1997) From tjarvi at qbang.org Tue Feb 7 01:11:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 01:11:31 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <43E85056.2090608@trusted-logic.com> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: On Tue, 7 Feb 2006, David Garnier wrote: > Hello, > > I think that the make-based build process is fine as it is, apart from the location of the Java > source files. It is true that putting the Java source in a directory structure that map 1-to-1 to > the Java package structure is the norm and should make it easier for everyone to modify the Java > source, with or without an IDE. > > Ant is a good tool, but in the RXTX case I fail to see the advantage of using it compared to the > current make-based process. As Trent said, they are more pressing issues, like testing. > Hi David I have more experience with testing rxtx than I can talk about. But let it be known, rxtx has gone trough 100's of hours of testing. We are hobby folks interested in toys but there is more. rxtx has had some of the best guidance in the industry there. This is not an easy thing. I may be able to come back in a month from the other side of the corperate fence and help. I suspect the tests could just be made public but they are in a very unusual environment that just wont work in a wider sense. This is something I'll be trying to change. At one point it was agreed we could just make the results public so this isnt just noise.. There is interest and I think its safe to mention that much. The big problem with testing in the past is most of it is done with a loopback connection. So we *still* have major questions regarding things like flow control. rxtx talks to itself over a loopback and it works. regardless of right or wrong. This requires more thought to be done right. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Feb 7 02:46:34 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 02:46:34 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: > The big problem with testing in the past is most of it is done with a > loopback connection. So we *still* have major questions regarding things > like flow control. rxtx talks to itself over a loopback and it works. > regardless of right or wrong. With serial communication there are gold standards. ckermit is probably a definitive 'standard.' Maybe its possible to do ping/pong tests with ckermit? Is it scriptable? There are known issues in rxtx. Probably the worst is some threading issues regarding some JREs with multiple JNI threads setting java variables. Man did I get schooled there. Just switch the c functions to returning variables and things go away. Sometimes they work fine, sometimes they blow up. Without understanding everything, somehow rhat got it right and debian (and especially gentoo) grabbed kernel patches causing all sort of harm. Its not hard to fix once you understand whats going on but nearly impossible to track with a debugger. So I have a good idea what 2.1-8 will have outside of the IDE modifications. rxtx 2.1-7 is a release for everyone to sync with. Its not even as stable as -pre17 as far as I know - I ran no test suites. I'll be chasing it too. We just had so many contributions that it was time. It seriously broke internal scheduals but thats a great thing :) The other thing I want to do in 2.1-8 is automagic baud rates. It turns out lots of shops are doing really funky baud rates for things like automobile test equipment. It is possible but it requires a fair amount of change in the native code. Is anyone looking at this? -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Feb 7 02:57:21 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 07 Feb 2006 04:57:21 -0500 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <43E85056.2090608@trusted-logic.com> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: Hi All, I agree, testing is very important. The problem I have been trying to address is related to cross-platform testing and the robust nature of the installs. Typically, I visit 3 platforms to deploy my product, windows, linux and mac. A build is performed on each platform. The idea that you can build for many platforms from one copy the source code seems attractive. This should enable synchronized deployments of identical code. The question of how to achieve this goal remains open. As Trent mentioned, this is hard. Perhaps Ant will help here (but perhaps not). Ant does seem to help with running unit tests. However, it does not help with multi-platform tests. For that you need many machines and different operating environments. Toward that end, I have created a multi-platform test that can be run from web start, located at: http://show.docjava.com:8086/book/cgij/code/jnlp/serialPort.PortTest.jnlp This is interesting because many people in the community can run the test and we can improve the test, as time permits. No, it is not a perfect solution, however, the idea does help with multi-platform tests using many machines and different operating environments. If the group has a good test for a general serial port set-ups, i would be happy to deploy it, for general evaluation using web start. And as for ANT, it is just an idea. Not all my ideas are good ones! - Doug >Hello, > >I think that the make-based build process is fine as it is, apart >from the location of the Java >source files. It is true that putting the Java source in a directory >structure that map 1-to-1 to >the Java package structure is the norm and should make it easier for >everyone to modify the Java >source, with or without an IDE. > >Ant is a good tool, but in the RXTX case I fail to see the advantage >of using it compared to the >current make-based process. As Trent said, they are more pressing >issues, like testing. > >Regards, >David > >Dmitry Markman wrote: >> if I understands the issue right >> in order to be able to use ant for c/c++ compilation >> you have to install ant's cc task >> http://ant-contrib.sourceforge.net/cc.html >> >> it looks like it should work on mac os x >> (authors claim, that it's platform independent) >> but I never tested >> >> so all you have to do it's providing right command line >> for the gcc compiler >> >> >> >> >> On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: >> >>>> rxtx_root_directory >>>> `-- src >>>> |-- main >>>> | `-- java >>>> | `-- gnu >>>> | `-- io >>>> `-- test >>>> `-- java >>>> `-- gnu >>>> `-- io >>>> >>> >>> >>>> From what I understand this will just be good. >>> >>> For me it makes no difference. So lets do the rxtx thing. Let if >>> fester for two weeks and if nobody objects, we will do it. >>> >>> I'm not doing this because I care. I'm doing this to eliminate much >>> of my inbox. >>> >>> But test... man is rxtx lacking there in the community aspect. It is >>> covered but not right. _maybe_ I can change that this year. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> (cat hurding since 1997) > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From matt.higgins at gmail.com Tue Feb 7 08:28:34 2006 From: matt.higgins at gmail.com (Matt Higgins) Date: Tue, 7 Feb 2006 10:28:34 -0500 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final Message-ID: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? import java.io.*; import java.util.*; import gnu.io.*; public class MySimpleRead implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; public static void main(String[] args) { boolean portFound = false; String defaultPort = "COM1"; if (args.length > 0) { defaultPort = args[0]; } portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; MySimpleRead reader = new MySimpleRead(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } } public MySimpleRead() { try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) { e.printStackTrace(); } try { inputStream = serialPort.getInputStream(); } catch (IOException e) { e.printStackTrace(); } try { serialPort.addEventListener(this); } catch (TooManyListenersException e) { e.printStackTrace(); } try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { e.printStackTrace(); } System.out.println("Baud is " + serialPort.getBaudRate()); System.out.println("Bits is " + serialPort.getDataBits()); System.out.println("Stop is " + serialPort.getStopBits()); System.out.println("Par is " + serialPort.getParity()); serialPort.notifyOnDataAvailable(true); readThread = new Thread(this); readThread.start(); } public void run() { // Thread.sleep(20000); //} catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { System.out.println("An event occurred " + event.getEventType()); switch (event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: byte[] readBuffer = new byte[20]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } System.out.print(new String(readBuffer)); } catch (IOException e) {} break; } } } --------------- Result on windows ------------------------------ Stable Library ============================================================== Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port:: COM1 Baud is 9600 Bits is 8 Stop is 1 Par is 0 ----------------- End Results ----------------------------------------- ------------------ Result on Linux ----------------------------------- Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 Found port: /dev/ttyS0 Baud is 9600 Bits is 8 Stop is 1 Par is 0 An event occurred 1 043100066224 ------------------ End Results --------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/a1431630/attachment-0046.html From brian at mbari.org Tue Feb 7 09:48:37 2006 From: brian at mbari.org (Brian Schlining) Date: Tue, 7 Feb 2006 08:48:37 -0800 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> Message-ID: <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> Hi Matt > The following code works fine on Linux but I never see any data > when run on Windows. This is a cut and paste from the SimpleRead > example. > I am attempting to read data from a bar code scanner. I can fire > up HyperTermianl on windows and see that the device is working > properly as I see the barcodes are scanned and echoed back to the > terminal. However when I run the app I don't see any data. It is > however associating with the com port as the informational bits > print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. Cheers Brian Schlining Software Engineer http://www.mbari.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/16d07f37/attachment-0046.html From lux at diesel-research.com Tue Feb 7 11:59:58 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 11:59:58 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139293215.3689.4.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> Message-ID: <1139338798.8145.4.camel@zd7280> Any ideas on this ? Any reason why portList.hasMoreElements() should be false even though there are devices in /dev ? On Mon, 2006-02-06 at 23:20 -0700, Kim Lux wrote: > I'm running the code below. > > portlist.hasMoreElements() is false. > > /dev has ports in it as listed below. > > What am I doing wrong ? > > > ========================================================== > // Step through the list of ports until we find one that matches > // the one we are looking for. > > portList = CommPortIdentifier.getPortIdentifiers(); > > while(portList.hasMoreElements()) > { > portID = (CommPortIdentifier) portList.nextElement(); // > if (portID.getName().equals("/dev/ttyUSB0")) > { > myTA.append("Serial port ttyUSB0 has been found\n"); > break; > }// if portID equals... > }// End of while... > ========================================================== > > ls -al /dev/tty* > crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty > crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 > crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 > crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 > crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 > ... > crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 > crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 > crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 > > > -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 12:20:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 12:20:25 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139338798.8145.4.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> Message-ID: On Tue, 7 Feb 2006, Kim Lux wrote: > > Any ideas on this ? Any reason why portList.hasMoreElements() should be > false even though there are devices in /dev ? > > > On Mon, 2006-02-06 at 23:20 -0700, Kim Lux wrote: >> I'm running the code below. >> >> portlist.hasMoreElements() is false. >> >> /dev has ports in it as listed below. >> >> What am I doing wrong ? >> >> >> ========================================================== >> // Step through the list of ports until we find one that matches >> // the one we are looking for. >> >> portList = CommPortIdentifier.getPortIdentifiers(); >> >> while(portList.hasMoreElements()) >> { >> portID = (CommPortIdentifier) portList.nextElement(); // >> if (portID.getName().equals("/dev/ttyUSB0")) >> { >> myTA.append("Serial port ttyUSB0 has been found\n"); >> break; >> }// if portID equals... >> }// End of while... >> ========================================================== >> >> ls -al /dev/tty* >> crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty >> crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 >> crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 >> crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 >> crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 >> ... >> crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 >> crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 >> crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 >> >> >> > Hi Kim What rxtx does is try to open the port and do a timed out read. If the kernel/... do not complain it's enumarted. I suspect you could do a crude test by doing something like cat /dev/ttyS0 > /dev/null If that barfs then rxtx wont enumerate the port. hmm looking at your question again, I suspect it's a lockfile problem. This is documented in INSTALL with the source. Its easy enough to test this too.. touch /var/lock/testingrxtxlockfiles && rm -f /var/lock/testingrxtxlockfiles If you are not in the right group it will bail. Root will work regardless. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 12:37:56 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 12:37:56 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> Message-ID: <1139341076.8145.11.camel@zd7280> Exactly which ports does rxtx attempt to put into the list ? /dev/* or /dev/tty* or /dev/tty[0-9[0-9] ? or /dev/ttyS* ? For the record, only /dev/ttyUSB0 is a valid port on the machine I am presently on. Will this be a problem ? On Tue, 2006-02-07 at 12:20 -0700, Trent Jarvi wrote: > This is documented in INSTALL with the source. > I was wondering where that file was. I will download source and dig it up. Thanks. -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 12:51:09 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 12:51:09 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139341076.8145.11.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: On Tue, 7 Feb 2006, Kim Lux wrote: > > Exactly which ports does rxtx attempt to put into the list ? /dev/* > or /dev/tty* or /dev/tty[0-9[0-9] ? or /dev/ttyS* ? > > For the record, only /dev/ttyUSB0 is a valid port on the machine I am > presently on. Will this be a problem ? > > > On Tue, 2006-02-07 at 12:20 -0700, Trent Jarvi wrote: >> This is documented in INSTALL with the source. >> > I was wondering where that file was. I will download source and dig it > up. > > Thanks. > Hmm I'm looking at pre17 so this may have changed. (its just what I have on this machine) if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA" // for the IPAQs }; CandidatePortPrefixes=Temp; } So you may need to add "ttyUSB" to that list. RXTX used to enumerate _everything_ see if(osName.equals("Linux-all-ports") But it became less than practical. This is all in RXTXCommDriver.java hmm I just did a cvs update. if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have to get your fingers into the code. We aim for sane defaults. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 13:06:45 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 13:06:45 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139342805.8145.22.camel@zd7280> On Tue, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > Hmm I'm looking at pre17 so this may have changed. (its just what I have > on this machine) > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA" // for the IPAQs > }; > CandidatePortPrefixes=Temp; > } > > > So you may need to add "ttyUSB" to that list. RXTX used to enumerate > _everything_ see if(osName.equals("Linux-all-ports") But it became less > than practical. > > This is all in RXTXCommDriver.java > > hmm I just did a cvs update. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have > to get your fingers into the code. We aim for sane defaults. Excellent. Thanks for taking the time. -- Kim Lux, Diesel Research Inc. From ideiglenes1 at freemail.hu Tue Feb 7 13:53:39 2006 From: ideiglenes1 at freemail.hu (--) Date: Tue, 07 Feb 2006 21:53:39 +0100 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139345619.22534.2.camel@localhost> Hi! I use this code to get all the extra Linux devices. :) if ("Linux".equals(System.getProperty("os.name"))) { System.setProperty("os.name","Linux-all-ports"); } driver = new RXTXCommDriver(); On k, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > On Tue, 7 Feb 2006, Kim Lux wrote: > > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have > to get your fingers into the code. We aim for sane defaults. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From matt.higgins at gmail.com Tue Feb 7 13:45:54 2006 From: matt.higgins at gmail.com (Matt Higgins) Date: Tue, 7 Feb 2006 15:45:54 -0500 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> Message-ID: <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> Sweet this is exactly what I needed. I was searching the archives through marc.theamisgroup they only have archives back to 1/3/05. Should have hit the mailman archive! Thanks a lot! On 2/7/06, Brian Schlining wrote: > > Hi Matt > > The following code works fine on Linux but I never see any data when run > on Windows. This is a cut and paste from the SimpleRead example. > I am attempting to read data from a bar code scanner. I can fire up > HyperTermianl on windows and see that the device is working properly as I > see the barcodes are scanned and echoed back to the terminal. However when I > run the app I don't see any data. It is however associating with the com > port as the informational bits print fine? > > > You're not the only one whose had this problem, I don't know if Trent has > addressed this is the latest release of RXTX but there is a workaround. > Here's the recent thread from the RXTX mailing list regarding this issues: > > Thanasis Delenikas tdelenik at gmail.com > Wed Jan 18 13:56:23 MST 2006 > > * Previous message: [Rxtx] Re: More close() performance fixes > * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] > > Hi all. > (I've subscribed again from my other email account). > > Trent, > > You are right. Linux *always* works, no matter what flow control you set. > Windows *works only* with hardware flow control (I haven't tested what > happens with software XON/XOFF flow control). > > I assume (but I am not certain) that even with no flow control at all, all > platforms should work. Without flow control, you have the risk of bumping > into overflow or framing errors, but that's your (the end programmer, I > mean) problem. > > >From my side, I shouldn't be working without flow control. That was a bug > too... It was some code forgotten from the old times, when I used to work > with phone emulation drivers which didn't support flow control. The > correct > way is to have some flow control enabled and that's why I suppose this is > a > low-severity bug for RxTx. > > I have no idea which platform shows the correct behaviour, since > my knowledge about Linux and the inner workings of these low-level i/o > operations is limited. > > Regards, > Thanasis Delenikas. > > > > > Message: 2 > > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > > From: Trent Jarvi > > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > > To: RXTX Developers and Users > > Message-ID: > > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > > > Hi all, > > > > > > Trent, I have found something. > > > I read your comment about flow control, so I experimented a bit. > > > > > > If you remember, in my sample program I've used no flow control at all > ( > > i.e. > > > Java constant FLOWCONTROL_NONE). > > > > > > Now, during testing, I've switch to hardware inbound flow control (i.e > . > > Java > > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > > beautifully! > > > > > > I think I will switch to H/W flow control and test things for a while, > > but > > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > > > > > Hi Thanasis, > > > > I'm fairly sure you have identified a bug. I would not worry too much > > about what Sun CommAPI w32 defaults are. I think they did more or less > > whatever the port opened with. Just a guess. Linux tries to stomp on > > ports so they are all the same. > > > > So this started out with Linux worked, Windows XP/.. did not as I > recall. > > Something is wrong in rxtx. Do I understand this right? > > > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > > > Perhaps there is something Wayne or I did not understand when we wrote > > that code. I wasnt programming back in the BBS days so modems are not > my > > thing. I have a few questions. > > > > Is the above matrix confirmed by observation? > > Linux just always worked? > > Which one _should_ work? I'm guessing modems work with hardware flow > > control. I'll have to dig around. > > > > The windows flow control changes a couple things with hardware flow > > control. Following the w32 API documentation is confusing sometimes. > > But it looks like Linux could have a bug too. > > Cheers > > Brian Schlining > Software Engineer > http://www.mbari.org > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/9c989144/attachment-0046.html From tjarvi at qbang.org Tue Feb 7 14:06:14 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 14:06:14 -0700 (MST) Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> Message-ID: >> >> You're not the only one whose had this problem, I don't know if Trent has >> addressed this is the latest release of RXTX but there is a workaround. >> Here's the recent thread from the RXTX mailing list regarding this issues: >> I have not. I expect to have access to some test equipment next month and I'll go through all of this. I really don't know whats going on and I need a gold standard. I thought maybe linux was autodetecting the flow control. Your observations would certainly be welcome. I need to talk to Russell King and see what he is doing. Until then I'd just be toying around over a loopback as usual. This is very high on the list though. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 17:25:05 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 17:25:05 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139358305.17994.2.camel@zd7280> My application now works. I installed the libraries and jar from 2.1-7 (Final). portlist.hasMoreElements is no longer false. The application finds the port for /dev/ttyUSB0. Thanks for your help, Trent (et al) Sorry I bothered you with this. Next time I will look in the source first. I didn't think it was an rxtx issue, I thought it was a Linux setup issue . On Tue, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > Hmm I'm looking at pre17 so this may have changed. (its just what I > have > on this machine) > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux > Serial Ports > "ttySA" // for the > IPAQs > }; > > CandidatePortPrefixes=Temp; > } > > > So you may need to add "ttyUSB" to that list. RXTX used to enumerate > _everything_ see if(osName.equals("Linux-all-ports") But it became > less > than practical. > > This is all in RXTXCommDriver.java > > hmm I just did a cvs update. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux > Serial Ports > "ttySA", // for the > IPAQs > "ttyUSB" // for USB > frobs > }; > > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you > have > to get your fingers into the code. We aim for sane defaults. -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 19:21:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 19:21:54 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139358305.17994.2.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> <1139358305.17994.2.camel@zd7280> Message-ID: >Sorry I bothered you with this. Next time I will look in the source >first. I didn't think it was an rxtx issue, I thought it was a Linux >setup issue . Why would you be sorry? I would have done the same. I'm glad it's working :) -- Trent Jarvi tjarvi at qbang.org From tma at mail.island.net Wed Feb 8 13:39:35 2006 From: tma at mail.island.net (Tom Alldread) Date: Wed, 08 Feb 2006 12:39:35 -0800 Subject: [Rxtx] Win32/Linux Serial Port Data Dropouts In-Reply-To: <200602060702.k167255O007882@www.qbang.org> References: <200602060702.k167255O007882@www.qbang.org> Message-ID: <43EA5707.4020200@mail.island.net> Greetings Folks at RXTX: During the last couple of months I have been alternately testing with javax.comm 2 and RXTX 2.1 under Windows XP and CommApi 3 and RXTX 2.1 under Suse 10.0 Linux. In the process I have learned a little about java multi-threading under NetBeans 5 with Profiler. My java (jdk 1.5_06) application is used for data acquisition and provides a graphical display of A-D conversion data received from a 56KBaud serial port. The actual data throughput is about 10KBaud thus it is well below the speed of the port. I use hardware RTS/CTS flow control which can stall the data acquisition sample rate if necessary. This ensures the display computer has the ability to slow the data acquisition rate should it become too busy to accept the regular data flow. Both the serial port buffer and the java read buffer are set at 16KB. Usually the data transfers into the java read buffer are less than 100 bytes unless the data acquisition is recovering from a stall. The data flow normally hesitates after each 5 KB block as a continue command is needed from the display computer to start the drawing of a new graphics display line. Separate threads have been provided for the serial port event monitoring and data processing. The serial port event thread has been given the maximum priority and data processing thread the minimum priority provided by java. Thread yield statements have been placed within all data processing while/for loops as an effort to ensure quick access to CPU cycles for the serial port event thread. I have found that short data transmissions are essentially error free but occasional dropouts occur with continuous data flow especially under Windows XP. ....................................................................................................................................................................................... Linux results: I am happy to report that RXTX 2.1 appears to work very well under Linux although I did notice some errors when the screen savers were running with my dual monitors. I believe this is a local problem associated with my dual graphics which needs further attention. The recent CommApi 3 Linux release from Sun did not work at all with my program. It seemed to send commands out OK but did not receive any data. Although the serial port event triggered the ISR, the input stream appeared filled with nulls and thus did not contain any data. As my understanding is that CommApi 3 was tested with a Red Hat distribution of Linux I wonder if this problem is distro dependent? Although somewhat off topic here I wonder if anyone reading this has had similar experience? .................................................................................................................................................................................. Windows XP results: There are problems with occasional data dropouts which become more frequent as the sampling rate is increased or if the computer becomes busy with other duties. The dropouts typically consist of a half dozen byte block of lost data. It appears the lost bytes never get added to the java input stream. There has not been any indication of garbled data, overruns or framing errors which suggests the UART communications remains solid. Using javax.comm 2 I found that the setting of SerialPort 'enableReceiveThreshold' to 40 and 'enableReceiveTimeout' of 100mS reduced the dropouts error rate significantly. I found that I could not get RXTX 2.1 to function with the aforementioned threshold and timeout settings. The javax.comm 2 interface is consequently performing better for me under Windows than RXTX 2.1. I wonder if anyone here has any suggestions as to what I might try to improve RXTX 2.1? Although my settings are the same as under Suse 10.0, RXTX 2.1 performs much better for me under Linux than any of the alternatives that I have tried under Windows XP . ............................................................................................................................................................................... I would like to establish, based on the experience of others, if I have reached the normally expected performance limit of java serial port communications? Should I expect to achieve virtually error free serial port data input from a continuous stream under Windows XP java software? I am considering changing my protocol to packets with error checking if necessary but would like to know if the dropout problems I am experiencing are typical or not before I take this rather work intensive plunge. Many thanks in advance for any help! Best Regards, Tom Alldread -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.375 / Virus Database: 267.15.2/253 - Release Date: 2006-02-07 From jlaxson at mac.com Wed Feb 8 23:56:48 2006 From: jlaxson at mac.com (John Laxson) Date: Thu, 9 Feb 2006 00:56:48 -0600 Subject: [Rxtx] PortInUseException: Unknown Application on OSX Message-ID: Hi, I've been trying to get RXTX 2.1.7 going on Mac OS X for a while here, and am running up into a wall here. I've tried with pre- compiled and the source version and get the same problem, a gnu.io.PortInUseException: Unknown Application. I have run the fixperms script included with the source distribution, and id shows me as a member of the uucp group, and permissions on /var/spool/uucp are 775 root:uucp. Running a test program (included at the bottom for clarity) lets me enumerate all the serial ports correctly, but trying to open any of them gives the PortInUseException. If it helps, when I try to open a port that's set to make an outgoing bluetooth connection, there is no delay and no connection attempt at all. Thanks, John Laxson PS: The documentation wiki on qbang.org shows 404, and has for a few days now. My test code: public static void main(String[] args) { SerialPort serialPort; try { Enumeration e = CommPortIdentifier.getPortIdentifiers(); CommPortIdentifier ident; while (e.hasMoreElements()) { ident = (CommPortIdentifier)e.nextElement(); System.out.println(ident.getName()); } ident = CommPortIdentifier.getPortIdentifier("/dev/cu.modem"); serialPort = (SerialPort) ident.open("Me", 5000); } catch (Exception e) { e.printStackTrace(); } } From rajesh.invincible at gmail.com Thu Feb 9 03:39:38 2006 From: rajesh.invincible at gmail.com (Rajesh N) Date: Thu, 9 Feb 2006 16:09:38 +0530 Subject: [Rxtx] Re: Move .java Files in gnu.io filesystem hierarchy - Maven (2) In-Reply-To: <43DF21D2.7090200@ngi.it> References: <43DF21D2.7090200@ngi.it> Message-ID: <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Can anybody tell me how to overcome these EXCEPTIONS I AM WORKING ON SERIAL COMMN IN JAVA ON LINUX. 1. " NOT ALL PARAMETERS SUPPORTED BY THE KERNEL" This i came across the following statement inmy prog. SerialP is A SerialPort object SerialP.setSerialPortParams(9600(BAUDRATE),DATABITS_8,STOPBITS_1,PARITY_NONE) 2. NullPointer Exception at Event Dispatch Now i have checked all my object references for a null reference but i found none i have put up my entire code in try catch blocks but still I AM UNABLE TO CATCH THIS EXCEPTION AND HENCE MY APPLICATION CLOSES HOW DOES THESE GO? PLEASE HELP ME IT IS URGENTTTTTTTTTTTTTTTT yours sincerely RAJESH On 1/31/06, Fabio Frumento wrote: > Hi Xavier, > > I don't know maven at all but the directory hierarchy listed buy Trent > is fine for me... > > I'll take a look to maven, it seems an interesting project > > Regards > > Fabio Frumento > > Trent Jarvi wrote: > > On Tue, 31 Jan 2006, Xavier Frisaye wrote: > > > >> Hi all, > >> > >> If you are going to rearrange the src folder, i will propose to use > >> maven 2 and follow its directory structure > >> > (http://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html). > >> > >> Maven 2 simplify java project and give a standard way to make projects > >> (http://maven.apache.org/). > >> We are using it for internal projects and we are very satisfied. > >> > >> Is anybody interested? > >> > >> I'm not an expert in maven 2 (yet) but i'm agree to help using it if > >> you choose to make so. > >> > > > > so this would be: > > > > rxtx-devel/src/main/java/gnu.io > > rxtx-devel/src/test/java/ManIwish.java > > > > I don't use IDEs very much so I'll let others comment. But I don't see > > a problem with that. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Thu Feb 9 09:50:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 9 Feb 2006 09:50:31 -0700 (MST) Subject: [Rxtx] Re: Move .java Files in gnu.io filesystem hierarchy - Maven (2) In-Reply-To: <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Message-ID: On Thu, 9 Feb 2006, Rajesh N wrote: > Can anybody tell me how to overcome these EXCEPTIONS > I AM WORKING ON SERIAL COMMN IN JAVA ON LINUX. > > 1. " NOT ALL PARAMETERS SUPPORTED BY THE KERNEL" > > This i came across the following statement inmy prog. > SerialP is A SerialPort object > SerialP.setSerialPortParams(9600(BAUDRATE),DATABITS_8,STOPBITS_1,PARITY_NONE) > Strange. The parameters you use are the same the port should open with by default. Could you paste the actual exception you are getting? I don't see that in the rxtx source. Also it would help to know the rxtx version. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Fri Feb 10 15:29:05 2006 From: lux at diesel-research.com (Kim Lux) Date: Fri, 10 Feb 2006 15:29:05 -0700 Subject: [Rxtx] One serial port object for both sending and receiving ? Message-ID: <1139610545.18177.4.camel@zd7280> Is it OK to use one SerialPort ojbect (ex Serial Port serialPort;) and use it for both sending and receiving ? For example: ======================================================================== static SerialPort serialPort = null; static OutputStream serialOut = null; static InputStream serialIn = null; // assign it to an outputStream for use try{ serialOut = serialPort.getOutputStream(); System.out.println("Serial output stream has been assigned."); }//try catch(IOException e) { System.out.println("Error: Couldn't assign output stream to serial port."); }//catch //assign it to an inputStream for use try{ serialIn = serialPort.getInputStream(); System.out.println("Serial input stream has been assigned."); }//try catch(IOException e) { System.out.println("Error: Couldn't assign input stream to serial port."); }//catch ======================================================================== -- Kim Lux, Diesel Research Inc. From lux at diesel-research.com Fri Feb 10 21:23:00 2006 From: lux at diesel-research.com (Kim Lux) Date: Fri, 10 Feb 2006 21:23:00 -0700 Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Message-ID: <1139631780.23882.10.camel@zd7280> I've got a problem receiving chars with my version of serialRead, written in an SWT GUI. I had a Java pro have a good look at my code and he can't see anything wrong with it. I can send chars fine. When I receive a char the cpu usage for the app goes to 100% and the code in the serial event handler doesn't get executed. The instructions on the Java Comm Serial API How-To for Linux page state that I must install javacomm. Is that true ? Everything builds without it and I can send chars on rxtx just fine, but I can't receive them. Could this be the problem ? I downloaded and installed javacomm. I was not able to add "Driver=gnuio.RXTXCommDriver to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 installed in /usr/java/jre1.5.0_05. I added comm.jar to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext to the library paths. Is this OK ? Does it matter that I am receiving on /dev/ttyUSB0 ? Thanks. -- Kim Lux, Diesel Research Inc. From lunareclipse03 at web.de Sat Feb 11 09:44:46 2006 From: lunareclipse03 at web.de (lunareclipse03@web.de) Date: Sat, 11 Feb 2006 17:44:46 +0100 Subject: [Rxtx] Question about Serial I/O under Win32 Message-ID: <662084330@web.de> Hello everybody, I have a strange problem with a piece of code I made for myself. No, this is not really concerning rxtx, but nevertheless I post this to the list, hoping that some of you can help me. I've written two libraries, one for linux and one for win32. The linux port works quite well, I can send / receive faxes and / or replay voice messages over the telephone line using a voice modem. But the win32 port of the library causes some trouble. If, for example, I send out a fax with a certain modem under linux, it works well. The fax is complete when it comes out of the fax machine. If I then use the same modem to send out a fax under win32, the fax coming out of the fax machine gets "stuck" halfways, but the sending modem thinks that transmission was ok and drops the connection. The answering fax machine then gives me "error while receiving." The "upper layer" java code MUST be right, because if I do the same thing under linux (using the linux library), everything is alright. Now I have to ask: Can somebody please help me out with this??!? Could it be the case that some kind of flow control or COMMTIMEOUTS setting causes this behaviour? I set flow control to RTS/CTS before sending out a fax. How can I DISABLE flow control? Or what do you think? Can something else cause this problems? Thank you all for your time and PLEASE write back soon. Regards, --Sven Ahlemann Am Waldrand 31 45721 Haltern am See Germany ______________________________________________________________ Verschicken Sie romantische, coole und witzige Bilder per SMS! Jetzt bei WEB.DE FreeMail: http://f.web.de/?mc=021193 From lux at diesel-research.com Sat Feb 11 10:06:52 2006 From: lux at diesel-research.com (Kim Lux) Date: Sat, 11 Feb 2006 10:06:52 -0700 Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: <1139631780.23882.10.camel@zd7280> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> <1139631780.23882.10.camel@zd7280> Message-ID: <1139677612.3431.5.camel@zd7280> More on this problem. I copied and pasted simpleRead into a console based Eclipse project and I've got the same result, except that cpu usage doesn't go to 100%. I'm beginning to think there is an issue in rxtx. My imports for simpleRead are: ============================ import gnu.io.*; import java.util.*; //import javax.comm.*; import java.io.*; =========================== Any ideas ? I am trying to read from /dev/ttyUSB0 using a serial to USB adapter which has worked well with minicom and gtkterm. Thanks. On Fri, 2006-02-10 at 21:23 -0700, Kim Lux wrote: > I've got a problem receiving chars with my version of serialRead, > written in an SWT GUI. > > I had a Java pro have a good look at my code and he can't see anything > wrong with it. > > I can send chars fine. When I receive a char the cpu usage for the app > goes to 100% and the code in the serial event handler doesn't get > executed. > > The instructions on the Java Comm Serial API How-To for Linux page state > that I must install javacomm. Is that true ? Everything builds without > it and I can send chars on rxtx just fine, but I can't receive them. > Could this be the problem ? > > I downloaded and installed javacomm. I was not able to add > "Driver=gnuio.RXTXCommDriver > to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not > have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 > installed in /usr/java/jre1.5.0_05. I added comm.jar > to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext > to the library paths. Is this OK ? > > Does it matter that I am receiving on /dev/ttyUSB0 ? > > Thanks. > -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Sun Feb 12 21:01:33 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:01:33 -0700 (MST) Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: <1139677612.3431.5.camel@zd7280> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> <1139631780.23882.10.camel@zd7280> <1139677612.3431.5.camel@zd7280> Message-ID: I suspect what is happening is the select() is breaking out in the native code but the driver does not have support for notifying there are X bytes available. On some traditional Unix based systems, the only way you know data is available is the fd status changes and do an FIORDCHK ioctl. Or perhaps the only thing you can know is the fd status changed. It would take reading through the kernel driver code to know for sure. So on USB, depending upon the driver, the same may need to be done or the driver improved a bit if possible to support. Polling reads will also work but don't use the event driven model of CommAPI which isnt acceptable in the long run. The 100% cpu usage can then be explained because select no longer blocks until the data is read; the eventLoop spins loose. You can put a well placed sleep but rxtx only expects those are needed when it knows data is available. This may not be a super simple thing to understand and fix. I do have ideas to get you started. I'm going to be short on time the next couple weeks. I expect to put some good time in and answer some other questions I saw around the 25th. For now, I'd look at the following and go from there with the hints I've given. JNIEXPORT jint JNICALL RXTXPort(nativeavailable)( JNIEnv *env, jobject jobj ) { int fd = get_java_var( env, jobj,"fd","I" ); int result; /* char message[80]; ENTER( "RXTXPort:nativeavailable" ); On SCO OpenServer FIONREAD always fails for serial devices, so try ioctl FIORDCHK instead; will only tell us whether bytes are available, not how many, but better than nothing. This turns out to be true on Solaris also. taj. */ #ifdef FIORDCHK /* __unixware__ __sun__ probably others */ result = ioctl(fd, FIORDCHK, 0); #else if( ioctl( fd, FIONREAD, &result ) < 0 ) { goto fail; } #endif /* FIORDCHK */ On Sat, 11 Feb 2006, Kim Lux wrote: > > More on this problem. I copied and pasted simpleRead into a console > based Eclipse project and I've got the same result, except that cpu > usage doesn't go to 100%. I'm beginning to think there is an issue in > rxtx. > > My imports for simpleRead are: > > ============================ > import gnu.io.*; > import java.util.*; > //import javax.comm.*; > import java.io.*; > =========================== > > Any ideas ? I am trying to read from /dev/ttyUSB0 using a serial to > USB adapter which has worked well with minicom and gtkterm. > > Thanks. > > > > On Fri, 2006-02-10 at 21:23 -0700, Kim Lux wrote: >> I've got a problem receiving chars with my version of serialRead, >> written in an SWT GUI. >> >> I had a Java pro have a good look at my code and he can't see anything >> wrong with it. >> >> I can send chars fine. When I receive a char the cpu usage for the app >> goes to 100% and the code in the serial event handler doesn't get >> executed. >> >> The instructions on the Java Comm Serial API How-To for Linux page state >> that I must install javacomm. Is that true ? Everything builds without >> it and I can send chars on rxtx just fine, but I can't receive them. >> Could this be the problem ? >> >> I downloaded and installed javacomm. I was not able to add >> "Driver=gnuio.RXTXCommDriver >> to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not >> have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 >> installed in /usr/java/jre1.5.0_05. I added comm.jar >> to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext >> to the library paths. Is this OK ? >> >> Does it matter that I am receiving on /dev/ttyUSB0 ? >> >> Thanks. >> > From tjarvi at qbang.org Sun Feb 12 21:03:30 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:03:30 -0700 (MST) Subject: [Rxtx] One serial port object for both sending and receiving ? In-Reply-To: <1139610545.18177.4.camel@zd7280> References: <1139610545.18177.4.camel@zd7280> Message-ID: On Fri, 10 Feb 2006, Kim Lux wrote: > > Is it OK to use one SerialPort ojbect (ex Serial Port serialPort;) and > use it for both sending and receiving ? > > For example: > > ======================================================================== > static SerialPort serialPort = null; > static OutputStream serialOut = null; > static InputStream serialIn = null; > > > > > // assign it to an outputStream for use > try{ > serialOut = serialPort.getOutputStream(); > System.out.println("Serial output stream has been assigned."); > }//try > catch(IOException e) > { > System.out.println("Error: Couldn't assign output stream to serial > port."); > }//catch > > > //assign it to an inputStream for use > try{ > serialIn = serialPort.getInputStream(); > System.out.println("Serial input stream has been assigned."); > }//try > catch(IOException e) > { > System.out.println("Error: Couldn't assign input stream to serial > port."); > }//catch This should be fine. In fact trying to do it another way will probably not work as you will run into lockfile issues. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun Feb 12 21:13:13 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:13:13 -0700 (MST) Subject: [Rxtx] Question about Serial I/O under Win32 In-Reply-To: <662084330@web.de> References: <662084330@web.de> Message-ID: On Sat, 11 Feb 2006 lunareclipse03 at web.de wrote: > Hello everybody, > > I have a strange problem with a piece of code I made for myself. No, > this is not really concerning rxtx, but nevertheless I post this to the > list, hoping that some of you can help me. I've written two libraries, > one for linux and one for win32. The linux port works quite well, I can > send / receive faxes and / or replay voice messages over the telephone > line using a voice modem. But the win32 port of the library causes some > trouble. If, for example, I send out a fax with a certain modem under > linux, it works well. The fax is complete when it comes out of the fax > machine. If I then use the same modem to send out a fax under win32, the > fax coming out of the fax machine gets "stuck" halfways, but the sending > modem thinks that transmission was ok and drops the connection. The > answering fax machine then gives me "error while receiving." The "upper > layer" java code MUST be right, because if I do the same thing under > linux (using the linux library), everything is alright. Now I have to > ask: Can somebody please help me out with this??!? Could it be the case > that some kind of flow control or COMMTIMEOUTS setting causes this > behaviour? I set flow control to RTS/CTS before sending out a fax. How > can I DISABLE flow control? Or what do you think? Can something else > cause this problems? Thank you all for your time and PLEASE write back > soon. > Hi Sven I'm not too willing to talk about flow control at the low level until I confirm some things with test equipment later. It is not clear if you are using rxtx or writing your own native code. So I'm not sure how to answer much of this :) If you are wondering how to change the flow control using rxtx from java, The BlackBox example from Sun flips this back and forth. SerialPort.java in rxtx 2.1 uses the following: SerialPort.java: public static final int FLOWCONTROL_NONE =0; SerialPort.java: public static final int FLOWCONTROL_RTSCTS_IN =1; SerialPort.java: public static final int FLOWCONTROL_RTSCTS_OUT =2; SerialPort.java: public static final int FLOWCONTROL_XONXOFF_IN =4; SerialPort.java: public static final int FLOWCONTROL_XONXOFF_OUT=8; So if you set flowcontrol to RTSCTS, you can set it to NONE to turn it off. If you are looking for how to do it in native code, the rxtx Source is SerialImp.c (unix/linux/mac os x/w32) and termios.c (w32 only with SerialImp.c) You can track the code: SerialImp.c:JNIEXPORT void JNICALL RXTXPort(setflowcontrol)( JNIEnv *env, jobject jobj, jint flowmode ) termios.c:int tcgetattr( int fd, struct termios *s_termios ) termios.c:int tcsetattr( int fd, int when, struct termios *s_termios ) There may be a problem in the rxtx flow control code though. Rather than guess, I want to test this with a gold standard. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Feb 6 00:00:16 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 00:00:16 -0700 (MST) Subject: [Rxtx] wiki delay until tomorrow night. In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: On Sun, 5 Feb 2006, Trent Jarvi wrote: > On Sun, 5 Feb 2006, Kim Lux wrote: > >> usb ? Tell me more... I need that too. > > usb is a very proper design. Thats all it is. > Maybe rxtx could help usb. But it would start with helping bring back the community that was already there. It's not something I'd love to do but maybe its the right thing to do. It would probably take 2 years to do right. But maybe thats better than what we have now. I honestly don't know what IBM is doing which could just run over everything. Just some thoughts after some fine german wine. -- Trent Jarvi tjarvi at qbang.org From gadelavega at yahoo.com.ar Mon Feb 6 02:17:05 2006 From: gadelavega at yahoo.com.ar (Gonzalo A. de la Vega) Date: Mon, 06 Feb 2006 10:17:05 +0100 Subject: [Rxtx] Serial port ownership question In-Reply-To: References: <20060205113618.30274.qmail@web53501.mail.yahoo.com> <1139157422.4553.9.camel@zd7280> <1139158698.4936.9.camel@zd7280> Message-ID: <43E71411.4050402@yahoo.com.ar> On my Fedora Core 4: ls -l /dev/ttyS* crw-rw---- 1 root uucp 4, 64 Feb 6 2006 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Feb 6 2006 /dev/ttyS1 ... and: grep "ttyUSB" /etc/udev/rules.d/50-udev.rules KERNEL=="ttyUSB*", GROUP="uucp", MODE="0660" So anyone in the "uucp" group can use serial ports. On Gentoo the group is "tty". Trent Jarvi escribi?: > > > On Sun, 5 Feb 2006, Dr. Douglas Lyon wrote: > >> I can confirm that this is the case (only root ownership of >> serial ports, under fedora 4). >> Wow, what were they thinking?! >> - DL >> >>> I've found that the newer kernels have the serial ports owned by root. >>> For example, >>> >>> $ls -al /dev/tty* >>> crw-rw-rw- 1 root root 5, 0 Feb 5 02:06 /dev/tty >>> crw-rw---- 1 root root 4, 0 Feb 5 02:06 /dev/tty0 >>> crw------- 1 root root 4, 1 Feb 5 09:07 /dev/tty1 >>> crw-rw---- 1 root tty 4, 10 Feb 5 02:06 /dev/tty10 >>> crw-rw---- 1 root tty 4, 11 Feb 5 02:06 /dev/tty11 >>> ... > > > This is just not a problem jcp or such are going to solve. Its a > platform spitwad fight. But do look at pam. In fact thats what Sun > is doing too. Maybe Linux followed their lead.. I'm not a pam guy. > I've spent 16 hours trying to understand it but your users wont :) > > Solution? I have no clue. Its two tangent mentalities from my > perspective. > > -- > Trent Jarvi > tjarvi at qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mtnvega at yahoo.com.br Mon Feb 6 05:35:43 2006 From: mtnvega at yahoo.com.br (Luiz Jr) Date: Mon, 6 Feb 2006 12:35:43 +0000 (GMT) Subject: [Rxtx] Documentation Wiki In-Reply-To: <1139157422.4553.9.camel@zd7280> Message-ID: <20060206123543.57256.qmail@web53515.mail.yahoo.com> Hello, Thank you for you answer, but so the usage of the API is pretty much like the Java Communications Api? If yes, what version of the Java Comm Api? Thank you, Luiz A. Brandao Jr Kim Lux escreveu: On Sun, 2006-02-05 at 08:36 -0300, Luiz Jr wrote: > Hello, > > I want to start using the RXTX libraries, but I would to know how, > since I can not access the documentation wiki page I just started using them yesterday. Below is how I installed the libraries, if that helps. I used snippets of code from the SimpleWrite application here to get me going. http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html Instead of "import javax.comm.*;", use "import gnu.io.*;" which is gotten from RXTXcomm.jar, which you will need to include in your project references. I am working in Eclipse. BTW: there is no way to open a port without going through the port list and finding it. Maybe sometime in the future someone (me ?) will write a method called openSerialPort that allows the user to give a port identifier, such as "/dev/tty1" and return a port ready to use. It wouldn't take much to write that and it would save users a lot of code. Hope this helps. ======================================================================= 1) Figure out which java you are running, incase there is more than one installed. $ java -version java version "1.5.0_05" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_05-b05) Java HotSpot(TM) Client VM (build 1.5.0_05-b05, mixed mode, sharing) 2) Find all the jre directories and the one from which you are currently running. kfind (jre) 3) cd to that directory plus /lib/i386 cd /usr/java/jre1.5.0_05/lib/i386 4) Copy the library files (*.so) to that directory. cp /home/krlux/Desktop/'Java Controls'/rxtx-linux/bin/* . 5) Check that the copy was successful ls librxtx* librxtxI2C.so librxtxRaw.so librxtxSerial.so librxtxParallel.so librxtxRS485.so 6) cd to the /lib/ext directory for your java. cd /usr/java/jre1.5.0_05/lib/ext 7) Copy the Jar files there cp /home/krlux/Desktop/'Java Controls'/rxtx-linux/lib/ext/* . 8) Check that it was successful ls RXTX* RXTXcomm.jar Rxtx is now installed on your machine ready to use. =================================================================== -- Kim Lux, Diesel Research Inc. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx --------------------------------- Yahoo! Acesso Gr?tis - Internet r?pida e gr?tis. Instale o discador agora! -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/544aa403/attachment-0047.html From lyon at docjava.com Mon Feb 6 05:49:34 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 06 Feb 2006 07:49:34 -0500 Subject: [Rxtx] wiki delay until tomorrow night. In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: Hi All, I have often thought about USB drivers being needed. For example, the ironman watch will not interface to a mac (windows only). It is USB. My dymo label writer has no Java driver (native only). Etc. Most cheap web cameras are USB (and Java drivers go through JAI, if it supports the camera at all). The JAI code shows how sun did the USB drivers. You have to be a member of the jai project to download the source code. https://jai.dev.java.net has the jai distro. And then you are not allowed to redistribute it. However, we can all learn from it (if so inclined). Basically: cvs -d :pserver:lyon at cvs.dev.java.net:/cvs login cvs -d :pserver:lyon at cvs.dev.java.net:/cvs checkout jai-core You will need to user your own uid and pw to get in. The ant build has over 100 warnings from sun deprecations of its own code. You might say that they were hoisted on their own Picard ;) One interesting thing is that they support several platforms: linux-amd64 64-bit Linux-AMD64 linux-i586 32-bit Linux-x86 solaris-amd64 64-bit Solaris-AMD64 solaris-i586 32-bit Solaris-x86 solaris-sparc 32-bit Solaris-SPARC solaris-sparcv9 64-bit Solaris-SPARC windows-i586 32-bit Windows-x86 Thus, ant is used to provide a multi-platform native method distro. Neat. How do they do it? check this out: And: The core download does not contain any C source code (it was all pre-built). Basically, they are just copying .so and .dll files into build directories. I would love to see the C code for this...but Sun does not post it on the https://jai.dev.java.net site. I don't know why...Perhaps I missed it. - Doug >On Sun, 5 Feb 2006, Trent Jarvi wrote: > >>On Sun, 5 Feb 2006, Kim Lux wrote: >> >>>usb ? Tell me more... I need that too. >> >>usb is a very proper design. Thats all it is. >> > >Maybe rxtx could help usb. But it would start with helping bring >back the community that was already there. > >It's not something I'd love to do but maybe its the right thing to do. > >It would probably take 2 years to do right. But maybe thats better >than what we have now. > >I honestly don't know what IBM is doing which could just run over everything. > >Just some thoughts after some fine german wine. > >-- >Trent Jarvi >tjarvi at qbang.org > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tdelenik at gmail.com Mon Feb 6 05:56:32 2006 From: tdelenik at gmail.com (Thanasis Delenikas) Date: Mon, 6 Feb 2006 14:56:32 +0200 Subject: Fwd: [Rxtx] Documentation Wiki In-Reply-To: <1139157422.4553.9.camel@zd7280> References: <20060205113618.30274.qmail@web53501.mail.yahoo.com> <1139157422.4553.9.camel@zd7280> Message-ID: <310a1a930602060456t129f1dc6p5f2b908f13ab5a0b@mail.gmail.com> Hello all, Kim, this is a snippet from the code I use. The closest to directly opening a specific port without enumeration. << ... portId = CommPortIdentifier.getPortIdentifier(getPort()); serialPort = (SerialPort) portId.open("jSMSEngine", 1971); ... >> where getPort() return the string identifier of the port, i.e. "/dev/ttyS0" or "COM1" or whatever. Thanasis. ---------- Forwarded message ---------- From: Kim Lux Date: Feb 5, 2006 6:37 PM Subject: Re: [Rxtx] Documentation Wiki To: RXTX Developers and Users BTW: there is no way to open a port without going through the port list and finding it. Maybe sometime in the future someone (me ?) will write a method called openSerialPort that allows the user to give a port identifier, such as "/dev/tty1" and return a port ready to use. It wouldn't take much to write that and it would save users a lot of code. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/182ab5b8/attachment-0047.html From tjarvi at qbang.org Mon Feb 6 11:53:57 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 11:53:57 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: On Mon, 6 Feb 2006, Dr. Douglas Lyon wrote: > Hi All, > I have often thought about USB drivers being needed. > For example, the ironman watch will not interface > to a mac (windows only). It is USB. > My dymo label writer has no Java driver (native only). > Etc. > Most cheap web cameras are USB (and Java drivers go > through JAI, if it supports the camera at all). > The JAI code shows how sun did the USB drivers. > You have to be a member of the jai project to download > the source code. > https://jai.dev.java.net has the jai distro. > And then you are not allowed to redistribute it. However, > we can all learn from it (if so inclined). Basically: > cvs -d :pserver:lyon at cvs.dev.java.net:/cvs login > cvs -d :pserver:lyon at cvs.dev.java.net:/cvs checkout jai-core > You will need to user your own uid and pw to get in. > The ant build has over 100 warnings from sun deprecations > of its own code. > > You might say that they were hoisted on their own Picard ;) > > One interesting thing is that they support several platforms: > linux-amd64 64-bit Linux-AMD64 > linux-i586 32-bit Linux-x86 > solaris-amd64 64-bit Solaris-AMD64 > solaris-i586 32-bit Solaris-x86 > solaris-sparc 32-bit Solaris-SPARC > solaris-sparcv9 64-bit Solaris-SPARC > windows-i586 32-bit Windows-x86 > Thus, ant is used to provide a multi-platform native method distro. > Neat. > How do they do it? > check this out: > > > > > > > > > > > > > And: > > > > > > > > > > The core download does not contain any C source code (it was all pre-built). > Basically, they are just copying .so and .dll files into build directories. > > I would love to see the C code for this...but Sun does not post it on the > https://jai.dev.java.net site. > > I don't know why...Perhaps I missed it. > > - Doug > > I've looked at moving rxtx to Ant builds. I think that would help IDEs a great deal. I requested a evalutation desk copy the O'Reilly Ant book for some j2ee material I was teaching. http://www.oreilly.com/catalog/anttdg/ It has a one sentence mention of JNI. So there was not luck there. I saw that there is another Ant book that does mention JNI more. I can't find it now. Ant must be able to support it with extensions. http://ant.apache.org/manual/OptionalTasks/javah.html What the auto(break :) tools do in the rxtx build is 4 things really. 1) gcc compile flags 2) ld compile flags 3) config.h 4) compile flags for customizing rxtx (lockfiles, ...) See 1 All of this information except 4 can be static once obtained. So I'm not attached to the auto tools. If I could find an example of Ant being used for JNI code, I'd be one of the first to start moving that direction. Maybe someone saw an example someplace. The other thing we have not completed discussing is the directory structure. There is interest in making rxtx more IDE friendly. I get more mail about that off the list than how to install rxtx. And I see we have Ken Thompson in da house :) He is our trusted CVS maintainer and the guy that purchased the rxtx.org domain. Old community. We will need Ken for changing the directory structure of source. I would like to open up discussion about both of these as it is more than time. The problem is I have little experience with Ant and even less with IDEs. It would be nice if we could work with Eclipse and NetBeans. http://www.netbeans.org/ (sun and some community) http://www.eclipes.org (ibm,rhat,... perhaps more community) http://maven.apache.org/what-is-maven.html (apache. It is community) borland should sortof be here too but I think thats covered in eclipse. >From what I understand so far, we should morph rxtx to support those three maybe trusting apaches lead with maven. But I use vi. I have little to no clues beyond what people have fed me. Can we agree that thats the right direction to go? -- Trent Jarvi tjarvi at qbang.org From brian at mbari.org Mon Feb 6 14:57:50 2006 From: brian at mbari.org (Brian Schlining) Date: Mon, 6 Feb 2006 13:57:50 -0800 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> > The other thing we have not completed discussing is the directory > structure. There is interest in making rxtx more IDE friendly. I > get more mail about that off the list than how to install rxtx. > > And I see we have Ken Thompson in da house :) He is our trusted > CVS maintainer and the guy that purchased the rxtx.org domain. Old > community. We will need Ken for changing the directory structure of > source. > > I would like to open up discussion about both of these as it is > more than time. The problem is I have little experience with Ant > and even less with IDEs. It would be nice if we could work with > Eclipse and NetBeans. > > http://www.netbeans.org/ (sun and some community) > http://www.eclipes.org (ibm,rhat,... perhaps more community) > http://maven.apache.org/what-is-maven.html (apache. It is community) > borland should sortof be here too but I think thats covered in > eclipse. > >> From what I understand so far, we should morph rxtx to support >> those three > maybe trusting apaches lead with maven. But I use vi. I have > little to no clues beyond what people have fed me. > Maven likes the directory structure below for Java code. (From http:// maven.apache.org/guides/getting-started/index.html) This structure works fine with ant, netbeans, and eclipse. rxtx_root_directory `-- src |-- main | `-- java | `-- gnu | `-- io `-- test `-- java `-- gnu `-- io Brian Schlining Software Engineer http://www.mbari.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/d9451eba/attachment-0047.html From tjarvi at qbang.org Mon Feb 6 15:11:45 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 15:11:45 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: > rxtx_root_directory > `-- src > |-- main > | `-- java > | `-- gnu > | `-- io > `-- test > `-- java > `-- gnu > `-- io > >From what I understand this will just be good. For me it makes no difference. So lets do the rxtx thing. Let if fester for two weeks and if nobody objects, we will do it. I'm not doing this because I care. I'm doing this to eliminate much of my inbox. But test... man is rxtx lacking there in the community aspect. It is covered but not right. _maybe_ I can change that this year. -- Trent Jarvi tjarvi at qbang.org (cat hurding since 1997) From lux at diesel-research.com Mon Feb 6 21:38:49 2006 From: lux at diesel-research.com (Kim Lux) Date: Mon, 06 Feb 2006 21:38:49 -0700 Subject: [Rxtx] How can I use Lock Files with rxtx (in FC4) ? Message-ID: <1139287129.17031.3.camel@zd7280> I am now running an rxtx application on FC4. I am getting: ========================================================= check_group_uucp(): error testing lock file creation Error details: Permission denied check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL ========================================================= $ ls -al /var/lock total 32 drwxrwxr-x 4 root lock 4096 Feb 6 16:04 . drwxr-xr-x 24 root root 4096 Nov 14 01:19 .. drwx------ 2 root root 4096 Apr 27 2005 lvm drwxr-xr-x 2 root root 4096 Feb 6 16:04 subsys How do I fix this for regulator users ? -- Kim Lux, Diesel Research Inc. From dmarkman at mac.com Mon Feb 6 22:24:44 2006 From: dmarkman at mac.com (Dmitry Markman) Date: Tue, 7 Feb 2006 00:24:44 -0500 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: if I understands the issue right in order to be able to use ant for c/c++ compilation you have to install ant's cc task http://ant-contrib.sourceforge.net/cc.html it looks like it should work on mac os x (authors claim, that it's platform independent) but I never tested so all you have to do it's providing right command line for the gcc compiler On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: >> rxtx_root_directory >> `-- src >> |-- main >> | `-- java >> | `-- gnu >> | `-- io >> `-- test >> `-- java >> `-- gnu >> `-- io >> > > >> From what I understand this will just be good. > > For me it makes no difference. So lets do the rxtx thing. Let if > fester for two weeks and if nobody objects, we will do it. > > I'm not doing this because I care. I'm doing this to eliminate > much of my inbox. > > But test... man is rxtx lacking there in the community aspect. It > is covered but not right. _maybe_ I can change that this year. > > -- > Trent Jarvi > tjarvi at qbang.org > (cat hurding since 1997) > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx Dmitry Markman From lux at diesel-research.com Mon Feb 6 23:20:15 2006 From: lux at diesel-research.com (Kim Lux) Date: Mon, 06 Feb 2006 23:20:15 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? Message-ID: <1139293215.3689.4.camel@zd7280> I'm running the code below. portlist.hasMoreElements() is false. /dev has ports in it as listed below. What am I doing wrong ? ========================================================== // Step through the list of ports until we find one that matches // the one we are looking for. portList = CommPortIdentifier.getPortIdentifiers(); while(portList.hasMoreElements()) { portID = (CommPortIdentifier) portList.nextElement(); // if (portID.getName().equals("/dev/ttyUSB0")) { myTA.append("Serial port ttyUSB0 has been found\n"); break; }// if portID equals... }// End of while... ========================================================== ls -al /dev/tty* crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 ... crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 -- Kim Lux, Diesel Research Inc. From david.garnier at trusted-logic.com Tue Feb 7 00:46:30 2006 From: david.garnier at trusted-logic.com (David Garnier) Date: Tue, 07 Feb 2006 08:46:30 +0100 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: <43E85056.2090608@trusted-logic.com> Hello, I think that the make-based build process is fine as it is, apart from the location of the Java source files. It is true that putting the Java source in a directory structure that map 1-to-1 to the Java package structure is the norm and should make it easier for everyone to modify the Java source, with or without an IDE. Ant is a good tool, but in the RXTX case I fail to see the advantage of using it compared to the current make-based process. As Trent said, they are more pressing issues, like testing. Regards, David Dmitry Markman wrote: > if I understands the issue right > in order to be able to use ant for c/c++ compilation > you have to install ant's cc task > http://ant-contrib.sourceforge.net/cc.html > > it looks like it should work on mac os x > (authors claim, that it's platform independent) > but I never tested > > so all you have to do it's providing right command line > for the gcc compiler > > > > > On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: > >>> rxtx_root_directory >>> `-- src >>> |-- main >>> | `-- java >>> | `-- gnu >>> | `-- io >>> `-- test >>> `-- java >>> `-- gnu >>> `-- io >>> >> >> >>> From what I understand this will just be good. >> >> For me it makes no difference. So lets do the rxtx thing. Let if >> fester for two weeks and if nobody objects, we will do it. >> >> I'm not doing this because I care. I'm doing this to eliminate much >> of my inbox. >> >> But test... man is rxtx lacking there in the community aspect. It is >> covered but not right. _maybe_ I can change that this year. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> (cat hurding since 1997) From tjarvi at qbang.org Tue Feb 7 01:11:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 01:11:31 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <43E85056.2090608@trusted-logic.com> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: On Tue, 7 Feb 2006, David Garnier wrote: > Hello, > > I think that the make-based build process is fine as it is, apart from the location of the Java > source files. It is true that putting the Java source in a directory structure that map 1-to-1 to > the Java package structure is the norm and should make it easier for everyone to modify the Java > source, with or without an IDE. > > Ant is a good tool, but in the RXTX case I fail to see the advantage of using it compared to the > current make-based process. As Trent said, they are more pressing issues, like testing. > Hi David I have more experience with testing rxtx than I can talk about. But let it be known, rxtx has gone trough 100's of hours of testing. We are hobby folks interested in toys but there is more. rxtx has had some of the best guidance in the industry there. This is not an easy thing. I may be able to come back in a month from the other side of the corperate fence and help. I suspect the tests could just be made public but they are in a very unusual environment that just wont work in a wider sense. This is something I'll be trying to change. At one point it was agreed we could just make the results public so this isnt just noise.. There is interest and I think its safe to mention that much. The big problem with testing in the past is most of it is done with a loopback connection. So we *still* have major questions regarding things like flow control. rxtx talks to itself over a loopback and it works. regardless of right or wrong. This requires more thought to be done right. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Feb 7 02:46:34 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 02:46:34 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: > The big problem with testing in the past is most of it is done with a > loopback connection. So we *still* have major questions regarding things > like flow control. rxtx talks to itself over a loopback and it works. > regardless of right or wrong. With serial communication there are gold standards. ckermit is probably a definitive 'standard.' Maybe its possible to do ping/pong tests with ckermit? Is it scriptable? There are known issues in rxtx. Probably the worst is some threading issues regarding some JREs with multiple JNI threads setting java variables. Man did I get schooled there. Just switch the c functions to returning variables and things go away. Sometimes they work fine, sometimes they blow up. Without understanding everything, somehow rhat got it right and debian (and especially gentoo) grabbed kernel patches causing all sort of harm. Its not hard to fix once you understand whats going on but nearly impossible to track with a debugger. So I have a good idea what 2.1-8 will have outside of the IDE modifications. rxtx 2.1-7 is a release for everyone to sync with. Its not even as stable as -pre17 as far as I know - I ran no test suites. I'll be chasing it too. We just had so many contributions that it was time. It seriously broke internal scheduals but thats a great thing :) The other thing I want to do in 2.1-8 is automagic baud rates. It turns out lots of shops are doing really funky baud rates for things like automobile test equipment. It is possible but it requires a fair amount of change in the native code. Is anyone looking at this? -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Feb 7 02:57:21 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 07 Feb 2006 04:57:21 -0500 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <43E85056.2090608@trusted-logic.com> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: Hi All, I agree, testing is very important. The problem I have been trying to address is related to cross-platform testing and the robust nature of the installs. Typically, I visit 3 platforms to deploy my product, windows, linux and mac. A build is performed on each platform. The idea that you can build for many platforms from one copy the source code seems attractive. This should enable synchronized deployments of identical code. The question of how to achieve this goal remains open. As Trent mentioned, this is hard. Perhaps Ant will help here (but perhaps not). Ant does seem to help with running unit tests. However, it does not help with multi-platform tests. For that you need many machines and different operating environments. Toward that end, I have created a multi-platform test that can be run from web start, located at: http://show.docjava.com:8086/book/cgij/code/jnlp/serialPort.PortTest.jnlp This is interesting because many people in the community can run the test and we can improve the test, as time permits. No, it is not a perfect solution, however, the idea does help with multi-platform tests using many machines and different operating environments. If the group has a good test for a general serial port set-ups, i would be happy to deploy it, for general evaluation using web start. And as for ANT, it is just an idea. Not all my ideas are good ones! - Doug >Hello, > >I think that the make-based build process is fine as it is, apart >from the location of the Java >source files. It is true that putting the Java source in a directory >structure that map 1-to-1 to >the Java package structure is the norm and should make it easier for >everyone to modify the Java >source, with or without an IDE. > >Ant is a good tool, but in the RXTX case I fail to see the advantage >of using it compared to the >current make-based process. As Trent said, they are more pressing >issues, like testing. > >Regards, >David > >Dmitry Markman wrote: >> if I understands the issue right >> in order to be able to use ant for c/c++ compilation >> you have to install ant's cc task >> http://ant-contrib.sourceforge.net/cc.html >> >> it looks like it should work on mac os x >> (authors claim, that it's platform independent) >> but I never tested >> >> so all you have to do it's providing right command line >> for the gcc compiler >> >> >> >> >> On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: >> >>>> rxtx_root_directory >>>> `-- src >>>> |-- main >>>> | `-- java >>>> | `-- gnu >>>> | `-- io >>>> `-- test >>>> `-- java >>>> `-- gnu >>>> `-- io >>>> >>> >>> >>>> From what I understand this will just be good. >>> >>> For me it makes no difference. So lets do the rxtx thing. Let if >>> fester for two weeks and if nobody objects, we will do it. >>> >>> I'm not doing this because I care. I'm doing this to eliminate much >>> of my inbox. >>> >>> But test... man is rxtx lacking there in the community aspect. It is >>> covered but not right. _maybe_ I can change that this year. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> (cat hurding since 1997) > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From matt.higgins at gmail.com Tue Feb 7 08:28:34 2006 From: matt.higgins at gmail.com (Matt Higgins) Date: Tue, 7 Feb 2006 10:28:34 -0500 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final Message-ID: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? import java.io.*; import java.util.*; import gnu.io.*; public class MySimpleRead implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; public static void main(String[] args) { boolean portFound = false; String defaultPort = "COM1"; if (args.length > 0) { defaultPort = args[0]; } portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; MySimpleRead reader = new MySimpleRead(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } } public MySimpleRead() { try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) { e.printStackTrace(); } try { inputStream = serialPort.getInputStream(); } catch (IOException e) { e.printStackTrace(); } try { serialPort.addEventListener(this); } catch (TooManyListenersException e) { e.printStackTrace(); } try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { e.printStackTrace(); } System.out.println("Baud is " + serialPort.getBaudRate()); System.out.println("Bits is " + serialPort.getDataBits()); System.out.println("Stop is " + serialPort.getStopBits()); System.out.println("Par is " + serialPort.getParity()); serialPort.notifyOnDataAvailable(true); readThread = new Thread(this); readThread.start(); } public void run() { // Thread.sleep(20000); //} catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { System.out.println("An event occurred " + event.getEventType()); switch (event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: byte[] readBuffer = new byte[20]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } System.out.print(new String(readBuffer)); } catch (IOException e) {} break; } } } --------------- Result on windows ------------------------------ Stable Library ============================================================== Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port:: COM1 Baud is 9600 Bits is 8 Stop is 1 Par is 0 ----------------- End Results ----------------------------------------- ------------------ Result on Linux ----------------------------------- Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 Found port: /dev/ttyS0 Baud is 9600 Bits is 8 Stop is 1 Par is 0 An event occurred 1 043100066224 ------------------ End Results --------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/a1431630/attachment-0047.html From brian at mbari.org Tue Feb 7 09:48:37 2006 From: brian at mbari.org (Brian Schlining) Date: Tue, 7 Feb 2006 08:48:37 -0800 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> Message-ID: <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> Hi Matt > The following code works fine on Linux but I never see any data > when run on Windows. This is a cut and paste from the SimpleRead > example. > I am attempting to read data from a bar code scanner. I can fire > up HyperTermianl on windows and see that the device is working > properly as I see the barcodes are scanned and echoed back to the > terminal. However when I run the app I don't see any data. It is > however associating with the com port as the informational bits > print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. Cheers Brian Schlining Software Engineer http://www.mbari.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/16d07f37/attachment-0047.html From lux at diesel-research.com Tue Feb 7 11:59:58 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 11:59:58 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139293215.3689.4.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> Message-ID: <1139338798.8145.4.camel@zd7280> Any ideas on this ? Any reason why portList.hasMoreElements() should be false even though there are devices in /dev ? On Mon, 2006-02-06 at 23:20 -0700, Kim Lux wrote: > I'm running the code below. > > portlist.hasMoreElements() is false. > > /dev has ports in it as listed below. > > What am I doing wrong ? > > > ========================================================== > // Step through the list of ports until we find one that matches > // the one we are looking for. > > portList = CommPortIdentifier.getPortIdentifiers(); > > while(portList.hasMoreElements()) > { > portID = (CommPortIdentifier) portList.nextElement(); // > if (portID.getName().equals("/dev/ttyUSB0")) > { > myTA.append("Serial port ttyUSB0 has been found\n"); > break; > }// if portID equals... > }// End of while... > ========================================================== > > ls -al /dev/tty* > crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty > crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 > crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 > crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 > crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 > ... > crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 > crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 > crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 > > > -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 12:20:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 12:20:25 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139338798.8145.4.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> Message-ID: On Tue, 7 Feb 2006, Kim Lux wrote: > > Any ideas on this ? Any reason why portList.hasMoreElements() should be > false even though there are devices in /dev ? > > > On Mon, 2006-02-06 at 23:20 -0700, Kim Lux wrote: >> I'm running the code below. >> >> portlist.hasMoreElements() is false. >> >> /dev has ports in it as listed below. >> >> What am I doing wrong ? >> >> >> ========================================================== >> // Step through the list of ports until we find one that matches >> // the one we are looking for. >> >> portList = CommPortIdentifier.getPortIdentifiers(); >> >> while(portList.hasMoreElements()) >> { >> portID = (CommPortIdentifier) portList.nextElement(); // >> if (portID.getName().equals("/dev/ttyUSB0")) >> { >> myTA.append("Serial port ttyUSB0 has been found\n"); >> break; >> }// if portID equals... >> }// End of while... >> ========================================================== >> >> ls -al /dev/tty* >> crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty >> crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 >> crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 >> crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 >> crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 >> ... >> crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 >> crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 >> crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 >> >> >> > Hi Kim What rxtx does is try to open the port and do a timed out read. If the kernel/... do not complain it's enumarted. I suspect you could do a crude test by doing something like cat /dev/ttyS0 > /dev/null If that barfs then rxtx wont enumerate the port. hmm looking at your question again, I suspect it's a lockfile problem. This is documented in INSTALL with the source. Its easy enough to test this too.. touch /var/lock/testingrxtxlockfiles && rm -f /var/lock/testingrxtxlockfiles If you are not in the right group it will bail. Root will work regardless. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 12:37:56 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 12:37:56 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> Message-ID: <1139341076.8145.11.camel@zd7280> Exactly which ports does rxtx attempt to put into the list ? /dev/* or /dev/tty* or /dev/tty[0-9[0-9] ? or /dev/ttyS* ? For the record, only /dev/ttyUSB0 is a valid port on the machine I am presently on. Will this be a problem ? On Tue, 2006-02-07 at 12:20 -0700, Trent Jarvi wrote: > This is documented in INSTALL with the source. > I was wondering where that file was. I will download source and dig it up. Thanks. -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 12:51:09 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 12:51:09 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139341076.8145.11.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: On Tue, 7 Feb 2006, Kim Lux wrote: > > Exactly which ports does rxtx attempt to put into the list ? /dev/* > or /dev/tty* or /dev/tty[0-9[0-9] ? or /dev/ttyS* ? > > For the record, only /dev/ttyUSB0 is a valid port on the machine I am > presently on. Will this be a problem ? > > > On Tue, 2006-02-07 at 12:20 -0700, Trent Jarvi wrote: >> This is documented in INSTALL with the source. >> > I was wondering where that file was. I will download source and dig it > up. > > Thanks. > Hmm I'm looking at pre17 so this may have changed. (its just what I have on this machine) if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA" // for the IPAQs }; CandidatePortPrefixes=Temp; } So you may need to add "ttyUSB" to that list. RXTX used to enumerate _everything_ see if(osName.equals("Linux-all-ports") But it became less than practical. This is all in RXTXCommDriver.java hmm I just did a cvs update. if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have to get your fingers into the code. We aim for sane defaults. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 13:06:45 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 13:06:45 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139342805.8145.22.camel@zd7280> On Tue, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > Hmm I'm looking at pre17 so this may have changed. (its just what I have > on this machine) > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA" // for the IPAQs > }; > CandidatePortPrefixes=Temp; > } > > > So you may need to add "ttyUSB" to that list. RXTX used to enumerate > _everything_ see if(osName.equals("Linux-all-ports") But it became less > than practical. > > This is all in RXTXCommDriver.java > > hmm I just did a cvs update. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have > to get your fingers into the code. We aim for sane defaults. Excellent. Thanks for taking the time. -- Kim Lux, Diesel Research Inc. From ideiglenes1 at freemail.hu Tue Feb 7 13:53:39 2006 From: ideiglenes1 at freemail.hu (--) Date: Tue, 07 Feb 2006 21:53:39 +0100 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139345619.22534.2.camel@localhost> Hi! I use this code to get all the extra Linux devices. :) if ("Linux".equals(System.getProperty("os.name"))) { System.setProperty("os.name","Linux-all-ports"); } driver = new RXTXCommDriver(); On k, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > On Tue, 7 Feb 2006, Kim Lux wrote: > > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have > to get your fingers into the code. We aim for sane defaults. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From matt.higgins at gmail.com Tue Feb 7 13:45:54 2006 From: matt.higgins at gmail.com (Matt Higgins) Date: Tue, 7 Feb 2006 15:45:54 -0500 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> Message-ID: <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> Sweet this is exactly what I needed. I was searching the archives through marc.theamisgroup they only have archives back to 1/3/05. Should have hit the mailman archive! Thanks a lot! On 2/7/06, Brian Schlining wrote: > > Hi Matt > > The following code works fine on Linux but I never see any data when run > on Windows. This is a cut and paste from the SimpleRead example. > I am attempting to read data from a bar code scanner. I can fire up > HyperTermianl on windows and see that the device is working properly as I > see the barcodes are scanned and echoed back to the terminal. However when I > run the app I don't see any data. It is however associating with the com > port as the informational bits print fine? > > > You're not the only one whose had this problem, I don't know if Trent has > addressed this is the latest release of RXTX but there is a workaround. > Here's the recent thread from the RXTX mailing list regarding this issues: > > Thanasis Delenikas tdelenik at gmail.com > Wed Jan 18 13:56:23 MST 2006 > > * Previous message: [Rxtx] Re: More close() performance fixes > * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] > > Hi all. > (I've subscribed again from my other email account). > > Trent, > > You are right. Linux *always* works, no matter what flow control you set. > Windows *works only* with hardware flow control (I haven't tested what > happens with software XON/XOFF flow control). > > I assume (but I am not certain) that even with no flow control at all, all > platforms should work. Without flow control, you have the risk of bumping > into overflow or framing errors, but that's your (the end programmer, I > mean) problem. > > >From my side, I shouldn't be working without flow control. That was a bug > too... It was some code forgotten from the old times, when I used to work > with phone emulation drivers which didn't support flow control. The > correct > way is to have some flow control enabled and that's why I suppose this is > a > low-severity bug for RxTx. > > I have no idea which platform shows the correct behaviour, since > my knowledge about Linux and the inner workings of these low-level i/o > operations is limited. > > Regards, > Thanasis Delenikas. > > > > > Message: 2 > > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > > From: Trent Jarvi > > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > > To: RXTX Developers and Users > > Message-ID: > > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > > > Hi all, > > > > > > Trent, I have found something. > > > I read your comment about flow control, so I experimented a bit. > > > > > > If you remember, in my sample program I've used no flow control at all > ( > > i.e. > > > Java constant FLOWCONTROL_NONE). > > > > > > Now, during testing, I've switch to hardware inbound flow control (i.e > . > > Java > > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > > beautifully! > > > > > > I think I will switch to H/W flow control and test things for a while, > > but > > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > > > > > Hi Thanasis, > > > > I'm fairly sure you have identified a bug. I would not worry too much > > about what Sun CommAPI w32 defaults are. I think they did more or less > > whatever the port opened with. Just a guess. Linux tries to stomp on > > ports so they are all the same. > > > > So this started out with Linux worked, Windows XP/.. did not as I > recall. > > Something is wrong in rxtx. Do I understand this right? > > > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > > > Perhaps there is something Wayne or I did not understand when we wrote > > that code. I wasnt programming back in the BBS days so modems are not > my > > thing. I have a few questions. > > > > Is the above matrix confirmed by observation? > > Linux just always worked? > > Which one _should_ work? I'm guessing modems work with hardware flow > > control. I'll have to dig around. > > > > The windows flow control changes a couple things with hardware flow > > control. Following the w32 API documentation is confusing sometimes. > > But it looks like Linux could have a bug too. > > Cheers > > Brian Schlining > Software Engineer > http://www.mbari.org > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/9c989144/attachment-0047.html From tjarvi at qbang.org Tue Feb 7 14:06:14 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 14:06:14 -0700 (MST) Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> Message-ID: >> >> You're not the only one whose had this problem, I don't know if Trent has >> addressed this is the latest release of RXTX but there is a workaround. >> Here's the recent thread from the RXTX mailing list regarding this issues: >> I have not. I expect to have access to some test equipment next month and I'll go through all of this. I really don't know whats going on and I need a gold standard. I thought maybe linux was autodetecting the flow control. Your observations would certainly be welcome. I need to talk to Russell King and see what he is doing. Until then I'd just be toying around over a loopback as usual. This is very high on the list though. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 17:25:05 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 17:25:05 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139358305.17994.2.camel@zd7280> My application now works. I installed the libraries and jar from 2.1-7 (Final). portlist.hasMoreElements is no longer false. The application finds the port for /dev/ttyUSB0. Thanks for your help, Trent (et al) Sorry I bothered you with this. Next time I will look in the source first. I didn't think it was an rxtx issue, I thought it was a Linux setup issue . On Tue, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > Hmm I'm looking at pre17 so this may have changed. (its just what I > have > on this machine) > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux > Serial Ports > "ttySA" // for the > IPAQs > }; > > CandidatePortPrefixes=Temp; > } > > > So you may need to add "ttyUSB" to that list. RXTX used to enumerate > _everything_ see if(osName.equals("Linux-all-ports") But it became > less > than practical. > > This is all in RXTXCommDriver.java > > hmm I just did a cvs update. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux > Serial Ports > "ttySA", // for the > IPAQs > "ttyUSB" // for USB > frobs > }; > > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you > have > to get your fingers into the code. We aim for sane defaults. -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 19:21:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 19:21:54 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139358305.17994.2.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> <1139358305.17994.2.camel@zd7280> Message-ID: >Sorry I bothered you with this. Next time I will look in the source >first. I didn't think it was an rxtx issue, I thought it was a Linux >setup issue . Why would you be sorry? I would have done the same. I'm glad it's working :) -- Trent Jarvi tjarvi at qbang.org From tma at mail.island.net Wed Feb 8 13:39:35 2006 From: tma at mail.island.net (Tom Alldread) Date: Wed, 08 Feb 2006 12:39:35 -0800 Subject: [Rxtx] Win32/Linux Serial Port Data Dropouts In-Reply-To: <200602060702.k167255O007882@www.qbang.org> References: <200602060702.k167255O007882@www.qbang.org> Message-ID: <43EA5707.4020200@mail.island.net> Greetings Folks at RXTX: During the last couple of months I have been alternately testing with javax.comm 2 and RXTX 2.1 under Windows XP and CommApi 3 and RXTX 2.1 under Suse 10.0 Linux. In the process I have learned a little about java multi-threading under NetBeans 5 with Profiler. My java (jdk 1.5_06) application is used for data acquisition and provides a graphical display of A-D conversion data received from a 56KBaud serial port. The actual data throughput is about 10KBaud thus it is well below the speed of the port. I use hardware RTS/CTS flow control which can stall the data acquisition sample rate if necessary. This ensures the display computer has the ability to slow the data acquisition rate should it become too busy to accept the regular data flow. Both the serial port buffer and the java read buffer are set at 16KB. Usually the data transfers into the java read buffer are less than 100 bytes unless the data acquisition is recovering from a stall. The data flow normally hesitates after each 5 KB block as a continue command is needed from the display computer to start the drawing of a new graphics display line. Separate threads have been provided for the serial port event monitoring and data processing. The serial port event thread has been given the maximum priority and data processing thread the minimum priority provided by java. Thread yield statements have been placed within all data processing while/for loops as an effort to ensure quick access to CPU cycles for the serial port event thread. I have found that short data transmissions are essentially error free but occasional dropouts occur with continuous data flow especially under Windows XP. ....................................................................................................................................................................................... Linux results: I am happy to report that RXTX 2.1 appears to work very well under Linux although I did notice some errors when the screen savers were running with my dual monitors. I believe this is a local problem associated with my dual graphics which needs further attention. The recent CommApi 3 Linux release from Sun did not work at all with my program. It seemed to send commands out OK but did not receive any data. Although the serial port event triggered the ISR, the input stream appeared filled with nulls and thus did not contain any data. As my understanding is that CommApi 3 was tested with a Red Hat distribution of Linux I wonder if this problem is distro dependent? Although somewhat off topic here I wonder if anyone reading this has had similar experience? .................................................................................................................................................................................. Windows XP results: There are problems with occasional data dropouts which become more frequent as the sampling rate is increased or if the computer becomes busy with other duties. The dropouts typically consist of a half dozen byte block of lost data. It appears the lost bytes never get added to the java input stream. There has not been any indication of garbled data, overruns or framing errors which suggests the UART communications remains solid. Using javax.comm 2 I found that the setting of SerialPort 'enableReceiveThreshold' to 40 and 'enableReceiveTimeout' of 100mS reduced the dropouts error rate significantly. I found that I could not get RXTX 2.1 to function with the aforementioned threshold and timeout settings. The javax.comm 2 interface is consequently performing better for me under Windows than RXTX 2.1. I wonder if anyone here has any suggestions as to what I might try to improve RXTX 2.1? Although my settings are the same as under Suse 10.0, RXTX 2.1 performs much better for me under Linux than any of the alternatives that I have tried under Windows XP . ............................................................................................................................................................................... I would like to establish, based on the experience of others, if I have reached the normally expected performance limit of java serial port communications? Should I expect to achieve virtually error free serial port data input from a continuous stream under Windows XP java software? I am considering changing my protocol to packets with error checking if necessary but would like to know if the dropout problems I am experiencing are typical or not before I take this rather work intensive plunge. Many thanks in advance for any help! Best Regards, Tom Alldread -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.375 / Virus Database: 267.15.2/253 - Release Date: 2006-02-07 From jlaxson at mac.com Wed Feb 8 23:56:48 2006 From: jlaxson at mac.com (John Laxson) Date: Thu, 9 Feb 2006 00:56:48 -0600 Subject: [Rxtx] PortInUseException: Unknown Application on OSX Message-ID: Hi, I've been trying to get RXTX 2.1.7 going on Mac OS X for a while here, and am running up into a wall here. I've tried with pre- compiled and the source version and get the same problem, a gnu.io.PortInUseException: Unknown Application. I have run the fixperms script included with the source distribution, and id shows me as a member of the uucp group, and permissions on /var/spool/uucp are 775 root:uucp. Running a test program (included at the bottom for clarity) lets me enumerate all the serial ports correctly, but trying to open any of them gives the PortInUseException. If it helps, when I try to open a port that's set to make an outgoing bluetooth connection, there is no delay and no connection attempt at all. Thanks, John Laxson PS: The documentation wiki on qbang.org shows 404, and has for a few days now. My test code: public static void main(String[] args) { SerialPort serialPort; try { Enumeration e = CommPortIdentifier.getPortIdentifiers(); CommPortIdentifier ident; while (e.hasMoreElements()) { ident = (CommPortIdentifier)e.nextElement(); System.out.println(ident.getName()); } ident = CommPortIdentifier.getPortIdentifier("/dev/cu.modem"); serialPort = (SerialPort) ident.open("Me", 5000); } catch (Exception e) { e.printStackTrace(); } } From rajesh.invincible at gmail.com Thu Feb 9 03:39:38 2006 From: rajesh.invincible at gmail.com (Rajesh N) Date: Thu, 9 Feb 2006 16:09:38 +0530 Subject: [Rxtx] Re: Move .java Files in gnu.io filesystem hierarchy - Maven (2) In-Reply-To: <43DF21D2.7090200@ngi.it> References: <43DF21D2.7090200@ngi.it> Message-ID: <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Can anybody tell me how to overcome these EXCEPTIONS I AM WORKING ON SERIAL COMMN IN JAVA ON LINUX. 1. " NOT ALL PARAMETERS SUPPORTED BY THE KERNEL" This i came across the following statement inmy prog. SerialP is A SerialPort object SerialP.setSerialPortParams(9600(BAUDRATE),DATABITS_8,STOPBITS_1,PARITY_NONE) 2. NullPointer Exception at Event Dispatch Now i have checked all my object references for a null reference but i found none i have put up my entire code in try catch blocks but still I AM UNABLE TO CATCH THIS EXCEPTION AND HENCE MY APPLICATION CLOSES HOW DOES THESE GO? PLEASE HELP ME IT IS URGENTTTTTTTTTTTTTTTT yours sincerely RAJESH On 1/31/06, Fabio Frumento wrote: > Hi Xavier, > > I don't know maven at all but the directory hierarchy listed buy Trent > is fine for me... > > I'll take a look to maven, it seems an interesting project > > Regards > > Fabio Frumento > > Trent Jarvi wrote: > > On Tue, 31 Jan 2006, Xavier Frisaye wrote: > > > >> Hi all, > >> > >> If you are going to rearrange the src folder, i will propose to use > >> maven 2 and follow its directory structure > >> > (http://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html). > >> > >> Maven 2 simplify java project and give a standard way to make projects > >> (http://maven.apache.org/). > >> We are using it for internal projects and we are very satisfied. > >> > >> Is anybody interested? > >> > >> I'm not an expert in maven 2 (yet) but i'm agree to help using it if > >> you choose to make so. > >> > > > > so this would be: > > > > rxtx-devel/src/main/java/gnu.io > > rxtx-devel/src/test/java/ManIwish.java > > > > I don't use IDEs very much so I'll let others comment. But I don't see > > a problem with that. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Thu Feb 9 09:50:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 9 Feb 2006 09:50:31 -0700 (MST) Subject: [Rxtx] Re: Move .java Files in gnu.io filesystem hierarchy - Maven (2) In-Reply-To: <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Message-ID: On Thu, 9 Feb 2006, Rajesh N wrote: > Can anybody tell me how to overcome these EXCEPTIONS > I AM WORKING ON SERIAL COMMN IN JAVA ON LINUX. > > 1. " NOT ALL PARAMETERS SUPPORTED BY THE KERNEL" > > This i came across the following statement inmy prog. > SerialP is A SerialPort object > SerialP.setSerialPortParams(9600(BAUDRATE),DATABITS_8,STOPBITS_1,PARITY_NONE) > Strange. The parameters you use are the same the port should open with by default. Could you paste the actual exception you are getting? I don't see that in the rxtx source. Also it would help to know the rxtx version. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Fri Feb 10 15:29:05 2006 From: lux at diesel-research.com (Kim Lux) Date: Fri, 10 Feb 2006 15:29:05 -0700 Subject: [Rxtx] One serial port object for both sending and receiving ? Message-ID: <1139610545.18177.4.camel@zd7280> Is it OK to use one SerialPort ojbect (ex Serial Port serialPort;) and use it for both sending and receiving ? For example: ======================================================================== static SerialPort serialPort = null; static OutputStream serialOut = null; static InputStream serialIn = null; // assign it to an outputStream for use try{ serialOut = serialPort.getOutputStream(); System.out.println("Serial output stream has been assigned."); }//try catch(IOException e) { System.out.println("Error: Couldn't assign output stream to serial port."); }//catch //assign it to an inputStream for use try{ serialIn = serialPort.getInputStream(); System.out.println("Serial input stream has been assigned."); }//try catch(IOException e) { System.out.println("Error: Couldn't assign input stream to serial port."); }//catch ======================================================================== -- Kim Lux, Diesel Research Inc. From lux at diesel-research.com Fri Feb 10 21:23:00 2006 From: lux at diesel-research.com (Kim Lux) Date: Fri, 10 Feb 2006 21:23:00 -0700 Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Message-ID: <1139631780.23882.10.camel@zd7280> I've got a problem receiving chars with my version of serialRead, written in an SWT GUI. I had a Java pro have a good look at my code and he can't see anything wrong with it. I can send chars fine. When I receive a char the cpu usage for the app goes to 100% and the code in the serial event handler doesn't get executed. The instructions on the Java Comm Serial API How-To for Linux page state that I must install javacomm. Is that true ? Everything builds without it and I can send chars on rxtx just fine, but I can't receive them. Could this be the problem ? I downloaded and installed javacomm. I was not able to add "Driver=gnuio.RXTXCommDriver to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 installed in /usr/java/jre1.5.0_05. I added comm.jar to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext to the library paths. Is this OK ? Does it matter that I am receiving on /dev/ttyUSB0 ? Thanks. -- Kim Lux, Diesel Research Inc. From lunareclipse03 at web.de Sat Feb 11 09:44:46 2006 From: lunareclipse03 at web.de (lunareclipse03@web.de) Date: Sat, 11 Feb 2006 17:44:46 +0100 Subject: [Rxtx] Question about Serial I/O under Win32 Message-ID: <662084330@web.de> Hello everybody, I have a strange problem with a piece of code I made for myself. No, this is not really concerning rxtx, but nevertheless I post this to the list, hoping that some of you can help me. I've written two libraries, one for linux and one for win32. The linux port works quite well, I can send / receive faxes and / or replay voice messages over the telephone line using a voice modem. But the win32 port of the library causes some trouble. If, for example, I send out a fax with a certain modem under linux, it works well. The fax is complete when it comes out of the fax machine. If I then use the same modem to send out a fax under win32, the fax coming out of the fax machine gets "stuck" halfways, but the sending modem thinks that transmission was ok and drops the connection. The answering fax machine then gives me "error while receiving." The "upper layer" java code MUST be right, because if I do the same thing under linux (using the linux library), everything is alright. Now I have to ask: Can somebody please help me out with this??!? Could it be the case that some kind of flow control or COMMTIMEOUTS setting causes this behaviour? I set flow control to RTS/CTS before sending out a fax. How can I DISABLE flow control? Or what do you think? Can something else cause this problems? Thank you all for your time and PLEASE write back soon. Regards, --Sven Ahlemann Am Waldrand 31 45721 Haltern am See Germany ______________________________________________________________ Verschicken Sie romantische, coole und witzige Bilder per SMS! Jetzt bei WEB.DE FreeMail: http://f.web.de/?mc=021193 From lux at diesel-research.com Sat Feb 11 10:06:52 2006 From: lux at diesel-research.com (Kim Lux) Date: Sat, 11 Feb 2006 10:06:52 -0700 Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: <1139631780.23882.10.camel@zd7280> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> <1139631780.23882.10.camel@zd7280> Message-ID: <1139677612.3431.5.camel@zd7280> More on this problem. I copied and pasted simpleRead into a console based Eclipse project and I've got the same result, except that cpu usage doesn't go to 100%. I'm beginning to think there is an issue in rxtx. My imports for simpleRead are: ============================ import gnu.io.*; import java.util.*; //import javax.comm.*; import java.io.*; =========================== Any ideas ? I am trying to read from /dev/ttyUSB0 using a serial to USB adapter which has worked well with minicom and gtkterm. Thanks. On Fri, 2006-02-10 at 21:23 -0700, Kim Lux wrote: > I've got a problem receiving chars with my version of serialRead, > written in an SWT GUI. > > I had a Java pro have a good look at my code and he can't see anything > wrong with it. > > I can send chars fine. When I receive a char the cpu usage for the app > goes to 100% and the code in the serial event handler doesn't get > executed. > > The instructions on the Java Comm Serial API How-To for Linux page state > that I must install javacomm. Is that true ? Everything builds without > it and I can send chars on rxtx just fine, but I can't receive them. > Could this be the problem ? > > I downloaded and installed javacomm. I was not able to add > "Driver=gnuio.RXTXCommDriver > to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not > have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 > installed in /usr/java/jre1.5.0_05. I added comm.jar > to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext > to the library paths. Is this OK ? > > Does it matter that I am receiving on /dev/ttyUSB0 ? > > Thanks. > -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Sun Feb 12 21:01:33 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:01:33 -0700 (MST) Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: <1139677612.3431.5.camel@zd7280> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> <1139631780.23882.10.camel@zd7280> <1139677612.3431.5.camel@zd7280> Message-ID: I suspect what is happening is the select() is breaking out in the native code but the driver does not have support for notifying there are X bytes available. On some traditional Unix based systems, the only way you know data is available is the fd status changes and do an FIORDCHK ioctl. Or perhaps the only thing you can know is the fd status changed. It would take reading through the kernel driver code to know for sure. So on USB, depending upon the driver, the same may need to be done or the driver improved a bit if possible to support. Polling reads will also work but don't use the event driven model of CommAPI which isnt acceptable in the long run. The 100% cpu usage can then be explained because select no longer blocks until the data is read; the eventLoop spins loose. You can put a well placed sleep but rxtx only expects those are needed when it knows data is available. This may not be a super simple thing to understand and fix. I do have ideas to get you started. I'm going to be short on time the next couple weeks. I expect to put some good time in and answer some other questions I saw around the 25th. For now, I'd look at the following and go from there with the hints I've given. JNIEXPORT jint JNICALL RXTXPort(nativeavailable)( JNIEnv *env, jobject jobj ) { int fd = get_java_var( env, jobj,"fd","I" ); int result; /* char message[80]; ENTER( "RXTXPort:nativeavailable" ); On SCO OpenServer FIONREAD always fails for serial devices, so try ioctl FIORDCHK instead; will only tell us whether bytes are available, not how many, but better than nothing. This turns out to be true on Solaris also. taj. */ #ifdef FIORDCHK /* __unixware__ __sun__ probably others */ result = ioctl(fd, FIORDCHK, 0); #else if( ioctl( fd, FIONREAD, &result ) < 0 ) { goto fail; } #endif /* FIORDCHK */ On Sat, 11 Feb 2006, Kim Lux wrote: > > More on this problem. I copied and pasted simpleRead into a console > based Eclipse project and I've got the same result, except that cpu > usage doesn't go to 100%. I'm beginning to think there is an issue in > rxtx. > > My imports for simpleRead are: > > ============================ > import gnu.io.*; > import java.util.*; > //import javax.comm.*; > import java.io.*; > =========================== > > Any ideas ? I am trying to read from /dev/ttyUSB0 using a serial to > USB adapter which has worked well with minicom and gtkterm. > > Thanks. > > > > On Fri, 2006-02-10 at 21:23 -0700, Kim Lux wrote: >> I've got a problem receiving chars with my version of serialRead, >> written in an SWT GUI. >> >> I had a Java pro have a good look at my code and he can't see anything >> wrong with it. >> >> I can send chars fine. When I receive a char the cpu usage for the app >> goes to 100% and the code in the serial event handler doesn't get >> executed. >> >> The instructions on the Java Comm Serial API How-To for Linux page state >> that I must install javacomm. Is that true ? Everything builds without >> it and I can send chars on rxtx just fine, but I can't receive them. >> Could this be the problem ? >> >> I downloaded and installed javacomm. I was not able to add >> "Driver=gnuio.RXTXCommDriver >> to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not >> have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 >> installed in /usr/java/jre1.5.0_05. I added comm.jar >> to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext >> to the library paths. Is this OK ? >> >> Does it matter that I am receiving on /dev/ttyUSB0 ? >> >> Thanks. >> > From tjarvi at qbang.org Sun Feb 12 21:03:30 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:03:30 -0700 (MST) Subject: [Rxtx] One serial port object for both sending and receiving ? In-Reply-To: <1139610545.18177.4.camel@zd7280> References: <1139610545.18177.4.camel@zd7280> Message-ID: On Fri, 10 Feb 2006, Kim Lux wrote: > > Is it OK to use one SerialPort ojbect (ex Serial Port serialPort;) and > use it for both sending and receiving ? > > For example: > > ======================================================================== > static SerialPort serialPort = null; > static OutputStream serialOut = null; > static InputStream serialIn = null; > > > > > // assign it to an outputStream for use > try{ > serialOut = serialPort.getOutputStream(); > System.out.println("Serial output stream has been assigned."); > }//try > catch(IOException e) > { > System.out.println("Error: Couldn't assign output stream to serial > port."); > }//catch > > > //assign it to an inputStream for use > try{ > serialIn = serialPort.getInputStream(); > System.out.println("Serial input stream has been assigned."); > }//try > catch(IOException e) > { > System.out.println("Error: Couldn't assign input stream to serial > port."); > }//catch This should be fine. In fact trying to do it another way will probably not work as you will run into lockfile issues. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun Feb 12 21:13:13 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:13:13 -0700 (MST) Subject: [Rxtx] Question about Serial I/O under Win32 In-Reply-To: <662084330@web.de> References: <662084330@web.de> Message-ID: On Sat, 11 Feb 2006 lunareclipse03 at web.de wrote: > Hello everybody, > > I have a strange problem with a piece of code I made for myself. No, > this is not really concerning rxtx, but nevertheless I post this to the > list, hoping that some of you can help me. I've written two libraries, > one for linux and one for win32. The linux port works quite well, I can > send / receive faxes and / or replay voice messages over the telephone > line using a voice modem. But the win32 port of the library causes some > trouble. If, for example, I send out a fax with a certain modem under > linux, it works well. The fax is complete when it comes out of the fax > machine. If I then use the same modem to send out a fax under win32, the > fax coming out of the fax machine gets "stuck" halfways, but the sending > modem thinks that transmission was ok and drops the connection. The > answering fax machine then gives me "error while receiving." The "upper > layer" java code MUST be right, because if I do the same thing under > linux (using the linux library), everything is alright. Now I have to > ask: Can somebody please help me out with this??!? Could it be the case > that some kind of flow control or COMMTIMEOUTS setting causes this > behaviour? I set flow control to RTS/CTS before sending out a fax. How > can I DISABLE flow control? Or what do you think? Can something else > cause this problems? Thank you all for your time and PLEASE write back > soon. > Hi Sven I'm not too willing to talk about flow control at the low level until I confirm some things with test equipment later. It is not clear if you are using rxtx or writing your own native code. So I'm not sure how to answer much of this :) If you are wondering how to change the flow control using rxtx from java, The BlackBox example from Sun flips this back and forth. SerialPort.java in rxtx 2.1 uses the following: SerialPort.java: public static final int FLOWCONTROL_NONE =0; SerialPort.java: public static final int FLOWCONTROL_RTSCTS_IN =1; SerialPort.java: public static final int FLOWCONTROL_RTSCTS_OUT =2; SerialPort.java: public static final int FLOWCONTROL_XONXOFF_IN =4; SerialPort.java: public static final int FLOWCONTROL_XONXOFF_OUT=8; So if you set flowcontrol to RTSCTS, you can set it to NONE to turn it off. If you are looking for how to do it in native code, the rxtx Source is SerialImp.c (unix/linux/mac os x/w32) and termios.c (w32 only with SerialImp.c) You can track the code: SerialImp.c:JNIEXPORT void JNICALL RXTXPort(setflowcontrol)( JNIEnv *env, jobject jobj, jint flowmode ) termios.c:int tcgetattr( int fd, struct termios *s_termios ) termios.c:int tcsetattr( int fd, int when, struct termios *s_termios ) There may be a problem in the rxtx flow control code though. Rather than guess, I want to test this with a gold standard. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Feb 6 00:00:16 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 00:00:16 -0700 (MST) Subject: [Rxtx] wiki delay until tomorrow night. In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: On Sun, 5 Feb 2006, Trent Jarvi wrote: > On Sun, 5 Feb 2006, Kim Lux wrote: > >> usb ? Tell me more... I need that too. > > usb is a very proper design. Thats all it is. > Maybe rxtx could help usb. But it would start with helping bring back the community that was already there. It's not something I'd love to do but maybe its the right thing to do. It would probably take 2 years to do right. But maybe thats better than what we have now. I honestly don't know what IBM is doing which could just run over everything. Just some thoughts after some fine german wine. -- Trent Jarvi tjarvi at qbang.org From gadelavega at yahoo.com.ar Mon Feb 6 02:17:05 2006 From: gadelavega at yahoo.com.ar (Gonzalo A. de la Vega) Date: Mon, 06 Feb 2006 10:17:05 +0100 Subject: [Rxtx] Serial port ownership question In-Reply-To: References: <20060205113618.30274.qmail@web53501.mail.yahoo.com> <1139157422.4553.9.camel@zd7280> <1139158698.4936.9.camel@zd7280> Message-ID: <43E71411.4050402@yahoo.com.ar> On my Fedora Core 4: ls -l /dev/ttyS* crw-rw---- 1 root uucp 4, 64 Feb 6 2006 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Feb 6 2006 /dev/ttyS1 ... and: grep "ttyUSB" /etc/udev/rules.d/50-udev.rules KERNEL=="ttyUSB*", GROUP="uucp", MODE="0660" So anyone in the "uucp" group can use serial ports. On Gentoo the group is "tty". Trent Jarvi escribi?: > > > On Sun, 5 Feb 2006, Dr. Douglas Lyon wrote: > >> I can confirm that this is the case (only root ownership of >> serial ports, under fedora 4). >> Wow, what were they thinking?! >> - DL >> >>> I've found that the newer kernels have the serial ports owned by root. >>> For example, >>> >>> $ls -al /dev/tty* >>> crw-rw-rw- 1 root root 5, 0 Feb 5 02:06 /dev/tty >>> crw-rw---- 1 root root 4, 0 Feb 5 02:06 /dev/tty0 >>> crw------- 1 root root 4, 1 Feb 5 09:07 /dev/tty1 >>> crw-rw---- 1 root tty 4, 10 Feb 5 02:06 /dev/tty10 >>> crw-rw---- 1 root tty 4, 11 Feb 5 02:06 /dev/tty11 >>> ... > > > This is just not a problem jcp or such are going to solve. Its a > platform spitwad fight. But do look at pam. In fact thats what Sun > is doing too. Maybe Linux followed their lead.. I'm not a pam guy. > I've spent 16 hours trying to understand it but your users wont :) > > Solution? I have no clue. Its two tangent mentalities from my > perspective. > > -- > Trent Jarvi > tjarvi at qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mtnvega at yahoo.com.br Mon Feb 6 05:35:43 2006 From: mtnvega at yahoo.com.br (Luiz Jr) Date: Mon, 6 Feb 2006 12:35:43 +0000 (GMT) Subject: [Rxtx] Documentation Wiki In-Reply-To: <1139157422.4553.9.camel@zd7280> Message-ID: <20060206123543.57256.qmail@web53515.mail.yahoo.com> Hello, Thank you for you answer, but so the usage of the API is pretty much like the Java Communications Api? If yes, what version of the Java Comm Api? Thank you, Luiz A. Brandao Jr Kim Lux escreveu: On Sun, 2006-02-05 at 08:36 -0300, Luiz Jr wrote: > Hello, > > I want to start using the RXTX libraries, but I would to know how, > since I can not access the documentation wiki page I just started using them yesterday. Below is how I installed the libraries, if that helps. I used snippets of code from the SimpleWrite application here to get me going. http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html Instead of "import javax.comm.*;", use "import gnu.io.*;" which is gotten from RXTXcomm.jar, which you will need to include in your project references. I am working in Eclipse. BTW: there is no way to open a port without going through the port list and finding it. Maybe sometime in the future someone (me ?) will write a method called openSerialPort that allows the user to give a port identifier, such as "/dev/tty1" and return a port ready to use. It wouldn't take much to write that and it would save users a lot of code. Hope this helps. ======================================================================= 1) Figure out which java you are running, incase there is more than one installed. $ java -version java version "1.5.0_05" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_05-b05) Java HotSpot(TM) Client VM (build 1.5.0_05-b05, mixed mode, sharing) 2) Find all the jre directories and the one from which you are currently running. kfind (jre) 3) cd to that directory plus /lib/i386 cd /usr/java/jre1.5.0_05/lib/i386 4) Copy the library files (*.so) to that directory. cp /home/krlux/Desktop/'Java Controls'/rxtx-linux/bin/* . 5) Check that the copy was successful ls librxtx* librxtxI2C.so librxtxRaw.so librxtxSerial.so librxtxParallel.so librxtxRS485.so 6) cd to the /lib/ext directory for your java. cd /usr/java/jre1.5.0_05/lib/ext 7) Copy the Jar files there cp /home/krlux/Desktop/'Java Controls'/rxtx-linux/lib/ext/* . 8) Check that it was successful ls RXTX* RXTXcomm.jar Rxtx is now installed on your machine ready to use. =================================================================== -- Kim Lux, Diesel Research Inc. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx --------------------------------- Yahoo! Acesso Gr?tis - Internet r?pida e gr?tis. Instale o discador agora! -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/544aa403/attachment-0048.html From lyon at docjava.com Mon Feb 6 05:49:34 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 06 Feb 2006 07:49:34 -0500 Subject: [Rxtx] wiki delay until tomorrow night. In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: Hi All, I have often thought about USB drivers being needed. For example, the ironman watch will not interface to a mac (windows only). It is USB. My dymo label writer has no Java driver (native only). Etc. Most cheap web cameras are USB (and Java drivers go through JAI, if it supports the camera at all). The JAI code shows how sun did the USB drivers. You have to be a member of the jai project to download the source code. https://jai.dev.java.net has the jai distro. And then you are not allowed to redistribute it. However, we can all learn from it (if so inclined). Basically: cvs -d :pserver:lyon at cvs.dev.java.net:/cvs login cvs -d :pserver:lyon at cvs.dev.java.net:/cvs checkout jai-core You will need to user your own uid and pw to get in. The ant build has over 100 warnings from sun deprecations of its own code. You might say that they were hoisted on their own Picard ;) One interesting thing is that they support several platforms: linux-amd64 64-bit Linux-AMD64 linux-i586 32-bit Linux-x86 solaris-amd64 64-bit Solaris-AMD64 solaris-i586 32-bit Solaris-x86 solaris-sparc 32-bit Solaris-SPARC solaris-sparcv9 64-bit Solaris-SPARC windows-i586 32-bit Windows-x86 Thus, ant is used to provide a multi-platform native method distro. Neat. How do they do it? check this out: And: The core download does not contain any C source code (it was all pre-built). Basically, they are just copying .so and .dll files into build directories. I would love to see the C code for this...but Sun does not post it on the https://jai.dev.java.net site. I don't know why...Perhaps I missed it. - Doug >On Sun, 5 Feb 2006, Trent Jarvi wrote: > >>On Sun, 5 Feb 2006, Kim Lux wrote: >> >>>usb ? Tell me more... I need that too. >> >>usb is a very proper design. Thats all it is. >> > >Maybe rxtx could help usb. But it would start with helping bring >back the community that was already there. > >It's not something I'd love to do but maybe its the right thing to do. > >It would probably take 2 years to do right. But maybe thats better >than what we have now. > >I honestly don't know what IBM is doing which could just run over everything. > >Just some thoughts after some fine german wine. > >-- >Trent Jarvi >tjarvi at qbang.org > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tdelenik at gmail.com Mon Feb 6 05:56:32 2006 From: tdelenik at gmail.com (Thanasis Delenikas) Date: Mon, 6 Feb 2006 14:56:32 +0200 Subject: Fwd: [Rxtx] Documentation Wiki In-Reply-To: <1139157422.4553.9.camel@zd7280> References: <20060205113618.30274.qmail@web53501.mail.yahoo.com> <1139157422.4553.9.camel@zd7280> Message-ID: <310a1a930602060456t129f1dc6p5f2b908f13ab5a0b@mail.gmail.com> Hello all, Kim, this is a snippet from the code I use. The closest to directly opening a specific port without enumeration. << ... portId = CommPortIdentifier.getPortIdentifier(getPort()); serialPort = (SerialPort) portId.open("jSMSEngine", 1971); ... >> where getPort() return the string identifier of the port, i.e. "/dev/ttyS0" or "COM1" or whatever. Thanasis. ---------- Forwarded message ---------- From: Kim Lux Date: Feb 5, 2006 6:37 PM Subject: Re: [Rxtx] Documentation Wiki To: RXTX Developers and Users BTW: there is no way to open a port without going through the port list and finding it. Maybe sometime in the future someone (me ?) will write a method called openSerialPort that allows the user to give a port identifier, such as "/dev/tty1" and return a port ready to use. It wouldn't take much to write that and it would save users a lot of code. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/182ab5b8/attachment-0048.html From tjarvi at qbang.org Mon Feb 6 11:53:57 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 11:53:57 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: On Mon, 6 Feb 2006, Dr. Douglas Lyon wrote: > Hi All, > I have often thought about USB drivers being needed. > For example, the ironman watch will not interface > to a mac (windows only). It is USB. > My dymo label writer has no Java driver (native only). > Etc. > Most cheap web cameras are USB (and Java drivers go > through JAI, if it supports the camera at all). > The JAI code shows how sun did the USB drivers. > You have to be a member of the jai project to download > the source code. > https://jai.dev.java.net has the jai distro. > And then you are not allowed to redistribute it. However, > we can all learn from it (if so inclined). Basically: > cvs -d :pserver:lyon at cvs.dev.java.net:/cvs login > cvs -d :pserver:lyon at cvs.dev.java.net:/cvs checkout jai-core > You will need to user your own uid and pw to get in. > The ant build has over 100 warnings from sun deprecations > of its own code. > > You might say that they were hoisted on their own Picard ;) > > One interesting thing is that they support several platforms: > linux-amd64 64-bit Linux-AMD64 > linux-i586 32-bit Linux-x86 > solaris-amd64 64-bit Solaris-AMD64 > solaris-i586 32-bit Solaris-x86 > solaris-sparc 32-bit Solaris-SPARC > solaris-sparcv9 64-bit Solaris-SPARC > windows-i586 32-bit Windows-x86 > Thus, ant is used to provide a multi-platform native method distro. > Neat. > How do they do it? > check this out: > > > > > > > > > > > > > And: > > > > > > > > > > The core download does not contain any C source code (it was all pre-built). > Basically, they are just copying .so and .dll files into build directories. > > I would love to see the C code for this...but Sun does not post it on the > https://jai.dev.java.net site. > > I don't know why...Perhaps I missed it. > > - Doug > > I've looked at moving rxtx to Ant builds. I think that would help IDEs a great deal. I requested a evalutation desk copy the O'Reilly Ant book for some j2ee material I was teaching. http://www.oreilly.com/catalog/anttdg/ It has a one sentence mention of JNI. So there was not luck there. I saw that there is another Ant book that does mention JNI more. I can't find it now. Ant must be able to support it with extensions. http://ant.apache.org/manual/OptionalTasks/javah.html What the auto(break :) tools do in the rxtx build is 4 things really. 1) gcc compile flags 2) ld compile flags 3) config.h 4) compile flags for customizing rxtx (lockfiles, ...) See 1 All of this information except 4 can be static once obtained. So I'm not attached to the auto tools. If I could find an example of Ant being used for JNI code, I'd be one of the first to start moving that direction. Maybe someone saw an example someplace. The other thing we have not completed discussing is the directory structure. There is interest in making rxtx more IDE friendly. I get more mail about that off the list than how to install rxtx. And I see we have Ken Thompson in da house :) He is our trusted CVS maintainer and the guy that purchased the rxtx.org domain. Old community. We will need Ken for changing the directory structure of source. I would like to open up discussion about both of these as it is more than time. The problem is I have little experience with Ant and even less with IDEs. It would be nice if we could work with Eclipse and NetBeans. http://www.netbeans.org/ (sun and some community) http://www.eclipes.org (ibm,rhat,... perhaps more community) http://maven.apache.org/what-is-maven.html (apache. It is community) borland should sortof be here too but I think thats covered in eclipse. >From what I understand so far, we should morph rxtx to support those three maybe trusting apaches lead with maven. But I use vi. I have little to no clues beyond what people have fed me. Can we agree that thats the right direction to go? -- Trent Jarvi tjarvi at qbang.org From brian at mbari.org Mon Feb 6 14:57:50 2006 From: brian at mbari.org (Brian Schlining) Date: Mon, 6 Feb 2006 13:57:50 -0800 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> > The other thing we have not completed discussing is the directory > structure. There is interest in making rxtx more IDE friendly. I > get more mail about that off the list than how to install rxtx. > > And I see we have Ken Thompson in da house :) He is our trusted > CVS maintainer and the guy that purchased the rxtx.org domain. Old > community. We will need Ken for changing the directory structure of > source. > > I would like to open up discussion about both of these as it is > more than time. The problem is I have little experience with Ant > and even less with IDEs. It would be nice if we could work with > Eclipse and NetBeans. > > http://www.netbeans.org/ (sun and some community) > http://www.eclipes.org (ibm,rhat,... perhaps more community) > http://maven.apache.org/what-is-maven.html (apache. It is community) > borland should sortof be here too but I think thats covered in > eclipse. > >> From what I understand so far, we should morph rxtx to support >> those three > maybe trusting apaches lead with maven. But I use vi. I have > little to no clues beyond what people have fed me. > Maven likes the directory structure below for Java code. (From http:// maven.apache.org/guides/getting-started/index.html) This structure works fine with ant, netbeans, and eclipse. rxtx_root_directory `-- src |-- main | `-- java | `-- gnu | `-- io `-- test `-- java `-- gnu `-- io Brian Schlining Software Engineer http://www.mbari.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/d9451eba/attachment-0048.html From tjarvi at qbang.org Mon Feb 6 15:11:45 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 15:11:45 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: > rxtx_root_directory > `-- src > |-- main > | `-- java > | `-- gnu > | `-- io > `-- test > `-- java > `-- gnu > `-- io > >From what I understand this will just be good. For me it makes no difference. So lets do the rxtx thing. Let if fester for two weeks and if nobody objects, we will do it. I'm not doing this because I care. I'm doing this to eliminate much of my inbox. But test... man is rxtx lacking there in the community aspect. It is covered but not right. _maybe_ I can change that this year. -- Trent Jarvi tjarvi at qbang.org (cat hurding since 1997) From lux at diesel-research.com Mon Feb 6 21:38:49 2006 From: lux at diesel-research.com (Kim Lux) Date: Mon, 06 Feb 2006 21:38:49 -0700 Subject: [Rxtx] How can I use Lock Files with rxtx (in FC4) ? Message-ID: <1139287129.17031.3.camel@zd7280> I am now running an rxtx application on FC4. I am getting: ========================================================= check_group_uucp(): error testing lock file creation Error details: Permission denied check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL ========================================================= $ ls -al /var/lock total 32 drwxrwxr-x 4 root lock 4096 Feb 6 16:04 . drwxr-xr-x 24 root root 4096 Nov 14 01:19 .. drwx------ 2 root root 4096 Apr 27 2005 lvm drwxr-xr-x 2 root root 4096 Feb 6 16:04 subsys How do I fix this for regulator users ? -- Kim Lux, Diesel Research Inc. From dmarkman at mac.com Mon Feb 6 22:24:44 2006 From: dmarkman at mac.com (Dmitry Markman) Date: Tue, 7 Feb 2006 00:24:44 -0500 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: if I understands the issue right in order to be able to use ant for c/c++ compilation you have to install ant's cc task http://ant-contrib.sourceforge.net/cc.html it looks like it should work on mac os x (authors claim, that it's platform independent) but I never tested so all you have to do it's providing right command line for the gcc compiler On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: >> rxtx_root_directory >> `-- src >> |-- main >> | `-- java >> | `-- gnu >> | `-- io >> `-- test >> `-- java >> `-- gnu >> `-- io >> > > >> From what I understand this will just be good. > > For me it makes no difference. So lets do the rxtx thing. Let if > fester for two weeks and if nobody objects, we will do it. > > I'm not doing this because I care. I'm doing this to eliminate > much of my inbox. > > But test... man is rxtx lacking there in the community aspect. It > is covered but not right. _maybe_ I can change that this year. > > -- > Trent Jarvi > tjarvi at qbang.org > (cat hurding since 1997) > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx Dmitry Markman From lux at diesel-research.com Mon Feb 6 23:20:15 2006 From: lux at diesel-research.com (Kim Lux) Date: Mon, 06 Feb 2006 23:20:15 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? Message-ID: <1139293215.3689.4.camel@zd7280> I'm running the code below. portlist.hasMoreElements() is false. /dev has ports in it as listed below. What am I doing wrong ? ========================================================== // Step through the list of ports until we find one that matches // the one we are looking for. portList = CommPortIdentifier.getPortIdentifiers(); while(portList.hasMoreElements()) { portID = (CommPortIdentifier) portList.nextElement(); // if (portID.getName().equals("/dev/ttyUSB0")) { myTA.append("Serial port ttyUSB0 has been found\n"); break; }// if portID equals... }// End of while... ========================================================== ls -al /dev/tty* crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 ... crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 -- Kim Lux, Diesel Research Inc. From david.garnier at trusted-logic.com Tue Feb 7 00:46:30 2006 From: david.garnier at trusted-logic.com (David Garnier) Date: Tue, 07 Feb 2006 08:46:30 +0100 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: <43E85056.2090608@trusted-logic.com> Hello, I think that the make-based build process is fine as it is, apart from the location of the Java source files. It is true that putting the Java source in a directory structure that map 1-to-1 to the Java package structure is the norm and should make it easier for everyone to modify the Java source, with or without an IDE. Ant is a good tool, but in the RXTX case I fail to see the advantage of using it compared to the current make-based process. As Trent said, they are more pressing issues, like testing. Regards, David Dmitry Markman wrote: > if I understands the issue right > in order to be able to use ant for c/c++ compilation > you have to install ant's cc task > http://ant-contrib.sourceforge.net/cc.html > > it looks like it should work on mac os x > (authors claim, that it's platform independent) > but I never tested > > so all you have to do it's providing right command line > for the gcc compiler > > > > > On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: > >>> rxtx_root_directory >>> `-- src >>> |-- main >>> | `-- java >>> | `-- gnu >>> | `-- io >>> `-- test >>> `-- java >>> `-- gnu >>> `-- io >>> >> >> >>> From what I understand this will just be good. >> >> For me it makes no difference. So lets do the rxtx thing. Let if >> fester for two weeks and if nobody objects, we will do it. >> >> I'm not doing this because I care. I'm doing this to eliminate much >> of my inbox. >> >> But test... man is rxtx lacking there in the community aspect. It is >> covered but not right. _maybe_ I can change that this year. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> (cat hurding since 1997) From tjarvi at qbang.org Tue Feb 7 01:11:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 01:11:31 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <43E85056.2090608@trusted-logic.com> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: On Tue, 7 Feb 2006, David Garnier wrote: > Hello, > > I think that the make-based build process is fine as it is, apart from the location of the Java > source files. It is true that putting the Java source in a directory structure that map 1-to-1 to > the Java package structure is the norm and should make it easier for everyone to modify the Java > source, with or without an IDE. > > Ant is a good tool, but in the RXTX case I fail to see the advantage of using it compared to the > current make-based process. As Trent said, they are more pressing issues, like testing. > Hi David I have more experience with testing rxtx than I can talk about. But let it be known, rxtx has gone trough 100's of hours of testing. We are hobby folks interested in toys but there is more. rxtx has had some of the best guidance in the industry there. This is not an easy thing. I may be able to come back in a month from the other side of the corperate fence and help. I suspect the tests could just be made public but they are in a very unusual environment that just wont work in a wider sense. This is something I'll be trying to change. At one point it was agreed we could just make the results public so this isnt just noise.. There is interest and I think its safe to mention that much. The big problem with testing in the past is most of it is done with a loopback connection. So we *still* have major questions regarding things like flow control. rxtx talks to itself over a loopback and it works. regardless of right or wrong. This requires more thought to be done right. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Feb 7 02:46:34 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 02:46:34 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: > The big problem with testing in the past is most of it is done with a > loopback connection. So we *still* have major questions regarding things > like flow control. rxtx talks to itself over a loopback and it works. > regardless of right or wrong. With serial communication there are gold standards. ckermit is probably a definitive 'standard.' Maybe its possible to do ping/pong tests with ckermit? Is it scriptable? There are known issues in rxtx. Probably the worst is some threading issues regarding some JREs with multiple JNI threads setting java variables. Man did I get schooled there. Just switch the c functions to returning variables and things go away. Sometimes they work fine, sometimes they blow up. Without understanding everything, somehow rhat got it right and debian (and especially gentoo) grabbed kernel patches causing all sort of harm. Its not hard to fix once you understand whats going on but nearly impossible to track with a debugger. So I have a good idea what 2.1-8 will have outside of the IDE modifications. rxtx 2.1-7 is a release for everyone to sync with. Its not even as stable as -pre17 as far as I know - I ran no test suites. I'll be chasing it too. We just had so many contributions that it was time. It seriously broke internal scheduals but thats a great thing :) The other thing I want to do in 2.1-8 is automagic baud rates. It turns out lots of shops are doing really funky baud rates for things like automobile test equipment. It is possible but it requires a fair amount of change in the native code. Is anyone looking at this? -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Feb 7 02:57:21 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 07 Feb 2006 04:57:21 -0500 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <43E85056.2090608@trusted-logic.com> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: Hi All, I agree, testing is very important. The problem I have been trying to address is related to cross-platform testing and the robust nature of the installs. Typically, I visit 3 platforms to deploy my product, windows, linux and mac. A build is performed on each platform. The idea that you can build for many platforms from one copy the source code seems attractive. This should enable synchronized deployments of identical code. The question of how to achieve this goal remains open. As Trent mentioned, this is hard. Perhaps Ant will help here (but perhaps not). Ant does seem to help with running unit tests. However, it does not help with multi-platform tests. For that you need many machines and different operating environments. Toward that end, I have created a multi-platform test that can be run from web start, located at: http://show.docjava.com:8086/book/cgij/code/jnlp/serialPort.PortTest.jnlp This is interesting because many people in the community can run the test and we can improve the test, as time permits. No, it is not a perfect solution, however, the idea does help with multi-platform tests using many machines and different operating environments. If the group has a good test for a general serial port set-ups, i would be happy to deploy it, for general evaluation using web start. And as for ANT, it is just an idea. Not all my ideas are good ones! - Doug >Hello, > >I think that the make-based build process is fine as it is, apart >from the location of the Java >source files. It is true that putting the Java source in a directory >structure that map 1-to-1 to >the Java package structure is the norm and should make it easier for >everyone to modify the Java >source, with or without an IDE. > >Ant is a good tool, but in the RXTX case I fail to see the advantage >of using it compared to the >current make-based process. As Trent said, they are more pressing >issues, like testing. > >Regards, >David > >Dmitry Markman wrote: >> if I understands the issue right >> in order to be able to use ant for c/c++ compilation >> you have to install ant's cc task >> http://ant-contrib.sourceforge.net/cc.html >> >> it looks like it should work on mac os x >> (authors claim, that it's platform independent) >> but I never tested >> >> so all you have to do it's providing right command line >> for the gcc compiler >> >> >> >> >> On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: >> >>>> rxtx_root_directory >>>> `-- src >>>> |-- main >>>> | `-- java >>>> | `-- gnu >>>> | `-- io >>>> `-- test >>>> `-- java >>>> `-- gnu >>>> `-- io >>>> >>> >>> >>>> From what I understand this will just be good. >>> >>> For me it makes no difference. So lets do the rxtx thing. Let if >>> fester for two weeks and if nobody objects, we will do it. >>> >>> I'm not doing this because I care. I'm doing this to eliminate much >>> of my inbox. >>> >>> But test... man is rxtx lacking there in the community aspect. It is >>> covered but not right. _maybe_ I can change that this year. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> (cat hurding since 1997) > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From matt.higgins at gmail.com Tue Feb 7 08:28:34 2006 From: matt.higgins at gmail.com (Matt Higgins) Date: Tue, 7 Feb 2006 10:28:34 -0500 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final Message-ID: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? import java.io.*; import java.util.*; import gnu.io.*; public class MySimpleRead implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; public static void main(String[] args) { boolean portFound = false; String defaultPort = "COM1"; if (args.length > 0) { defaultPort = args[0]; } portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; MySimpleRead reader = new MySimpleRead(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } } public MySimpleRead() { try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) { e.printStackTrace(); } try { inputStream = serialPort.getInputStream(); } catch (IOException e) { e.printStackTrace(); } try { serialPort.addEventListener(this); } catch (TooManyListenersException e) { e.printStackTrace(); } try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { e.printStackTrace(); } System.out.println("Baud is " + serialPort.getBaudRate()); System.out.println("Bits is " + serialPort.getDataBits()); System.out.println("Stop is " + serialPort.getStopBits()); System.out.println("Par is " + serialPort.getParity()); serialPort.notifyOnDataAvailable(true); readThread = new Thread(this); readThread.start(); } public void run() { // Thread.sleep(20000); //} catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { System.out.println("An event occurred " + event.getEventType()); switch (event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: byte[] readBuffer = new byte[20]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } System.out.print(new String(readBuffer)); } catch (IOException e) {} break; } } } --------------- Result on windows ------------------------------ Stable Library ============================================================== Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port:: COM1 Baud is 9600 Bits is 8 Stop is 1 Par is 0 ----------------- End Results ----------------------------------------- ------------------ Result on Linux ----------------------------------- Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 Found port: /dev/ttyS0 Baud is 9600 Bits is 8 Stop is 1 Par is 0 An event occurred 1 043100066224 ------------------ End Results --------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/a1431630/attachment-0048.html From brian at mbari.org Tue Feb 7 09:48:37 2006 From: brian at mbari.org (Brian Schlining) Date: Tue, 7 Feb 2006 08:48:37 -0800 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> Message-ID: <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> Hi Matt > The following code works fine on Linux but I never see any data > when run on Windows. This is a cut and paste from the SimpleRead > example. > I am attempting to read data from a bar code scanner. I can fire > up HyperTermianl on windows and see that the device is working > properly as I see the barcodes are scanned and echoed back to the > terminal. However when I run the app I don't see any data. It is > however associating with the com port as the informational bits > print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. Cheers Brian Schlining Software Engineer http://www.mbari.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/16d07f37/attachment-0048.html From lux at diesel-research.com Tue Feb 7 11:59:58 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 11:59:58 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139293215.3689.4.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> Message-ID: <1139338798.8145.4.camel@zd7280> Any ideas on this ? Any reason why portList.hasMoreElements() should be false even though there are devices in /dev ? On Mon, 2006-02-06 at 23:20 -0700, Kim Lux wrote: > I'm running the code below. > > portlist.hasMoreElements() is false. > > /dev has ports in it as listed below. > > What am I doing wrong ? > > > ========================================================== > // Step through the list of ports until we find one that matches > // the one we are looking for. > > portList = CommPortIdentifier.getPortIdentifiers(); > > while(portList.hasMoreElements()) > { > portID = (CommPortIdentifier) portList.nextElement(); // > if (portID.getName().equals("/dev/ttyUSB0")) > { > myTA.append("Serial port ttyUSB0 has been found\n"); > break; > }// if portID equals... > }// End of while... > ========================================================== > > ls -al /dev/tty* > crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty > crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 > crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 > crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 > crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 > ... > crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 > crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 > crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 > > > -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 12:20:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 12:20:25 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139338798.8145.4.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> Message-ID: On Tue, 7 Feb 2006, Kim Lux wrote: > > Any ideas on this ? Any reason why portList.hasMoreElements() should be > false even though there are devices in /dev ? > > > On Mon, 2006-02-06 at 23:20 -0700, Kim Lux wrote: >> I'm running the code below. >> >> portlist.hasMoreElements() is false. >> >> /dev has ports in it as listed below. >> >> What am I doing wrong ? >> >> >> ========================================================== >> // Step through the list of ports until we find one that matches >> // the one we are looking for. >> >> portList = CommPortIdentifier.getPortIdentifiers(); >> >> while(portList.hasMoreElements()) >> { >> portID = (CommPortIdentifier) portList.nextElement(); // >> if (portID.getName().equals("/dev/ttyUSB0")) >> { >> myTA.append("Serial port ttyUSB0 has been found\n"); >> break; >> }// if portID equals... >> }// End of while... >> ========================================================== >> >> ls -al /dev/tty* >> crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty >> crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 >> crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 >> crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 >> crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 >> ... >> crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 >> crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 >> crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 >> >> >> > Hi Kim What rxtx does is try to open the port and do a timed out read. If the kernel/... do not complain it's enumarted. I suspect you could do a crude test by doing something like cat /dev/ttyS0 > /dev/null If that barfs then rxtx wont enumerate the port. hmm looking at your question again, I suspect it's a lockfile problem. This is documented in INSTALL with the source. Its easy enough to test this too.. touch /var/lock/testingrxtxlockfiles && rm -f /var/lock/testingrxtxlockfiles If you are not in the right group it will bail. Root will work regardless. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 12:37:56 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 12:37:56 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> Message-ID: <1139341076.8145.11.camel@zd7280> Exactly which ports does rxtx attempt to put into the list ? /dev/* or /dev/tty* or /dev/tty[0-9[0-9] ? or /dev/ttyS* ? For the record, only /dev/ttyUSB0 is a valid port on the machine I am presently on. Will this be a problem ? On Tue, 2006-02-07 at 12:20 -0700, Trent Jarvi wrote: > This is documented in INSTALL with the source. > I was wondering where that file was. I will download source and dig it up. Thanks. -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 12:51:09 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 12:51:09 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139341076.8145.11.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: On Tue, 7 Feb 2006, Kim Lux wrote: > > Exactly which ports does rxtx attempt to put into the list ? /dev/* > or /dev/tty* or /dev/tty[0-9[0-9] ? or /dev/ttyS* ? > > For the record, only /dev/ttyUSB0 is a valid port on the machine I am > presently on. Will this be a problem ? > > > On Tue, 2006-02-07 at 12:20 -0700, Trent Jarvi wrote: >> This is documented in INSTALL with the source. >> > I was wondering where that file was. I will download source and dig it > up. > > Thanks. > Hmm I'm looking at pre17 so this may have changed. (its just what I have on this machine) if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA" // for the IPAQs }; CandidatePortPrefixes=Temp; } So you may need to add "ttyUSB" to that list. RXTX used to enumerate _everything_ see if(osName.equals("Linux-all-ports") But it became less than practical. This is all in RXTXCommDriver.java hmm I just did a cvs update. if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have to get your fingers into the code. We aim for sane defaults. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 13:06:45 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 13:06:45 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139342805.8145.22.camel@zd7280> On Tue, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > Hmm I'm looking at pre17 so this may have changed. (its just what I have > on this machine) > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA" // for the IPAQs > }; > CandidatePortPrefixes=Temp; > } > > > So you may need to add "ttyUSB" to that list. RXTX used to enumerate > _everything_ see if(osName.equals("Linux-all-ports") But it became less > than practical. > > This is all in RXTXCommDriver.java > > hmm I just did a cvs update. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have > to get your fingers into the code. We aim for sane defaults. Excellent. Thanks for taking the time. -- Kim Lux, Diesel Research Inc. From ideiglenes1 at freemail.hu Tue Feb 7 13:53:39 2006 From: ideiglenes1 at freemail.hu (--) Date: Tue, 07 Feb 2006 21:53:39 +0100 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139345619.22534.2.camel@localhost> Hi! I use this code to get all the extra Linux devices. :) if ("Linux".equals(System.getProperty("os.name"))) { System.setProperty("os.name","Linux-all-ports"); } driver = new RXTXCommDriver(); On k, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > On Tue, 7 Feb 2006, Kim Lux wrote: > > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have > to get your fingers into the code. We aim for sane defaults. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From matt.higgins at gmail.com Tue Feb 7 13:45:54 2006 From: matt.higgins at gmail.com (Matt Higgins) Date: Tue, 7 Feb 2006 15:45:54 -0500 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> Message-ID: <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> Sweet this is exactly what I needed. I was searching the archives through marc.theamisgroup they only have archives back to 1/3/05. Should have hit the mailman archive! Thanks a lot! On 2/7/06, Brian Schlining wrote: > > Hi Matt > > The following code works fine on Linux but I never see any data when run > on Windows. This is a cut and paste from the SimpleRead example. > I am attempting to read data from a bar code scanner. I can fire up > HyperTermianl on windows and see that the device is working properly as I > see the barcodes are scanned and echoed back to the terminal. However when I > run the app I don't see any data. It is however associating with the com > port as the informational bits print fine? > > > You're not the only one whose had this problem, I don't know if Trent has > addressed this is the latest release of RXTX but there is a workaround. > Here's the recent thread from the RXTX mailing list regarding this issues: > > Thanasis Delenikas tdelenik at gmail.com > Wed Jan 18 13:56:23 MST 2006 > > * Previous message: [Rxtx] Re: More close() performance fixes > * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] > > Hi all. > (I've subscribed again from my other email account). > > Trent, > > You are right. Linux *always* works, no matter what flow control you set. > Windows *works only* with hardware flow control (I haven't tested what > happens with software XON/XOFF flow control). > > I assume (but I am not certain) that even with no flow control at all, all > platforms should work. Without flow control, you have the risk of bumping > into overflow or framing errors, but that's your (the end programmer, I > mean) problem. > > >From my side, I shouldn't be working without flow control. That was a bug > too... It was some code forgotten from the old times, when I used to work > with phone emulation drivers which didn't support flow control. The > correct > way is to have some flow control enabled and that's why I suppose this is > a > low-severity bug for RxTx. > > I have no idea which platform shows the correct behaviour, since > my knowledge about Linux and the inner workings of these low-level i/o > operations is limited. > > Regards, > Thanasis Delenikas. > > > > > Message: 2 > > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > > From: Trent Jarvi > > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > > To: RXTX Developers and Users > > Message-ID: > > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > > > Hi all, > > > > > > Trent, I have found something. > > > I read your comment about flow control, so I experimented a bit. > > > > > > If you remember, in my sample program I've used no flow control at all > ( > > i.e. > > > Java constant FLOWCONTROL_NONE). > > > > > > Now, during testing, I've switch to hardware inbound flow control (i.e > . > > Java > > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > > beautifully! > > > > > > I think I will switch to H/W flow control and test things for a while, > > but > > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > > > > > Hi Thanasis, > > > > I'm fairly sure you have identified a bug. I would not worry too much > > about what Sun CommAPI w32 defaults are. I think they did more or less > > whatever the port opened with. Just a guess. Linux tries to stomp on > > ports so they are all the same. > > > > So this started out with Linux worked, Windows XP/.. did not as I > recall. > > Something is wrong in rxtx. Do I understand this right? > > > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > > > Perhaps there is something Wayne or I did not understand when we wrote > > that code. I wasnt programming back in the BBS days so modems are not > my > > thing. I have a few questions. > > > > Is the above matrix confirmed by observation? > > Linux just always worked? > > Which one _should_ work? I'm guessing modems work with hardware flow > > control. I'll have to dig around. > > > > The windows flow control changes a couple things with hardware flow > > control. Following the w32 API documentation is confusing sometimes. > > But it looks like Linux could have a bug too. > > Cheers > > Brian Schlining > Software Engineer > http://www.mbari.org > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/9c989144/attachment-0048.html From tjarvi at qbang.org Tue Feb 7 14:06:14 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 14:06:14 -0700 (MST) Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> Message-ID: >> >> You're not the only one whose had this problem, I don't know if Trent has >> addressed this is the latest release of RXTX but there is a workaround. >> Here's the recent thread from the RXTX mailing list regarding this issues: >> I have not. I expect to have access to some test equipment next month and I'll go through all of this. I really don't know whats going on and I need a gold standard. I thought maybe linux was autodetecting the flow control. Your observations would certainly be welcome. I need to talk to Russell King and see what he is doing. Until then I'd just be toying around over a loopback as usual. This is very high on the list though. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 17:25:05 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 17:25:05 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139358305.17994.2.camel@zd7280> My application now works. I installed the libraries and jar from 2.1-7 (Final). portlist.hasMoreElements is no longer false. The application finds the port for /dev/ttyUSB0. Thanks for your help, Trent (et al) Sorry I bothered you with this. Next time I will look in the source first. I didn't think it was an rxtx issue, I thought it was a Linux setup issue . On Tue, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > Hmm I'm looking at pre17 so this may have changed. (its just what I > have > on this machine) > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux > Serial Ports > "ttySA" // for the > IPAQs > }; > > CandidatePortPrefixes=Temp; > } > > > So you may need to add "ttyUSB" to that list. RXTX used to enumerate > _everything_ see if(osName.equals("Linux-all-ports") But it became > less > than practical. > > This is all in RXTXCommDriver.java > > hmm I just did a cvs update. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux > Serial Ports > "ttySA", // for the > IPAQs > "ttyUSB" // for USB > frobs > }; > > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you > have > to get your fingers into the code. We aim for sane defaults. -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 19:21:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 19:21:54 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139358305.17994.2.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> <1139358305.17994.2.camel@zd7280> Message-ID: >Sorry I bothered you with this. Next time I will look in the source >first. I didn't think it was an rxtx issue, I thought it was a Linux >setup issue . Why would you be sorry? I would have done the same. I'm glad it's working :) -- Trent Jarvi tjarvi at qbang.org From tma at mail.island.net Wed Feb 8 13:39:35 2006 From: tma at mail.island.net (Tom Alldread) Date: Wed, 08 Feb 2006 12:39:35 -0800 Subject: [Rxtx] Win32/Linux Serial Port Data Dropouts In-Reply-To: <200602060702.k167255O007882@www.qbang.org> References: <200602060702.k167255O007882@www.qbang.org> Message-ID: <43EA5707.4020200@mail.island.net> Greetings Folks at RXTX: During the last couple of months I have been alternately testing with javax.comm 2 and RXTX 2.1 under Windows XP and CommApi 3 and RXTX 2.1 under Suse 10.0 Linux. In the process I have learned a little about java multi-threading under NetBeans 5 with Profiler. My java (jdk 1.5_06) application is used for data acquisition and provides a graphical display of A-D conversion data received from a 56KBaud serial port. The actual data throughput is about 10KBaud thus it is well below the speed of the port. I use hardware RTS/CTS flow control which can stall the data acquisition sample rate if necessary. This ensures the display computer has the ability to slow the data acquisition rate should it become too busy to accept the regular data flow. Both the serial port buffer and the java read buffer are set at 16KB. Usually the data transfers into the java read buffer are less than 100 bytes unless the data acquisition is recovering from a stall. The data flow normally hesitates after each 5 KB block as a continue command is needed from the display computer to start the drawing of a new graphics display line. Separate threads have been provided for the serial port event monitoring and data processing. The serial port event thread has been given the maximum priority and data processing thread the minimum priority provided by java. Thread yield statements have been placed within all data processing while/for loops as an effort to ensure quick access to CPU cycles for the serial port event thread. I have found that short data transmissions are essentially error free but occasional dropouts occur with continuous data flow especially under Windows XP. ....................................................................................................................................................................................... Linux results: I am happy to report that RXTX 2.1 appears to work very well under Linux although I did notice some errors when the screen savers were running with my dual monitors. I believe this is a local problem associated with my dual graphics which needs further attention. The recent CommApi 3 Linux release from Sun did not work at all with my program. It seemed to send commands out OK but did not receive any data. Although the serial port event triggered the ISR, the input stream appeared filled with nulls and thus did not contain any data. As my understanding is that CommApi 3 was tested with a Red Hat distribution of Linux I wonder if this problem is distro dependent? Although somewhat off topic here I wonder if anyone reading this has had similar experience? .................................................................................................................................................................................. Windows XP results: There are problems with occasional data dropouts which become more frequent as the sampling rate is increased or if the computer becomes busy with other duties. The dropouts typically consist of a half dozen byte block of lost data. It appears the lost bytes never get added to the java input stream. There has not been any indication of garbled data, overruns or framing errors which suggests the UART communications remains solid. Using javax.comm 2 I found that the setting of SerialPort 'enableReceiveThreshold' to 40 and 'enableReceiveTimeout' of 100mS reduced the dropouts error rate significantly. I found that I could not get RXTX 2.1 to function with the aforementioned threshold and timeout settings. The javax.comm 2 interface is consequently performing better for me under Windows than RXTX 2.1. I wonder if anyone here has any suggestions as to what I might try to improve RXTX 2.1? Although my settings are the same as under Suse 10.0, RXTX 2.1 performs much better for me under Linux than any of the alternatives that I have tried under Windows XP . ............................................................................................................................................................................... I would like to establish, based on the experience of others, if I have reached the normally expected performance limit of java serial port communications? Should I expect to achieve virtually error free serial port data input from a continuous stream under Windows XP java software? I am considering changing my protocol to packets with error checking if necessary but would like to know if the dropout problems I am experiencing are typical or not before I take this rather work intensive plunge. Many thanks in advance for any help! Best Regards, Tom Alldread -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.375 / Virus Database: 267.15.2/253 - Release Date: 2006-02-07 From jlaxson at mac.com Wed Feb 8 23:56:48 2006 From: jlaxson at mac.com (John Laxson) Date: Thu, 9 Feb 2006 00:56:48 -0600 Subject: [Rxtx] PortInUseException: Unknown Application on OSX Message-ID: Hi, I've been trying to get RXTX 2.1.7 going on Mac OS X for a while here, and am running up into a wall here. I've tried with pre- compiled and the source version and get the same problem, a gnu.io.PortInUseException: Unknown Application. I have run the fixperms script included with the source distribution, and id shows me as a member of the uucp group, and permissions on /var/spool/uucp are 775 root:uucp. Running a test program (included at the bottom for clarity) lets me enumerate all the serial ports correctly, but trying to open any of them gives the PortInUseException. If it helps, when I try to open a port that's set to make an outgoing bluetooth connection, there is no delay and no connection attempt at all. Thanks, John Laxson PS: The documentation wiki on qbang.org shows 404, and has for a few days now. My test code: public static void main(String[] args) { SerialPort serialPort; try { Enumeration e = CommPortIdentifier.getPortIdentifiers(); CommPortIdentifier ident; while (e.hasMoreElements()) { ident = (CommPortIdentifier)e.nextElement(); System.out.println(ident.getName()); } ident = CommPortIdentifier.getPortIdentifier("/dev/cu.modem"); serialPort = (SerialPort) ident.open("Me", 5000); } catch (Exception e) { e.printStackTrace(); } } From rajesh.invincible at gmail.com Thu Feb 9 03:39:38 2006 From: rajesh.invincible at gmail.com (Rajesh N) Date: Thu, 9 Feb 2006 16:09:38 +0530 Subject: [Rxtx] Re: Move .java Files in gnu.io filesystem hierarchy - Maven (2) In-Reply-To: <43DF21D2.7090200@ngi.it> References: <43DF21D2.7090200@ngi.it> Message-ID: <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Can anybody tell me how to overcome these EXCEPTIONS I AM WORKING ON SERIAL COMMN IN JAVA ON LINUX. 1. " NOT ALL PARAMETERS SUPPORTED BY THE KERNEL" This i came across the following statement inmy prog. SerialP is A SerialPort object SerialP.setSerialPortParams(9600(BAUDRATE),DATABITS_8,STOPBITS_1,PARITY_NONE) 2. NullPointer Exception at Event Dispatch Now i have checked all my object references for a null reference but i found none i have put up my entire code in try catch blocks but still I AM UNABLE TO CATCH THIS EXCEPTION AND HENCE MY APPLICATION CLOSES HOW DOES THESE GO? PLEASE HELP ME IT IS URGENTTTTTTTTTTTTTTTT yours sincerely RAJESH On 1/31/06, Fabio Frumento wrote: > Hi Xavier, > > I don't know maven at all but the directory hierarchy listed buy Trent > is fine for me... > > I'll take a look to maven, it seems an interesting project > > Regards > > Fabio Frumento > > Trent Jarvi wrote: > > On Tue, 31 Jan 2006, Xavier Frisaye wrote: > > > >> Hi all, > >> > >> If you are going to rearrange the src folder, i will propose to use > >> maven 2 and follow its directory structure > >> > (http://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html). > >> > >> Maven 2 simplify java project and give a standard way to make projects > >> (http://maven.apache.org/). > >> We are using it for internal projects and we are very satisfied. > >> > >> Is anybody interested? > >> > >> I'm not an expert in maven 2 (yet) but i'm agree to help using it if > >> you choose to make so. > >> > > > > so this would be: > > > > rxtx-devel/src/main/java/gnu.io > > rxtx-devel/src/test/java/ManIwish.java > > > > I don't use IDEs very much so I'll let others comment. But I don't see > > a problem with that. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Thu Feb 9 09:50:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 9 Feb 2006 09:50:31 -0700 (MST) Subject: [Rxtx] Re: Move .java Files in gnu.io filesystem hierarchy - Maven (2) In-Reply-To: <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Message-ID: On Thu, 9 Feb 2006, Rajesh N wrote: > Can anybody tell me how to overcome these EXCEPTIONS > I AM WORKING ON SERIAL COMMN IN JAVA ON LINUX. > > 1. " NOT ALL PARAMETERS SUPPORTED BY THE KERNEL" > > This i came across the following statement inmy prog. > SerialP is A SerialPort object > SerialP.setSerialPortParams(9600(BAUDRATE),DATABITS_8,STOPBITS_1,PARITY_NONE) > Strange. The parameters you use are the same the port should open with by default. Could you paste the actual exception you are getting? I don't see that in the rxtx source. Also it would help to know the rxtx version. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Fri Feb 10 15:29:05 2006 From: lux at diesel-research.com (Kim Lux) Date: Fri, 10 Feb 2006 15:29:05 -0700 Subject: [Rxtx] One serial port object for both sending and receiving ? Message-ID: <1139610545.18177.4.camel@zd7280> Is it OK to use one SerialPort ojbect (ex Serial Port serialPort;) and use it for both sending and receiving ? For example: ======================================================================== static SerialPort serialPort = null; static OutputStream serialOut = null; static InputStream serialIn = null; // assign it to an outputStream for use try{ serialOut = serialPort.getOutputStream(); System.out.println("Serial output stream has been assigned."); }//try catch(IOException e) { System.out.println("Error: Couldn't assign output stream to serial port."); }//catch //assign it to an inputStream for use try{ serialIn = serialPort.getInputStream(); System.out.println("Serial input stream has been assigned."); }//try catch(IOException e) { System.out.println("Error: Couldn't assign input stream to serial port."); }//catch ======================================================================== -- Kim Lux, Diesel Research Inc. From lux at diesel-research.com Fri Feb 10 21:23:00 2006 From: lux at diesel-research.com (Kim Lux) Date: Fri, 10 Feb 2006 21:23:00 -0700 Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Message-ID: <1139631780.23882.10.camel@zd7280> I've got a problem receiving chars with my version of serialRead, written in an SWT GUI. I had a Java pro have a good look at my code and he can't see anything wrong with it. I can send chars fine. When I receive a char the cpu usage for the app goes to 100% and the code in the serial event handler doesn't get executed. The instructions on the Java Comm Serial API How-To for Linux page state that I must install javacomm. Is that true ? Everything builds without it and I can send chars on rxtx just fine, but I can't receive them. Could this be the problem ? I downloaded and installed javacomm. I was not able to add "Driver=gnuio.RXTXCommDriver to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 installed in /usr/java/jre1.5.0_05. I added comm.jar to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext to the library paths. Is this OK ? Does it matter that I am receiving on /dev/ttyUSB0 ? Thanks. -- Kim Lux, Diesel Research Inc. From lunareclipse03 at web.de Sat Feb 11 09:44:46 2006 From: lunareclipse03 at web.de (lunareclipse03@web.de) Date: Sat, 11 Feb 2006 17:44:46 +0100 Subject: [Rxtx] Question about Serial I/O under Win32 Message-ID: <662084330@web.de> Hello everybody, I have a strange problem with a piece of code I made for myself. No, this is not really concerning rxtx, but nevertheless I post this to the list, hoping that some of you can help me. I've written two libraries, one for linux and one for win32. The linux port works quite well, I can send / receive faxes and / or replay voice messages over the telephone line using a voice modem. But the win32 port of the library causes some trouble. If, for example, I send out a fax with a certain modem under linux, it works well. The fax is complete when it comes out of the fax machine. If I then use the same modem to send out a fax under win32, the fax coming out of the fax machine gets "stuck" halfways, but the sending modem thinks that transmission was ok and drops the connection. The answering fax machine then gives me "error while receiving." The "upper layer" java code MUST be right, because if I do the same thing under linux (using the linux library), everything is alright. Now I have to ask: Can somebody please help me out with this??!? Could it be the case that some kind of flow control or COMMTIMEOUTS setting causes this behaviour? I set flow control to RTS/CTS before sending out a fax. How can I DISABLE flow control? Or what do you think? Can something else cause this problems? Thank you all for your time and PLEASE write back soon. Regards, --Sven Ahlemann Am Waldrand 31 45721 Haltern am See Germany ______________________________________________________________ Verschicken Sie romantische, coole und witzige Bilder per SMS! Jetzt bei WEB.DE FreeMail: http://f.web.de/?mc=021193 From lux at diesel-research.com Sat Feb 11 10:06:52 2006 From: lux at diesel-research.com (Kim Lux) Date: Sat, 11 Feb 2006 10:06:52 -0700 Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: <1139631780.23882.10.camel@zd7280> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> <1139631780.23882.10.camel@zd7280> Message-ID: <1139677612.3431.5.camel@zd7280> More on this problem. I copied and pasted simpleRead into a console based Eclipse project and I've got the same result, except that cpu usage doesn't go to 100%. I'm beginning to think there is an issue in rxtx. My imports for simpleRead are: ============================ import gnu.io.*; import java.util.*; //import javax.comm.*; import java.io.*; =========================== Any ideas ? I am trying to read from /dev/ttyUSB0 using a serial to USB adapter which has worked well with minicom and gtkterm. Thanks. On Fri, 2006-02-10 at 21:23 -0700, Kim Lux wrote: > I've got a problem receiving chars with my version of serialRead, > written in an SWT GUI. > > I had a Java pro have a good look at my code and he can't see anything > wrong with it. > > I can send chars fine. When I receive a char the cpu usage for the app > goes to 100% and the code in the serial event handler doesn't get > executed. > > The instructions on the Java Comm Serial API How-To for Linux page state > that I must install javacomm. Is that true ? Everything builds without > it and I can send chars on rxtx just fine, but I can't receive them. > Could this be the problem ? > > I downloaded and installed javacomm. I was not able to add > "Driver=gnuio.RXTXCommDriver > to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not > have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 > installed in /usr/java/jre1.5.0_05. I added comm.jar > to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext > to the library paths. Is this OK ? > > Does it matter that I am receiving on /dev/ttyUSB0 ? > > Thanks. > -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Sun Feb 12 21:01:33 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:01:33 -0700 (MST) Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: <1139677612.3431.5.camel@zd7280> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> <1139631780.23882.10.camel@zd7280> <1139677612.3431.5.camel@zd7280> Message-ID: I suspect what is happening is the select() is breaking out in the native code but the driver does not have support for notifying there are X bytes available. On some traditional Unix based systems, the only way you know data is available is the fd status changes and do an FIORDCHK ioctl. Or perhaps the only thing you can know is the fd status changed. It would take reading through the kernel driver code to know for sure. So on USB, depending upon the driver, the same may need to be done or the driver improved a bit if possible to support. Polling reads will also work but don't use the event driven model of CommAPI which isnt acceptable in the long run. The 100% cpu usage can then be explained because select no longer blocks until the data is read; the eventLoop spins loose. You can put a well placed sleep but rxtx only expects those are needed when it knows data is available. This may not be a super simple thing to understand and fix. I do have ideas to get you started. I'm going to be short on time the next couple weeks. I expect to put some good time in and answer some other questions I saw around the 25th. For now, I'd look at the following and go from there with the hints I've given. JNIEXPORT jint JNICALL RXTXPort(nativeavailable)( JNIEnv *env, jobject jobj ) { int fd = get_java_var( env, jobj,"fd","I" ); int result; /* char message[80]; ENTER( "RXTXPort:nativeavailable" ); On SCO OpenServer FIONREAD always fails for serial devices, so try ioctl FIORDCHK instead; will only tell us whether bytes are available, not how many, but better than nothing. This turns out to be true on Solaris also. taj. */ #ifdef FIORDCHK /* __unixware__ __sun__ probably others */ result = ioctl(fd, FIORDCHK, 0); #else if( ioctl( fd, FIONREAD, &result ) < 0 ) { goto fail; } #endif /* FIORDCHK */ On Sat, 11 Feb 2006, Kim Lux wrote: > > More on this problem. I copied and pasted simpleRead into a console > based Eclipse project and I've got the same result, except that cpu > usage doesn't go to 100%. I'm beginning to think there is an issue in > rxtx. > > My imports for simpleRead are: > > ============================ > import gnu.io.*; > import java.util.*; > //import javax.comm.*; > import java.io.*; > =========================== > > Any ideas ? I am trying to read from /dev/ttyUSB0 using a serial to > USB adapter which has worked well with minicom and gtkterm. > > Thanks. > > > > On Fri, 2006-02-10 at 21:23 -0700, Kim Lux wrote: >> I've got a problem receiving chars with my version of serialRead, >> written in an SWT GUI. >> >> I had a Java pro have a good look at my code and he can't see anything >> wrong with it. >> >> I can send chars fine. When I receive a char the cpu usage for the app >> goes to 100% and the code in the serial event handler doesn't get >> executed. >> >> The instructions on the Java Comm Serial API How-To for Linux page state >> that I must install javacomm. Is that true ? Everything builds without >> it and I can send chars on rxtx just fine, but I can't receive them. >> Could this be the problem ? >> >> I downloaded and installed javacomm. I was not able to add >> "Driver=gnuio.RXTXCommDriver >> to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not >> have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 >> installed in /usr/java/jre1.5.0_05. I added comm.jar >> to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext >> to the library paths. Is this OK ? >> >> Does it matter that I am receiving on /dev/ttyUSB0 ? >> >> Thanks. >> > From tjarvi at qbang.org Sun Feb 12 21:03:30 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:03:30 -0700 (MST) Subject: [Rxtx] One serial port object for both sending and receiving ? In-Reply-To: <1139610545.18177.4.camel@zd7280> References: <1139610545.18177.4.camel@zd7280> Message-ID: On Fri, 10 Feb 2006, Kim Lux wrote: > > Is it OK to use one SerialPort ojbect (ex Serial Port serialPort;) and > use it for both sending and receiving ? > > For example: > > ======================================================================== > static SerialPort serialPort = null; > static OutputStream serialOut = null; > static InputStream serialIn = null; > > > > > // assign it to an outputStream for use > try{ > serialOut = serialPort.getOutputStream(); > System.out.println("Serial output stream has been assigned."); > }//try > catch(IOException e) > { > System.out.println("Error: Couldn't assign output stream to serial > port."); > }//catch > > > //assign it to an inputStream for use > try{ > serialIn = serialPort.getInputStream(); > System.out.println("Serial input stream has been assigned."); > }//try > catch(IOException e) > { > System.out.println("Error: Couldn't assign input stream to serial > port."); > }//catch This should be fine. In fact trying to do it another way will probably not work as you will run into lockfile issues. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun Feb 12 21:13:13 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:13:13 -0700 (MST) Subject: [Rxtx] Question about Serial I/O under Win32 In-Reply-To: <662084330@web.de> References: <662084330@web.de> Message-ID: On Sat, 11 Feb 2006 lunareclipse03 at web.de wrote: > Hello everybody, > > I have a strange problem with a piece of code I made for myself. No, > this is not really concerning rxtx, but nevertheless I post this to the > list, hoping that some of you can help me. I've written two libraries, > one for linux and one for win32. The linux port works quite well, I can > send / receive faxes and / or replay voice messages over the telephone > line using a voice modem. But the win32 port of the library causes some > trouble. If, for example, I send out a fax with a certain modem under > linux, it works well. The fax is complete when it comes out of the fax > machine. If I then use the same modem to send out a fax under win32, the > fax coming out of the fax machine gets "stuck" halfways, but the sending > modem thinks that transmission was ok and drops the connection. The > answering fax machine then gives me "error while receiving." The "upper > layer" java code MUST be right, because if I do the same thing under > linux (using the linux library), everything is alright. Now I have to > ask: Can somebody please help me out with this??!? Could it be the case > that some kind of flow control or COMMTIMEOUTS setting causes this > behaviour? I set flow control to RTS/CTS before sending out a fax. How > can I DISABLE flow control? Or what do you think? Can something else > cause this problems? Thank you all for your time and PLEASE write back > soon. > Hi Sven I'm not too willing to talk about flow control at the low level until I confirm some things with test equipment later. It is not clear if you are using rxtx or writing your own native code. So I'm not sure how to answer much of this :) If you are wondering how to change the flow control using rxtx from java, The BlackBox example from Sun flips this back and forth. SerialPort.java in rxtx 2.1 uses the following: SerialPort.java: public static final int FLOWCONTROL_NONE =0; SerialPort.java: public static final int FLOWCONTROL_RTSCTS_IN =1; SerialPort.java: public static final int FLOWCONTROL_RTSCTS_OUT =2; SerialPort.java: public static final int FLOWCONTROL_XONXOFF_IN =4; SerialPort.java: public static final int FLOWCONTROL_XONXOFF_OUT=8; So if you set flowcontrol to RTSCTS, you can set it to NONE to turn it off. If you are looking for how to do it in native code, the rxtx Source is SerialImp.c (unix/linux/mac os x/w32) and termios.c (w32 only with SerialImp.c) You can track the code: SerialImp.c:JNIEXPORT void JNICALL RXTXPort(setflowcontrol)( JNIEnv *env, jobject jobj, jint flowmode ) termios.c:int tcgetattr( int fd, struct termios *s_termios ) termios.c:int tcsetattr( int fd, int when, struct termios *s_termios ) There may be a problem in the rxtx flow control code though. Rather than guess, I want to test this with a gold standard. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Feb 6 00:00:16 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 00:00:16 -0700 (MST) Subject: [Rxtx] wiki delay until tomorrow night. In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: On Sun, 5 Feb 2006, Trent Jarvi wrote: > On Sun, 5 Feb 2006, Kim Lux wrote: > >> usb ? Tell me more... I need that too. > > usb is a very proper design. Thats all it is. > Maybe rxtx could help usb. But it would start with helping bring back the community that was already there. It's not something I'd love to do but maybe its the right thing to do. It would probably take 2 years to do right. But maybe thats better than what we have now. I honestly don't know what IBM is doing which could just run over everything. Just some thoughts after some fine german wine. -- Trent Jarvi tjarvi at qbang.org From gadelavega at yahoo.com.ar Mon Feb 6 02:17:05 2006 From: gadelavega at yahoo.com.ar (Gonzalo A. de la Vega) Date: Mon, 06 Feb 2006 10:17:05 +0100 Subject: [Rxtx] Serial port ownership question In-Reply-To: References: <20060205113618.30274.qmail@web53501.mail.yahoo.com> <1139157422.4553.9.camel@zd7280> <1139158698.4936.9.camel@zd7280> Message-ID: <43E71411.4050402@yahoo.com.ar> On my Fedora Core 4: ls -l /dev/ttyS* crw-rw---- 1 root uucp 4, 64 Feb 6 2006 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Feb 6 2006 /dev/ttyS1 ... and: grep "ttyUSB" /etc/udev/rules.d/50-udev.rules KERNEL=="ttyUSB*", GROUP="uucp", MODE="0660" So anyone in the "uucp" group can use serial ports. On Gentoo the group is "tty". Trent Jarvi escribi?: > > > On Sun, 5 Feb 2006, Dr. Douglas Lyon wrote: > >> I can confirm that this is the case (only root ownership of >> serial ports, under fedora 4). >> Wow, what were they thinking?! >> - DL >> >>> I've found that the newer kernels have the serial ports owned by root. >>> For example, >>> >>> $ls -al /dev/tty* >>> crw-rw-rw- 1 root root 5, 0 Feb 5 02:06 /dev/tty >>> crw-rw---- 1 root root 4, 0 Feb 5 02:06 /dev/tty0 >>> crw------- 1 root root 4, 1 Feb 5 09:07 /dev/tty1 >>> crw-rw---- 1 root tty 4, 10 Feb 5 02:06 /dev/tty10 >>> crw-rw---- 1 root tty 4, 11 Feb 5 02:06 /dev/tty11 >>> ... > > > This is just not a problem jcp or such are going to solve. Its a > platform spitwad fight. But do look at pam. In fact thats what Sun > is doing too. Maybe Linux followed their lead.. I'm not a pam guy. > I've spent 16 hours trying to understand it but your users wont :) > > Solution? I have no clue. Its two tangent mentalities from my > perspective. > > -- > Trent Jarvi > tjarvi at qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mtnvega at yahoo.com.br Mon Feb 6 05:35:43 2006 From: mtnvega at yahoo.com.br (Luiz Jr) Date: Mon, 6 Feb 2006 12:35:43 +0000 (GMT) Subject: [Rxtx] Documentation Wiki In-Reply-To: <1139157422.4553.9.camel@zd7280> Message-ID: <20060206123543.57256.qmail@web53515.mail.yahoo.com> Hello, Thank you for you answer, but so the usage of the API is pretty much like the Java Communications Api? If yes, what version of the Java Comm Api? Thank you, Luiz A. Brandao Jr Kim Lux escreveu: On Sun, 2006-02-05 at 08:36 -0300, Luiz Jr wrote: > Hello, > > I want to start using the RXTX libraries, but I would to know how, > since I can not access the documentation wiki page I just started using them yesterday. Below is how I installed the libraries, if that helps. I used snippets of code from the SimpleWrite application here to get me going. http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html Instead of "import javax.comm.*;", use "import gnu.io.*;" which is gotten from RXTXcomm.jar, which you will need to include in your project references. I am working in Eclipse. BTW: there is no way to open a port without going through the port list and finding it. Maybe sometime in the future someone (me ?) will write a method called openSerialPort that allows the user to give a port identifier, such as "/dev/tty1" and return a port ready to use. It wouldn't take much to write that and it would save users a lot of code. Hope this helps. ======================================================================= 1) Figure out which java you are running, incase there is more than one installed. $ java -version java version "1.5.0_05" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_05-b05) Java HotSpot(TM) Client VM (build 1.5.0_05-b05, mixed mode, sharing) 2) Find all the jre directories and the one from which you are currently running. kfind (jre) 3) cd to that directory plus /lib/i386 cd /usr/java/jre1.5.0_05/lib/i386 4) Copy the library files (*.so) to that directory. cp /home/krlux/Desktop/'Java Controls'/rxtx-linux/bin/* . 5) Check that the copy was successful ls librxtx* librxtxI2C.so librxtxRaw.so librxtxSerial.so librxtxParallel.so librxtxRS485.so 6) cd to the /lib/ext directory for your java. cd /usr/java/jre1.5.0_05/lib/ext 7) Copy the Jar files there cp /home/krlux/Desktop/'Java Controls'/rxtx-linux/lib/ext/* . 8) Check that it was successful ls RXTX* RXTXcomm.jar Rxtx is now installed on your machine ready to use. =================================================================== -- Kim Lux, Diesel Research Inc. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx --------------------------------- Yahoo! Acesso Gr?tis - Internet r?pida e gr?tis. Instale o discador agora! -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/544aa403/attachment-0049.html From lyon at docjava.com Mon Feb 6 05:49:34 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 06 Feb 2006 07:49:34 -0500 Subject: [Rxtx] wiki delay until tomorrow night. In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: Hi All, I have often thought about USB drivers being needed. For example, the ironman watch will not interface to a mac (windows only). It is USB. My dymo label writer has no Java driver (native only). Etc. Most cheap web cameras are USB (and Java drivers go through JAI, if it supports the camera at all). The JAI code shows how sun did the USB drivers. You have to be a member of the jai project to download the source code. https://jai.dev.java.net has the jai distro. And then you are not allowed to redistribute it. However, we can all learn from it (if so inclined). Basically: cvs -d :pserver:lyon at cvs.dev.java.net:/cvs login cvs -d :pserver:lyon at cvs.dev.java.net:/cvs checkout jai-core You will need to user your own uid and pw to get in. The ant build has over 100 warnings from sun deprecations of its own code. You might say that they were hoisted on their own Picard ;) One interesting thing is that they support several platforms: linux-amd64 64-bit Linux-AMD64 linux-i586 32-bit Linux-x86 solaris-amd64 64-bit Solaris-AMD64 solaris-i586 32-bit Solaris-x86 solaris-sparc 32-bit Solaris-SPARC solaris-sparcv9 64-bit Solaris-SPARC windows-i586 32-bit Windows-x86 Thus, ant is used to provide a multi-platform native method distro. Neat. How do they do it? check this out: And: The core download does not contain any C source code (it was all pre-built). Basically, they are just copying .so and .dll files into build directories. I would love to see the C code for this...but Sun does not post it on the https://jai.dev.java.net site. I don't know why...Perhaps I missed it. - Doug >On Sun, 5 Feb 2006, Trent Jarvi wrote: > >>On Sun, 5 Feb 2006, Kim Lux wrote: >> >>>usb ? Tell me more... I need that too. >> >>usb is a very proper design. Thats all it is. >> > >Maybe rxtx could help usb. But it would start with helping bring >back the community that was already there. > >It's not something I'd love to do but maybe its the right thing to do. > >It would probably take 2 years to do right. But maybe thats better >than what we have now. > >I honestly don't know what IBM is doing which could just run over everything. > >Just some thoughts after some fine german wine. > >-- >Trent Jarvi >tjarvi at qbang.org > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tdelenik at gmail.com Mon Feb 6 05:56:32 2006 From: tdelenik at gmail.com (Thanasis Delenikas) Date: Mon, 6 Feb 2006 14:56:32 +0200 Subject: Fwd: [Rxtx] Documentation Wiki In-Reply-To: <1139157422.4553.9.camel@zd7280> References: <20060205113618.30274.qmail@web53501.mail.yahoo.com> <1139157422.4553.9.camel@zd7280> Message-ID: <310a1a930602060456t129f1dc6p5f2b908f13ab5a0b@mail.gmail.com> Hello all, Kim, this is a snippet from the code I use. The closest to directly opening a specific port without enumeration. << ... portId = CommPortIdentifier.getPortIdentifier(getPort()); serialPort = (SerialPort) portId.open("jSMSEngine", 1971); ... >> where getPort() return the string identifier of the port, i.e. "/dev/ttyS0" or "COM1" or whatever. Thanasis. ---------- Forwarded message ---------- From: Kim Lux Date: Feb 5, 2006 6:37 PM Subject: Re: [Rxtx] Documentation Wiki To: RXTX Developers and Users BTW: there is no way to open a port without going through the port list and finding it. Maybe sometime in the future someone (me ?) will write a method called openSerialPort that allows the user to give a port identifier, such as "/dev/tty1" and return a port ready to use. It wouldn't take much to write that and it would save users a lot of code. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/182ab5b8/attachment-0049.html From tjarvi at qbang.org Mon Feb 6 11:53:57 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 11:53:57 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: On Mon, 6 Feb 2006, Dr. Douglas Lyon wrote: > Hi All, > I have often thought about USB drivers being needed. > For example, the ironman watch will not interface > to a mac (windows only). It is USB. > My dymo label writer has no Java driver (native only). > Etc. > Most cheap web cameras are USB (and Java drivers go > through JAI, if it supports the camera at all). > The JAI code shows how sun did the USB drivers. > You have to be a member of the jai project to download > the source code. > https://jai.dev.java.net has the jai distro. > And then you are not allowed to redistribute it. However, > we can all learn from it (if so inclined). Basically: > cvs -d :pserver:lyon at cvs.dev.java.net:/cvs login > cvs -d :pserver:lyon at cvs.dev.java.net:/cvs checkout jai-core > You will need to user your own uid and pw to get in. > The ant build has over 100 warnings from sun deprecations > of its own code. > > You might say that they were hoisted on their own Picard ;) > > One interesting thing is that they support several platforms: > linux-amd64 64-bit Linux-AMD64 > linux-i586 32-bit Linux-x86 > solaris-amd64 64-bit Solaris-AMD64 > solaris-i586 32-bit Solaris-x86 > solaris-sparc 32-bit Solaris-SPARC > solaris-sparcv9 64-bit Solaris-SPARC > windows-i586 32-bit Windows-x86 > Thus, ant is used to provide a multi-platform native method distro. > Neat. > How do they do it? > check this out: > > > > > > > > > > > > > And: > > > > > > > > > > The core download does not contain any C source code (it was all pre-built). > Basically, they are just copying .so and .dll files into build directories. > > I would love to see the C code for this...but Sun does not post it on the > https://jai.dev.java.net site. > > I don't know why...Perhaps I missed it. > > - Doug > > I've looked at moving rxtx to Ant builds. I think that would help IDEs a great deal. I requested a evalutation desk copy the O'Reilly Ant book for some j2ee material I was teaching. http://www.oreilly.com/catalog/anttdg/ It has a one sentence mention of JNI. So there was not luck there. I saw that there is another Ant book that does mention JNI more. I can't find it now. Ant must be able to support it with extensions. http://ant.apache.org/manual/OptionalTasks/javah.html What the auto(break :) tools do in the rxtx build is 4 things really. 1) gcc compile flags 2) ld compile flags 3) config.h 4) compile flags for customizing rxtx (lockfiles, ...) See 1 All of this information except 4 can be static once obtained. So I'm not attached to the auto tools. If I could find an example of Ant being used for JNI code, I'd be one of the first to start moving that direction. Maybe someone saw an example someplace. The other thing we have not completed discussing is the directory structure. There is interest in making rxtx more IDE friendly. I get more mail about that off the list than how to install rxtx. And I see we have Ken Thompson in da house :) He is our trusted CVS maintainer and the guy that purchased the rxtx.org domain. Old community. We will need Ken for changing the directory structure of source. I would like to open up discussion about both of these as it is more than time. The problem is I have little experience with Ant and even less with IDEs. It would be nice if we could work with Eclipse and NetBeans. http://www.netbeans.org/ (sun and some community) http://www.eclipes.org (ibm,rhat,... perhaps more community) http://maven.apache.org/what-is-maven.html (apache. It is community) borland should sortof be here too but I think thats covered in eclipse. >From what I understand so far, we should morph rxtx to support those three maybe trusting apaches lead with maven. But I use vi. I have little to no clues beyond what people have fed me. Can we agree that thats the right direction to go? -- Trent Jarvi tjarvi at qbang.org From brian at mbari.org Mon Feb 6 14:57:50 2006 From: brian at mbari.org (Brian Schlining) Date: Mon, 6 Feb 2006 13:57:50 -0800 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> > The other thing we have not completed discussing is the directory > structure. There is interest in making rxtx more IDE friendly. I > get more mail about that off the list than how to install rxtx. > > And I see we have Ken Thompson in da house :) He is our trusted > CVS maintainer and the guy that purchased the rxtx.org domain. Old > community. We will need Ken for changing the directory structure of > source. > > I would like to open up discussion about both of these as it is > more than time. The problem is I have little experience with Ant > and even less with IDEs. It would be nice if we could work with > Eclipse and NetBeans. > > http://www.netbeans.org/ (sun and some community) > http://www.eclipes.org (ibm,rhat,... perhaps more community) > http://maven.apache.org/what-is-maven.html (apache. It is community) > borland should sortof be here too but I think thats covered in > eclipse. > >> From what I understand so far, we should morph rxtx to support >> those three > maybe trusting apaches lead with maven. But I use vi. I have > little to no clues beyond what people have fed me. > Maven likes the directory structure below for Java code. (From http:// maven.apache.org/guides/getting-started/index.html) This structure works fine with ant, netbeans, and eclipse. rxtx_root_directory `-- src |-- main | `-- java | `-- gnu | `-- io `-- test `-- java `-- gnu `-- io Brian Schlining Software Engineer http://www.mbari.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/d9451eba/attachment-0049.html From tjarvi at qbang.org Mon Feb 6 15:11:45 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 15:11:45 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: > rxtx_root_directory > `-- src > |-- main > | `-- java > | `-- gnu > | `-- io > `-- test > `-- java > `-- gnu > `-- io > >From what I understand this will just be good. For me it makes no difference. So lets do the rxtx thing. Let if fester for two weeks and if nobody objects, we will do it. I'm not doing this because I care. I'm doing this to eliminate much of my inbox. But test... man is rxtx lacking there in the community aspect. It is covered but not right. _maybe_ I can change that this year. -- Trent Jarvi tjarvi at qbang.org (cat hurding since 1997) From lux at diesel-research.com Mon Feb 6 21:38:49 2006 From: lux at diesel-research.com (Kim Lux) Date: Mon, 06 Feb 2006 21:38:49 -0700 Subject: [Rxtx] How can I use Lock Files with rxtx (in FC4) ? Message-ID: <1139287129.17031.3.camel@zd7280> I am now running an rxtx application on FC4. I am getting: ========================================================= check_group_uucp(): error testing lock file creation Error details: Permission denied check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL ========================================================= $ ls -al /var/lock total 32 drwxrwxr-x 4 root lock 4096 Feb 6 16:04 . drwxr-xr-x 24 root root 4096 Nov 14 01:19 .. drwx------ 2 root root 4096 Apr 27 2005 lvm drwxr-xr-x 2 root root 4096 Feb 6 16:04 subsys How do I fix this for regulator users ? -- Kim Lux, Diesel Research Inc. From dmarkman at mac.com Mon Feb 6 22:24:44 2006 From: dmarkman at mac.com (Dmitry Markman) Date: Tue, 7 Feb 2006 00:24:44 -0500 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: if I understands the issue right in order to be able to use ant for c/c++ compilation you have to install ant's cc task http://ant-contrib.sourceforge.net/cc.html it looks like it should work on mac os x (authors claim, that it's platform independent) but I never tested so all you have to do it's providing right command line for the gcc compiler On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: >> rxtx_root_directory >> `-- src >> |-- main >> | `-- java >> | `-- gnu >> | `-- io >> `-- test >> `-- java >> `-- gnu >> `-- io >> > > >> From what I understand this will just be good. > > For me it makes no difference. So lets do the rxtx thing. Let if > fester for two weeks and if nobody objects, we will do it. > > I'm not doing this because I care. I'm doing this to eliminate > much of my inbox. > > But test... man is rxtx lacking there in the community aspect. It > is covered but not right. _maybe_ I can change that this year. > > -- > Trent Jarvi > tjarvi at qbang.org > (cat hurding since 1997) > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx Dmitry Markman From lux at diesel-research.com Mon Feb 6 23:20:15 2006 From: lux at diesel-research.com (Kim Lux) Date: Mon, 06 Feb 2006 23:20:15 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? Message-ID: <1139293215.3689.4.camel@zd7280> I'm running the code below. portlist.hasMoreElements() is false. /dev has ports in it as listed below. What am I doing wrong ? ========================================================== // Step through the list of ports until we find one that matches // the one we are looking for. portList = CommPortIdentifier.getPortIdentifiers(); while(portList.hasMoreElements()) { portID = (CommPortIdentifier) portList.nextElement(); // if (portID.getName().equals("/dev/ttyUSB0")) { myTA.append("Serial port ttyUSB0 has been found\n"); break; }// if portID equals... }// End of while... ========================================================== ls -al /dev/tty* crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 ... crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 -- Kim Lux, Diesel Research Inc. From david.garnier at trusted-logic.com Tue Feb 7 00:46:30 2006 From: david.garnier at trusted-logic.com (David Garnier) Date: Tue, 07 Feb 2006 08:46:30 +0100 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: <43E85056.2090608@trusted-logic.com> Hello, I think that the make-based build process is fine as it is, apart from the location of the Java source files. It is true that putting the Java source in a directory structure that map 1-to-1 to the Java package structure is the norm and should make it easier for everyone to modify the Java source, with or without an IDE. Ant is a good tool, but in the RXTX case I fail to see the advantage of using it compared to the current make-based process. As Trent said, they are more pressing issues, like testing. Regards, David Dmitry Markman wrote: > if I understands the issue right > in order to be able to use ant for c/c++ compilation > you have to install ant's cc task > http://ant-contrib.sourceforge.net/cc.html > > it looks like it should work on mac os x > (authors claim, that it's platform independent) > but I never tested > > so all you have to do it's providing right command line > for the gcc compiler > > > > > On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: > >>> rxtx_root_directory >>> `-- src >>> |-- main >>> | `-- java >>> | `-- gnu >>> | `-- io >>> `-- test >>> `-- java >>> `-- gnu >>> `-- io >>> >> >> >>> From what I understand this will just be good. >> >> For me it makes no difference. So lets do the rxtx thing. Let if >> fester for two weeks and if nobody objects, we will do it. >> >> I'm not doing this because I care. I'm doing this to eliminate much >> of my inbox. >> >> But test... man is rxtx lacking there in the community aspect. It is >> covered but not right. _maybe_ I can change that this year. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> (cat hurding since 1997) From tjarvi at qbang.org Tue Feb 7 01:11:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 01:11:31 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <43E85056.2090608@trusted-logic.com> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: On Tue, 7 Feb 2006, David Garnier wrote: > Hello, > > I think that the make-based build process is fine as it is, apart from the location of the Java > source files. It is true that putting the Java source in a directory structure that map 1-to-1 to > the Java package structure is the norm and should make it easier for everyone to modify the Java > source, with or without an IDE. > > Ant is a good tool, but in the RXTX case I fail to see the advantage of using it compared to the > current make-based process. As Trent said, they are more pressing issues, like testing. > Hi David I have more experience with testing rxtx than I can talk about. But let it be known, rxtx has gone trough 100's of hours of testing. We are hobby folks interested in toys but there is more. rxtx has had some of the best guidance in the industry there. This is not an easy thing. I may be able to come back in a month from the other side of the corperate fence and help. I suspect the tests could just be made public but they are in a very unusual environment that just wont work in a wider sense. This is something I'll be trying to change. At one point it was agreed we could just make the results public so this isnt just noise.. There is interest and I think its safe to mention that much. The big problem with testing in the past is most of it is done with a loopback connection. So we *still* have major questions regarding things like flow control. rxtx talks to itself over a loopback and it works. regardless of right or wrong. This requires more thought to be done right. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Feb 7 02:46:34 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 02:46:34 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: > The big problem with testing in the past is most of it is done with a > loopback connection. So we *still* have major questions regarding things > like flow control. rxtx talks to itself over a loopback and it works. > regardless of right or wrong. With serial communication there are gold standards. ckermit is probably a definitive 'standard.' Maybe its possible to do ping/pong tests with ckermit? Is it scriptable? There are known issues in rxtx. Probably the worst is some threading issues regarding some JREs with multiple JNI threads setting java variables. Man did I get schooled there. Just switch the c functions to returning variables and things go away. Sometimes they work fine, sometimes they blow up. Without understanding everything, somehow rhat got it right and debian (and especially gentoo) grabbed kernel patches causing all sort of harm. Its not hard to fix once you understand whats going on but nearly impossible to track with a debugger. So I have a good idea what 2.1-8 will have outside of the IDE modifications. rxtx 2.1-7 is a release for everyone to sync with. Its not even as stable as -pre17 as far as I know - I ran no test suites. I'll be chasing it too. We just had so many contributions that it was time. It seriously broke internal scheduals but thats a great thing :) The other thing I want to do in 2.1-8 is automagic baud rates. It turns out lots of shops are doing really funky baud rates for things like automobile test equipment. It is possible but it requires a fair amount of change in the native code. Is anyone looking at this? -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Feb 7 02:57:21 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 07 Feb 2006 04:57:21 -0500 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <43E85056.2090608@trusted-logic.com> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: Hi All, I agree, testing is very important. The problem I have been trying to address is related to cross-platform testing and the robust nature of the installs. Typically, I visit 3 platforms to deploy my product, windows, linux and mac. A build is performed on each platform. The idea that you can build for many platforms from one copy the source code seems attractive. This should enable synchronized deployments of identical code. The question of how to achieve this goal remains open. As Trent mentioned, this is hard. Perhaps Ant will help here (but perhaps not). Ant does seem to help with running unit tests. However, it does not help with multi-platform tests. For that you need many machines and different operating environments. Toward that end, I have created a multi-platform test that can be run from web start, located at: http://show.docjava.com:8086/book/cgij/code/jnlp/serialPort.PortTest.jnlp This is interesting because many people in the community can run the test and we can improve the test, as time permits. No, it is not a perfect solution, however, the idea does help with multi-platform tests using many machines and different operating environments. If the group has a good test for a general serial port set-ups, i would be happy to deploy it, for general evaluation using web start. And as for ANT, it is just an idea. Not all my ideas are good ones! - Doug >Hello, > >I think that the make-based build process is fine as it is, apart >from the location of the Java >source files. It is true that putting the Java source in a directory >structure that map 1-to-1 to >the Java package structure is the norm and should make it easier for >everyone to modify the Java >source, with or without an IDE. > >Ant is a good tool, but in the RXTX case I fail to see the advantage >of using it compared to the >current make-based process. As Trent said, they are more pressing >issues, like testing. > >Regards, >David > >Dmitry Markman wrote: >> if I understands the issue right >> in order to be able to use ant for c/c++ compilation >> you have to install ant's cc task >> http://ant-contrib.sourceforge.net/cc.html >> >> it looks like it should work on mac os x >> (authors claim, that it's platform independent) >> but I never tested >> >> so all you have to do it's providing right command line >> for the gcc compiler >> >> >> >> >> On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: >> >>>> rxtx_root_directory >>>> `-- src >>>> |-- main >>>> | `-- java >>>> | `-- gnu >>>> | `-- io >>>> `-- test >>>> `-- java >>>> `-- gnu >>>> `-- io >>>> >>> >>> >>>> From what I understand this will just be good. >>> >>> For me it makes no difference. So lets do the rxtx thing. Let if >>> fester for two weeks and if nobody objects, we will do it. >>> >>> I'm not doing this because I care. I'm doing this to eliminate much >>> of my inbox. >>> >>> But test... man is rxtx lacking there in the community aspect. It is >>> covered but not right. _maybe_ I can change that this year. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> (cat hurding since 1997) > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From matt.higgins at gmail.com Tue Feb 7 08:28:34 2006 From: matt.higgins at gmail.com (Matt Higgins) Date: Tue, 7 Feb 2006 10:28:34 -0500 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final Message-ID: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? import java.io.*; import java.util.*; import gnu.io.*; public class MySimpleRead implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; public static void main(String[] args) { boolean portFound = false; String defaultPort = "COM1"; if (args.length > 0) { defaultPort = args[0]; } portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; MySimpleRead reader = new MySimpleRead(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } } public MySimpleRead() { try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) { e.printStackTrace(); } try { inputStream = serialPort.getInputStream(); } catch (IOException e) { e.printStackTrace(); } try { serialPort.addEventListener(this); } catch (TooManyListenersException e) { e.printStackTrace(); } try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { e.printStackTrace(); } System.out.println("Baud is " + serialPort.getBaudRate()); System.out.println("Bits is " + serialPort.getDataBits()); System.out.println("Stop is " + serialPort.getStopBits()); System.out.println("Par is " + serialPort.getParity()); serialPort.notifyOnDataAvailable(true); readThread = new Thread(this); readThread.start(); } public void run() { // Thread.sleep(20000); //} catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { System.out.println("An event occurred " + event.getEventType()); switch (event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: byte[] readBuffer = new byte[20]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } System.out.print(new String(readBuffer)); } catch (IOException e) {} break; } } } --------------- Result on windows ------------------------------ Stable Library ============================================================== Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port:: COM1 Baud is 9600 Bits is 8 Stop is 1 Par is 0 ----------------- End Results ----------------------------------------- ------------------ Result on Linux ----------------------------------- Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 Found port: /dev/ttyS0 Baud is 9600 Bits is 8 Stop is 1 Par is 0 An event occurred 1 043100066224 ------------------ End Results --------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/a1431630/attachment-0049.html From brian at mbari.org Tue Feb 7 09:48:37 2006 From: brian at mbari.org (Brian Schlining) Date: Tue, 7 Feb 2006 08:48:37 -0800 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> Message-ID: <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> Hi Matt > The following code works fine on Linux but I never see any data > when run on Windows. This is a cut and paste from the SimpleRead > example. > I am attempting to read data from a bar code scanner. I can fire > up HyperTermianl on windows and see that the device is working > properly as I see the barcodes are scanned and echoed back to the > terminal. However when I run the app I don't see any data. It is > however associating with the com port as the informational bits > print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. Cheers Brian Schlining Software Engineer http://www.mbari.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/16d07f37/attachment-0049.html From lux at diesel-research.com Tue Feb 7 11:59:58 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 11:59:58 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139293215.3689.4.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> Message-ID: <1139338798.8145.4.camel@zd7280> Any ideas on this ? Any reason why portList.hasMoreElements() should be false even though there are devices in /dev ? On Mon, 2006-02-06 at 23:20 -0700, Kim Lux wrote: > I'm running the code below. > > portlist.hasMoreElements() is false. > > /dev has ports in it as listed below. > > What am I doing wrong ? > > > ========================================================== > // Step through the list of ports until we find one that matches > // the one we are looking for. > > portList = CommPortIdentifier.getPortIdentifiers(); > > while(portList.hasMoreElements()) > { > portID = (CommPortIdentifier) portList.nextElement(); // > if (portID.getName().equals("/dev/ttyUSB0")) > { > myTA.append("Serial port ttyUSB0 has been found\n"); > break; > }// if portID equals... > }// End of while... > ========================================================== > > ls -al /dev/tty* > crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty > crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 > crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 > crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 > crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 > ... > crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 > crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 > crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 > > > -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 12:20:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 12:20:25 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139338798.8145.4.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> Message-ID: On Tue, 7 Feb 2006, Kim Lux wrote: > > Any ideas on this ? Any reason why portList.hasMoreElements() should be > false even though there are devices in /dev ? > > > On Mon, 2006-02-06 at 23:20 -0700, Kim Lux wrote: >> I'm running the code below. >> >> portlist.hasMoreElements() is false. >> >> /dev has ports in it as listed below. >> >> What am I doing wrong ? >> >> >> ========================================================== >> // Step through the list of ports until we find one that matches >> // the one we are looking for. >> >> portList = CommPortIdentifier.getPortIdentifiers(); >> >> while(portList.hasMoreElements()) >> { >> portID = (CommPortIdentifier) portList.nextElement(); // >> if (portID.getName().equals("/dev/ttyUSB0")) >> { >> myTA.append("Serial port ttyUSB0 has been found\n"); >> break; >> }// if portID equals... >> }// End of while... >> ========================================================== >> >> ls -al /dev/tty* >> crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty >> crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 >> crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 >> crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 >> crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 >> ... >> crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 >> crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 >> crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 >> >> >> > Hi Kim What rxtx does is try to open the port and do a timed out read. If the kernel/... do not complain it's enumarted. I suspect you could do a crude test by doing something like cat /dev/ttyS0 > /dev/null If that barfs then rxtx wont enumerate the port. hmm looking at your question again, I suspect it's a lockfile problem. This is documented in INSTALL with the source. Its easy enough to test this too.. touch /var/lock/testingrxtxlockfiles && rm -f /var/lock/testingrxtxlockfiles If you are not in the right group it will bail. Root will work regardless. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 12:37:56 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 12:37:56 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> Message-ID: <1139341076.8145.11.camel@zd7280> Exactly which ports does rxtx attempt to put into the list ? /dev/* or /dev/tty* or /dev/tty[0-9[0-9] ? or /dev/ttyS* ? For the record, only /dev/ttyUSB0 is a valid port on the machine I am presently on. Will this be a problem ? On Tue, 2006-02-07 at 12:20 -0700, Trent Jarvi wrote: > This is documented in INSTALL with the source. > I was wondering where that file was. I will download source and dig it up. Thanks. -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 12:51:09 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 12:51:09 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139341076.8145.11.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: On Tue, 7 Feb 2006, Kim Lux wrote: > > Exactly which ports does rxtx attempt to put into the list ? /dev/* > or /dev/tty* or /dev/tty[0-9[0-9] ? or /dev/ttyS* ? > > For the record, only /dev/ttyUSB0 is a valid port on the machine I am > presently on. Will this be a problem ? > > > On Tue, 2006-02-07 at 12:20 -0700, Trent Jarvi wrote: >> This is documented in INSTALL with the source. >> > I was wondering where that file was. I will download source and dig it > up. > > Thanks. > Hmm I'm looking at pre17 so this may have changed. (its just what I have on this machine) if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA" // for the IPAQs }; CandidatePortPrefixes=Temp; } So you may need to add "ttyUSB" to that list. RXTX used to enumerate _everything_ see if(osName.equals("Linux-all-ports") But it became less than practical. This is all in RXTXCommDriver.java hmm I just did a cvs update. if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have to get your fingers into the code. We aim for sane defaults. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 13:06:45 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 13:06:45 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139342805.8145.22.camel@zd7280> On Tue, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > Hmm I'm looking at pre17 so this may have changed. (its just what I have > on this machine) > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA" // for the IPAQs > }; > CandidatePortPrefixes=Temp; > } > > > So you may need to add "ttyUSB" to that list. RXTX used to enumerate > _everything_ see if(osName.equals("Linux-all-ports") But it became less > than practical. > > This is all in RXTXCommDriver.java > > hmm I just did a cvs update. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have > to get your fingers into the code. We aim for sane defaults. Excellent. Thanks for taking the time. -- Kim Lux, Diesel Research Inc. From ideiglenes1 at freemail.hu Tue Feb 7 13:53:39 2006 From: ideiglenes1 at freemail.hu (--) Date: Tue, 07 Feb 2006 21:53:39 +0100 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139345619.22534.2.camel@localhost> Hi! I use this code to get all the extra Linux devices. :) if ("Linux".equals(System.getProperty("os.name"))) { System.setProperty("os.name","Linux-all-ports"); } driver = new RXTXCommDriver(); On k, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > On Tue, 7 Feb 2006, Kim Lux wrote: > > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have > to get your fingers into the code. We aim for sane defaults. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From matt.higgins at gmail.com Tue Feb 7 13:45:54 2006 From: matt.higgins at gmail.com (Matt Higgins) Date: Tue, 7 Feb 2006 15:45:54 -0500 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> Message-ID: <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> Sweet this is exactly what I needed. I was searching the archives through marc.theamisgroup they only have archives back to 1/3/05. Should have hit the mailman archive! Thanks a lot! On 2/7/06, Brian Schlining wrote: > > Hi Matt > > The following code works fine on Linux but I never see any data when run > on Windows. This is a cut and paste from the SimpleRead example. > I am attempting to read data from a bar code scanner. I can fire up > HyperTermianl on windows and see that the device is working properly as I > see the barcodes are scanned and echoed back to the terminal. However when I > run the app I don't see any data. It is however associating with the com > port as the informational bits print fine? > > > You're not the only one whose had this problem, I don't know if Trent has > addressed this is the latest release of RXTX but there is a workaround. > Here's the recent thread from the RXTX mailing list regarding this issues: > > Thanasis Delenikas tdelenik at gmail.com > Wed Jan 18 13:56:23 MST 2006 > > * Previous message: [Rxtx] Re: More close() performance fixes > * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] > > Hi all. > (I've subscribed again from my other email account). > > Trent, > > You are right. Linux *always* works, no matter what flow control you set. > Windows *works only* with hardware flow control (I haven't tested what > happens with software XON/XOFF flow control). > > I assume (but I am not certain) that even with no flow control at all, all > platforms should work. Without flow control, you have the risk of bumping > into overflow or framing errors, but that's your (the end programmer, I > mean) problem. > > >From my side, I shouldn't be working without flow control. That was a bug > too... It was some code forgotten from the old times, when I used to work > with phone emulation drivers which didn't support flow control. The > correct > way is to have some flow control enabled and that's why I suppose this is > a > low-severity bug for RxTx. > > I have no idea which platform shows the correct behaviour, since > my knowledge about Linux and the inner workings of these low-level i/o > operations is limited. > > Regards, > Thanasis Delenikas. > > > > > Message: 2 > > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > > From: Trent Jarvi > > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > > To: RXTX Developers and Users > > Message-ID: > > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > > > Hi all, > > > > > > Trent, I have found something. > > > I read your comment about flow control, so I experimented a bit. > > > > > > If you remember, in my sample program I've used no flow control at all > ( > > i.e. > > > Java constant FLOWCONTROL_NONE). > > > > > > Now, during testing, I've switch to hardware inbound flow control (i.e > . > > Java > > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > > beautifully! > > > > > > I think I will switch to H/W flow control and test things for a while, > > but > > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > > > > > Hi Thanasis, > > > > I'm fairly sure you have identified a bug. I would not worry too much > > about what Sun CommAPI w32 defaults are. I think they did more or less > > whatever the port opened with. Just a guess. Linux tries to stomp on > > ports so they are all the same. > > > > So this started out with Linux worked, Windows XP/.. did not as I > recall. > > Something is wrong in rxtx. Do I understand this right? > > > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > > > Perhaps there is something Wayne or I did not understand when we wrote > > that code. I wasnt programming back in the BBS days so modems are not > my > > thing. I have a few questions. > > > > Is the above matrix confirmed by observation? > > Linux just always worked? > > Which one _should_ work? I'm guessing modems work with hardware flow > > control. I'll have to dig around. > > > > The windows flow control changes a couple things with hardware flow > > control. Following the w32 API documentation is confusing sometimes. > > But it looks like Linux could have a bug too. > > Cheers > > Brian Schlining > Software Engineer > http://www.mbari.org > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/9c989144/attachment-0049.html From tjarvi at qbang.org Tue Feb 7 14:06:14 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 14:06:14 -0700 (MST) Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> Message-ID: >> >> You're not the only one whose had this problem, I don't know if Trent has >> addressed this is the latest release of RXTX but there is a workaround. >> Here's the recent thread from the RXTX mailing list regarding this issues: >> I have not. I expect to have access to some test equipment next month and I'll go through all of this. I really don't know whats going on and I need a gold standard. I thought maybe linux was autodetecting the flow control. Your observations would certainly be welcome. I need to talk to Russell King and see what he is doing. Until then I'd just be toying around over a loopback as usual. This is very high on the list though. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 17:25:05 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 17:25:05 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139358305.17994.2.camel@zd7280> My application now works. I installed the libraries and jar from 2.1-7 (Final). portlist.hasMoreElements is no longer false. The application finds the port for /dev/ttyUSB0. Thanks for your help, Trent (et al) Sorry I bothered you with this. Next time I will look in the source first. I didn't think it was an rxtx issue, I thought it was a Linux setup issue . On Tue, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > Hmm I'm looking at pre17 so this may have changed. (its just what I > have > on this machine) > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux > Serial Ports > "ttySA" // for the > IPAQs > }; > > CandidatePortPrefixes=Temp; > } > > > So you may need to add "ttyUSB" to that list. RXTX used to enumerate > _everything_ see if(osName.equals("Linux-all-ports") But it became > less > than practical. > > This is all in RXTXCommDriver.java > > hmm I just did a cvs update. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux > Serial Ports > "ttySA", // for the > IPAQs > "ttyUSB" // for USB > frobs > }; > > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you > have > to get your fingers into the code. We aim for sane defaults. -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 19:21:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 19:21:54 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139358305.17994.2.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> <1139358305.17994.2.camel@zd7280> Message-ID: >Sorry I bothered you with this. Next time I will look in the source >first. I didn't think it was an rxtx issue, I thought it was a Linux >setup issue . Why would you be sorry? I would have done the same. I'm glad it's working :) -- Trent Jarvi tjarvi at qbang.org From tma at mail.island.net Wed Feb 8 13:39:35 2006 From: tma at mail.island.net (Tom Alldread) Date: Wed, 08 Feb 2006 12:39:35 -0800 Subject: [Rxtx] Win32/Linux Serial Port Data Dropouts In-Reply-To: <200602060702.k167255O007882@www.qbang.org> References: <200602060702.k167255O007882@www.qbang.org> Message-ID: <43EA5707.4020200@mail.island.net> Greetings Folks at RXTX: During the last couple of months I have been alternately testing with javax.comm 2 and RXTX 2.1 under Windows XP and CommApi 3 and RXTX 2.1 under Suse 10.0 Linux. In the process I have learned a little about java multi-threading under NetBeans 5 with Profiler. My java (jdk 1.5_06) application is used for data acquisition and provides a graphical display of A-D conversion data received from a 56KBaud serial port. The actual data throughput is about 10KBaud thus it is well below the speed of the port. I use hardware RTS/CTS flow control which can stall the data acquisition sample rate if necessary. This ensures the display computer has the ability to slow the data acquisition rate should it become too busy to accept the regular data flow. Both the serial port buffer and the java read buffer are set at 16KB. Usually the data transfers into the java read buffer are less than 100 bytes unless the data acquisition is recovering from a stall. The data flow normally hesitates after each 5 KB block as a continue command is needed from the display computer to start the drawing of a new graphics display line. Separate threads have been provided for the serial port event monitoring and data processing. The serial port event thread has been given the maximum priority and data processing thread the minimum priority provided by java. Thread yield statements have been placed within all data processing while/for loops as an effort to ensure quick access to CPU cycles for the serial port event thread. I have found that short data transmissions are essentially error free but occasional dropouts occur with continuous data flow especially under Windows XP. ....................................................................................................................................................................................... Linux results: I am happy to report that RXTX 2.1 appears to work very well under Linux although I did notice some errors when the screen savers were running with my dual monitors. I believe this is a local problem associated with my dual graphics which needs further attention. The recent CommApi 3 Linux release from Sun did not work at all with my program. It seemed to send commands out OK but did not receive any data. Although the serial port event triggered the ISR, the input stream appeared filled with nulls and thus did not contain any data. As my understanding is that CommApi 3 was tested with a Red Hat distribution of Linux I wonder if this problem is distro dependent? Although somewhat off topic here I wonder if anyone reading this has had similar experience? .................................................................................................................................................................................. Windows XP results: There are problems with occasional data dropouts which become more frequent as the sampling rate is increased or if the computer becomes busy with other duties. The dropouts typically consist of a half dozen byte block of lost data. It appears the lost bytes never get added to the java input stream. There has not been any indication of garbled data, overruns or framing errors which suggests the UART communications remains solid. Using javax.comm 2 I found that the setting of SerialPort 'enableReceiveThreshold' to 40 and 'enableReceiveTimeout' of 100mS reduced the dropouts error rate significantly. I found that I could not get RXTX 2.1 to function with the aforementioned threshold and timeout settings. The javax.comm 2 interface is consequently performing better for me under Windows than RXTX 2.1. I wonder if anyone here has any suggestions as to what I might try to improve RXTX 2.1? Although my settings are the same as under Suse 10.0, RXTX 2.1 performs much better for me under Linux than any of the alternatives that I have tried under Windows XP . ............................................................................................................................................................................... I would like to establish, based on the experience of others, if I have reached the normally expected performance limit of java serial port communications? Should I expect to achieve virtually error free serial port data input from a continuous stream under Windows XP java software? I am considering changing my protocol to packets with error checking if necessary but would like to know if the dropout problems I am experiencing are typical or not before I take this rather work intensive plunge. Many thanks in advance for any help! Best Regards, Tom Alldread -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.375 / Virus Database: 267.15.2/253 - Release Date: 2006-02-07 From jlaxson at mac.com Wed Feb 8 23:56:48 2006 From: jlaxson at mac.com (John Laxson) Date: Thu, 9 Feb 2006 00:56:48 -0600 Subject: [Rxtx] PortInUseException: Unknown Application on OSX Message-ID: Hi, I've been trying to get RXTX 2.1.7 going on Mac OS X for a while here, and am running up into a wall here. I've tried with pre- compiled and the source version and get the same problem, a gnu.io.PortInUseException: Unknown Application. I have run the fixperms script included with the source distribution, and id shows me as a member of the uucp group, and permissions on /var/spool/uucp are 775 root:uucp. Running a test program (included at the bottom for clarity) lets me enumerate all the serial ports correctly, but trying to open any of them gives the PortInUseException. If it helps, when I try to open a port that's set to make an outgoing bluetooth connection, there is no delay and no connection attempt at all. Thanks, John Laxson PS: The documentation wiki on qbang.org shows 404, and has for a few days now. My test code: public static void main(String[] args) { SerialPort serialPort; try { Enumeration e = CommPortIdentifier.getPortIdentifiers(); CommPortIdentifier ident; while (e.hasMoreElements()) { ident = (CommPortIdentifier)e.nextElement(); System.out.println(ident.getName()); } ident = CommPortIdentifier.getPortIdentifier("/dev/cu.modem"); serialPort = (SerialPort) ident.open("Me", 5000); } catch (Exception e) { e.printStackTrace(); } } From rajesh.invincible at gmail.com Thu Feb 9 03:39:38 2006 From: rajesh.invincible at gmail.com (Rajesh N) Date: Thu, 9 Feb 2006 16:09:38 +0530 Subject: [Rxtx] Re: Move .java Files in gnu.io filesystem hierarchy - Maven (2) In-Reply-To: <43DF21D2.7090200@ngi.it> References: <43DF21D2.7090200@ngi.it> Message-ID: <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Can anybody tell me how to overcome these EXCEPTIONS I AM WORKING ON SERIAL COMMN IN JAVA ON LINUX. 1. " NOT ALL PARAMETERS SUPPORTED BY THE KERNEL" This i came across the following statement inmy prog. SerialP is A SerialPort object SerialP.setSerialPortParams(9600(BAUDRATE),DATABITS_8,STOPBITS_1,PARITY_NONE) 2. NullPointer Exception at Event Dispatch Now i have checked all my object references for a null reference but i found none i have put up my entire code in try catch blocks but still I AM UNABLE TO CATCH THIS EXCEPTION AND HENCE MY APPLICATION CLOSES HOW DOES THESE GO? PLEASE HELP ME IT IS URGENTTTTTTTTTTTTTTTT yours sincerely RAJESH On 1/31/06, Fabio Frumento wrote: > Hi Xavier, > > I don't know maven at all but the directory hierarchy listed buy Trent > is fine for me... > > I'll take a look to maven, it seems an interesting project > > Regards > > Fabio Frumento > > Trent Jarvi wrote: > > On Tue, 31 Jan 2006, Xavier Frisaye wrote: > > > >> Hi all, > >> > >> If you are going to rearrange the src folder, i will propose to use > >> maven 2 and follow its directory structure > >> > (http://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html). > >> > >> Maven 2 simplify java project and give a standard way to make projects > >> (http://maven.apache.org/). > >> We are using it for internal projects and we are very satisfied. > >> > >> Is anybody interested? > >> > >> I'm not an expert in maven 2 (yet) but i'm agree to help using it if > >> you choose to make so. > >> > > > > so this would be: > > > > rxtx-devel/src/main/java/gnu.io > > rxtx-devel/src/test/java/ManIwish.java > > > > I don't use IDEs very much so I'll let others comment. But I don't see > > a problem with that. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Thu Feb 9 09:50:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 9 Feb 2006 09:50:31 -0700 (MST) Subject: [Rxtx] Re: Move .java Files in gnu.io filesystem hierarchy - Maven (2) In-Reply-To: <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Message-ID: On Thu, 9 Feb 2006, Rajesh N wrote: > Can anybody tell me how to overcome these EXCEPTIONS > I AM WORKING ON SERIAL COMMN IN JAVA ON LINUX. > > 1. " NOT ALL PARAMETERS SUPPORTED BY THE KERNEL" > > This i came across the following statement inmy prog. > SerialP is A SerialPort object > SerialP.setSerialPortParams(9600(BAUDRATE),DATABITS_8,STOPBITS_1,PARITY_NONE) > Strange. The parameters you use are the same the port should open with by default. Could you paste the actual exception you are getting? I don't see that in the rxtx source. Also it would help to know the rxtx version. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Fri Feb 10 15:29:05 2006 From: lux at diesel-research.com (Kim Lux) Date: Fri, 10 Feb 2006 15:29:05 -0700 Subject: [Rxtx] One serial port object for both sending and receiving ? Message-ID: <1139610545.18177.4.camel@zd7280> Is it OK to use one SerialPort ojbect (ex Serial Port serialPort;) and use it for both sending and receiving ? For example: ======================================================================== static SerialPort serialPort = null; static OutputStream serialOut = null; static InputStream serialIn = null; // assign it to an outputStream for use try{ serialOut = serialPort.getOutputStream(); System.out.println("Serial output stream has been assigned."); }//try catch(IOException e) { System.out.println("Error: Couldn't assign output stream to serial port."); }//catch //assign it to an inputStream for use try{ serialIn = serialPort.getInputStream(); System.out.println("Serial input stream has been assigned."); }//try catch(IOException e) { System.out.println("Error: Couldn't assign input stream to serial port."); }//catch ======================================================================== -- Kim Lux, Diesel Research Inc. From lux at diesel-research.com Fri Feb 10 21:23:00 2006 From: lux at diesel-research.com (Kim Lux) Date: Fri, 10 Feb 2006 21:23:00 -0700 Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Message-ID: <1139631780.23882.10.camel@zd7280> I've got a problem receiving chars with my version of serialRead, written in an SWT GUI. I had a Java pro have a good look at my code and he can't see anything wrong with it. I can send chars fine. When I receive a char the cpu usage for the app goes to 100% and the code in the serial event handler doesn't get executed. The instructions on the Java Comm Serial API How-To for Linux page state that I must install javacomm. Is that true ? Everything builds without it and I can send chars on rxtx just fine, but I can't receive them. Could this be the problem ? I downloaded and installed javacomm. I was not able to add "Driver=gnuio.RXTXCommDriver to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 installed in /usr/java/jre1.5.0_05. I added comm.jar to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext to the library paths. Is this OK ? Does it matter that I am receiving on /dev/ttyUSB0 ? Thanks. -- Kim Lux, Diesel Research Inc. From lunareclipse03 at web.de Sat Feb 11 09:44:46 2006 From: lunareclipse03 at web.de (lunareclipse03@web.de) Date: Sat, 11 Feb 2006 17:44:46 +0100 Subject: [Rxtx] Question about Serial I/O under Win32 Message-ID: <662084330@web.de> Hello everybody, I have a strange problem with a piece of code I made for myself. No, this is not really concerning rxtx, but nevertheless I post this to the list, hoping that some of you can help me. I've written two libraries, one for linux and one for win32. The linux port works quite well, I can send / receive faxes and / or replay voice messages over the telephone line using a voice modem. But the win32 port of the library causes some trouble. If, for example, I send out a fax with a certain modem under linux, it works well. The fax is complete when it comes out of the fax machine. If I then use the same modem to send out a fax under win32, the fax coming out of the fax machine gets "stuck" halfways, but the sending modem thinks that transmission was ok and drops the connection. The answering fax machine then gives me "error while receiving." The "upper layer" java code MUST be right, because if I do the same thing under linux (using the linux library), everything is alright. Now I have to ask: Can somebody please help me out with this??!? Could it be the case that some kind of flow control or COMMTIMEOUTS setting causes this behaviour? I set flow control to RTS/CTS before sending out a fax. How can I DISABLE flow control? Or what do you think? Can something else cause this problems? Thank you all for your time and PLEASE write back soon. Regards, --Sven Ahlemann Am Waldrand 31 45721 Haltern am See Germany ______________________________________________________________ Verschicken Sie romantische, coole und witzige Bilder per SMS! Jetzt bei WEB.DE FreeMail: http://f.web.de/?mc=021193 From lux at diesel-research.com Sat Feb 11 10:06:52 2006 From: lux at diesel-research.com (Kim Lux) Date: Sat, 11 Feb 2006 10:06:52 -0700 Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: <1139631780.23882.10.camel@zd7280> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> <1139631780.23882.10.camel@zd7280> Message-ID: <1139677612.3431.5.camel@zd7280> More on this problem. I copied and pasted simpleRead into a console based Eclipse project and I've got the same result, except that cpu usage doesn't go to 100%. I'm beginning to think there is an issue in rxtx. My imports for simpleRead are: ============================ import gnu.io.*; import java.util.*; //import javax.comm.*; import java.io.*; =========================== Any ideas ? I am trying to read from /dev/ttyUSB0 using a serial to USB adapter which has worked well with minicom and gtkterm. Thanks. On Fri, 2006-02-10 at 21:23 -0700, Kim Lux wrote: > I've got a problem receiving chars with my version of serialRead, > written in an SWT GUI. > > I had a Java pro have a good look at my code and he can't see anything > wrong with it. > > I can send chars fine. When I receive a char the cpu usage for the app > goes to 100% and the code in the serial event handler doesn't get > executed. > > The instructions on the Java Comm Serial API How-To for Linux page state > that I must install javacomm. Is that true ? Everything builds without > it and I can send chars on rxtx just fine, but I can't receive them. > Could this be the problem ? > > I downloaded and installed javacomm. I was not able to add > "Driver=gnuio.RXTXCommDriver > to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not > have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 > installed in /usr/java/jre1.5.0_05. I added comm.jar > to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext > to the library paths. Is this OK ? > > Does it matter that I am receiving on /dev/ttyUSB0 ? > > Thanks. > -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Sun Feb 12 21:01:33 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:01:33 -0700 (MST) Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: <1139677612.3431.5.camel@zd7280> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> <1139631780.23882.10.camel@zd7280> <1139677612.3431.5.camel@zd7280> Message-ID: I suspect what is happening is the select() is breaking out in the native code but the driver does not have support for notifying there are X bytes available. On some traditional Unix based systems, the only way you know data is available is the fd status changes and do an FIORDCHK ioctl. Or perhaps the only thing you can know is the fd status changed. It would take reading through the kernel driver code to know for sure. So on USB, depending upon the driver, the same may need to be done or the driver improved a bit if possible to support. Polling reads will also work but don't use the event driven model of CommAPI which isnt acceptable in the long run. The 100% cpu usage can then be explained because select no longer blocks until the data is read; the eventLoop spins loose. You can put a well placed sleep but rxtx only expects those are needed when it knows data is available. This may not be a super simple thing to understand and fix. I do have ideas to get you started. I'm going to be short on time the next couple weeks. I expect to put some good time in and answer some other questions I saw around the 25th. For now, I'd look at the following and go from there with the hints I've given. JNIEXPORT jint JNICALL RXTXPort(nativeavailable)( JNIEnv *env, jobject jobj ) { int fd = get_java_var( env, jobj,"fd","I" ); int result; /* char message[80]; ENTER( "RXTXPort:nativeavailable" ); On SCO OpenServer FIONREAD always fails for serial devices, so try ioctl FIORDCHK instead; will only tell us whether bytes are available, not how many, but better than nothing. This turns out to be true on Solaris also. taj. */ #ifdef FIORDCHK /* __unixware__ __sun__ probably others */ result = ioctl(fd, FIORDCHK, 0); #else if( ioctl( fd, FIONREAD, &result ) < 0 ) { goto fail; } #endif /* FIORDCHK */ On Sat, 11 Feb 2006, Kim Lux wrote: > > More on this problem. I copied and pasted simpleRead into a console > based Eclipse project and I've got the same result, except that cpu > usage doesn't go to 100%. I'm beginning to think there is an issue in > rxtx. > > My imports for simpleRead are: > > ============================ > import gnu.io.*; > import java.util.*; > //import javax.comm.*; > import java.io.*; > =========================== > > Any ideas ? I am trying to read from /dev/ttyUSB0 using a serial to > USB adapter which has worked well with minicom and gtkterm. > > Thanks. > > > > On Fri, 2006-02-10 at 21:23 -0700, Kim Lux wrote: >> I've got a problem receiving chars with my version of serialRead, >> written in an SWT GUI. >> >> I had a Java pro have a good look at my code and he can't see anything >> wrong with it. >> >> I can send chars fine. When I receive a char the cpu usage for the app >> goes to 100% and the code in the serial event handler doesn't get >> executed. >> >> The instructions on the Java Comm Serial API How-To for Linux page state >> that I must install javacomm. Is that true ? Everything builds without >> it and I can send chars on rxtx just fine, but I can't receive them. >> Could this be the problem ? >> >> I downloaded and installed javacomm. I was not able to add >> "Driver=gnuio.RXTXCommDriver >> to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not >> have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 >> installed in /usr/java/jre1.5.0_05. I added comm.jar >> to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext >> to the library paths. Is this OK ? >> >> Does it matter that I am receiving on /dev/ttyUSB0 ? >> >> Thanks. >> > From tjarvi at qbang.org Sun Feb 12 21:03:30 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:03:30 -0700 (MST) Subject: [Rxtx] One serial port object for both sending and receiving ? In-Reply-To: <1139610545.18177.4.camel@zd7280> References: <1139610545.18177.4.camel@zd7280> Message-ID: On Fri, 10 Feb 2006, Kim Lux wrote: > > Is it OK to use one SerialPort ojbect (ex Serial Port serialPort;) and > use it for both sending and receiving ? > > For example: > > ======================================================================== > static SerialPort serialPort = null; > static OutputStream serialOut = null; > static InputStream serialIn = null; > > > > > // assign it to an outputStream for use > try{ > serialOut = serialPort.getOutputStream(); > System.out.println("Serial output stream has been assigned."); > }//try > catch(IOException e) > { > System.out.println("Error: Couldn't assign output stream to serial > port."); > }//catch > > > //assign it to an inputStream for use > try{ > serialIn = serialPort.getInputStream(); > System.out.println("Serial input stream has been assigned."); > }//try > catch(IOException e) > { > System.out.println("Error: Couldn't assign input stream to serial > port."); > }//catch This should be fine. In fact trying to do it another way will probably not work as you will run into lockfile issues. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun Feb 12 21:13:13 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:13:13 -0700 (MST) Subject: [Rxtx] Question about Serial I/O under Win32 In-Reply-To: <662084330@web.de> References: <662084330@web.de> Message-ID: On Sat, 11 Feb 2006 lunareclipse03 at web.de wrote: > Hello everybody, > > I have a strange problem with a piece of code I made for myself. No, > this is not really concerning rxtx, but nevertheless I post this to the > list, hoping that some of you can help me. I've written two libraries, > one for linux and one for win32. The linux port works quite well, I can > send / receive faxes and / or replay voice messages over the telephone > line using a voice modem. But the win32 port of the library causes some > trouble. If, for example, I send out a fax with a certain modem under > linux, it works well. The fax is complete when it comes out of the fax > machine. If I then use the same modem to send out a fax under win32, the > fax coming out of the fax machine gets "stuck" halfways, but the sending > modem thinks that transmission was ok and drops the connection. The > answering fax machine then gives me "error while receiving." The "upper > layer" java code MUST be right, because if I do the same thing under > linux (using the linux library), everything is alright. Now I have to > ask: Can somebody please help me out with this??!? Could it be the case > that some kind of flow control or COMMTIMEOUTS setting causes this > behaviour? I set flow control to RTS/CTS before sending out a fax. How > can I DISABLE flow control? Or what do you think? Can something else > cause this problems? Thank you all for your time and PLEASE write back > soon. > Hi Sven I'm not too willing to talk about flow control at the low level until I confirm some things with test equipment later. It is not clear if you are using rxtx or writing your own native code. So I'm not sure how to answer much of this :) If you are wondering how to change the flow control using rxtx from java, The BlackBox example from Sun flips this back and forth. SerialPort.java in rxtx 2.1 uses the following: SerialPort.java: public static final int FLOWCONTROL_NONE =0; SerialPort.java: public static final int FLOWCONTROL_RTSCTS_IN =1; SerialPort.java: public static final int FLOWCONTROL_RTSCTS_OUT =2; SerialPort.java: public static final int FLOWCONTROL_XONXOFF_IN =4; SerialPort.java: public static final int FLOWCONTROL_XONXOFF_OUT=8; So if you set flowcontrol to RTSCTS, you can set it to NONE to turn it off. If you are looking for how to do it in native code, the rxtx Source is SerialImp.c (unix/linux/mac os x/w32) and termios.c (w32 only with SerialImp.c) You can track the code: SerialImp.c:JNIEXPORT void JNICALL RXTXPort(setflowcontrol)( JNIEnv *env, jobject jobj, jint flowmode ) termios.c:int tcgetattr( int fd, struct termios *s_termios ) termios.c:int tcsetattr( int fd, int when, struct termios *s_termios ) There may be a problem in the rxtx flow control code though. Rather than guess, I want to test this with a gold standard. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Feb 6 00:00:16 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 00:00:16 -0700 (MST) Subject: [Rxtx] wiki delay until tomorrow night. In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: On Sun, 5 Feb 2006, Trent Jarvi wrote: > On Sun, 5 Feb 2006, Kim Lux wrote: > >> usb ? Tell me more... I need that too. > > usb is a very proper design. Thats all it is. > Maybe rxtx could help usb. But it would start with helping bring back the community that was already there. It's not something I'd love to do but maybe its the right thing to do. It would probably take 2 years to do right. But maybe thats better than what we have now. I honestly don't know what IBM is doing which could just run over everything. Just some thoughts after some fine german wine. -- Trent Jarvi tjarvi at qbang.org From gadelavega at yahoo.com.ar Mon Feb 6 02:17:05 2006 From: gadelavega at yahoo.com.ar (Gonzalo A. de la Vega) Date: Mon, 06 Feb 2006 10:17:05 +0100 Subject: [Rxtx] Serial port ownership question In-Reply-To: References: <20060205113618.30274.qmail@web53501.mail.yahoo.com> <1139157422.4553.9.camel@zd7280> <1139158698.4936.9.camel@zd7280> Message-ID: <43E71411.4050402@yahoo.com.ar> On my Fedora Core 4: ls -l /dev/ttyS* crw-rw---- 1 root uucp 4, 64 Feb 6 2006 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Feb 6 2006 /dev/ttyS1 ... and: grep "ttyUSB" /etc/udev/rules.d/50-udev.rules KERNEL=="ttyUSB*", GROUP="uucp", MODE="0660" So anyone in the "uucp" group can use serial ports. On Gentoo the group is "tty". Trent Jarvi escribi?: > > > On Sun, 5 Feb 2006, Dr. Douglas Lyon wrote: > >> I can confirm that this is the case (only root ownership of >> serial ports, under fedora 4). >> Wow, what were they thinking?! >> - DL >> >>> I've found that the newer kernels have the serial ports owned by root. >>> For example, >>> >>> $ls -al /dev/tty* >>> crw-rw-rw- 1 root root 5, 0 Feb 5 02:06 /dev/tty >>> crw-rw---- 1 root root 4, 0 Feb 5 02:06 /dev/tty0 >>> crw------- 1 root root 4, 1 Feb 5 09:07 /dev/tty1 >>> crw-rw---- 1 root tty 4, 10 Feb 5 02:06 /dev/tty10 >>> crw-rw---- 1 root tty 4, 11 Feb 5 02:06 /dev/tty11 >>> ... > > > This is just not a problem jcp or such are going to solve. Its a > platform spitwad fight. But do look at pam. In fact thats what Sun > is doing too. Maybe Linux followed their lead.. I'm not a pam guy. > I've spent 16 hours trying to understand it but your users wont :) > > Solution? I have no clue. Its two tangent mentalities from my > perspective. > > -- > Trent Jarvi > tjarvi at qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mtnvega at yahoo.com.br Mon Feb 6 05:35:43 2006 From: mtnvega at yahoo.com.br (Luiz Jr) Date: Mon, 6 Feb 2006 12:35:43 +0000 (GMT) Subject: [Rxtx] Documentation Wiki In-Reply-To: <1139157422.4553.9.camel@zd7280> Message-ID: <20060206123543.57256.qmail@web53515.mail.yahoo.com> Hello, Thank you for you answer, but so the usage of the API is pretty much like the Java Communications Api? If yes, what version of the Java Comm Api? Thank you, Luiz A. Brandao Jr Kim Lux escreveu: On Sun, 2006-02-05 at 08:36 -0300, Luiz Jr wrote: > Hello, > > I want to start using the RXTX libraries, but I would to know how, > since I can not access the documentation wiki page I just started using them yesterday. Below is how I installed the libraries, if that helps. I used snippets of code from the SimpleWrite application here to get me going. http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html Instead of "import javax.comm.*;", use "import gnu.io.*;" which is gotten from RXTXcomm.jar, which you will need to include in your project references. I am working in Eclipse. BTW: there is no way to open a port without going through the port list and finding it. Maybe sometime in the future someone (me ?) will write a method called openSerialPort that allows the user to give a port identifier, such as "/dev/tty1" and return a port ready to use. It wouldn't take much to write that and it would save users a lot of code. Hope this helps. ======================================================================= 1) Figure out which java you are running, incase there is more than one installed. $ java -version java version "1.5.0_05" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_05-b05) Java HotSpot(TM) Client VM (build 1.5.0_05-b05, mixed mode, sharing) 2) Find all the jre directories and the one from which you are currently running. kfind (jre) 3) cd to that directory plus /lib/i386 cd /usr/java/jre1.5.0_05/lib/i386 4) Copy the library files (*.so) to that directory. cp /home/krlux/Desktop/'Java Controls'/rxtx-linux/bin/* . 5) Check that the copy was successful ls librxtx* librxtxI2C.so librxtxRaw.so librxtxSerial.so librxtxParallel.so librxtxRS485.so 6) cd to the /lib/ext directory for your java. cd /usr/java/jre1.5.0_05/lib/ext 7) Copy the Jar files there cp /home/krlux/Desktop/'Java Controls'/rxtx-linux/lib/ext/* . 8) Check that it was successful ls RXTX* RXTXcomm.jar Rxtx is now installed on your machine ready to use. =================================================================== -- Kim Lux, Diesel Research Inc. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx --------------------------------- Yahoo! Acesso Gr?tis - Internet r?pida e gr?tis. Instale o discador agora! -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/544aa403/attachment-0050.html From lyon at docjava.com Mon Feb 6 05:49:34 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 06 Feb 2006 07:49:34 -0500 Subject: [Rxtx] wiki delay until tomorrow night. In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: Hi All, I have often thought about USB drivers being needed. For example, the ironman watch will not interface to a mac (windows only). It is USB. My dymo label writer has no Java driver (native only). Etc. Most cheap web cameras are USB (and Java drivers go through JAI, if it supports the camera at all). The JAI code shows how sun did the USB drivers. You have to be a member of the jai project to download the source code. https://jai.dev.java.net has the jai distro. And then you are not allowed to redistribute it. However, we can all learn from it (if so inclined). Basically: cvs -d :pserver:lyon at cvs.dev.java.net:/cvs login cvs -d :pserver:lyon at cvs.dev.java.net:/cvs checkout jai-core You will need to user your own uid and pw to get in. The ant build has over 100 warnings from sun deprecations of its own code. You might say that they were hoisted on their own Picard ;) One interesting thing is that they support several platforms: linux-amd64 64-bit Linux-AMD64 linux-i586 32-bit Linux-x86 solaris-amd64 64-bit Solaris-AMD64 solaris-i586 32-bit Solaris-x86 solaris-sparc 32-bit Solaris-SPARC solaris-sparcv9 64-bit Solaris-SPARC windows-i586 32-bit Windows-x86 Thus, ant is used to provide a multi-platform native method distro. Neat. How do they do it? check this out: And: The core download does not contain any C source code (it was all pre-built). Basically, they are just copying .so and .dll files into build directories. I would love to see the C code for this...but Sun does not post it on the https://jai.dev.java.net site. I don't know why...Perhaps I missed it. - Doug >On Sun, 5 Feb 2006, Trent Jarvi wrote: > >>On Sun, 5 Feb 2006, Kim Lux wrote: >> >>>usb ? Tell me more... I need that too. >> >>usb is a very proper design. Thats all it is. >> > >Maybe rxtx could help usb. But it would start with helping bring >back the community that was already there. > >It's not something I'd love to do but maybe its the right thing to do. > >It would probably take 2 years to do right. But maybe thats better >than what we have now. > >I honestly don't know what IBM is doing which could just run over everything. > >Just some thoughts after some fine german wine. > >-- >Trent Jarvi >tjarvi at qbang.org > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tdelenik at gmail.com Mon Feb 6 05:56:32 2006 From: tdelenik at gmail.com (Thanasis Delenikas) Date: Mon, 6 Feb 2006 14:56:32 +0200 Subject: Fwd: [Rxtx] Documentation Wiki In-Reply-To: <1139157422.4553.9.camel@zd7280> References: <20060205113618.30274.qmail@web53501.mail.yahoo.com> <1139157422.4553.9.camel@zd7280> Message-ID: <310a1a930602060456t129f1dc6p5f2b908f13ab5a0b@mail.gmail.com> Hello all, Kim, this is a snippet from the code I use. The closest to directly opening a specific port without enumeration. << ... portId = CommPortIdentifier.getPortIdentifier(getPort()); serialPort = (SerialPort) portId.open("jSMSEngine", 1971); ... >> where getPort() return the string identifier of the port, i.e. "/dev/ttyS0" or "COM1" or whatever. Thanasis. ---------- Forwarded message ---------- From: Kim Lux Date: Feb 5, 2006 6:37 PM Subject: Re: [Rxtx] Documentation Wiki To: RXTX Developers and Users BTW: there is no way to open a port without going through the port list and finding it. Maybe sometime in the future someone (me ?) will write a method called openSerialPort that allows the user to give a port identifier, such as "/dev/tty1" and return a port ready to use. It wouldn't take much to write that and it would save users a lot of code. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/182ab5b8/attachment-0050.html From tjarvi at qbang.org Mon Feb 6 11:53:57 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 11:53:57 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: On Mon, 6 Feb 2006, Dr. Douglas Lyon wrote: > Hi All, > I have often thought about USB drivers being needed. > For example, the ironman watch will not interface > to a mac (windows only). It is USB. > My dymo label writer has no Java driver (native only). > Etc. > Most cheap web cameras are USB (and Java drivers go > through JAI, if it supports the camera at all). > The JAI code shows how sun did the USB drivers. > You have to be a member of the jai project to download > the source code. > https://jai.dev.java.net has the jai distro. > And then you are not allowed to redistribute it. However, > we can all learn from it (if so inclined). Basically: > cvs -d :pserver:lyon at cvs.dev.java.net:/cvs login > cvs -d :pserver:lyon at cvs.dev.java.net:/cvs checkout jai-core > You will need to user your own uid and pw to get in. > The ant build has over 100 warnings from sun deprecations > of its own code. > > You might say that they were hoisted on their own Picard ;) > > One interesting thing is that they support several platforms: > linux-amd64 64-bit Linux-AMD64 > linux-i586 32-bit Linux-x86 > solaris-amd64 64-bit Solaris-AMD64 > solaris-i586 32-bit Solaris-x86 > solaris-sparc 32-bit Solaris-SPARC > solaris-sparcv9 64-bit Solaris-SPARC > windows-i586 32-bit Windows-x86 > Thus, ant is used to provide a multi-platform native method distro. > Neat. > How do they do it? > check this out: > > > > > > > > > > > > > And: > > > > > > > > > > The core download does not contain any C source code (it was all pre-built). > Basically, they are just copying .so and .dll files into build directories. > > I would love to see the C code for this...but Sun does not post it on the > https://jai.dev.java.net site. > > I don't know why...Perhaps I missed it. > > - Doug > > I've looked at moving rxtx to Ant builds. I think that would help IDEs a great deal. I requested a evalutation desk copy the O'Reilly Ant book for some j2ee material I was teaching. http://www.oreilly.com/catalog/anttdg/ It has a one sentence mention of JNI. So there was not luck there. I saw that there is another Ant book that does mention JNI more. I can't find it now. Ant must be able to support it with extensions. http://ant.apache.org/manual/OptionalTasks/javah.html What the auto(break :) tools do in the rxtx build is 4 things really. 1) gcc compile flags 2) ld compile flags 3) config.h 4) compile flags for customizing rxtx (lockfiles, ...) See 1 All of this information except 4 can be static once obtained. So I'm not attached to the auto tools. If I could find an example of Ant being used for JNI code, I'd be one of the first to start moving that direction. Maybe someone saw an example someplace. The other thing we have not completed discussing is the directory structure. There is interest in making rxtx more IDE friendly. I get more mail about that off the list than how to install rxtx. And I see we have Ken Thompson in da house :) He is our trusted CVS maintainer and the guy that purchased the rxtx.org domain. Old community. We will need Ken for changing the directory structure of source. I would like to open up discussion about both of these as it is more than time. The problem is I have little experience with Ant and even less with IDEs. It would be nice if we could work with Eclipse and NetBeans. http://www.netbeans.org/ (sun and some community) http://www.eclipes.org (ibm,rhat,... perhaps more community) http://maven.apache.org/what-is-maven.html (apache. It is community) borland should sortof be here too but I think thats covered in eclipse. >From what I understand so far, we should morph rxtx to support those three maybe trusting apaches lead with maven. But I use vi. I have little to no clues beyond what people have fed me. Can we agree that thats the right direction to go? -- Trent Jarvi tjarvi at qbang.org From brian at mbari.org Mon Feb 6 14:57:50 2006 From: brian at mbari.org (Brian Schlining) Date: Mon, 6 Feb 2006 13:57:50 -0800 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> > The other thing we have not completed discussing is the directory > structure. There is interest in making rxtx more IDE friendly. I > get more mail about that off the list than how to install rxtx. > > And I see we have Ken Thompson in da house :) He is our trusted > CVS maintainer and the guy that purchased the rxtx.org domain. Old > community. We will need Ken for changing the directory structure of > source. > > I would like to open up discussion about both of these as it is > more than time. The problem is I have little experience with Ant > and even less with IDEs. It would be nice if we could work with > Eclipse and NetBeans. > > http://www.netbeans.org/ (sun and some community) > http://www.eclipes.org (ibm,rhat,... perhaps more community) > http://maven.apache.org/what-is-maven.html (apache. It is community) > borland should sortof be here too but I think thats covered in > eclipse. > >> From what I understand so far, we should morph rxtx to support >> those three > maybe trusting apaches lead with maven. But I use vi. I have > little to no clues beyond what people have fed me. > Maven likes the directory structure below for Java code. (From http:// maven.apache.org/guides/getting-started/index.html) This structure works fine with ant, netbeans, and eclipse. rxtx_root_directory `-- src |-- main | `-- java | `-- gnu | `-- io `-- test `-- java `-- gnu `-- io Brian Schlining Software Engineer http://www.mbari.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/d9451eba/attachment-0050.html From tjarvi at qbang.org Mon Feb 6 15:11:45 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 15:11:45 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: > rxtx_root_directory > `-- src > |-- main > | `-- java > | `-- gnu > | `-- io > `-- test > `-- java > `-- gnu > `-- io > >From what I understand this will just be good. For me it makes no difference. So lets do the rxtx thing. Let if fester for two weeks and if nobody objects, we will do it. I'm not doing this because I care. I'm doing this to eliminate much of my inbox. But test... man is rxtx lacking there in the community aspect. It is covered but not right. _maybe_ I can change that this year. -- Trent Jarvi tjarvi at qbang.org (cat hurding since 1997) From lux at diesel-research.com Mon Feb 6 21:38:49 2006 From: lux at diesel-research.com (Kim Lux) Date: Mon, 06 Feb 2006 21:38:49 -0700 Subject: [Rxtx] How can I use Lock Files with rxtx (in FC4) ? Message-ID: <1139287129.17031.3.camel@zd7280> I am now running an rxtx application on FC4. I am getting: ========================================================= check_group_uucp(): error testing lock file creation Error details: Permission denied check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL ========================================================= $ ls -al /var/lock total 32 drwxrwxr-x 4 root lock 4096 Feb 6 16:04 . drwxr-xr-x 24 root root 4096 Nov 14 01:19 .. drwx------ 2 root root 4096 Apr 27 2005 lvm drwxr-xr-x 2 root root 4096 Feb 6 16:04 subsys How do I fix this for regulator users ? -- Kim Lux, Diesel Research Inc. From dmarkman at mac.com Mon Feb 6 22:24:44 2006 From: dmarkman at mac.com (Dmitry Markman) Date: Tue, 7 Feb 2006 00:24:44 -0500 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: if I understands the issue right in order to be able to use ant for c/c++ compilation you have to install ant's cc task http://ant-contrib.sourceforge.net/cc.html it looks like it should work on mac os x (authors claim, that it's platform independent) but I never tested so all you have to do it's providing right command line for the gcc compiler On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: >> rxtx_root_directory >> `-- src >> |-- main >> | `-- java >> | `-- gnu >> | `-- io >> `-- test >> `-- java >> `-- gnu >> `-- io >> > > >> From what I understand this will just be good. > > For me it makes no difference. So lets do the rxtx thing. Let if > fester for two weeks and if nobody objects, we will do it. > > I'm not doing this because I care. I'm doing this to eliminate > much of my inbox. > > But test... man is rxtx lacking there in the community aspect. It > is covered but not right. _maybe_ I can change that this year. > > -- > Trent Jarvi > tjarvi at qbang.org > (cat hurding since 1997) > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx Dmitry Markman From lux at diesel-research.com Mon Feb 6 23:20:15 2006 From: lux at diesel-research.com (Kim Lux) Date: Mon, 06 Feb 2006 23:20:15 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? Message-ID: <1139293215.3689.4.camel@zd7280> I'm running the code below. portlist.hasMoreElements() is false. /dev has ports in it as listed below. What am I doing wrong ? ========================================================== // Step through the list of ports until we find one that matches // the one we are looking for. portList = CommPortIdentifier.getPortIdentifiers(); while(portList.hasMoreElements()) { portID = (CommPortIdentifier) portList.nextElement(); // if (portID.getName().equals("/dev/ttyUSB0")) { myTA.append("Serial port ttyUSB0 has been found\n"); break; }// if portID equals... }// End of while... ========================================================== ls -al /dev/tty* crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 ... crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 -- Kim Lux, Diesel Research Inc. From david.garnier at trusted-logic.com Tue Feb 7 00:46:30 2006 From: david.garnier at trusted-logic.com (David Garnier) Date: Tue, 07 Feb 2006 08:46:30 +0100 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: <43E85056.2090608@trusted-logic.com> Hello, I think that the make-based build process is fine as it is, apart from the location of the Java source files. It is true that putting the Java source in a directory structure that map 1-to-1 to the Java package structure is the norm and should make it easier for everyone to modify the Java source, with or without an IDE. Ant is a good tool, but in the RXTX case I fail to see the advantage of using it compared to the current make-based process. As Trent said, they are more pressing issues, like testing. Regards, David Dmitry Markman wrote: > if I understands the issue right > in order to be able to use ant for c/c++ compilation > you have to install ant's cc task > http://ant-contrib.sourceforge.net/cc.html > > it looks like it should work on mac os x > (authors claim, that it's platform independent) > but I never tested > > so all you have to do it's providing right command line > for the gcc compiler > > > > > On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: > >>> rxtx_root_directory >>> `-- src >>> |-- main >>> | `-- java >>> | `-- gnu >>> | `-- io >>> `-- test >>> `-- java >>> `-- gnu >>> `-- io >>> >> >> >>> From what I understand this will just be good. >> >> For me it makes no difference. So lets do the rxtx thing. Let if >> fester for two weeks and if nobody objects, we will do it. >> >> I'm not doing this because I care. I'm doing this to eliminate much >> of my inbox. >> >> But test... man is rxtx lacking there in the community aspect. It is >> covered but not right. _maybe_ I can change that this year. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> (cat hurding since 1997) From tjarvi at qbang.org Tue Feb 7 01:11:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 01:11:31 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <43E85056.2090608@trusted-logic.com> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: On Tue, 7 Feb 2006, David Garnier wrote: > Hello, > > I think that the make-based build process is fine as it is, apart from the location of the Java > source files. It is true that putting the Java source in a directory structure that map 1-to-1 to > the Java package structure is the norm and should make it easier for everyone to modify the Java > source, with or without an IDE. > > Ant is a good tool, but in the RXTX case I fail to see the advantage of using it compared to the > current make-based process. As Trent said, they are more pressing issues, like testing. > Hi David I have more experience with testing rxtx than I can talk about. But let it be known, rxtx has gone trough 100's of hours of testing. We are hobby folks interested in toys but there is more. rxtx has had some of the best guidance in the industry there. This is not an easy thing. I may be able to come back in a month from the other side of the corperate fence and help. I suspect the tests could just be made public but they are in a very unusual environment that just wont work in a wider sense. This is something I'll be trying to change. At one point it was agreed we could just make the results public so this isnt just noise.. There is interest and I think its safe to mention that much. The big problem with testing in the past is most of it is done with a loopback connection. So we *still* have major questions regarding things like flow control. rxtx talks to itself over a loopback and it works. regardless of right or wrong. This requires more thought to be done right. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Feb 7 02:46:34 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 02:46:34 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: > The big problem with testing in the past is most of it is done with a > loopback connection. So we *still* have major questions regarding things > like flow control. rxtx talks to itself over a loopback and it works. > regardless of right or wrong. With serial communication there are gold standards. ckermit is probably a definitive 'standard.' Maybe its possible to do ping/pong tests with ckermit? Is it scriptable? There are known issues in rxtx. Probably the worst is some threading issues regarding some JREs with multiple JNI threads setting java variables. Man did I get schooled there. Just switch the c functions to returning variables and things go away. Sometimes they work fine, sometimes they blow up. Without understanding everything, somehow rhat got it right and debian (and especially gentoo) grabbed kernel patches causing all sort of harm. Its not hard to fix once you understand whats going on but nearly impossible to track with a debugger. So I have a good idea what 2.1-8 will have outside of the IDE modifications. rxtx 2.1-7 is a release for everyone to sync with. Its not even as stable as -pre17 as far as I know - I ran no test suites. I'll be chasing it too. We just had so many contributions that it was time. It seriously broke internal scheduals but thats a great thing :) The other thing I want to do in 2.1-8 is automagic baud rates. It turns out lots of shops are doing really funky baud rates for things like automobile test equipment. It is possible but it requires a fair amount of change in the native code. Is anyone looking at this? -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Feb 7 02:57:21 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 07 Feb 2006 04:57:21 -0500 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <43E85056.2090608@trusted-logic.com> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: Hi All, I agree, testing is very important. The problem I have been trying to address is related to cross-platform testing and the robust nature of the installs. Typically, I visit 3 platforms to deploy my product, windows, linux and mac. A build is performed on each platform. The idea that you can build for many platforms from one copy the source code seems attractive. This should enable synchronized deployments of identical code. The question of how to achieve this goal remains open. As Trent mentioned, this is hard. Perhaps Ant will help here (but perhaps not). Ant does seem to help with running unit tests. However, it does not help with multi-platform tests. For that you need many machines and different operating environments. Toward that end, I have created a multi-platform test that can be run from web start, located at: http://show.docjava.com:8086/book/cgij/code/jnlp/serialPort.PortTest.jnlp This is interesting because many people in the community can run the test and we can improve the test, as time permits. No, it is not a perfect solution, however, the idea does help with multi-platform tests using many machines and different operating environments. If the group has a good test for a general serial port set-ups, i would be happy to deploy it, for general evaluation using web start. And as for ANT, it is just an idea. Not all my ideas are good ones! - Doug >Hello, > >I think that the make-based build process is fine as it is, apart >from the location of the Java >source files. It is true that putting the Java source in a directory >structure that map 1-to-1 to >the Java package structure is the norm and should make it easier for >everyone to modify the Java >source, with or without an IDE. > >Ant is a good tool, but in the RXTX case I fail to see the advantage >of using it compared to the >current make-based process. As Trent said, they are more pressing >issues, like testing. > >Regards, >David > >Dmitry Markman wrote: >> if I understands the issue right >> in order to be able to use ant for c/c++ compilation >> you have to install ant's cc task >> http://ant-contrib.sourceforge.net/cc.html >> >> it looks like it should work on mac os x >> (authors claim, that it's platform independent) >> but I never tested >> >> so all you have to do it's providing right command line >> for the gcc compiler >> >> >> >> >> On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: >> >>>> rxtx_root_directory >>>> `-- src >>>> |-- main >>>> | `-- java >>>> | `-- gnu >>>> | `-- io >>>> `-- test >>>> `-- java >>>> `-- gnu >>>> `-- io >>>> >>> >>> >>>> From what I understand this will just be good. >>> >>> For me it makes no difference. So lets do the rxtx thing. Let if >>> fester for two weeks and if nobody objects, we will do it. >>> >>> I'm not doing this because I care. I'm doing this to eliminate much >>> of my inbox. >>> >>> But test... man is rxtx lacking there in the community aspect. It is >>> covered but not right. _maybe_ I can change that this year. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> (cat hurding since 1997) > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From matt.higgins at gmail.com Tue Feb 7 08:28:34 2006 From: matt.higgins at gmail.com (Matt Higgins) Date: Tue, 7 Feb 2006 10:28:34 -0500 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final Message-ID: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? import java.io.*; import java.util.*; import gnu.io.*; public class MySimpleRead implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; public static void main(String[] args) { boolean portFound = false; String defaultPort = "COM1"; if (args.length > 0) { defaultPort = args[0]; } portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; MySimpleRead reader = new MySimpleRead(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } } public MySimpleRead() { try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) { e.printStackTrace(); } try { inputStream = serialPort.getInputStream(); } catch (IOException e) { e.printStackTrace(); } try { serialPort.addEventListener(this); } catch (TooManyListenersException e) { e.printStackTrace(); } try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { e.printStackTrace(); } System.out.println("Baud is " + serialPort.getBaudRate()); System.out.println("Bits is " + serialPort.getDataBits()); System.out.println("Stop is " + serialPort.getStopBits()); System.out.println("Par is " + serialPort.getParity()); serialPort.notifyOnDataAvailable(true); readThread = new Thread(this); readThread.start(); } public void run() { // Thread.sleep(20000); //} catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { System.out.println("An event occurred " + event.getEventType()); switch (event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: byte[] readBuffer = new byte[20]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } System.out.print(new String(readBuffer)); } catch (IOException e) {} break; } } } --------------- Result on windows ------------------------------ Stable Library ============================================================== Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port:: COM1 Baud is 9600 Bits is 8 Stop is 1 Par is 0 ----------------- End Results ----------------------------------------- ------------------ Result on Linux ----------------------------------- Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 Found port: /dev/ttyS0 Baud is 9600 Bits is 8 Stop is 1 Par is 0 An event occurred 1 043100066224 ------------------ End Results --------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/a1431630/attachment-0050.html From brian at mbari.org Tue Feb 7 09:48:37 2006 From: brian at mbari.org (Brian Schlining) Date: Tue, 7 Feb 2006 08:48:37 -0800 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> Message-ID: <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> Hi Matt > The following code works fine on Linux but I never see any data > when run on Windows. This is a cut and paste from the SimpleRead > example. > I am attempting to read data from a bar code scanner. I can fire > up HyperTermianl on windows and see that the device is working > properly as I see the barcodes are scanned and echoed back to the > terminal. However when I run the app I don't see any data. It is > however associating with the com port as the informational bits > print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. Cheers Brian Schlining Software Engineer http://www.mbari.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/16d07f37/attachment-0050.html From lux at diesel-research.com Tue Feb 7 11:59:58 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 11:59:58 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139293215.3689.4.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> Message-ID: <1139338798.8145.4.camel@zd7280> Any ideas on this ? Any reason why portList.hasMoreElements() should be false even though there are devices in /dev ? On Mon, 2006-02-06 at 23:20 -0700, Kim Lux wrote: > I'm running the code below. > > portlist.hasMoreElements() is false. > > /dev has ports in it as listed below. > > What am I doing wrong ? > > > ========================================================== > // Step through the list of ports until we find one that matches > // the one we are looking for. > > portList = CommPortIdentifier.getPortIdentifiers(); > > while(portList.hasMoreElements()) > { > portID = (CommPortIdentifier) portList.nextElement(); // > if (portID.getName().equals("/dev/ttyUSB0")) > { > myTA.append("Serial port ttyUSB0 has been found\n"); > break; > }// if portID equals... > }// End of while... > ========================================================== > > ls -al /dev/tty* > crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty > crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 > crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 > crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 > crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 > ... > crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 > crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 > crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 > > > -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 12:20:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 12:20:25 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139338798.8145.4.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> Message-ID: On Tue, 7 Feb 2006, Kim Lux wrote: > > Any ideas on this ? Any reason why portList.hasMoreElements() should be > false even though there are devices in /dev ? > > > On Mon, 2006-02-06 at 23:20 -0700, Kim Lux wrote: >> I'm running the code below. >> >> portlist.hasMoreElements() is false. >> >> /dev has ports in it as listed below. >> >> What am I doing wrong ? >> >> >> ========================================================== >> // Step through the list of ports until we find one that matches >> // the one we are looking for. >> >> portList = CommPortIdentifier.getPortIdentifiers(); >> >> while(portList.hasMoreElements()) >> { >> portID = (CommPortIdentifier) portList.nextElement(); // >> if (portID.getName().equals("/dev/ttyUSB0")) >> { >> myTA.append("Serial port ttyUSB0 has been found\n"); >> break; >> }// if portID equals... >> }// End of while... >> ========================================================== >> >> ls -al /dev/tty* >> crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty >> crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 >> crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 >> crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 >> crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 >> ... >> crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 >> crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 >> crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 >> >> >> > Hi Kim What rxtx does is try to open the port and do a timed out read. If the kernel/... do not complain it's enumarted. I suspect you could do a crude test by doing something like cat /dev/ttyS0 > /dev/null If that barfs then rxtx wont enumerate the port. hmm looking at your question again, I suspect it's a lockfile problem. This is documented in INSTALL with the source. Its easy enough to test this too.. touch /var/lock/testingrxtxlockfiles && rm -f /var/lock/testingrxtxlockfiles If you are not in the right group it will bail. Root will work regardless. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 12:37:56 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 12:37:56 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> Message-ID: <1139341076.8145.11.camel@zd7280> Exactly which ports does rxtx attempt to put into the list ? /dev/* or /dev/tty* or /dev/tty[0-9[0-9] ? or /dev/ttyS* ? For the record, only /dev/ttyUSB0 is a valid port on the machine I am presently on. Will this be a problem ? On Tue, 2006-02-07 at 12:20 -0700, Trent Jarvi wrote: > This is documented in INSTALL with the source. > I was wondering where that file was. I will download source and dig it up. Thanks. -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 12:51:09 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 12:51:09 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139341076.8145.11.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: On Tue, 7 Feb 2006, Kim Lux wrote: > > Exactly which ports does rxtx attempt to put into the list ? /dev/* > or /dev/tty* or /dev/tty[0-9[0-9] ? or /dev/ttyS* ? > > For the record, only /dev/ttyUSB0 is a valid port on the machine I am > presently on. Will this be a problem ? > > > On Tue, 2006-02-07 at 12:20 -0700, Trent Jarvi wrote: >> This is documented in INSTALL with the source. >> > I was wondering where that file was. I will download source and dig it > up. > > Thanks. > Hmm I'm looking at pre17 so this may have changed. (its just what I have on this machine) if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA" // for the IPAQs }; CandidatePortPrefixes=Temp; } So you may need to add "ttyUSB" to that list. RXTX used to enumerate _everything_ see if(osName.equals("Linux-all-ports") But it became less than practical. This is all in RXTXCommDriver.java hmm I just did a cvs update. if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have to get your fingers into the code. We aim for sane defaults. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 13:06:45 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 13:06:45 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139342805.8145.22.camel@zd7280> On Tue, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > Hmm I'm looking at pre17 so this may have changed. (its just what I have > on this machine) > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA" // for the IPAQs > }; > CandidatePortPrefixes=Temp; > } > > > So you may need to add "ttyUSB" to that list. RXTX used to enumerate > _everything_ see if(osName.equals("Linux-all-ports") But it became less > than practical. > > This is all in RXTXCommDriver.java > > hmm I just did a cvs update. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have > to get your fingers into the code. We aim for sane defaults. Excellent. Thanks for taking the time. -- Kim Lux, Diesel Research Inc. From ideiglenes1 at freemail.hu Tue Feb 7 13:53:39 2006 From: ideiglenes1 at freemail.hu (--) Date: Tue, 07 Feb 2006 21:53:39 +0100 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139345619.22534.2.camel@localhost> Hi! I use this code to get all the extra Linux devices. :) if ("Linux".equals(System.getProperty("os.name"))) { System.setProperty("os.name","Linux-all-ports"); } driver = new RXTXCommDriver(); On k, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > On Tue, 7 Feb 2006, Kim Lux wrote: > > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have > to get your fingers into the code. We aim for sane defaults. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From matt.higgins at gmail.com Tue Feb 7 13:45:54 2006 From: matt.higgins at gmail.com (Matt Higgins) Date: Tue, 7 Feb 2006 15:45:54 -0500 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> Message-ID: <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> Sweet this is exactly what I needed. I was searching the archives through marc.theamisgroup they only have archives back to 1/3/05. Should have hit the mailman archive! Thanks a lot! On 2/7/06, Brian Schlining wrote: > > Hi Matt > > The following code works fine on Linux but I never see any data when run > on Windows. This is a cut and paste from the SimpleRead example. > I am attempting to read data from a bar code scanner. I can fire up > HyperTermianl on windows and see that the device is working properly as I > see the barcodes are scanned and echoed back to the terminal. However when I > run the app I don't see any data. It is however associating with the com > port as the informational bits print fine? > > > You're not the only one whose had this problem, I don't know if Trent has > addressed this is the latest release of RXTX but there is a workaround. > Here's the recent thread from the RXTX mailing list regarding this issues: > > Thanasis Delenikas tdelenik at gmail.com > Wed Jan 18 13:56:23 MST 2006 > > * Previous message: [Rxtx] Re: More close() performance fixes > * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] > > Hi all. > (I've subscribed again from my other email account). > > Trent, > > You are right. Linux *always* works, no matter what flow control you set. > Windows *works only* with hardware flow control (I haven't tested what > happens with software XON/XOFF flow control). > > I assume (but I am not certain) that even with no flow control at all, all > platforms should work. Without flow control, you have the risk of bumping > into overflow or framing errors, but that's your (the end programmer, I > mean) problem. > > >From my side, I shouldn't be working without flow control. That was a bug > too... It was some code forgotten from the old times, when I used to work > with phone emulation drivers which didn't support flow control. The > correct > way is to have some flow control enabled and that's why I suppose this is > a > low-severity bug for RxTx. > > I have no idea which platform shows the correct behaviour, since > my knowledge about Linux and the inner workings of these low-level i/o > operations is limited. > > Regards, > Thanasis Delenikas. > > > > > Message: 2 > > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > > From: Trent Jarvi > > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > > To: RXTX Developers and Users > > Message-ID: > > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > > > Hi all, > > > > > > Trent, I have found something. > > > I read your comment about flow control, so I experimented a bit. > > > > > > If you remember, in my sample program I've used no flow control at all > ( > > i.e. > > > Java constant FLOWCONTROL_NONE). > > > > > > Now, during testing, I've switch to hardware inbound flow control (i.e > . > > Java > > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > > beautifully! > > > > > > I think I will switch to H/W flow control and test things for a while, > > but > > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > > > > > Hi Thanasis, > > > > I'm fairly sure you have identified a bug. I would not worry too much > > about what Sun CommAPI w32 defaults are. I think they did more or less > > whatever the port opened with. Just a guess. Linux tries to stomp on > > ports so they are all the same. > > > > So this started out with Linux worked, Windows XP/.. did not as I > recall. > > Something is wrong in rxtx. Do I understand this right? > > > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > > > Perhaps there is something Wayne or I did not understand when we wrote > > that code. I wasnt programming back in the BBS days so modems are not > my > > thing. I have a few questions. > > > > Is the above matrix confirmed by observation? > > Linux just always worked? > > Which one _should_ work? I'm guessing modems work with hardware flow > > control. I'll have to dig around. > > > > The windows flow control changes a couple things with hardware flow > > control. Following the w32 API documentation is confusing sometimes. > > But it looks like Linux could have a bug too. > > Cheers > > Brian Schlining > Software Engineer > http://www.mbari.org > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/9c989144/attachment-0050.html From tjarvi at qbang.org Tue Feb 7 14:06:14 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 14:06:14 -0700 (MST) Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> Message-ID: >> >> You're not the only one whose had this problem, I don't know if Trent has >> addressed this is the latest release of RXTX but there is a workaround. >> Here's the recent thread from the RXTX mailing list regarding this issues: >> I have not. I expect to have access to some test equipment next month and I'll go through all of this. I really don't know whats going on and I need a gold standard. I thought maybe linux was autodetecting the flow control. Your observations would certainly be welcome. I need to talk to Russell King and see what he is doing. Until then I'd just be toying around over a loopback as usual. This is very high on the list though. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 17:25:05 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 17:25:05 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139358305.17994.2.camel@zd7280> My application now works. I installed the libraries and jar from 2.1-7 (Final). portlist.hasMoreElements is no longer false. The application finds the port for /dev/ttyUSB0. Thanks for your help, Trent (et al) Sorry I bothered you with this. Next time I will look in the source first. I didn't think it was an rxtx issue, I thought it was a Linux setup issue . On Tue, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > Hmm I'm looking at pre17 so this may have changed. (its just what I > have > on this machine) > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux > Serial Ports > "ttySA" // for the > IPAQs > }; > > CandidatePortPrefixes=Temp; > } > > > So you may need to add "ttyUSB" to that list. RXTX used to enumerate > _everything_ see if(osName.equals("Linux-all-ports") But it became > less > than practical. > > This is all in RXTXCommDriver.java > > hmm I just did a cvs update. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux > Serial Ports > "ttySA", // for the > IPAQs > "ttyUSB" // for USB > frobs > }; > > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you > have > to get your fingers into the code. We aim for sane defaults. -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 19:21:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 19:21:54 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139358305.17994.2.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> <1139358305.17994.2.camel@zd7280> Message-ID: >Sorry I bothered you with this. Next time I will look in the source >first. I didn't think it was an rxtx issue, I thought it was a Linux >setup issue . Why would you be sorry? I would have done the same. I'm glad it's working :) -- Trent Jarvi tjarvi at qbang.org From tma at mail.island.net Wed Feb 8 13:39:35 2006 From: tma at mail.island.net (Tom Alldread) Date: Wed, 08 Feb 2006 12:39:35 -0800 Subject: [Rxtx] Win32/Linux Serial Port Data Dropouts In-Reply-To: <200602060702.k167255O007882@www.qbang.org> References: <200602060702.k167255O007882@www.qbang.org> Message-ID: <43EA5707.4020200@mail.island.net> Greetings Folks at RXTX: During the last couple of months I have been alternately testing with javax.comm 2 and RXTX 2.1 under Windows XP and CommApi 3 and RXTX 2.1 under Suse 10.0 Linux. In the process I have learned a little about java multi-threading under NetBeans 5 with Profiler. My java (jdk 1.5_06) application is used for data acquisition and provides a graphical display of A-D conversion data received from a 56KBaud serial port. The actual data throughput is about 10KBaud thus it is well below the speed of the port. I use hardware RTS/CTS flow control which can stall the data acquisition sample rate if necessary. This ensures the display computer has the ability to slow the data acquisition rate should it become too busy to accept the regular data flow. Both the serial port buffer and the java read buffer are set at 16KB. Usually the data transfers into the java read buffer are less than 100 bytes unless the data acquisition is recovering from a stall. The data flow normally hesitates after each 5 KB block as a continue command is needed from the display computer to start the drawing of a new graphics display line. Separate threads have been provided for the serial port event monitoring and data processing. The serial port event thread has been given the maximum priority and data processing thread the minimum priority provided by java. Thread yield statements have been placed within all data processing while/for loops as an effort to ensure quick access to CPU cycles for the serial port event thread. I have found that short data transmissions are essentially error free but occasional dropouts occur with continuous data flow especially under Windows XP. ....................................................................................................................................................................................... Linux results: I am happy to report that RXTX 2.1 appears to work very well under Linux although I did notice some errors when the screen savers were running with my dual monitors. I believe this is a local problem associated with my dual graphics which needs further attention. The recent CommApi 3 Linux release from Sun did not work at all with my program. It seemed to send commands out OK but did not receive any data. Although the serial port event triggered the ISR, the input stream appeared filled with nulls and thus did not contain any data. As my understanding is that CommApi 3 was tested with a Red Hat distribution of Linux I wonder if this problem is distro dependent? Although somewhat off topic here I wonder if anyone reading this has had similar experience? .................................................................................................................................................................................. Windows XP results: There are problems with occasional data dropouts which become more frequent as the sampling rate is increased or if the computer becomes busy with other duties. The dropouts typically consist of a half dozen byte block of lost data. It appears the lost bytes never get added to the java input stream. There has not been any indication of garbled data, overruns or framing errors which suggests the UART communications remains solid. Using javax.comm 2 I found that the setting of SerialPort 'enableReceiveThreshold' to 40 and 'enableReceiveTimeout' of 100mS reduced the dropouts error rate significantly. I found that I could not get RXTX 2.1 to function with the aforementioned threshold and timeout settings. The javax.comm 2 interface is consequently performing better for me under Windows than RXTX 2.1. I wonder if anyone here has any suggestions as to what I might try to improve RXTX 2.1? Although my settings are the same as under Suse 10.0, RXTX 2.1 performs much better for me under Linux than any of the alternatives that I have tried under Windows XP . ............................................................................................................................................................................... I would like to establish, based on the experience of others, if I have reached the normally expected performance limit of java serial port communications? Should I expect to achieve virtually error free serial port data input from a continuous stream under Windows XP java software? I am considering changing my protocol to packets with error checking if necessary but would like to know if the dropout problems I am experiencing are typical or not before I take this rather work intensive plunge. Many thanks in advance for any help! Best Regards, Tom Alldread -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.375 / Virus Database: 267.15.2/253 - Release Date: 2006-02-07 From jlaxson at mac.com Wed Feb 8 23:56:48 2006 From: jlaxson at mac.com (John Laxson) Date: Thu, 9 Feb 2006 00:56:48 -0600 Subject: [Rxtx] PortInUseException: Unknown Application on OSX Message-ID: Hi, I've been trying to get RXTX 2.1.7 going on Mac OS X for a while here, and am running up into a wall here. I've tried with pre- compiled and the source version and get the same problem, a gnu.io.PortInUseException: Unknown Application. I have run the fixperms script included with the source distribution, and id shows me as a member of the uucp group, and permissions on /var/spool/uucp are 775 root:uucp. Running a test program (included at the bottom for clarity) lets me enumerate all the serial ports correctly, but trying to open any of them gives the PortInUseException. If it helps, when I try to open a port that's set to make an outgoing bluetooth connection, there is no delay and no connection attempt at all. Thanks, John Laxson PS: The documentation wiki on qbang.org shows 404, and has for a few days now. My test code: public static void main(String[] args) { SerialPort serialPort; try { Enumeration e = CommPortIdentifier.getPortIdentifiers(); CommPortIdentifier ident; while (e.hasMoreElements()) { ident = (CommPortIdentifier)e.nextElement(); System.out.println(ident.getName()); } ident = CommPortIdentifier.getPortIdentifier("/dev/cu.modem"); serialPort = (SerialPort) ident.open("Me", 5000); } catch (Exception e) { e.printStackTrace(); } } From rajesh.invincible at gmail.com Thu Feb 9 03:39:38 2006 From: rajesh.invincible at gmail.com (Rajesh N) Date: Thu, 9 Feb 2006 16:09:38 +0530 Subject: [Rxtx] Re: Move .java Files in gnu.io filesystem hierarchy - Maven (2) In-Reply-To: <43DF21D2.7090200@ngi.it> References: <43DF21D2.7090200@ngi.it> Message-ID: <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Can anybody tell me how to overcome these EXCEPTIONS I AM WORKING ON SERIAL COMMN IN JAVA ON LINUX. 1. " NOT ALL PARAMETERS SUPPORTED BY THE KERNEL" This i came across the following statement inmy prog. SerialP is A SerialPort object SerialP.setSerialPortParams(9600(BAUDRATE),DATABITS_8,STOPBITS_1,PARITY_NONE) 2. NullPointer Exception at Event Dispatch Now i have checked all my object references for a null reference but i found none i have put up my entire code in try catch blocks but still I AM UNABLE TO CATCH THIS EXCEPTION AND HENCE MY APPLICATION CLOSES HOW DOES THESE GO? PLEASE HELP ME IT IS URGENTTTTTTTTTTTTTTTT yours sincerely RAJESH On 1/31/06, Fabio Frumento wrote: > Hi Xavier, > > I don't know maven at all but the directory hierarchy listed buy Trent > is fine for me... > > I'll take a look to maven, it seems an interesting project > > Regards > > Fabio Frumento > > Trent Jarvi wrote: > > On Tue, 31 Jan 2006, Xavier Frisaye wrote: > > > >> Hi all, > >> > >> If you are going to rearrange the src folder, i will propose to use > >> maven 2 and follow its directory structure > >> > (http://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html). > >> > >> Maven 2 simplify java project and give a standard way to make projects > >> (http://maven.apache.org/). > >> We are using it for internal projects and we are very satisfied. > >> > >> Is anybody interested? > >> > >> I'm not an expert in maven 2 (yet) but i'm agree to help using it if > >> you choose to make so. > >> > > > > so this would be: > > > > rxtx-devel/src/main/java/gnu.io > > rxtx-devel/src/test/java/ManIwish.java > > > > I don't use IDEs very much so I'll let others comment. But I don't see > > a problem with that. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Thu Feb 9 09:50:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 9 Feb 2006 09:50:31 -0700 (MST) Subject: [Rxtx] Re: Move .java Files in gnu.io filesystem hierarchy - Maven (2) In-Reply-To: <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Message-ID: On Thu, 9 Feb 2006, Rajesh N wrote: > Can anybody tell me how to overcome these EXCEPTIONS > I AM WORKING ON SERIAL COMMN IN JAVA ON LINUX. > > 1. " NOT ALL PARAMETERS SUPPORTED BY THE KERNEL" > > This i came across the following statement inmy prog. > SerialP is A SerialPort object > SerialP.setSerialPortParams(9600(BAUDRATE),DATABITS_8,STOPBITS_1,PARITY_NONE) > Strange. The parameters you use are the same the port should open with by default. Could you paste the actual exception you are getting? I don't see that in the rxtx source. Also it would help to know the rxtx version. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Fri Feb 10 15:29:05 2006 From: lux at diesel-research.com (Kim Lux) Date: Fri, 10 Feb 2006 15:29:05 -0700 Subject: [Rxtx] One serial port object for both sending and receiving ? Message-ID: <1139610545.18177.4.camel@zd7280> Is it OK to use one SerialPort ojbect (ex Serial Port serialPort;) and use it for both sending and receiving ? For example: ======================================================================== static SerialPort serialPort = null; static OutputStream serialOut = null; static InputStream serialIn = null; // assign it to an outputStream for use try{ serialOut = serialPort.getOutputStream(); System.out.println("Serial output stream has been assigned."); }//try catch(IOException e) { System.out.println("Error: Couldn't assign output stream to serial port."); }//catch //assign it to an inputStream for use try{ serialIn = serialPort.getInputStream(); System.out.println("Serial input stream has been assigned."); }//try catch(IOException e) { System.out.println("Error: Couldn't assign input stream to serial port."); }//catch ======================================================================== -- Kim Lux, Diesel Research Inc. From lux at diesel-research.com Fri Feb 10 21:23:00 2006 From: lux at diesel-research.com (Kim Lux) Date: Fri, 10 Feb 2006 21:23:00 -0700 Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Message-ID: <1139631780.23882.10.camel@zd7280> I've got a problem receiving chars with my version of serialRead, written in an SWT GUI. I had a Java pro have a good look at my code and he can't see anything wrong with it. I can send chars fine. When I receive a char the cpu usage for the app goes to 100% and the code in the serial event handler doesn't get executed. The instructions on the Java Comm Serial API How-To for Linux page state that I must install javacomm. Is that true ? Everything builds without it and I can send chars on rxtx just fine, but I can't receive them. Could this be the problem ? I downloaded and installed javacomm. I was not able to add "Driver=gnuio.RXTXCommDriver to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 installed in /usr/java/jre1.5.0_05. I added comm.jar to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext to the library paths. Is this OK ? Does it matter that I am receiving on /dev/ttyUSB0 ? Thanks. -- Kim Lux, Diesel Research Inc. From lunareclipse03 at web.de Sat Feb 11 09:44:46 2006 From: lunareclipse03 at web.de (lunareclipse03@web.de) Date: Sat, 11 Feb 2006 17:44:46 +0100 Subject: [Rxtx] Question about Serial I/O under Win32 Message-ID: <662084330@web.de> Hello everybody, I have a strange problem with a piece of code I made for myself. No, this is not really concerning rxtx, but nevertheless I post this to the list, hoping that some of you can help me. I've written two libraries, one for linux and one for win32. The linux port works quite well, I can send / receive faxes and / or replay voice messages over the telephone line using a voice modem. But the win32 port of the library causes some trouble. If, for example, I send out a fax with a certain modem under linux, it works well. The fax is complete when it comes out of the fax machine. If I then use the same modem to send out a fax under win32, the fax coming out of the fax machine gets "stuck" halfways, but the sending modem thinks that transmission was ok and drops the connection. The answering fax machine then gives me "error while receiving." The "upper layer" java code MUST be right, because if I do the same thing under linux (using the linux library), everything is alright. Now I have to ask: Can somebody please help me out with this??!? Could it be the case that some kind of flow control or COMMTIMEOUTS setting causes this behaviour? I set flow control to RTS/CTS before sending out a fax. How can I DISABLE flow control? Or what do you think? Can something else cause this problems? Thank you all for your time and PLEASE write back soon. Regards, --Sven Ahlemann Am Waldrand 31 45721 Haltern am See Germany ______________________________________________________________ Verschicken Sie romantische, coole und witzige Bilder per SMS! Jetzt bei WEB.DE FreeMail: http://f.web.de/?mc=021193 From lux at diesel-research.com Sat Feb 11 10:06:52 2006 From: lux at diesel-research.com (Kim Lux) Date: Sat, 11 Feb 2006 10:06:52 -0700 Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: <1139631780.23882.10.camel@zd7280> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> <1139631780.23882.10.camel@zd7280> Message-ID: <1139677612.3431.5.camel@zd7280> More on this problem. I copied and pasted simpleRead into a console based Eclipse project and I've got the same result, except that cpu usage doesn't go to 100%. I'm beginning to think there is an issue in rxtx. My imports for simpleRead are: ============================ import gnu.io.*; import java.util.*; //import javax.comm.*; import java.io.*; =========================== Any ideas ? I am trying to read from /dev/ttyUSB0 using a serial to USB adapter which has worked well with minicom and gtkterm. Thanks. On Fri, 2006-02-10 at 21:23 -0700, Kim Lux wrote: > I've got a problem receiving chars with my version of serialRead, > written in an SWT GUI. > > I had a Java pro have a good look at my code and he can't see anything > wrong with it. > > I can send chars fine. When I receive a char the cpu usage for the app > goes to 100% and the code in the serial event handler doesn't get > executed. > > The instructions on the Java Comm Serial API How-To for Linux page state > that I must install javacomm. Is that true ? Everything builds without > it and I can send chars on rxtx just fine, but I can't receive them. > Could this be the problem ? > > I downloaded and installed javacomm. I was not able to add > "Driver=gnuio.RXTXCommDriver > to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not > have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 > installed in /usr/java/jre1.5.0_05. I added comm.jar > to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext > to the library paths. Is this OK ? > > Does it matter that I am receiving on /dev/ttyUSB0 ? > > Thanks. > -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Sun Feb 12 21:01:33 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:01:33 -0700 (MST) Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: <1139677612.3431.5.camel@zd7280> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> <1139631780.23882.10.camel@zd7280> <1139677612.3431.5.camel@zd7280> Message-ID: I suspect what is happening is the select() is breaking out in the native code but the driver does not have support for notifying there are X bytes available. On some traditional Unix based systems, the only way you know data is available is the fd status changes and do an FIORDCHK ioctl. Or perhaps the only thing you can know is the fd status changed. It would take reading through the kernel driver code to know for sure. So on USB, depending upon the driver, the same may need to be done or the driver improved a bit if possible to support. Polling reads will also work but don't use the event driven model of CommAPI which isnt acceptable in the long run. The 100% cpu usage can then be explained because select no longer blocks until the data is read; the eventLoop spins loose. You can put a well placed sleep but rxtx only expects those are needed when it knows data is available. This may not be a super simple thing to understand and fix. I do have ideas to get you started. I'm going to be short on time the next couple weeks. I expect to put some good time in and answer some other questions I saw around the 25th. For now, I'd look at the following and go from there with the hints I've given. JNIEXPORT jint JNICALL RXTXPort(nativeavailable)( JNIEnv *env, jobject jobj ) { int fd = get_java_var( env, jobj,"fd","I" ); int result; /* char message[80]; ENTER( "RXTXPort:nativeavailable" ); On SCO OpenServer FIONREAD always fails for serial devices, so try ioctl FIORDCHK instead; will only tell us whether bytes are available, not how many, but better than nothing. This turns out to be true on Solaris also. taj. */ #ifdef FIORDCHK /* __unixware__ __sun__ probably others */ result = ioctl(fd, FIORDCHK, 0); #else if( ioctl( fd, FIONREAD, &result ) < 0 ) { goto fail; } #endif /* FIORDCHK */ On Sat, 11 Feb 2006, Kim Lux wrote: > > More on this problem. I copied and pasted simpleRead into a console > based Eclipse project and I've got the same result, except that cpu > usage doesn't go to 100%. I'm beginning to think there is an issue in > rxtx. > > My imports for simpleRead are: > > ============================ > import gnu.io.*; > import java.util.*; > //import javax.comm.*; > import java.io.*; > =========================== > > Any ideas ? I am trying to read from /dev/ttyUSB0 using a serial to > USB adapter which has worked well with minicom and gtkterm. > > Thanks. > > > > On Fri, 2006-02-10 at 21:23 -0700, Kim Lux wrote: >> I've got a problem receiving chars with my version of serialRead, >> written in an SWT GUI. >> >> I had a Java pro have a good look at my code and he can't see anything >> wrong with it. >> >> I can send chars fine. When I receive a char the cpu usage for the app >> goes to 100% and the code in the serial event handler doesn't get >> executed. >> >> The instructions on the Java Comm Serial API How-To for Linux page state >> that I must install javacomm. Is that true ? Everything builds without >> it and I can send chars on rxtx just fine, but I can't receive them. >> Could this be the problem ? >> >> I downloaded and installed javacomm. I was not able to add >> "Driver=gnuio.RXTXCommDriver >> to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not >> have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 >> installed in /usr/java/jre1.5.0_05. I added comm.jar >> to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext >> to the library paths. Is this OK ? >> >> Does it matter that I am receiving on /dev/ttyUSB0 ? >> >> Thanks. >> > From tjarvi at qbang.org Sun Feb 12 21:03:30 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:03:30 -0700 (MST) Subject: [Rxtx] One serial port object for both sending and receiving ? In-Reply-To: <1139610545.18177.4.camel@zd7280> References: <1139610545.18177.4.camel@zd7280> Message-ID: On Fri, 10 Feb 2006, Kim Lux wrote: > > Is it OK to use one SerialPort ojbect (ex Serial Port serialPort;) and > use it for both sending and receiving ? > > For example: > > ======================================================================== > static SerialPort serialPort = null; > static OutputStream serialOut = null; > static InputStream serialIn = null; > > > > > // assign it to an outputStream for use > try{ > serialOut = serialPort.getOutputStream(); > System.out.println("Serial output stream has been assigned."); > }//try > catch(IOException e) > { > System.out.println("Error: Couldn't assign output stream to serial > port."); > }//catch > > > //assign it to an inputStream for use > try{ > serialIn = serialPort.getInputStream(); > System.out.println("Serial input stream has been assigned."); > }//try > catch(IOException e) > { > System.out.println("Error: Couldn't assign input stream to serial > port."); > }//catch This should be fine. In fact trying to do it another way will probably not work as you will run into lockfile issues. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun Feb 12 21:13:13 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:13:13 -0700 (MST) Subject: [Rxtx] Question about Serial I/O under Win32 In-Reply-To: <662084330@web.de> References: <662084330@web.de> Message-ID: On Sat, 11 Feb 2006 lunareclipse03 at web.de wrote: > Hello everybody, > > I have a strange problem with a piece of code I made for myself. No, > this is not really concerning rxtx, but nevertheless I post this to the > list, hoping that some of you can help me. I've written two libraries, > one for linux and one for win32. The linux port works quite well, I can > send / receive faxes and / or replay voice messages over the telephone > line using a voice modem. But the win32 port of the library causes some > trouble. If, for example, I send out a fax with a certain modem under > linux, it works well. The fax is complete when it comes out of the fax > machine. If I then use the same modem to send out a fax under win32, the > fax coming out of the fax machine gets "stuck" halfways, but the sending > modem thinks that transmission was ok and drops the connection. The > answering fax machine then gives me "error while receiving." The "upper > layer" java code MUST be right, because if I do the same thing under > linux (using the linux library), everything is alright. Now I have to > ask: Can somebody please help me out with this??!? Could it be the case > that some kind of flow control or COMMTIMEOUTS setting causes this > behaviour? I set flow control to RTS/CTS before sending out a fax. How > can I DISABLE flow control? Or what do you think? Can something else > cause this problems? Thank you all for your time and PLEASE write back > soon. > Hi Sven I'm not too willing to talk about flow control at the low level until I confirm some things with test equipment later. It is not clear if you are using rxtx or writing your own native code. So I'm not sure how to answer much of this :) If you are wondering how to change the flow control using rxtx from java, The BlackBox example from Sun flips this back and forth. SerialPort.java in rxtx 2.1 uses the following: SerialPort.java: public static final int FLOWCONTROL_NONE =0; SerialPort.java: public static final int FLOWCONTROL_RTSCTS_IN =1; SerialPort.java: public static final int FLOWCONTROL_RTSCTS_OUT =2; SerialPort.java: public static final int FLOWCONTROL_XONXOFF_IN =4; SerialPort.java: public static final int FLOWCONTROL_XONXOFF_OUT=8; So if you set flowcontrol to RTSCTS, you can set it to NONE to turn it off. If you are looking for how to do it in native code, the rxtx Source is SerialImp.c (unix/linux/mac os x/w32) and termios.c (w32 only with SerialImp.c) You can track the code: SerialImp.c:JNIEXPORT void JNICALL RXTXPort(setflowcontrol)( JNIEnv *env, jobject jobj, jint flowmode ) termios.c:int tcgetattr( int fd, struct termios *s_termios ) termios.c:int tcsetattr( int fd, int when, struct termios *s_termios ) There may be a problem in the rxtx flow control code though. Rather than guess, I want to test this with a gold standard. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Feb 6 00:00:16 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 00:00:16 -0700 (MST) Subject: [Rxtx] wiki delay until tomorrow night. In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: On Sun, 5 Feb 2006, Trent Jarvi wrote: > On Sun, 5 Feb 2006, Kim Lux wrote: > >> usb ? Tell me more... I need that too. > > usb is a very proper design. Thats all it is. > Maybe rxtx could help usb. But it would start with helping bring back the community that was already there. It's not something I'd love to do but maybe its the right thing to do. It would probably take 2 years to do right. But maybe thats better than what we have now. I honestly don't know what IBM is doing which could just run over everything. Just some thoughts after some fine german wine. -- Trent Jarvi tjarvi at qbang.org From gadelavega at yahoo.com.ar Mon Feb 6 02:17:05 2006 From: gadelavega at yahoo.com.ar (Gonzalo A. de la Vega) Date: Mon, 06 Feb 2006 10:17:05 +0100 Subject: [Rxtx] Serial port ownership question In-Reply-To: References: <20060205113618.30274.qmail@web53501.mail.yahoo.com> <1139157422.4553.9.camel@zd7280> <1139158698.4936.9.camel@zd7280> Message-ID: <43E71411.4050402@yahoo.com.ar> On my Fedora Core 4: ls -l /dev/ttyS* crw-rw---- 1 root uucp 4, 64 Feb 6 2006 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Feb 6 2006 /dev/ttyS1 ... and: grep "ttyUSB" /etc/udev/rules.d/50-udev.rules KERNEL=="ttyUSB*", GROUP="uucp", MODE="0660" So anyone in the "uucp" group can use serial ports. On Gentoo the group is "tty". Trent Jarvi escribi?: > > > On Sun, 5 Feb 2006, Dr. Douglas Lyon wrote: > >> I can confirm that this is the case (only root ownership of >> serial ports, under fedora 4). >> Wow, what were they thinking?! >> - DL >> >>> I've found that the newer kernels have the serial ports owned by root. >>> For example, >>> >>> $ls -al /dev/tty* >>> crw-rw-rw- 1 root root 5, 0 Feb 5 02:06 /dev/tty >>> crw-rw---- 1 root root 4, 0 Feb 5 02:06 /dev/tty0 >>> crw------- 1 root root 4, 1 Feb 5 09:07 /dev/tty1 >>> crw-rw---- 1 root tty 4, 10 Feb 5 02:06 /dev/tty10 >>> crw-rw---- 1 root tty 4, 11 Feb 5 02:06 /dev/tty11 >>> ... > > > This is just not a problem jcp or such are going to solve. Its a > platform spitwad fight. But do look at pam. In fact thats what Sun > is doing too. Maybe Linux followed their lead.. I'm not a pam guy. > I've spent 16 hours trying to understand it but your users wont :) > > Solution? I have no clue. Its two tangent mentalities from my > perspective. > > -- > Trent Jarvi > tjarvi at qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mtnvega at yahoo.com.br Mon Feb 6 05:35:43 2006 From: mtnvega at yahoo.com.br (Luiz Jr) Date: Mon, 6 Feb 2006 12:35:43 +0000 (GMT) Subject: [Rxtx] Documentation Wiki In-Reply-To: <1139157422.4553.9.camel@zd7280> Message-ID: <20060206123543.57256.qmail@web53515.mail.yahoo.com> Hello, Thank you for you answer, but so the usage of the API is pretty much like the Java Communications Api? If yes, what version of the Java Comm Api? Thank you, Luiz A. Brandao Jr Kim Lux escreveu: On Sun, 2006-02-05 at 08:36 -0300, Luiz Jr wrote: > Hello, > > I want to start using the RXTX libraries, but I would to know how, > since I can not access the documentation wiki page I just started using them yesterday. Below is how I installed the libraries, if that helps. I used snippets of code from the SimpleWrite application here to get me going. http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html Instead of "import javax.comm.*;", use "import gnu.io.*;" which is gotten from RXTXcomm.jar, which you will need to include in your project references. I am working in Eclipse. BTW: there is no way to open a port without going through the port list and finding it. Maybe sometime in the future someone (me ?) will write a method called openSerialPort that allows the user to give a port identifier, such as "/dev/tty1" and return a port ready to use. It wouldn't take much to write that and it would save users a lot of code. Hope this helps. ======================================================================= 1) Figure out which java you are running, incase there is more than one installed. $ java -version java version "1.5.0_05" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_05-b05) Java HotSpot(TM) Client VM (build 1.5.0_05-b05, mixed mode, sharing) 2) Find all the jre directories and the one from which you are currently running. kfind (jre) 3) cd to that directory plus /lib/i386 cd /usr/java/jre1.5.0_05/lib/i386 4) Copy the library files (*.so) to that directory. cp /home/krlux/Desktop/'Java Controls'/rxtx-linux/bin/* . 5) Check that the copy was successful ls librxtx* librxtxI2C.so librxtxRaw.so librxtxSerial.so librxtxParallel.so librxtxRS485.so 6) cd to the /lib/ext directory for your java. cd /usr/java/jre1.5.0_05/lib/ext 7) Copy the Jar files there cp /home/krlux/Desktop/'Java Controls'/rxtx-linux/lib/ext/* . 8) Check that it was successful ls RXTX* RXTXcomm.jar Rxtx is now installed on your machine ready to use. =================================================================== -- Kim Lux, Diesel Research Inc. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx --------------------------------- Yahoo! Acesso Gr?tis - Internet r?pida e gr?tis. Instale o discador agora! -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/544aa403/attachment-0051.html From lyon at docjava.com Mon Feb 6 05:49:34 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 06 Feb 2006 07:49:34 -0500 Subject: [Rxtx] wiki delay until tomorrow night. In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: Hi All, I have often thought about USB drivers being needed. For example, the ironman watch will not interface to a mac (windows only). It is USB. My dymo label writer has no Java driver (native only). Etc. Most cheap web cameras are USB (and Java drivers go through JAI, if it supports the camera at all). The JAI code shows how sun did the USB drivers. You have to be a member of the jai project to download the source code. https://jai.dev.java.net has the jai distro. And then you are not allowed to redistribute it. However, we can all learn from it (if so inclined). Basically: cvs -d :pserver:lyon at cvs.dev.java.net:/cvs login cvs -d :pserver:lyon at cvs.dev.java.net:/cvs checkout jai-core You will need to user your own uid and pw to get in. The ant build has over 100 warnings from sun deprecations of its own code. You might say that they were hoisted on their own Picard ;) One interesting thing is that they support several platforms: linux-amd64 64-bit Linux-AMD64 linux-i586 32-bit Linux-x86 solaris-amd64 64-bit Solaris-AMD64 solaris-i586 32-bit Solaris-x86 solaris-sparc 32-bit Solaris-SPARC solaris-sparcv9 64-bit Solaris-SPARC windows-i586 32-bit Windows-x86 Thus, ant is used to provide a multi-platform native method distro. Neat. How do they do it? check this out: And: The core download does not contain any C source code (it was all pre-built). Basically, they are just copying .so and .dll files into build directories. I would love to see the C code for this...but Sun does not post it on the https://jai.dev.java.net site. I don't know why...Perhaps I missed it. - Doug >On Sun, 5 Feb 2006, Trent Jarvi wrote: > >>On Sun, 5 Feb 2006, Kim Lux wrote: >> >>>usb ? Tell me more... I need that too. >> >>usb is a very proper design. Thats all it is. >> > >Maybe rxtx could help usb. But it would start with helping bring >back the community that was already there. > >It's not something I'd love to do but maybe its the right thing to do. > >It would probably take 2 years to do right. But maybe thats better >than what we have now. > >I honestly don't know what IBM is doing which could just run over everything. > >Just some thoughts after some fine german wine. > >-- >Trent Jarvi >tjarvi at qbang.org > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tdelenik at gmail.com Mon Feb 6 05:56:32 2006 From: tdelenik at gmail.com (Thanasis Delenikas) Date: Mon, 6 Feb 2006 14:56:32 +0200 Subject: Fwd: [Rxtx] Documentation Wiki In-Reply-To: <1139157422.4553.9.camel@zd7280> References: <20060205113618.30274.qmail@web53501.mail.yahoo.com> <1139157422.4553.9.camel@zd7280> Message-ID: <310a1a930602060456t129f1dc6p5f2b908f13ab5a0b@mail.gmail.com> Hello all, Kim, this is a snippet from the code I use. The closest to directly opening a specific port without enumeration. << ... portId = CommPortIdentifier.getPortIdentifier(getPort()); serialPort = (SerialPort) portId.open("jSMSEngine", 1971); ... >> where getPort() return the string identifier of the port, i.e. "/dev/ttyS0" or "COM1" or whatever. Thanasis. ---------- Forwarded message ---------- From: Kim Lux Date: Feb 5, 2006 6:37 PM Subject: Re: [Rxtx] Documentation Wiki To: RXTX Developers and Users BTW: there is no way to open a port without going through the port list and finding it. Maybe sometime in the future someone (me ?) will write a method called openSerialPort that allows the user to give a port identifier, such as "/dev/tty1" and return a port ready to use. It wouldn't take much to write that and it would save users a lot of code. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/182ab5b8/attachment-0051.html From tjarvi at qbang.org Mon Feb 6 11:53:57 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 11:53:57 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: On Mon, 6 Feb 2006, Dr. Douglas Lyon wrote: > Hi All, > I have often thought about USB drivers being needed. > For example, the ironman watch will not interface > to a mac (windows only). It is USB. > My dymo label writer has no Java driver (native only). > Etc. > Most cheap web cameras are USB (and Java drivers go > through JAI, if it supports the camera at all). > The JAI code shows how sun did the USB drivers. > You have to be a member of the jai project to download > the source code. > https://jai.dev.java.net has the jai distro. > And then you are not allowed to redistribute it. However, > we can all learn from it (if so inclined). Basically: > cvs -d :pserver:lyon at cvs.dev.java.net:/cvs login > cvs -d :pserver:lyon at cvs.dev.java.net:/cvs checkout jai-core > You will need to user your own uid and pw to get in. > The ant build has over 100 warnings from sun deprecations > of its own code. > > You might say that they were hoisted on their own Picard ;) > > One interesting thing is that they support several platforms: > linux-amd64 64-bit Linux-AMD64 > linux-i586 32-bit Linux-x86 > solaris-amd64 64-bit Solaris-AMD64 > solaris-i586 32-bit Solaris-x86 > solaris-sparc 32-bit Solaris-SPARC > solaris-sparcv9 64-bit Solaris-SPARC > windows-i586 32-bit Windows-x86 > Thus, ant is used to provide a multi-platform native method distro. > Neat. > How do they do it? > check this out: > > > > > > > > > > > > > And: > > > > > > > > > > The core download does not contain any C source code (it was all pre-built). > Basically, they are just copying .so and .dll files into build directories. > > I would love to see the C code for this...but Sun does not post it on the > https://jai.dev.java.net site. > > I don't know why...Perhaps I missed it. > > - Doug > > I've looked at moving rxtx to Ant builds. I think that would help IDEs a great deal. I requested a evalutation desk copy the O'Reilly Ant book for some j2ee material I was teaching. http://www.oreilly.com/catalog/anttdg/ It has a one sentence mention of JNI. So there was not luck there. I saw that there is another Ant book that does mention JNI more. I can't find it now. Ant must be able to support it with extensions. http://ant.apache.org/manual/OptionalTasks/javah.html What the auto(break :) tools do in the rxtx build is 4 things really. 1) gcc compile flags 2) ld compile flags 3) config.h 4) compile flags for customizing rxtx (lockfiles, ...) See 1 All of this information except 4 can be static once obtained. So I'm not attached to the auto tools. If I could find an example of Ant being used for JNI code, I'd be one of the first to start moving that direction. Maybe someone saw an example someplace. The other thing we have not completed discussing is the directory structure. There is interest in making rxtx more IDE friendly. I get more mail about that off the list than how to install rxtx. And I see we have Ken Thompson in da house :) He is our trusted CVS maintainer and the guy that purchased the rxtx.org domain. Old community. We will need Ken for changing the directory structure of source. I would like to open up discussion about both of these as it is more than time. The problem is I have little experience with Ant and even less with IDEs. It would be nice if we could work with Eclipse and NetBeans. http://www.netbeans.org/ (sun and some community) http://www.eclipes.org (ibm,rhat,... perhaps more community) http://maven.apache.org/what-is-maven.html (apache. It is community) borland should sortof be here too but I think thats covered in eclipse. >From what I understand so far, we should morph rxtx to support those three maybe trusting apaches lead with maven. But I use vi. I have little to no clues beyond what people have fed me. Can we agree that thats the right direction to go? -- Trent Jarvi tjarvi at qbang.org From brian at mbari.org Mon Feb 6 14:57:50 2006 From: brian at mbari.org (Brian Schlining) Date: Mon, 6 Feb 2006 13:57:50 -0800 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> > The other thing we have not completed discussing is the directory > structure. There is interest in making rxtx more IDE friendly. I > get more mail about that off the list than how to install rxtx. > > And I see we have Ken Thompson in da house :) He is our trusted > CVS maintainer and the guy that purchased the rxtx.org domain. Old > community. We will need Ken for changing the directory structure of > source. > > I would like to open up discussion about both of these as it is > more than time. The problem is I have little experience with Ant > and even less with IDEs. It would be nice if we could work with > Eclipse and NetBeans. > > http://www.netbeans.org/ (sun and some community) > http://www.eclipes.org (ibm,rhat,... perhaps more community) > http://maven.apache.org/what-is-maven.html (apache. It is community) > borland should sortof be here too but I think thats covered in > eclipse. > >> From what I understand so far, we should morph rxtx to support >> those three > maybe trusting apaches lead with maven. But I use vi. I have > little to no clues beyond what people have fed me. > Maven likes the directory structure below for Java code. (From http:// maven.apache.org/guides/getting-started/index.html) This structure works fine with ant, netbeans, and eclipse. rxtx_root_directory `-- src |-- main | `-- java | `-- gnu | `-- io `-- test `-- java `-- gnu `-- io Brian Schlining Software Engineer http://www.mbari.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/d9451eba/attachment-0051.html From tjarvi at qbang.org Mon Feb 6 15:11:45 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 15:11:45 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: > rxtx_root_directory > `-- src > |-- main > | `-- java > | `-- gnu > | `-- io > `-- test > `-- java > `-- gnu > `-- io > >From what I understand this will just be good. For me it makes no difference. So lets do the rxtx thing. Let if fester for two weeks and if nobody objects, we will do it. I'm not doing this because I care. I'm doing this to eliminate much of my inbox. But test... man is rxtx lacking there in the community aspect. It is covered but not right. _maybe_ I can change that this year. -- Trent Jarvi tjarvi at qbang.org (cat hurding since 1997) From lux at diesel-research.com Mon Feb 6 21:38:49 2006 From: lux at diesel-research.com (Kim Lux) Date: Mon, 06 Feb 2006 21:38:49 -0700 Subject: [Rxtx] How can I use Lock Files with rxtx (in FC4) ? Message-ID: <1139287129.17031.3.camel@zd7280> I am now running an rxtx application on FC4. I am getting: ========================================================= check_group_uucp(): error testing lock file creation Error details: Permission denied check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL ========================================================= $ ls -al /var/lock total 32 drwxrwxr-x 4 root lock 4096 Feb 6 16:04 . drwxr-xr-x 24 root root 4096 Nov 14 01:19 .. drwx------ 2 root root 4096 Apr 27 2005 lvm drwxr-xr-x 2 root root 4096 Feb 6 16:04 subsys How do I fix this for regulator users ? -- Kim Lux, Diesel Research Inc. From dmarkman at mac.com Mon Feb 6 22:24:44 2006 From: dmarkman at mac.com (Dmitry Markman) Date: Tue, 7 Feb 2006 00:24:44 -0500 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: if I understands the issue right in order to be able to use ant for c/c++ compilation you have to install ant's cc task http://ant-contrib.sourceforge.net/cc.html it looks like it should work on mac os x (authors claim, that it's platform independent) but I never tested so all you have to do it's providing right command line for the gcc compiler On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: >> rxtx_root_directory >> `-- src >> |-- main >> | `-- java >> | `-- gnu >> | `-- io >> `-- test >> `-- java >> `-- gnu >> `-- io >> > > >> From what I understand this will just be good. > > For me it makes no difference. So lets do the rxtx thing. Let if > fester for two weeks and if nobody objects, we will do it. > > I'm not doing this because I care. I'm doing this to eliminate > much of my inbox. > > But test... man is rxtx lacking there in the community aspect. It > is covered but not right. _maybe_ I can change that this year. > > -- > Trent Jarvi > tjarvi at qbang.org > (cat hurding since 1997) > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx Dmitry Markman From lux at diesel-research.com Mon Feb 6 23:20:15 2006 From: lux at diesel-research.com (Kim Lux) Date: Mon, 06 Feb 2006 23:20:15 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? Message-ID: <1139293215.3689.4.camel@zd7280> I'm running the code below. portlist.hasMoreElements() is false. /dev has ports in it as listed below. What am I doing wrong ? ========================================================== // Step through the list of ports until we find one that matches // the one we are looking for. portList = CommPortIdentifier.getPortIdentifiers(); while(portList.hasMoreElements()) { portID = (CommPortIdentifier) portList.nextElement(); // if (portID.getName().equals("/dev/ttyUSB0")) { myTA.append("Serial port ttyUSB0 has been found\n"); break; }// if portID equals... }// End of while... ========================================================== ls -al /dev/tty* crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 ... crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 -- Kim Lux, Diesel Research Inc. From david.garnier at trusted-logic.com Tue Feb 7 00:46:30 2006 From: david.garnier at trusted-logic.com (David Garnier) Date: Tue, 07 Feb 2006 08:46:30 +0100 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: <43E85056.2090608@trusted-logic.com> Hello, I think that the make-based build process is fine as it is, apart from the location of the Java source files. It is true that putting the Java source in a directory structure that map 1-to-1 to the Java package structure is the norm and should make it easier for everyone to modify the Java source, with or without an IDE. Ant is a good tool, but in the RXTX case I fail to see the advantage of using it compared to the current make-based process. As Trent said, they are more pressing issues, like testing. Regards, David Dmitry Markman wrote: > if I understands the issue right > in order to be able to use ant for c/c++ compilation > you have to install ant's cc task > http://ant-contrib.sourceforge.net/cc.html > > it looks like it should work on mac os x > (authors claim, that it's platform independent) > but I never tested > > so all you have to do it's providing right command line > for the gcc compiler > > > > > On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: > >>> rxtx_root_directory >>> `-- src >>> |-- main >>> | `-- java >>> | `-- gnu >>> | `-- io >>> `-- test >>> `-- java >>> `-- gnu >>> `-- io >>> >> >> >>> From what I understand this will just be good. >> >> For me it makes no difference. So lets do the rxtx thing. Let if >> fester for two weeks and if nobody objects, we will do it. >> >> I'm not doing this because I care. I'm doing this to eliminate much >> of my inbox. >> >> But test... man is rxtx lacking there in the community aspect. It is >> covered but not right. _maybe_ I can change that this year. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> (cat hurding since 1997) From tjarvi at qbang.org Tue Feb 7 01:11:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 01:11:31 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <43E85056.2090608@trusted-logic.com> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: On Tue, 7 Feb 2006, David Garnier wrote: > Hello, > > I think that the make-based build process is fine as it is, apart from the location of the Java > source files. It is true that putting the Java source in a directory structure that map 1-to-1 to > the Java package structure is the norm and should make it easier for everyone to modify the Java > source, with or without an IDE. > > Ant is a good tool, but in the RXTX case I fail to see the advantage of using it compared to the > current make-based process. As Trent said, they are more pressing issues, like testing. > Hi David I have more experience with testing rxtx than I can talk about. But let it be known, rxtx has gone trough 100's of hours of testing. We are hobby folks interested in toys but there is more. rxtx has had some of the best guidance in the industry there. This is not an easy thing. I may be able to come back in a month from the other side of the corperate fence and help. I suspect the tests could just be made public but they are in a very unusual environment that just wont work in a wider sense. This is something I'll be trying to change. At one point it was agreed we could just make the results public so this isnt just noise.. There is interest and I think its safe to mention that much. The big problem with testing in the past is most of it is done with a loopback connection. So we *still* have major questions regarding things like flow control. rxtx talks to itself over a loopback and it works. regardless of right or wrong. This requires more thought to be done right. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Feb 7 02:46:34 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 02:46:34 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: > The big problem with testing in the past is most of it is done with a > loopback connection. So we *still* have major questions regarding things > like flow control. rxtx talks to itself over a loopback and it works. > regardless of right or wrong. With serial communication there are gold standards. ckermit is probably a definitive 'standard.' Maybe its possible to do ping/pong tests with ckermit? Is it scriptable? There are known issues in rxtx. Probably the worst is some threading issues regarding some JREs with multiple JNI threads setting java variables. Man did I get schooled there. Just switch the c functions to returning variables and things go away. Sometimes they work fine, sometimes they blow up. Without understanding everything, somehow rhat got it right and debian (and especially gentoo) grabbed kernel patches causing all sort of harm. Its not hard to fix once you understand whats going on but nearly impossible to track with a debugger. So I have a good idea what 2.1-8 will have outside of the IDE modifications. rxtx 2.1-7 is a release for everyone to sync with. Its not even as stable as -pre17 as far as I know - I ran no test suites. I'll be chasing it too. We just had so many contributions that it was time. It seriously broke internal scheduals but thats a great thing :) The other thing I want to do in 2.1-8 is automagic baud rates. It turns out lots of shops are doing really funky baud rates for things like automobile test equipment. It is possible but it requires a fair amount of change in the native code. Is anyone looking at this? -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Feb 7 02:57:21 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 07 Feb 2006 04:57:21 -0500 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <43E85056.2090608@trusted-logic.com> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: Hi All, I agree, testing is very important. The problem I have been trying to address is related to cross-platform testing and the robust nature of the installs. Typically, I visit 3 platforms to deploy my product, windows, linux and mac. A build is performed on each platform. The idea that you can build for many platforms from one copy the source code seems attractive. This should enable synchronized deployments of identical code. The question of how to achieve this goal remains open. As Trent mentioned, this is hard. Perhaps Ant will help here (but perhaps not). Ant does seem to help with running unit tests. However, it does not help with multi-platform tests. For that you need many machines and different operating environments. Toward that end, I have created a multi-platform test that can be run from web start, located at: http://show.docjava.com:8086/book/cgij/code/jnlp/serialPort.PortTest.jnlp This is interesting because many people in the community can run the test and we can improve the test, as time permits. No, it is not a perfect solution, however, the idea does help with multi-platform tests using many machines and different operating environments. If the group has a good test for a general serial port set-ups, i would be happy to deploy it, for general evaluation using web start. And as for ANT, it is just an idea. Not all my ideas are good ones! - Doug >Hello, > >I think that the make-based build process is fine as it is, apart >from the location of the Java >source files. It is true that putting the Java source in a directory >structure that map 1-to-1 to >the Java package structure is the norm and should make it easier for >everyone to modify the Java >source, with or without an IDE. > >Ant is a good tool, but in the RXTX case I fail to see the advantage >of using it compared to the >current make-based process. As Trent said, they are more pressing >issues, like testing. > >Regards, >David > >Dmitry Markman wrote: >> if I understands the issue right >> in order to be able to use ant for c/c++ compilation >> you have to install ant's cc task >> http://ant-contrib.sourceforge.net/cc.html >> >> it looks like it should work on mac os x >> (authors claim, that it's platform independent) >> but I never tested >> >> so all you have to do it's providing right command line >> for the gcc compiler >> >> >> >> >> On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: >> >>>> rxtx_root_directory >>>> `-- src >>>> |-- main >>>> | `-- java >>>> | `-- gnu >>>> | `-- io >>>> `-- test >>>> `-- java >>>> `-- gnu >>>> `-- io >>>> >>> >>> >>>> From what I understand this will just be good. >>> >>> For me it makes no difference. So lets do the rxtx thing. Let if >>> fester for two weeks and if nobody objects, we will do it. >>> >>> I'm not doing this because I care. I'm doing this to eliminate much >>> of my inbox. >>> >>> But test... man is rxtx lacking there in the community aspect. It is >>> covered but not right. _maybe_ I can change that this year. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> (cat hurding since 1997) > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From matt.higgins at gmail.com Tue Feb 7 08:28:34 2006 From: matt.higgins at gmail.com (Matt Higgins) Date: Tue, 7 Feb 2006 10:28:34 -0500 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final Message-ID: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? import java.io.*; import java.util.*; import gnu.io.*; public class MySimpleRead implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; public static void main(String[] args) { boolean portFound = false; String defaultPort = "COM1"; if (args.length > 0) { defaultPort = args[0]; } portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; MySimpleRead reader = new MySimpleRead(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } } public MySimpleRead() { try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) { e.printStackTrace(); } try { inputStream = serialPort.getInputStream(); } catch (IOException e) { e.printStackTrace(); } try { serialPort.addEventListener(this); } catch (TooManyListenersException e) { e.printStackTrace(); } try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { e.printStackTrace(); } System.out.println("Baud is " + serialPort.getBaudRate()); System.out.println("Bits is " + serialPort.getDataBits()); System.out.println("Stop is " + serialPort.getStopBits()); System.out.println("Par is " + serialPort.getParity()); serialPort.notifyOnDataAvailable(true); readThread = new Thread(this); readThread.start(); } public void run() { // Thread.sleep(20000); //} catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { System.out.println("An event occurred " + event.getEventType()); switch (event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: byte[] readBuffer = new byte[20]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } System.out.print(new String(readBuffer)); } catch (IOException e) {} break; } } } --------------- Result on windows ------------------------------ Stable Library ============================================================== Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port:: COM1 Baud is 9600 Bits is 8 Stop is 1 Par is 0 ----------------- End Results ----------------------------------------- ------------------ Result on Linux ----------------------------------- Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 Found port: /dev/ttyS0 Baud is 9600 Bits is 8 Stop is 1 Par is 0 An event occurred 1 043100066224 ------------------ End Results --------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/a1431630/attachment-0051.html From brian at mbari.org Tue Feb 7 09:48:37 2006 From: brian at mbari.org (Brian Schlining) Date: Tue, 7 Feb 2006 08:48:37 -0800 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> Message-ID: <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> Hi Matt > The following code works fine on Linux but I never see any data > when run on Windows. This is a cut and paste from the SimpleRead > example. > I am attempting to read data from a bar code scanner. I can fire > up HyperTermianl on windows and see that the device is working > properly as I see the barcodes are scanned and echoed back to the > terminal. However when I run the app I don't see any data. It is > however associating with the com port as the informational bits > print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. Cheers Brian Schlining Software Engineer http://www.mbari.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/16d07f37/attachment-0051.html From lux at diesel-research.com Tue Feb 7 11:59:58 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 11:59:58 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139293215.3689.4.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> Message-ID: <1139338798.8145.4.camel@zd7280> Any ideas on this ? Any reason why portList.hasMoreElements() should be false even though there are devices in /dev ? On Mon, 2006-02-06 at 23:20 -0700, Kim Lux wrote: > I'm running the code below. > > portlist.hasMoreElements() is false. > > /dev has ports in it as listed below. > > What am I doing wrong ? > > > ========================================================== > // Step through the list of ports until we find one that matches > // the one we are looking for. > > portList = CommPortIdentifier.getPortIdentifiers(); > > while(portList.hasMoreElements()) > { > portID = (CommPortIdentifier) portList.nextElement(); // > if (portID.getName().equals("/dev/ttyUSB0")) > { > myTA.append("Serial port ttyUSB0 has been found\n"); > break; > }// if portID equals... > }// End of while... > ========================================================== > > ls -al /dev/tty* > crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty > crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 > crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 > crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 > crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 > ... > crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 > crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 > crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 > > > -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 12:20:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 12:20:25 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139338798.8145.4.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> Message-ID: On Tue, 7 Feb 2006, Kim Lux wrote: > > Any ideas on this ? Any reason why portList.hasMoreElements() should be > false even though there are devices in /dev ? > > > On Mon, 2006-02-06 at 23:20 -0700, Kim Lux wrote: >> I'm running the code below. >> >> portlist.hasMoreElements() is false. >> >> /dev has ports in it as listed below. >> >> What am I doing wrong ? >> >> >> ========================================================== >> // Step through the list of ports until we find one that matches >> // the one we are looking for. >> >> portList = CommPortIdentifier.getPortIdentifiers(); >> >> while(portList.hasMoreElements()) >> { >> portID = (CommPortIdentifier) portList.nextElement(); // >> if (portID.getName().equals("/dev/ttyUSB0")) >> { >> myTA.append("Serial port ttyUSB0 has been found\n"); >> break; >> }// if portID equals... >> }// End of while... >> ========================================================== >> >> ls -al /dev/tty* >> crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty >> crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 >> crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 >> crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 >> crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 >> ... >> crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 >> crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 >> crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 >> >> >> > Hi Kim What rxtx does is try to open the port and do a timed out read. If the kernel/... do not complain it's enumarted. I suspect you could do a crude test by doing something like cat /dev/ttyS0 > /dev/null If that barfs then rxtx wont enumerate the port. hmm looking at your question again, I suspect it's a lockfile problem. This is documented in INSTALL with the source. Its easy enough to test this too.. touch /var/lock/testingrxtxlockfiles && rm -f /var/lock/testingrxtxlockfiles If you are not in the right group it will bail. Root will work regardless. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 12:37:56 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 12:37:56 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> Message-ID: <1139341076.8145.11.camel@zd7280> Exactly which ports does rxtx attempt to put into the list ? /dev/* or /dev/tty* or /dev/tty[0-9[0-9] ? or /dev/ttyS* ? For the record, only /dev/ttyUSB0 is a valid port on the machine I am presently on. Will this be a problem ? On Tue, 2006-02-07 at 12:20 -0700, Trent Jarvi wrote: > This is documented in INSTALL with the source. > I was wondering where that file was. I will download source and dig it up. Thanks. -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 12:51:09 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 12:51:09 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139341076.8145.11.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: On Tue, 7 Feb 2006, Kim Lux wrote: > > Exactly which ports does rxtx attempt to put into the list ? /dev/* > or /dev/tty* or /dev/tty[0-9[0-9] ? or /dev/ttyS* ? > > For the record, only /dev/ttyUSB0 is a valid port on the machine I am > presently on. Will this be a problem ? > > > On Tue, 2006-02-07 at 12:20 -0700, Trent Jarvi wrote: >> This is documented in INSTALL with the source. >> > I was wondering where that file was. I will download source and dig it > up. > > Thanks. > Hmm I'm looking at pre17 so this may have changed. (its just what I have on this machine) if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA" // for the IPAQs }; CandidatePortPrefixes=Temp; } So you may need to add "ttyUSB" to that list. RXTX used to enumerate _everything_ see if(osName.equals("Linux-all-ports") But it became less than practical. This is all in RXTXCommDriver.java hmm I just did a cvs update. if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have to get your fingers into the code. We aim for sane defaults. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 13:06:45 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 13:06:45 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139342805.8145.22.camel@zd7280> On Tue, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > Hmm I'm looking at pre17 so this may have changed. (its just what I have > on this machine) > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA" // for the IPAQs > }; > CandidatePortPrefixes=Temp; > } > > > So you may need to add "ttyUSB" to that list. RXTX used to enumerate > _everything_ see if(osName.equals("Linux-all-ports") But it became less > than practical. > > This is all in RXTXCommDriver.java > > hmm I just did a cvs update. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have > to get your fingers into the code. We aim for sane defaults. Excellent. Thanks for taking the time. -- Kim Lux, Diesel Research Inc. From ideiglenes1 at freemail.hu Tue Feb 7 13:53:39 2006 From: ideiglenes1 at freemail.hu (--) Date: Tue, 07 Feb 2006 21:53:39 +0100 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139345619.22534.2.camel@localhost> Hi! I use this code to get all the extra Linux devices. :) if ("Linux".equals(System.getProperty("os.name"))) { System.setProperty("os.name","Linux-all-ports"); } driver = new RXTXCommDriver(); On k, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > On Tue, 7 Feb 2006, Kim Lux wrote: > > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have > to get your fingers into the code. We aim for sane defaults. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From matt.higgins at gmail.com Tue Feb 7 13:45:54 2006 From: matt.higgins at gmail.com (Matt Higgins) Date: Tue, 7 Feb 2006 15:45:54 -0500 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> Message-ID: <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> Sweet this is exactly what I needed. I was searching the archives through marc.theamisgroup they only have archives back to 1/3/05. Should have hit the mailman archive! Thanks a lot! On 2/7/06, Brian Schlining wrote: > > Hi Matt > > The following code works fine on Linux but I never see any data when run > on Windows. This is a cut and paste from the SimpleRead example. > I am attempting to read data from a bar code scanner. I can fire up > HyperTermianl on windows and see that the device is working properly as I > see the barcodes are scanned and echoed back to the terminal. However when I > run the app I don't see any data. It is however associating with the com > port as the informational bits print fine? > > > You're not the only one whose had this problem, I don't know if Trent has > addressed this is the latest release of RXTX but there is a workaround. > Here's the recent thread from the RXTX mailing list regarding this issues: > > Thanasis Delenikas tdelenik at gmail.com > Wed Jan 18 13:56:23 MST 2006 > > * Previous message: [Rxtx] Re: More close() performance fixes > * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] > > Hi all. > (I've subscribed again from my other email account). > > Trent, > > You are right. Linux *always* works, no matter what flow control you set. > Windows *works only* with hardware flow control (I haven't tested what > happens with software XON/XOFF flow control). > > I assume (but I am not certain) that even with no flow control at all, all > platforms should work. Without flow control, you have the risk of bumping > into overflow or framing errors, but that's your (the end programmer, I > mean) problem. > > >From my side, I shouldn't be working without flow control. That was a bug > too... It was some code forgotten from the old times, when I used to work > with phone emulation drivers which didn't support flow control. The > correct > way is to have some flow control enabled and that's why I suppose this is > a > low-severity bug for RxTx. > > I have no idea which platform shows the correct behaviour, since > my knowledge about Linux and the inner workings of these low-level i/o > operations is limited. > > Regards, > Thanasis Delenikas. > > > > > Message: 2 > > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > > From: Trent Jarvi > > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > > To: RXTX Developers and Users > > Message-ID: > > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > > > Hi all, > > > > > > Trent, I have found something. > > > I read your comment about flow control, so I experimented a bit. > > > > > > If you remember, in my sample program I've used no flow control at all > ( > > i.e. > > > Java constant FLOWCONTROL_NONE). > > > > > > Now, during testing, I've switch to hardware inbound flow control (i.e > . > > Java > > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > > beautifully! > > > > > > I think I will switch to H/W flow control and test things for a while, > > but > > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > > > > > Hi Thanasis, > > > > I'm fairly sure you have identified a bug. I would not worry too much > > about what Sun CommAPI w32 defaults are. I think they did more or less > > whatever the port opened with. Just a guess. Linux tries to stomp on > > ports so they are all the same. > > > > So this started out with Linux worked, Windows XP/.. did not as I > recall. > > Something is wrong in rxtx. Do I understand this right? > > > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > > > Perhaps there is something Wayne or I did not understand when we wrote > > that code. I wasnt programming back in the BBS days so modems are not > my > > thing. I have a few questions. > > > > Is the above matrix confirmed by observation? > > Linux just always worked? > > Which one _should_ work? I'm guessing modems work with hardware flow > > control. I'll have to dig around. > > > > The windows flow control changes a couple things with hardware flow > > control. Following the w32 API documentation is confusing sometimes. > > But it looks like Linux could have a bug too. > > Cheers > > Brian Schlining > Software Engineer > http://www.mbari.org > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/9c989144/attachment-0051.html From tjarvi at qbang.org Tue Feb 7 14:06:14 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 14:06:14 -0700 (MST) Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> Message-ID: >> >> You're not the only one whose had this problem, I don't know if Trent has >> addressed this is the latest release of RXTX but there is a workaround. >> Here's the recent thread from the RXTX mailing list regarding this issues: >> I have not. I expect to have access to some test equipment next month and I'll go through all of this. I really don't know whats going on and I need a gold standard. I thought maybe linux was autodetecting the flow control. Your observations would certainly be welcome. I need to talk to Russell King and see what he is doing. Until then I'd just be toying around over a loopback as usual. This is very high on the list though. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 17:25:05 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 17:25:05 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139358305.17994.2.camel@zd7280> My application now works. I installed the libraries and jar from 2.1-7 (Final). portlist.hasMoreElements is no longer false. The application finds the port for /dev/ttyUSB0. Thanks for your help, Trent (et al) Sorry I bothered you with this. Next time I will look in the source first. I didn't think it was an rxtx issue, I thought it was a Linux setup issue . On Tue, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > Hmm I'm looking at pre17 so this may have changed. (its just what I > have > on this machine) > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux > Serial Ports > "ttySA" // for the > IPAQs > }; > > CandidatePortPrefixes=Temp; > } > > > So you may need to add "ttyUSB" to that list. RXTX used to enumerate > _everything_ see if(osName.equals("Linux-all-ports") But it became > less > than practical. > > This is all in RXTXCommDriver.java > > hmm I just did a cvs update. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux > Serial Ports > "ttySA", // for the > IPAQs > "ttyUSB" // for USB > frobs > }; > > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you > have > to get your fingers into the code. We aim for sane defaults. -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 19:21:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 19:21:54 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139358305.17994.2.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> <1139358305.17994.2.camel@zd7280> Message-ID: >Sorry I bothered you with this. Next time I will look in the source >first. I didn't think it was an rxtx issue, I thought it was a Linux >setup issue . Why would you be sorry? I would have done the same. I'm glad it's working :) -- Trent Jarvi tjarvi at qbang.org From tma at mail.island.net Wed Feb 8 13:39:35 2006 From: tma at mail.island.net (Tom Alldread) Date: Wed, 08 Feb 2006 12:39:35 -0800 Subject: [Rxtx] Win32/Linux Serial Port Data Dropouts In-Reply-To: <200602060702.k167255O007882@www.qbang.org> References: <200602060702.k167255O007882@www.qbang.org> Message-ID: <43EA5707.4020200@mail.island.net> Greetings Folks at RXTX: During the last couple of months I have been alternately testing with javax.comm 2 and RXTX 2.1 under Windows XP and CommApi 3 and RXTX 2.1 under Suse 10.0 Linux. In the process I have learned a little about java multi-threading under NetBeans 5 with Profiler. My java (jdk 1.5_06) application is used for data acquisition and provides a graphical display of A-D conversion data received from a 56KBaud serial port. The actual data throughput is about 10KBaud thus it is well below the speed of the port. I use hardware RTS/CTS flow control which can stall the data acquisition sample rate if necessary. This ensures the display computer has the ability to slow the data acquisition rate should it become too busy to accept the regular data flow. Both the serial port buffer and the java read buffer are set at 16KB. Usually the data transfers into the java read buffer are less than 100 bytes unless the data acquisition is recovering from a stall. The data flow normally hesitates after each 5 KB block as a continue command is needed from the display computer to start the drawing of a new graphics display line. Separate threads have been provided for the serial port event monitoring and data processing. The serial port event thread has been given the maximum priority and data processing thread the minimum priority provided by java. Thread yield statements have been placed within all data processing while/for loops as an effort to ensure quick access to CPU cycles for the serial port event thread. I have found that short data transmissions are essentially error free but occasional dropouts occur with continuous data flow especially under Windows XP. ....................................................................................................................................................................................... Linux results: I am happy to report that RXTX 2.1 appears to work very well under Linux although I did notice some errors when the screen savers were running with my dual monitors. I believe this is a local problem associated with my dual graphics which needs further attention. The recent CommApi 3 Linux release from Sun did not work at all with my program. It seemed to send commands out OK but did not receive any data. Although the serial port event triggered the ISR, the input stream appeared filled with nulls and thus did not contain any data. As my understanding is that CommApi 3 was tested with a Red Hat distribution of Linux I wonder if this problem is distro dependent? Although somewhat off topic here I wonder if anyone reading this has had similar experience? .................................................................................................................................................................................. Windows XP results: There are problems with occasional data dropouts which become more frequent as the sampling rate is increased or if the computer becomes busy with other duties. The dropouts typically consist of a half dozen byte block of lost data. It appears the lost bytes never get added to the java input stream. There has not been any indication of garbled data, overruns or framing errors which suggests the UART communications remains solid. Using javax.comm 2 I found that the setting of SerialPort 'enableReceiveThreshold' to 40 and 'enableReceiveTimeout' of 100mS reduced the dropouts error rate significantly. I found that I could not get RXTX 2.1 to function with the aforementioned threshold and timeout settings. The javax.comm 2 interface is consequently performing better for me under Windows than RXTX 2.1. I wonder if anyone here has any suggestions as to what I might try to improve RXTX 2.1? Although my settings are the same as under Suse 10.0, RXTX 2.1 performs much better for me under Linux than any of the alternatives that I have tried under Windows XP . ............................................................................................................................................................................... I would like to establish, based on the experience of others, if I have reached the normally expected performance limit of java serial port communications? Should I expect to achieve virtually error free serial port data input from a continuous stream under Windows XP java software? I am considering changing my protocol to packets with error checking if necessary but would like to know if the dropout problems I am experiencing are typical or not before I take this rather work intensive plunge. Many thanks in advance for any help! Best Regards, Tom Alldread -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.375 / Virus Database: 267.15.2/253 - Release Date: 2006-02-07 From jlaxson at mac.com Wed Feb 8 23:56:48 2006 From: jlaxson at mac.com (John Laxson) Date: Thu, 9 Feb 2006 00:56:48 -0600 Subject: [Rxtx] PortInUseException: Unknown Application on OSX Message-ID: Hi, I've been trying to get RXTX 2.1.7 going on Mac OS X for a while here, and am running up into a wall here. I've tried with pre- compiled and the source version and get the same problem, a gnu.io.PortInUseException: Unknown Application. I have run the fixperms script included with the source distribution, and id shows me as a member of the uucp group, and permissions on /var/spool/uucp are 775 root:uucp. Running a test program (included at the bottom for clarity) lets me enumerate all the serial ports correctly, but trying to open any of them gives the PortInUseException. If it helps, when I try to open a port that's set to make an outgoing bluetooth connection, there is no delay and no connection attempt at all. Thanks, John Laxson PS: The documentation wiki on qbang.org shows 404, and has for a few days now. My test code: public static void main(String[] args) { SerialPort serialPort; try { Enumeration e = CommPortIdentifier.getPortIdentifiers(); CommPortIdentifier ident; while (e.hasMoreElements()) { ident = (CommPortIdentifier)e.nextElement(); System.out.println(ident.getName()); } ident = CommPortIdentifier.getPortIdentifier("/dev/cu.modem"); serialPort = (SerialPort) ident.open("Me", 5000); } catch (Exception e) { e.printStackTrace(); } } From rajesh.invincible at gmail.com Thu Feb 9 03:39:38 2006 From: rajesh.invincible at gmail.com (Rajesh N) Date: Thu, 9 Feb 2006 16:09:38 +0530 Subject: [Rxtx] Re: Move .java Files in gnu.io filesystem hierarchy - Maven (2) In-Reply-To: <43DF21D2.7090200@ngi.it> References: <43DF21D2.7090200@ngi.it> Message-ID: <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Can anybody tell me how to overcome these EXCEPTIONS I AM WORKING ON SERIAL COMMN IN JAVA ON LINUX. 1. " NOT ALL PARAMETERS SUPPORTED BY THE KERNEL" This i came across the following statement inmy prog. SerialP is A SerialPort object SerialP.setSerialPortParams(9600(BAUDRATE),DATABITS_8,STOPBITS_1,PARITY_NONE) 2. NullPointer Exception at Event Dispatch Now i have checked all my object references for a null reference but i found none i have put up my entire code in try catch blocks but still I AM UNABLE TO CATCH THIS EXCEPTION AND HENCE MY APPLICATION CLOSES HOW DOES THESE GO? PLEASE HELP ME IT IS URGENTTTTTTTTTTTTTTTT yours sincerely RAJESH On 1/31/06, Fabio Frumento wrote: > Hi Xavier, > > I don't know maven at all but the directory hierarchy listed buy Trent > is fine for me... > > I'll take a look to maven, it seems an interesting project > > Regards > > Fabio Frumento > > Trent Jarvi wrote: > > On Tue, 31 Jan 2006, Xavier Frisaye wrote: > > > >> Hi all, > >> > >> If you are going to rearrange the src folder, i will propose to use > >> maven 2 and follow its directory structure > >> > (http://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html). > >> > >> Maven 2 simplify java project and give a standard way to make projects > >> (http://maven.apache.org/). > >> We are using it for internal projects and we are very satisfied. > >> > >> Is anybody interested? > >> > >> I'm not an expert in maven 2 (yet) but i'm agree to help using it if > >> you choose to make so. > >> > > > > so this would be: > > > > rxtx-devel/src/main/java/gnu.io > > rxtx-devel/src/test/java/ManIwish.java > > > > I don't use IDEs very much so I'll let others comment. But I don't see > > a problem with that. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Thu Feb 9 09:50:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 9 Feb 2006 09:50:31 -0700 (MST) Subject: [Rxtx] Re: Move .java Files in gnu.io filesystem hierarchy - Maven (2) In-Reply-To: <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Message-ID: On Thu, 9 Feb 2006, Rajesh N wrote: > Can anybody tell me how to overcome these EXCEPTIONS > I AM WORKING ON SERIAL COMMN IN JAVA ON LINUX. > > 1. " NOT ALL PARAMETERS SUPPORTED BY THE KERNEL" > > This i came across the following statement inmy prog. > SerialP is A SerialPort object > SerialP.setSerialPortParams(9600(BAUDRATE),DATABITS_8,STOPBITS_1,PARITY_NONE) > Strange. The parameters you use are the same the port should open with by default. Could you paste the actual exception you are getting? I don't see that in the rxtx source. Also it would help to know the rxtx version. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Fri Feb 10 15:29:05 2006 From: lux at diesel-research.com (Kim Lux) Date: Fri, 10 Feb 2006 15:29:05 -0700 Subject: [Rxtx] One serial port object for both sending and receiving ? Message-ID: <1139610545.18177.4.camel@zd7280> Is it OK to use one SerialPort ojbect (ex Serial Port serialPort;) and use it for both sending and receiving ? For example: ======================================================================== static SerialPort serialPort = null; static OutputStream serialOut = null; static InputStream serialIn = null; // assign it to an outputStream for use try{ serialOut = serialPort.getOutputStream(); System.out.println("Serial output stream has been assigned."); }//try catch(IOException e) { System.out.println("Error: Couldn't assign output stream to serial port."); }//catch //assign it to an inputStream for use try{ serialIn = serialPort.getInputStream(); System.out.println("Serial input stream has been assigned."); }//try catch(IOException e) { System.out.println("Error: Couldn't assign input stream to serial port."); }//catch ======================================================================== -- Kim Lux, Diesel Research Inc. From lux at diesel-research.com Fri Feb 10 21:23:00 2006 From: lux at diesel-research.com (Kim Lux) Date: Fri, 10 Feb 2006 21:23:00 -0700 Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Message-ID: <1139631780.23882.10.camel@zd7280> I've got a problem receiving chars with my version of serialRead, written in an SWT GUI. I had a Java pro have a good look at my code and he can't see anything wrong with it. I can send chars fine. When I receive a char the cpu usage for the app goes to 100% and the code in the serial event handler doesn't get executed. The instructions on the Java Comm Serial API How-To for Linux page state that I must install javacomm. Is that true ? Everything builds without it and I can send chars on rxtx just fine, but I can't receive them. Could this be the problem ? I downloaded and installed javacomm. I was not able to add "Driver=gnuio.RXTXCommDriver to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 installed in /usr/java/jre1.5.0_05. I added comm.jar to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext to the library paths. Is this OK ? Does it matter that I am receiving on /dev/ttyUSB0 ? Thanks. -- Kim Lux, Diesel Research Inc. From lunareclipse03 at web.de Sat Feb 11 09:44:46 2006 From: lunareclipse03 at web.de (lunareclipse03@web.de) Date: Sat, 11 Feb 2006 17:44:46 +0100 Subject: [Rxtx] Question about Serial I/O under Win32 Message-ID: <662084330@web.de> Hello everybody, I have a strange problem with a piece of code I made for myself. No, this is not really concerning rxtx, but nevertheless I post this to the list, hoping that some of you can help me. I've written two libraries, one for linux and one for win32. The linux port works quite well, I can send / receive faxes and / or replay voice messages over the telephone line using a voice modem. But the win32 port of the library causes some trouble. If, for example, I send out a fax with a certain modem under linux, it works well. The fax is complete when it comes out of the fax machine. If I then use the same modem to send out a fax under win32, the fax coming out of the fax machine gets "stuck" halfways, but the sending modem thinks that transmission was ok and drops the connection. The answering fax machine then gives me "error while receiving." The "upper layer" java code MUST be right, because if I do the same thing under linux (using the linux library), everything is alright. Now I have to ask: Can somebody please help me out with this??!? Could it be the case that some kind of flow control or COMMTIMEOUTS setting causes this behaviour? I set flow control to RTS/CTS before sending out a fax. How can I DISABLE flow control? Or what do you think? Can something else cause this problems? Thank you all for your time and PLEASE write back soon. Regards, --Sven Ahlemann Am Waldrand 31 45721 Haltern am See Germany ______________________________________________________________ Verschicken Sie romantische, coole und witzige Bilder per SMS! Jetzt bei WEB.DE FreeMail: http://f.web.de/?mc=021193 From lux at diesel-research.com Sat Feb 11 10:06:52 2006 From: lux at diesel-research.com (Kim Lux) Date: Sat, 11 Feb 2006 10:06:52 -0700 Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: <1139631780.23882.10.camel@zd7280> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> <1139631780.23882.10.camel@zd7280> Message-ID: <1139677612.3431.5.camel@zd7280> More on this problem. I copied and pasted simpleRead into a console based Eclipse project and I've got the same result, except that cpu usage doesn't go to 100%. I'm beginning to think there is an issue in rxtx. My imports for simpleRead are: ============================ import gnu.io.*; import java.util.*; //import javax.comm.*; import java.io.*; =========================== Any ideas ? I am trying to read from /dev/ttyUSB0 using a serial to USB adapter which has worked well with minicom and gtkterm. Thanks. On Fri, 2006-02-10 at 21:23 -0700, Kim Lux wrote: > I've got a problem receiving chars with my version of serialRead, > written in an SWT GUI. > > I had a Java pro have a good look at my code and he can't see anything > wrong with it. > > I can send chars fine. When I receive a char the cpu usage for the app > goes to 100% and the code in the serial event handler doesn't get > executed. > > The instructions on the Java Comm Serial API How-To for Linux page state > that I must install javacomm. Is that true ? Everything builds without > it and I can send chars on rxtx just fine, but I can't receive them. > Could this be the problem ? > > I downloaded and installed javacomm. I was not able to add > "Driver=gnuio.RXTXCommDriver > to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not > have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 > installed in /usr/java/jre1.5.0_05. I added comm.jar > to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext > to the library paths. Is this OK ? > > Does it matter that I am receiving on /dev/ttyUSB0 ? > > Thanks. > -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Sun Feb 12 21:01:33 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:01:33 -0700 (MST) Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: <1139677612.3431.5.camel@zd7280> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> <1139631780.23882.10.camel@zd7280> <1139677612.3431.5.camel@zd7280> Message-ID: I suspect what is happening is the select() is breaking out in the native code but the driver does not have support for notifying there are X bytes available. On some traditional Unix based systems, the only way you know data is available is the fd status changes and do an FIORDCHK ioctl. Or perhaps the only thing you can know is the fd status changed. It would take reading through the kernel driver code to know for sure. So on USB, depending upon the driver, the same may need to be done or the driver improved a bit if possible to support. Polling reads will also work but don't use the event driven model of CommAPI which isnt acceptable in the long run. The 100% cpu usage can then be explained because select no longer blocks until the data is read; the eventLoop spins loose. You can put a well placed sleep but rxtx only expects those are needed when it knows data is available. This may not be a super simple thing to understand and fix. I do have ideas to get you started. I'm going to be short on time the next couple weeks. I expect to put some good time in and answer some other questions I saw around the 25th. For now, I'd look at the following and go from there with the hints I've given. JNIEXPORT jint JNICALL RXTXPort(nativeavailable)( JNIEnv *env, jobject jobj ) { int fd = get_java_var( env, jobj,"fd","I" ); int result; /* char message[80]; ENTER( "RXTXPort:nativeavailable" ); On SCO OpenServer FIONREAD always fails for serial devices, so try ioctl FIORDCHK instead; will only tell us whether bytes are available, not how many, but better than nothing. This turns out to be true on Solaris also. taj. */ #ifdef FIORDCHK /* __unixware__ __sun__ probably others */ result = ioctl(fd, FIORDCHK, 0); #else if( ioctl( fd, FIONREAD, &result ) < 0 ) { goto fail; } #endif /* FIORDCHK */ On Sat, 11 Feb 2006, Kim Lux wrote: > > More on this problem. I copied and pasted simpleRead into a console > based Eclipse project and I've got the same result, except that cpu > usage doesn't go to 100%. I'm beginning to think there is an issue in > rxtx. > > My imports for simpleRead are: > > ============================ > import gnu.io.*; > import java.util.*; > //import javax.comm.*; > import java.io.*; > =========================== > > Any ideas ? I am trying to read from /dev/ttyUSB0 using a serial to > USB adapter which has worked well with minicom and gtkterm. > > Thanks. > > > > On Fri, 2006-02-10 at 21:23 -0700, Kim Lux wrote: >> I've got a problem receiving chars with my version of serialRead, >> written in an SWT GUI. >> >> I had a Java pro have a good look at my code and he can't see anything >> wrong with it. >> >> I can send chars fine. When I receive a char the cpu usage for the app >> goes to 100% and the code in the serial event handler doesn't get >> executed. >> >> The instructions on the Java Comm Serial API How-To for Linux page state >> that I must install javacomm. Is that true ? Everything builds without >> it and I can send chars on rxtx just fine, but I can't receive them. >> Could this be the problem ? >> >> I downloaded and installed javacomm. I was not able to add >> "Driver=gnuio.RXTXCommDriver >> to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not >> have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 >> installed in /usr/java/jre1.5.0_05. I added comm.jar >> to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext >> to the library paths. Is this OK ? >> >> Does it matter that I am receiving on /dev/ttyUSB0 ? >> >> Thanks. >> > From tjarvi at qbang.org Sun Feb 12 21:03:30 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:03:30 -0700 (MST) Subject: [Rxtx] One serial port object for both sending and receiving ? In-Reply-To: <1139610545.18177.4.camel@zd7280> References: <1139610545.18177.4.camel@zd7280> Message-ID: On Fri, 10 Feb 2006, Kim Lux wrote: > > Is it OK to use one SerialPort ojbect (ex Serial Port serialPort;) and > use it for both sending and receiving ? > > For example: > > ======================================================================== > static SerialPort serialPort = null; > static OutputStream serialOut = null; > static InputStream serialIn = null; > > > > > // assign it to an outputStream for use > try{ > serialOut = serialPort.getOutputStream(); > System.out.println("Serial output stream has been assigned."); > }//try > catch(IOException e) > { > System.out.println("Error: Couldn't assign output stream to serial > port."); > }//catch > > > //assign it to an inputStream for use > try{ > serialIn = serialPort.getInputStream(); > System.out.println("Serial input stream has been assigned."); > }//try > catch(IOException e) > { > System.out.println("Error: Couldn't assign input stream to serial > port."); > }//catch This should be fine. In fact trying to do it another way will probably not work as you will run into lockfile issues. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun Feb 12 21:13:13 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:13:13 -0700 (MST) Subject: [Rxtx] Question about Serial I/O under Win32 In-Reply-To: <662084330@web.de> References: <662084330@web.de> Message-ID: On Sat, 11 Feb 2006 lunareclipse03 at web.de wrote: > Hello everybody, > > I have a strange problem with a piece of code I made for myself. No, > this is not really concerning rxtx, but nevertheless I post this to the > list, hoping that some of you can help me. I've written two libraries, > one for linux and one for win32. The linux port works quite well, I can > send / receive faxes and / or replay voice messages over the telephone > line using a voice modem. But the win32 port of the library causes some > trouble. If, for example, I send out a fax with a certain modem under > linux, it works well. The fax is complete when it comes out of the fax > machine. If I then use the same modem to send out a fax under win32, the > fax coming out of the fax machine gets "stuck" halfways, but the sending > modem thinks that transmission was ok and drops the connection. The > answering fax machine then gives me "error while receiving." The "upper > layer" java code MUST be right, because if I do the same thing under > linux (using the linux library), everything is alright. Now I have to > ask: Can somebody please help me out with this??!? Could it be the case > that some kind of flow control or COMMTIMEOUTS setting causes this > behaviour? I set flow control to RTS/CTS before sending out a fax. How > can I DISABLE flow control? Or what do you think? Can something else > cause this problems? Thank you all for your time and PLEASE write back > soon. > Hi Sven I'm not too willing to talk about flow control at the low level until I confirm some things with test equipment later. It is not clear if you are using rxtx or writing your own native code. So I'm not sure how to answer much of this :) If you are wondering how to change the flow control using rxtx from java, The BlackBox example from Sun flips this back and forth. SerialPort.java in rxtx 2.1 uses the following: SerialPort.java: public static final int FLOWCONTROL_NONE =0; SerialPort.java: public static final int FLOWCONTROL_RTSCTS_IN =1; SerialPort.java: public static final int FLOWCONTROL_RTSCTS_OUT =2; SerialPort.java: public static final int FLOWCONTROL_XONXOFF_IN =4; SerialPort.java: public static final int FLOWCONTROL_XONXOFF_OUT=8; So if you set flowcontrol to RTSCTS, you can set it to NONE to turn it off. If you are looking for how to do it in native code, the rxtx Source is SerialImp.c (unix/linux/mac os x/w32) and termios.c (w32 only with SerialImp.c) You can track the code: SerialImp.c:JNIEXPORT void JNICALL RXTXPort(setflowcontrol)( JNIEnv *env, jobject jobj, jint flowmode ) termios.c:int tcgetattr( int fd, struct termios *s_termios ) termios.c:int tcsetattr( int fd, int when, struct termios *s_termios ) There may be a problem in the rxtx flow control code though. Rather than guess, I want to test this with a gold standard. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Feb 6 00:00:16 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 00:00:16 -0700 (MST) Subject: [Rxtx] wiki delay until tomorrow night. In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: On Sun, 5 Feb 2006, Trent Jarvi wrote: > On Sun, 5 Feb 2006, Kim Lux wrote: > >> usb ? Tell me more... I need that too. > > usb is a very proper design. Thats all it is. > Maybe rxtx could help usb. But it would start with helping bring back the community that was already there. It's not something I'd love to do but maybe its the right thing to do. It would probably take 2 years to do right. But maybe thats better than what we have now. I honestly don't know what IBM is doing which could just run over everything. Just some thoughts after some fine german wine. -- Trent Jarvi tjarvi at qbang.org From gadelavega at yahoo.com.ar Mon Feb 6 02:17:05 2006 From: gadelavega at yahoo.com.ar (Gonzalo A. de la Vega) Date: Mon, 06 Feb 2006 10:17:05 +0100 Subject: [Rxtx] Serial port ownership question In-Reply-To: References: <20060205113618.30274.qmail@web53501.mail.yahoo.com> <1139157422.4553.9.camel@zd7280> <1139158698.4936.9.camel@zd7280> Message-ID: <43E71411.4050402@yahoo.com.ar> On my Fedora Core 4: ls -l /dev/ttyS* crw-rw---- 1 root uucp 4, 64 Feb 6 2006 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Feb 6 2006 /dev/ttyS1 ... and: grep "ttyUSB" /etc/udev/rules.d/50-udev.rules KERNEL=="ttyUSB*", GROUP="uucp", MODE="0660" So anyone in the "uucp" group can use serial ports. On Gentoo the group is "tty". Trent Jarvi escribi?: > > > On Sun, 5 Feb 2006, Dr. Douglas Lyon wrote: > >> I can confirm that this is the case (only root ownership of >> serial ports, under fedora 4). >> Wow, what were they thinking?! >> - DL >> >>> I've found that the newer kernels have the serial ports owned by root. >>> For example, >>> >>> $ls -al /dev/tty* >>> crw-rw-rw- 1 root root 5, 0 Feb 5 02:06 /dev/tty >>> crw-rw---- 1 root root 4, 0 Feb 5 02:06 /dev/tty0 >>> crw------- 1 root root 4, 1 Feb 5 09:07 /dev/tty1 >>> crw-rw---- 1 root tty 4, 10 Feb 5 02:06 /dev/tty10 >>> crw-rw---- 1 root tty 4, 11 Feb 5 02:06 /dev/tty11 >>> ... > > > This is just not a problem jcp or such are going to solve. Its a > platform spitwad fight. But do look at pam. In fact thats what Sun > is doing too. Maybe Linux followed their lead.. I'm not a pam guy. > I've spent 16 hours trying to understand it but your users wont :) > > Solution? I have no clue. Its two tangent mentalities from my > perspective. > > -- > Trent Jarvi > tjarvi at qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mtnvega at yahoo.com.br Mon Feb 6 05:35:43 2006 From: mtnvega at yahoo.com.br (Luiz Jr) Date: Mon, 6 Feb 2006 12:35:43 +0000 (GMT) Subject: [Rxtx] Documentation Wiki In-Reply-To: <1139157422.4553.9.camel@zd7280> Message-ID: <20060206123543.57256.qmail@web53515.mail.yahoo.com> Hello, Thank you for you answer, but so the usage of the API is pretty much like the Java Communications Api? If yes, what version of the Java Comm Api? Thank you, Luiz A. Brandao Jr Kim Lux escreveu: On Sun, 2006-02-05 at 08:36 -0300, Luiz Jr wrote: > Hello, > > I want to start using the RXTX libraries, but I would to know how, > since I can not access the documentation wiki page I just started using them yesterday. Below is how I installed the libraries, if that helps. I used snippets of code from the SimpleWrite application here to get me going. http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html Instead of "import javax.comm.*;", use "import gnu.io.*;" which is gotten from RXTXcomm.jar, which you will need to include in your project references. I am working in Eclipse. BTW: there is no way to open a port without going through the port list and finding it. Maybe sometime in the future someone (me ?) will write a method called openSerialPort that allows the user to give a port identifier, such as "/dev/tty1" and return a port ready to use. It wouldn't take much to write that and it would save users a lot of code. Hope this helps. ======================================================================= 1) Figure out which java you are running, incase there is more than one installed. $ java -version java version "1.5.0_05" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_05-b05) Java HotSpot(TM) Client VM (build 1.5.0_05-b05, mixed mode, sharing) 2) Find all the jre directories and the one from which you are currently running. kfind (jre) 3) cd to that directory plus /lib/i386 cd /usr/java/jre1.5.0_05/lib/i386 4) Copy the library files (*.so) to that directory. cp /home/krlux/Desktop/'Java Controls'/rxtx-linux/bin/* . 5) Check that the copy was successful ls librxtx* librxtxI2C.so librxtxRaw.so librxtxSerial.so librxtxParallel.so librxtxRS485.so 6) cd to the /lib/ext directory for your java. cd /usr/java/jre1.5.0_05/lib/ext 7) Copy the Jar files there cp /home/krlux/Desktop/'Java Controls'/rxtx-linux/lib/ext/* . 8) Check that it was successful ls RXTX* RXTXcomm.jar Rxtx is now installed on your machine ready to use. =================================================================== -- Kim Lux, Diesel Research Inc. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx --------------------------------- Yahoo! Acesso Gr?tis - Internet r?pida e gr?tis. Instale o discador agora! -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/544aa403/attachment-0052.html From lyon at docjava.com Mon Feb 6 05:49:34 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 06 Feb 2006 07:49:34 -0500 Subject: [Rxtx] wiki delay until tomorrow night. In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: Hi All, I have often thought about USB drivers being needed. For example, the ironman watch will not interface to a mac (windows only). It is USB. My dymo label writer has no Java driver (native only). Etc. Most cheap web cameras are USB (and Java drivers go through JAI, if it supports the camera at all). The JAI code shows how sun did the USB drivers. You have to be a member of the jai project to download the source code. https://jai.dev.java.net has the jai distro. And then you are not allowed to redistribute it. However, we can all learn from it (if so inclined). Basically: cvs -d :pserver:lyon at cvs.dev.java.net:/cvs login cvs -d :pserver:lyon at cvs.dev.java.net:/cvs checkout jai-core You will need to user your own uid and pw to get in. The ant build has over 100 warnings from sun deprecations of its own code. You might say that they were hoisted on their own Picard ;) One interesting thing is that they support several platforms: linux-amd64 64-bit Linux-AMD64 linux-i586 32-bit Linux-x86 solaris-amd64 64-bit Solaris-AMD64 solaris-i586 32-bit Solaris-x86 solaris-sparc 32-bit Solaris-SPARC solaris-sparcv9 64-bit Solaris-SPARC windows-i586 32-bit Windows-x86 Thus, ant is used to provide a multi-platform native method distro. Neat. How do they do it? check this out: And: The core download does not contain any C source code (it was all pre-built). Basically, they are just copying .so and .dll files into build directories. I would love to see the C code for this...but Sun does not post it on the https://jai.dev.java.net site. I don't know why...Perhaps I missed it. - Doug >On Sun, 5 Feb 2006, Trent Jarvi wrote: > >>On Sun, 5 Feb 2006, Kim Lux wrote: >> >>>usb ? Tell me more... I need that too. >> >>usb is a very proper design. Thats all it is. >> > >Maybe rxtx could help usb. But it would start with helping bring >back the community that was already there. > >It's not something I'd love to do but maybe its the right thing to do. > >It would probably take 2 years to do right. But maybe thats better >than what we have now. > >I honestly don't know what IBM is doing which could just run over everything. > >Just some thoughts after some fine german wine. > >-- >Trent Jarvi >tjarvi at qbang.org > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tdelenik at gmail.com Mon Feb 6 05:56:32 2006 From: tdelenik at gmail.com (Thanasis Delenikas) Date: Mon, 6 Feb 2006 14:56:32 +0200 Subject: Fwd: [Rxtx] Documentation Wiki In-Reply-To: <1139157422.4553.9.camel@zd7280> References: <20060205113618.30274.qmail@web53501.mail.yahoo.com> <1139157422.4553.9.camel@zd7280> Message-ID: <310a1a930602060456t129f1dc6p5f2b908f13ab5a0b@mail.gmail.com> Hello all, Kim, this is a snippet from the code I use. The closest to directly opening a specific port without enumeration. << ... portId = CommPortIdentifier.getPortIdentifier(getPort()); serialPort = (SerialPort) portId.open("jSMSEngine", 1971); ... >> where getPort() return the string identifier of the port, i.e. "/dev/ttyS0" or "COM1" or whatever. Thanasis. ---------- Forwarded message ---------- From: Kim Lux Date: Feb 5, 2006 6:37 PM Subject: Re: [Rxtx] Documentation Wiki To: RXTX Developers and Users BTW: there is no way to open a port without going through the port list and finding it. Maybe sometime in the future someone (me ?) will write a method called openSerialPort that allows the user to give a port identifier, such as "/dev/tty1" and return a port ready to use. It wouldn't take much to write that and it would save users a lot of code. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/182ab5b8/attachment-0052.html From tjarvi at qbang.org Mon Feb 6 11:53:57 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 11:53:57 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: On Mon, 6 Feb 2006, Dr. Douglas Lyon wrote: > Hi All, > I have often thought about USB drivers being needed. > For example, the ironman watch will not interface > to a mac (windows only). It is USB. > My dymo label writer has no Java driver (native only). > Etc. > Most cheap web cameras are USB (and Java drivers go > through JAI, if it supports the camera at all). > The JAI code shows how sun did the USB drivers. > You have to be a member of the jai project to download > the source code. > https://jai.dev.java.net has the jai distro. > And then you are not allowed to redistribute it. However, > we can all learn from it (if so inclined). Basically: > cvs -d :pserver:lyon at cvs.dev.java.net:/cvs login > cvs -d :pserver:lyon at cvs.dev.java.net:/cvs checkout jai-core > You will need to user your own uid and pw to get in. > The ant build has over 100 warnings from sun deprecations > of its own code. > > You might say that they were hoisted on their own Picard ;) > > One interesting thing is that they support several platforms: > linux-amd64 64-bit Linux-AMD64 > linux-i586 32-bit Linux-x86 > solaris-amd64 64-bit Solaris-AMD64 > solaris-i586 32-bit Solaris-x86 > solaris-sparc 32-bit Solaris-SPARC > solaris-sparcv9 64-bit Solaris-SPARC > windows-i586 32-bit Windows-x86 > Thus, ant is used to provide a multi-platform native method distro. > Neat. > How do they do it? > check this out: > > > > > > > > > > > > > And: > > > > > > > > > > The core download does not contain any C source code (it was all pre-built). > Basically, they are just copying .so and .dll files into build directories. > > I would love to see the C code for this...but Sun does not post it on the > https://jai.dev.java.net site. > > I don't know why...Perhaps I missed it. > > - Doug > > I've looked at moving rxtx to Ant builds. I think that would help IDEs a great deal. I requested a evalutation desk copy the O'Reilly Ant book for some j2ee material I was teaching. http://www.oreilly.com/catalog/anttdg/ It has a one sentence mention of JNI. So there was not luck there. I saw that there is another Ant book that does mention JNI more. I can't find it now. Ant must be able to support it with extensions. http://ant.apache.org/manual/OptionalTasks/javah.html What the auto(break :) tools do in the rxtx build is 4 things really. 1) gcc compile flags 2) ld compile flags 3) config.h 4) compile flags for customizing rxtx (lockfiles, ...) See 1 All of this information except 4 can be static once obtained. So I'm not attached to the auto tools. If I could find an example of Ant being used for JNI code, I'd be one of the first to start moving that direction. Maybe someone saw an example someplace. The other thing we have not completed discussing is the directory structure. There is interest in making rxtx more IDE friendly. I get more mail about that off the list than how to install rxtx. And I see we have Ken Thompson in da house :) He is our trusted CVS maintainer and the guy that purchased the rxtx.org domain. Old community. We will need Ken for changing the directory structure of source. I would like to open up discussion about both of these as it is more than time. The problem is I have little experience with Ant and even less with IDEs. It would be nice if we could work with Eclipse and NetBeans. http://www.netbeans.org/ (sun and some community) http://www.eclipes.org (ibm,rhat,... perhaps more community) http://maven.apache.org/what-is-maven.html (apache. It is community) borland should sortof be here too but I think thats covered in eclipse. >From what I understand so far, we should morph rxtx to support those three maybe trusting apaches lead with maven. But I use vi. I have little to no clues beyond what people have fed me. Can we agree that thats the right direction to go? -- Trent Jarvi tjarvi at qbang.org From brian at mbari.org Mon Feb 6 14:57:50 2006 From: brian at mbari.org (Brian Schlining) Date: Mon, 6 Feb 2006 13:57:50 -0800 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> > The other thing we have not completed discussing is the directory > structure. There is interest in making rxtx more IDE friendly. I > get more mail about that off the list than how to install rxtx. > > And I see we have Ken Thompson in da house :) He is our trusted > CVS maintainer and the guy that purchased the rxtx.org domain. Old > community. We will need Ken for changing the directory structure of > source. > > I would like to open up discussion about both of these as it is > more than time. The problem is I have little experience with Ant > and even less with IDEs. It would be nice if we could work with > Eclipse and NetBeans. > > http://www.netbeans.org/ (sun and some community) > http://www.eclipes.org (ibm,rhat,... perhaps more community) > http://maven.apache.org/what-is-maven.html (apache. It is community) > borland should sortof be here too but I think thats covered in > eclipse. > >> From what I understand so far, we should morph rxtx to support >> those three > maybe trusting apaches lead with maven. But I use vi. I have > little to no clues beyond what people have fed me. > Maven likes the directory structure below for Java code. (From http:// maven.apache.org/guides/getting-started/index.html) This structure works fine with ant, netbeans, and eclipse. rxtx_root_directory `-- src |-- main | `-- java | `-- gnu | `-- io `-- test `-- java `-- gnu `-- io Brian Schlining Software Engineer http://www.mbari.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/d9451eba/attachment-0052.html From tjarvi at qbang.org Mon Feb 6 15:11:45 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 15:11:45 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: > rxtx_root_directory > `-- src > |-- main > | `-- java > | `-- gnu > | `-- io > `-- test > `-- java > `-- gnu > `-- io > >From what I understand this will just be good. For me it makes no difference. So lets do the rxtx thing. Let if fester for two weeks and if nobody objects, we will do it. I'm not doing this because I care. I'm doing this to eliminate much of my inbox. But test... man is rxtx lacking there in the community aspect. It is covered but not right. _maybe_ I can change that this year. -- Trent Jarvi tjarvi at qbang.org (cat hurding since 1997) From lux at diesel-research.com Mon Feb 6 21:38:49 2006 From: lux at diesel-research.com (Kim Lux) Date: Mon, 06 Feb 2006 21:38:49 -0700 Subject: [Rxtx] How can I use Lock Files with rxtx (in FC4) ? Message-ID: <1139287129.17031.3.camel@zd7280> I am now running an rxtx application on FC4. I am getting: ========================================================= check_group_uucp(): error testing lock file creation Error details: Permission denied check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL ========================================================= $ ls -al /var/lock total 32 drwxrwxr-x 4 root lock 4096 Feb 6 16:04 . drwxr-xr-x 24 root root 4096 Nov 14 01:19 .. drwx------ 2 root root 4096 Apr 27 2005 lvm drwxr-xr-x 2 root root 4096 Feb 6 16:04 subsys How do I fix this for regulator users ? -- Kim Lux, Diesel Research Inc. From dmarkman at mac.com Mon Feb 6 22:24:44 2006 From: dmarkman at mac.com (Dmitry Markman) Date: Tue, 7 Feb 2006 00:24:44 -0500 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: if I understands the issue right in order to be able to use ant for c/c++ compilation you have to install ant's cc task http://ant-contrib.sourceforge.net/cc.html it looks like it should work on mac os x (authors claim, that it's platform independent) but I never tested so all you have to do it's providing right command line for the gcc compiler On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: >> rxtx_root_directory >> `-- src >> |-- main >> | `-- java >> | `-- gnu >> | `-- io >> `-- test >> `-- java >> `-- gnu >> `-- io >> > > >> From what I understand this will just be good. > > For me it makes no difference. So lets do the rxtx thing. Let if > fester for two weeks and if nobody objects, we will do it. > > I'm not doing this because I care. I'm doing this to eliminate > much of my inbox. > > But test... man is rxtx lacking there in the community aspect. It > is covered but not right. _maybe_ I can change that this year. > > -- > Trent Jarvi > tjarvi at qbang.org > (cat hurding since 1997) > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx Dmitry Markman From lux at diesel-research.com Mon Feb 6 23:20:15 2006 From: lux at diesel-research.com (Kim Lux) Date: Mon, 06 Feb 2006 23:20:15 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? Message-ID: <1139293215.3689.4.camel@zd7280> I'm running the code below. portlist.hasMoreElements() is false. /dev has ports in it as listed below. What am I doing wrong ? ========================================================== // Step through the list of ports until we find one that matches // the one we are looking for. portList = CommPortIdentifier.getPortIdentifiers(); while(portList.hasMoreElements()) { portID = (CommPortIdentifier) portList.nextElement(); // if (portID.getName().equals("/dev/ttyUSB0")) { myTA.append("Serial port ttyUSB0 has been found\n"); break; }// if portID equals... }// End of while... ========================================================== ls -al /dev/tty* crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 ... crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 -- Kim Lux, Diesel Research Inc. From david.garnier at trusted-logic.com Tue Feb 7 00:46:30 2006 From: david.garnier at trusted-logic.com (David Garnier) Date: Tue, 07 Feb 2006 08:46:30 +0100 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: <43E85056.2090608@trusted-logic.com> Hello, I think that the make-based build process is fine as it is, apart from the location of the Java source files. It is true that putting the Java source in a directory structure that map 1-to-1 to the Java package structure is the norm and should make it easier for everyone to modify the Java source, with or without an IDE. Ant is a good tool, but in the RXTX case I fail to see the advantage of using it compared to the current make-based process. As Trent said, they are more pressing issues, like testing. Regards, David Dmitry Markman wrote: > if I understands the issue right > in order to be able to use ant for c/c++ compilation > you have to install ant's cc task > http://ant-contrib.sourceforge.net/cc.html > > it looks like it should work on mac os x > (authors claim, that it's platform independent) > but I never tested > > so all you have to do it's providing right command line > for the gcc compiler > > > > > On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: > >>> rxtx_root_directory >>> `-- src >>> |-- main >>> | `-- java >>> | `-- gnu >>> | `-- io >>> `-- test >>> `-- java >>> `-- gnu >>> `-- io >>> >> >> >>> From what I understand this will just be good. >> >> For me it makes no difference. So lets do the rxtx thing. Let if >> fester for two weeks and if nobody objects, we will do it. >> >> I'm not doing this because I care. I'm doing this to eliminate much >> of my inbox. >> >> But test... man is rxtx lacking there in the community aspect. It is >> covered but not right. _maybe_ I can change that this year. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> (cat hurding since 1997) From tjarvi at qbang.org Tue Feb 7 01:11:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 01:11:31 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <43E85056.2090608@trusted-logic.com> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: On Tue, 7 Feb 2006, David Garnier wrote: > Hello, > > I think that the make-based build process is fine as it is, apart from the location of the Java > source files. It is true that putting the Java source in a directory structure that map 1-to-1 to > the Java package structure is the norm and should make it easier for everyone to modify the Java > source, with or without an IDE. > > Ant is a good tool, but in the RXTX case I fail to see the advantage of using it compared to the > current make-based process. As Trent said, they are more pressing issues, like testing. > Hi David I have more experience with testing rxtx than I can talk about. But let it be known, rxtx has gone trough 100's of hours of testing. We are hobby folks interested in toys but there is more. rxtx has had some of the best guidance in the industry there. This is not an easy thing. I may be able to come back in a month from the other side of the corperate fence and help. I suspect the tests could just be made public but they are in a very unusual environment that just wont work in a wider sense. This is something I'll be trying to change. At one point it was agreed we could just make the results public so this isnt just noise.. There is interest and I think its safe to mention that much. The big problem with testing in the past is most of it is done with a loopback connection. So we *still* have major questions regarding things like flow control. rxtx talks to itself over a loopback and it works. regardless of right or wrong. This requires more thought to be done right. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Feb 7 02:46:34 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 02:46:34 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: > The big problem with testing in the past is most of it is done with a > loopback connection. So we *still* have major questions regarding things > like flow control. rxtx talks to itself over a loopback and it works. > regardless of right or wrong. With serial communication there are gold standards. ckermit is probably a definitive 'standard.' Maybe its possible to do ping/pong tests with ckermit? Is it scriptable? There are known issues in rxtx. Probably the worst is some threading issues regarding some JREs with multiple JNI threads setting java variables. Man did I get schooled there. Just switch the c functions to returning variables and things go away. Sometimes they work fine, sometimes they blow up. Without understanding everything, somehow rhat got it right and debian (and especially gentoo) grabbed kernel patches causing all sort of harm. Its not hard to fix once you understand whats going on but nearly impossible to track with a debugger. So I have a good idea what 2.1-8 will have outside of the IDE modifications. rxtx 2.1-7 is a release for everyone to sync with. Its not even as stable as -pre17 as far as I know - I ran no test suites. I'll be chasing it too. We just had so many contributions that it was time. It seriously broke internal scheduals but thats a great thing :) The other thing I want to do in 2.1-8 is automagic baud rates. It turns out lots of shops are doing really funky baud rates for things like automobile test equipment. It is possible but it requires a fair amount of change in the native code. Is anyone looking at this? -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Feb 7 02:57:21 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 07 Feb 2006 04:57:21 -0500 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <43E85056.2090608@trusted-logic.com> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: Hi All, I agree, testing is very important. The problem I have been trying to address is related to cross-platform testing and the robust nature of the installs. Typically, I visit 3 platforms to deploy my product, windows, linux and mac. A build is performed on each platform. The idea that you can build for many platforms from one copy the source code seems attractive. This should enable synchronized deployments of identical code. The question of how to achieve this goal remains open. As Trent mentioned, this is hard. Perhaps Ant will help here (but perhaps not). Ant does seem to help with running unit tests. However, it does not help with multi-platform tests. For that you need many machines and different operating environments. Toward that end, I have created a multi-platform test that can be run from web start, located at: http://show.docjava.com:8086/book/cgij/code/jnlp/serialPort.PortTest.jnlp This is interesting because many people in the community can run the test and we can improve the test, as time permits. No, it is not a perfect solution, however, the idea does help with multi-platform tests using many machines and different operating environments. If the group has a good test for a general serial port set-ups, i would be happy to deploy it, for general evaluation using web start. And as for ANT, it is just an idea. Not all my ideas are good ones! - Doug >Hello, > >I think that the make-based build process is fine as it is, apart >from the location of the Java >source files. It is true that putting the Java source in a directory >structure that map 1-to-1 to >the Java package structure is the norm and should make it easier for >everyone to modify the Java >source, with or without an IDE. > >Ant is a good tool, but in the RXTX case I fail to see the advantage >of using it compared to the >current make-based process. As Trent said, they are more pressing >issues, like testing. > >Regards, >David > >Dmitry Markman wrote: >> if I understands the issue right >> in order to be able to use ant for c/c++ compilation >> you have to install ant's cc task >> http://ant-contrib.sourceforge.net/cc.html >> >> it looks like it should work on mac os x >> (authors claim, that it's platform independent) >> but I never tested >> >> so all you have to do it's providing right command line >> for the gcc compiler >> >> >> >> >> On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: >> >>>> rxtx_root_directory >>>> `-- src >>>> |-- main >>>> | `-- java >>>> | `-- gnu >>>> | `-- io >>>> `-- test >>>> `-- java >>>> `-- gnu >>>> `-- io >>>> >>> >>> >>>> From what I understand this will just be good. >>> >>> For me it makes no difference. So lets do the rxtx thing. Let if >>> fester for two weeks and if nobody objects, we will do it. >>> >>> I'm not doing this because I care. I'm doing this to eliminate much >>> of my inbox. >>> >>> But test... man is rxtx lacking there in the community aspect. It is >>> covered but not right. _maybe_ I can change that this year. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> (cat hurding since 1997) > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From matt.higgins at gmail.com Tue Feb 7 08:28:34 2006 From: matt.higgins at gmail.com (Matt Higgins) Date: Tue, 7 Feb 2006 10:28:34 -0500 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final Message-ID: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? import java.io.*; import java.util.*; import gnu.io.*; public class MySimpleRead implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; public static void main(String[] args) { boolean portFound = false; String defaultPort = "COM1"; if (args.length > 0) { defaultPort = args[0]; } portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; MySimpleRead reader = new MySimpleRead(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } } public MySimpleRead() { try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) { e.printStackTrace(); } try { inputStream = serialPort.getInputStream(); } catch (IOException e) { e.printStackTrace(); } try { serialPort.addEventListener(this); } catch (TooManyListenersException e) { e.printStackTrace(); } try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { e.printStackTrace(); } System.out.println("Baud is " + serialPort.getBaudRate()); System.out.println("Bits is " + serialPort.getDataBits()); System.out.println("Stop is " + serialPort.getStopBits()); System.out.println("Par is " + serialPort.getParity()); serialPort.notifyOnDataAvailable(true); readThread = new Thread(this); readThread.start(); } public void run() { // Thread.sleep(20000); //} catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { System.out.println("An event occurred " + event.getEventType()); switch (event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: byte[] readBuffer = new byte[20]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } System.out.print(new String(readBuffer)); } catch (IOException e) {} break; } } } --------------- Result on windows ------------------------------ Stable Library ============================================================== Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port:: COM1 Baud is 9600 Bits is 8 Stop is 1 Par is 0 ----------------- End Results ----------------------------------------- ------------------ Result on Linux ----------------------------------- Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 Found port: /dev/ttyS0 Baud is 9600 Bits is 8 Stop is 1 Par is 0 An event occurred 1 043100066224 ------------------ End Results --------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/a1431630/attachment-0052.html From brian at mbari.org Tue Feb 7 09:48:37 2006 From: brian at mbari.org (Brian Schlining) Date: Tue, 7 Feb 2006 08:48:37 -0800 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> Message-ID: <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> Hi Matt > The following code works fine on Linux but I never see any data > when run on Windows. This is a cut and paste from the SimpleRead > example. > I am attempting to read data from a bar code scanner. I can fire > up HyperTermianl on windows and see that the device is working > properly as I see the barcodes are scanned and echoed back to the > terminal. However when I run the app I don't see any data. It is > however associating with the com port as the informational bits > print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. Cheers Brian Schlining Software Engineer http://www.mbari.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/16d07f37/attachment-0052.html From lux at diesel-research.com Tue Feb 7 11:59:58 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 11:59:58 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139293215.3689.4.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> Message-ID: <1139338798.8145.4.camel@zd7280> Any ideas on this ? Any reason why portList.hasMoreElements() should be false even though there are devices in /dev ? On Mon, 2006-02-06 at 23:20 -0700, Kim Lux wrote: > I'm running the code below. > > portlist.hasMoreElements() is false. > > /dev has ports in it as listed below. > > What am I doing wrong ? > > > ========================================================== > // Step through the list of ports until we find one that matches > // the one we are looking for. > > portList = CommPortIdentifier.getPortIdentifiers(); > > while(portList.hasMoreElements()) > { > portID = (CommPortIdentifier) portList.nextElement(); // > if (portID.getName().equals("/dev/ttyUSB0")) > { > myTA.append("Serial port ttyUSB0 has been found\n"); > break; > }// if portID equals... > }// End of while... > ========================================================== > > ls -al /dev/tty* > crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty > crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 > crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 > crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 > crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 > ... > crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 > crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 > crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 > > > -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 12:20:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 12:20:25 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139338798.8145.4.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> Message-ID: On Tue, 7 Feb 2006, Kim Lux wrote: > > Any ideas on this ? Any reason why portList.hasMoreElements() should be > false even though there are devices in /dev ? > > > On Mon, 2006-02-06 at 23:20 -0700, Kim Lux wrote: >> I'm running the code below. >> >> portlist.hasMoreElements() is false. >> >> /dev has ports in it as listed below. >> >> What am I doing wrong ? >> >> >> ========================================================== >> // Step through the list of ports until we find one that matches >> // the one we are looking for. >> >> portList = CommPortIdentifier.getPortIdentifiers(); >> >> while(portList.hasMoreElements()) >> { >> portID = (CommPortIdentifier) portList.nextElement(); // >> if (portID.getName().equals("/dev/ttyUSB0")) >> { >> myTA.append("Serial port ttyUSB0 has been found\n"); >> break; >> }// if portID equals... >> }// End of while... >> ========================================================== >> >> ls -al /dev/tty* >> crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty >> crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 >> crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 >> crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 >> crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 >> ... >> crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 >> crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 >> crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 >> >> >> > Hi Kim What rxtx does is try to open the port and do a timed out read. If the kernel/... do not complain it's enumarted. I suspect you could do a crude test by doing something like cat /dev/ttyS0 > /dev/null If that barfs then rxtx wont enumerate the port. hmm looking at your question again, I suspect it's a lockfile problem. This is documented in INSTALL with the source. Its easy enough to test this too.. touch /var/lock/testingrxtxlockfiles && rm -f /var/lock/testingrxtxlockfiles If you are not in the right group it will bail. Root will work regardless. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 12:37:56 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 12:37:56 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> Message-ID: <1139341076.8145.11.camel@zd7280> Exactly which ports does rxtx attempt to put into the list ? /dev/* or /dev/tty* or /dev/tty[0-9[0-9] ? or /dev/ttyS* ? For the record, only /dev/ttyUSB0 is a valid port on the machine I am presently on. Will this be a problem ? On Tue, 2006-02-07 at 12:20 -0700, Trent Jarvi wrote: > This is documented in INSTALL with the source. > I was wondering where that file was. I will download source and dig it up. Thanks. -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 12:51:09 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 12:51:09 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139341076.8145.11.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: On Tue, 7 Feb 2006, Kim Lux wrote: > > Exactly which ports does rxtx attempt to put into the list ? /dev/* > or /dev/tty* or /dev/tty[0-9[0-9] ? or /dev/ttyS* ? > > For the record, only /dev/ttyUSB0 is a valid port on the machine I am > presently on. Will this be a problem ? > > > On Tue, 2006-02-07 at 12:20 -0700, Trent Jarvi wrote: >> This is documented in INSTALL with the source. >> > I was wondering where that file was. I will download source and dig it > up. > > Thanks. > Hmm I'm looking at pre17 so this may have changed. (its just what I have on this machine) if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA" // for the IPAQs }; CandidatePortPrefixes=Temp; } So you may need to add "ttyUSB" to that list. RXTX used to enumerate _everything_ see if(osName.equals("Linux-all-ports") But it became less than practical. This is all in RXTXCommDriver.java hmm I just did a cvs update. if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have to get your fingers into the code. We aim for sane defaults. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 13:06:45 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 13:06:45 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139342805.8145.22.camel@zd7280> On Tue, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > Hmm I'm looking at pre17 so this may have changed. (its just what I have > on this machine) > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA" // for the IPAQs > }; > CandidatePortPrefixes=Temp; > } > > > So you may need to add "ttyUSB" to that list. RXTX used to enumerate > _everything_ see if(osName.equals("Linux-all-ports") But it became less > than practical. > > This is all in RXTXCommDriver.java > > hmm I just did a cvs update. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have > to get your fingers into the code. We aim for sane defaults. Excellent. Thanks for taking the time. -- Kim Lux, Diesel Research Inc. From ideiglenes1 at freemail.hu Tue Feb 7 13:53:39 2006 From: ideiglenes1 at freemail.hu (--) Date: Tue, 07 Feb 2006 21:53:39 +0100 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139345619.22534.2.camel@localhost> Hi! I use this code to get all the extra Linux devices. :) if ("Linux".equals(System.getProperty("os.name"))) { System.setProperty("os.name","Linux-all-ports"); } driver = new RXTXCommDriver(); On k, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > On Tue, 7 Feb 2006, Kim Lux wrote: > > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have > to get your fingers into the code. We aim for sane defaults. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From matt.higgins at gmail.com Tue Feb 7 13:45:54 2006 From: matt.higgins at gmail.com (Matt Higgins) Date: Tue, 7 Feb 2006 15:45:54 -0500 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> Message-ID: <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> Sweet this is exactly what I needed. I was searching the archives through marc.theamisgroup they only have archives back to 1/3/05. Should have hit the mailman archive! Thanks a lot! On 2/7/06, Brian Schlining wrote: > > Hi Matt > > The following code works fine on Linux but I never see any data when run > on Windows. This is a cut and paste from the SimpleRead example. > I am attempting to read data from a bar code scanner. I can fire up > HyperTermianl on windows and see that the device is working properly as I > see the barcodes are scanned and echoed back to the terminal. However when I > run the app I don't see any data. It is however associating with the com > port as the informational bits print fine? > > > You're not the only one whose had this problem, I don't know if Trent has > addressed this is the latest release of RXTX but there is a workaround. > Here's the recent thread from the RXTX mailing list regarding this issues: > > Thanasis Delenikas tdelenik at gmail.com > Wed Jan 18 13:56:23 MST 2006 > > * Previous message: [Rxtx] Re: More close() performance fixes > * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] > > Hi all. > (I've subscribed again from my other email account). > > Trent, > > You are right. Linux *always* works, no matter what flow control you set. > Windows *works only* with hardware flow control (I haven't tested what > happens with software XON/XOFF flow control). > > I assume (but I am not certain) that even with no flow control at all, all > platforms should work. Without flow control, you have the risk of bumping > into overflow or framing errors, but that's your (the end programmer, I > mean) problem. > > >From my side, I shouldn't be working without flow control. That was a bug > too... It was some code forgotten from the old times, when I used to work > with phone emulation drivers which didn't support flow control. The > correct > way is to have some flow control enabled and that's why I suppose this is > a > low-severity bug for RxTx. > > I have no idea which platform shows the correct behaviour, since > my knowledge about Linux and the inner workings of these low-level i/o > operations is limited. > > Regards, > Thanasis Delenikas. > > > > > Message: 2 > > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > > From: Trent Jarvi > > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > > To: RXTX Developers and Users > > Message-ID: > > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > > > Hi all, > > > > > > Trent, I have found something. > > > I read your comment about flow control, so I experimented a bit. > > > > > > If you remember, in my sample program I've used no flow control at all > ( > > i.e. > > > Java constant FLOWCONTROL_NONE). > > > > > > Now, during testing, I've switch to hardware inbound flow control (i.e > . > > Java > > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > > beautifully! > > > > > > I think I will switch to H/W flow control and test things for a while, > > but > > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > > > > > Hi Thanasis, > > > > I'm fairly sure you have identified a bug. I would not worry too much > > about what Sun CommAPI w32 defaults are. I think they did more or less > > whatever the port opened with. Just a guess. Linux tries to stomp on > > ports so they are all the same. > > > > So this started out with Linux worked, Windows XP/.. did not as I > recall. > > Something is wrong in rxtx. Do I understand this right? > > > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > > > Perhaps there is something Wayne or I did not understand when we wrote > > that code. I wasnt programming back in the BBS days so modems are not > my > > thing. I have a few questions. > > > > Is the above matrix confirmed by observation? > > Linux just always worked? > > Which one _should_ work? I'm guessing modems work with hardware flow > > control. I'll have to dig around. > > > > The windows flow control changes a couple things with hardware flow > > control. Following the w32 API documentation is confusing sometimes. > > But it looks like Linux could have a bug too. > > Cheers > > Brian Schlining > Software Engineer > http://www.mbari.org > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/9c989144/attachment-0052.html From tjarvi at qbang.org Tue Feb 7 14:06:14 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 14:06:14 -0700 (MST) Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> Message-ID: >> >> You're not the only one whose had this problem, I don't know if Trent has >> addressed this is the latest release of RXTX but there is a workaround. >> Here's the recent thread from the RXTX mailing list regarding this issues: >> I have not. I expect to have access to some test equipment next month and I'll go through all of this. I really don't know whats going on and I need a gold standard. I thought maybe linux was autodetecting the flow control. Your observations would certainly be welcome. I need to talk to Russell King and see what he is doing. Until then I'd just be toying around over a loopback as usual. This is very high on the list though. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 17:25:05 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 17:25:05 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139358305.17994.2.camel@zd7280> My application now works. I installed the libraries and jar from 2.1-7 (Final). portlist.hasMoreElements is no longer false. The application finds the port for /dev/ttyUSB0. Thanks for your help, Trent (et al) Sorry I bothered you with this. Next time I will look in the source first. I didn't think it was an rxtx issue, I thought it was a Linux setup issue . On Tue, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > Hmm I'm looking at pre17 so this may have changed. (its just what I > have > on this machine) > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux > Serial Ports > "ttySA" // for the > IPAQs > }; > > CandidatePortPrefixes=Temp; > } > > > So you may need to add "ttyUSB" to that list. RXTX used to enumerate > _everything_ see if(osName.equals("Linux-all-ports") But it became > less > than practical. > > This is all in RXTXCommDriver.java > > hmm I just did a cvs update. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux > Serial Ports > "ttySA", // for the > IPAQs > "ttyUSB" // for USB > frobs > }; > > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you > have > to get your fingers into the code. We aim for sane defaults. -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 19:21:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 19:21:54 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139358305.17994.2.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> <1139358305.17994.2.camel@zd7280> Message-ID: >Sorry I bothered you with this. Next time I will look in the source >first. I didn't think it was an rxtx issue, I thought it was a Linux >setup issue . Why would you be sorry? I would have done the same. I'm glad it's working :) -- Trent Jarvi tjarvi at qbang.org From tma at mail.island.net Wed Feb 8 13:39:35 2006 From: tma at mail.island.net (Tom Alldread) Date: Wed, 08 Feb 2006 12:39:35 -0800 Subject: [Rxtx] Win32/Linux Serial Port Data Dropouts In-Reply-To: <200602060702.k167255O007882@www.qbang.org> References: <200602060702.k167255O007882@www.qbang.org> Message-ID: <43EA5707.4020200@mail.island.net> Greetings Folks at RXTX: During the last couple of months I have been alternately testing with javax.comm 2 and RXTX 2.1 under Windows XP and CommApi 3 and RXTX 2.1 under Suse 10.0 Linux. In the process I have learned a little about java multi-threading under NetBeans 5 with Profiler. My java (jdk 1.5_06) application is used for data acquisition and provides a graphical display of A-D conversion data received from a 56KBaud serial port. The actual data throughput is about 10KBaud thus it is well below the speed of the port. I use hardware RTS/CTS flow control which can stall the data acquisition sample rate if necessary. This ensures the display computer has the ability to slow the data acquisition rate should it become too busy to accept the regular data flow. Both the serial port buffer and the java read buffer are set at 16KB. Usually the data transfers into the java read buffer are less than 100 bytes unless the data acquisition is recovering from a stall. The data flow normally hesitates after each 5 KB block as a continue command is needed from the display computer to start the drawing of a new graphics display line. Separate threads have been provided for the serial port event monitoring and data processing. The serial port event thread has been given the maximum priority and data processing thread the minimum priority provided by java. Thread yield statements have been placed within all data processing while/for loops as an effort to ensure quick access to CPU cycles for the serial port event thread. I have found that short data transmissions are essentially error free but occasional dropouts occur with continuous data flow especially under Windows XP. ....................................................................................................................................................................................... Linux results: I am happy to report that RXTX 2.1 appears to work very well under Linux although I did notice some errors when the screen savers were running with my dual monitors. I believe this is a local problem associated with my dual graphics which needs further attention. The recent CommApi 3 Linux release from Sun did not work at all with my program. It seemed to send commands out OK but did not receive any data. Although the serial port event triggered the ISR, the input stream appeared filled with nulls and thus did not contain any data. As my understanding is that CommApi 3 was tested with a Red Hat distribution of Linux I wonder if this problem is distro dependent? Although somewhat off topic here I wonder if anyone reading this has had similar experience? .................................................................................................................................................................................. Windows XP results: There are problems with occasional data dropouts which become more frequent as the sampling rate is increased or if the computer becomes busy with other duties. The dropouts typically consist of a half dozen byte block of lost data. It appears the lost bytes never get added to the java input stream. There has not been any indication of garbled data, overruns or framing errors which suggests the UART communications remains solid. Using javax.comm 2 I found that the setting of SerialPort 'enableReceiveThreshold' to 40 and 'enableReceiveTimeout' of 100mS reduced the dropouts error rate significantly. I found that I could not get RXTX 2.1 to function with the aforementioned threshold and timeout settings. The javax.comm 2 interface is consequently performing better for me under Windows than RXTX 2.1. I wonder if anyone here has any suggestions as to what I might try to improve RXTX 2.1? Although my settings are the same as under Suse 10.0, RXTX 2.1 performs much better for me under Linux than any of the alternatives that I have tried under Windows XP . ............................................................................................................................................................................... I would like to establish, based on the experience of others, if I have reached the normally expected performance limit of java serial port communications? Should I expect to achieve virtually error free serial port data input from a continuous stream under Windows XP java software? I am considering changing my protocol to packets with error checking if necessary but would like to know if the dropout problems I am experiencing are typical or not before I take this rather work intensive plunge. Many thanks in advance for any help! Best Regards, Tom Alldread -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.375 / Virus Database: 267.15.2/253 - Release Date: 2006-02-07 From jlaxson at mac.com Wed Feb 8 23:56:48 2006 From: jlaxson at mac.com (John Laxson) Date: Thu, 9 Feb 2006 00:56:48 -0600 Subject: [Rxtx] PortInUseException: Unknown Application on OSX Message-ID: Hi, I've been trying to get RXTX 2.1.7 going on Mac OS X for a while here, and am running up into a wall here. I've tried with pre- compiled and the source version and get the same problem, a gnu.io.PortInUseException: Unknown Application. I have run the fixperms script included with the source distribution, and id shows me as a member of the uucp group, and permissions on /var/spool/uucp are 775 root:uucp. Running a test program (included at the bottom for clarity) lets me enumerate all the serial ports correctly, but trying to open any of them gives the PortInUseException. If it helps, when I try to open a port that's set to make an outgoing bluetooth connection, there is no delay and no connection attempt at all. Thanks, John Laxson PS: The documentation wiki on qbang.org shows 404, and has for a few days now. My test code: public static void main(String[] args) { SerialPort serialPort; try { Enumeration e = CommPortIdentifier.getPortIdentifiers(); CommPortIdentifier ident; while (e.hasMoreElements()) { ident = (CommPortIdentifier)e.nextElement(); System.out.println(ident.getName()); } ident = CommPortIdentifier.getPortIdentifier("/dev/cu.modem"); serialPort = (SerialPort) ident.open("Me", 5000); } catch (Exception e) { e.printStackTrace(); } } From rajesh.invincible at gmail.com Thu Feb 9 03:39:38 2006 From: rajesh.invincible at gmail.com (Rajesh N) Date: Thu, 9 Feb 2006 16:09:38 +0530 Subject: [Rxtx] Re: Move .java Files in gnu.io filesystem hierarchy - Maven (2) In-Reply-To: <43DF21D2.7090200@ngi.it> References: <43DF21D2.7090200@ngi.it> Message-ID: <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Can anybody tell me how to overcome these EXCEPTIONS I AM WORKING ON SERIAL COMMN IN JAVA ON LINUX. 1. " NOT ALL PARAMETERS SUPPORTED BY THE KERNEL" This i came across the following statement inmy prog. SerialP is A SerialPort object SerialP.setSerialPortParams(9600(BAUDRATE),DATABITS_8,STOPBITS_1,PARITY_NONE) 2. NullPointer Exception at Event Dispatch Now i have checked all my object references for a null reference but i found none i have put up my entire code in try catch blocks but still I AM UNABLE TO CATCH THIS EXCEPTION AND HENCE MY APPLICATION CLOSES HOW DOES THESE GO? PLEASE HELP ME IT IS URGENTTTTTTTTTTTTTTTT yours sincerely RAJESH On 1/31/06, Fabio Frumento wrote: > Hi Xavier, > > I don't know maven at all but the directory hierarchy listed buy Trent > is fine for me... > > I'll take a look to maven, it seems an interesting project > > Regards > > Fabio Frumento > > Trent Jarvi wrote: > > On Tue, 31 Jan 2006, Xavier Frisaye wrote: > > > >> Hi all, > >> > >> If you are going to rearrange the src folder, i will propose to use > >> maven 2 and follow its directory structure > >> > (http://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html). > >> > >> Maven 2 simplify java project and give a standard way to make projects > >> (http://maven.apache.org/). > >> We are using it for internal projects and we are very satisfied. > >> > >> Is anybody interested? > >> > >> I'm not an expert in maven 2 (yet) but i'm agree to help using it if > >> you choose to make so. > >> > > > > so this would be: > > > > rxtx-devel/src/main/java/gnu.io > > rxtx-devel/src/test/java/ManIwish.java > > > > I don't use IDEs very much so I'll let others comment. But I don't see > > a problem with that. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Thu Feb 9 09:50:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 9 Feb 2006 09:50:31 -0700 (MST) Subject: [Rxtx] Re: Move .java Files in gnu.io filesystem hierarchy - Maven (2) In-Reply-To: <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Message-ID: On Thu, 9 Feb 2006, Rajesh N wrote: > Can anybody tell me how to overcome these EXCEPTIONS > I AM WORKING ON SERIAL COMMN IN JAVA ON LINUX. > > 1. " NOT ALL PARAMETERS SUPPORTED BY THE KERNEL" > > This i came across the following statement inmy prog. > SerialP is A SerialPort object > SerialP.setSerialPortParams(9600(BAUDRATE),DATABITS_8,STOPBITS_1,PARITY_NONE) > Strange. The parameters you use are the same the port should open with by default. Could you paste the actual exception you are getting? I don't see that in the rxtx source. Also it would help to know the rxtx version. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Fri Feb 10 15:29:05 2006 From: lux at diesel-research.com (Kim Lux) Date: Fri, 10 Feb 2006 15:29:05 -0700 Subject: [Rxtx] One serial port object for both sending and receiving ? Message-ID: <1139610545.18177.4.camel@zd7280> Is it OK to use one SerialPort ojbect (ex Serial Port serialPort;) and use it for both sending and receiving ? For example: ======================================================================== static SerialPort serialPort = null; static OutputStream serialOut = null; static InputStream serialIn = null; // assign it to an outputStream for use try{ serialOut = serialPort.getOutputStream(); System.out.println("Serial output stream has been assigned."); }//try catch(IOException e) { System.out.println("Error: Couldn't assign output stream to serial port."); }//catch //assign it to an inputStream for use try{ serialIn = serialPort.getInputStream(); System.out.println("Serial input stream has been assigned."); }//try catch(IOException e) { System.out.println("Error: Couldn't assign input stream to serial port."); }//catch ======================================================================== -- Kim Lux, Diesel Research Inc. From lux at diesel-research.com Fri Feb 10 21:23:00 2006 From: lux at diesel-research.com (Kim Lux) Date: Fri, 10 Feb 2006 21:23:00 -0700 Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Message-ID: <1139631780.23882.10.camel@zd7280> I've got a problem receiving chars with my version of serialRead, written in an SWT GUI. I had a Java pro have a good look at my code and he can't see anything wrong with it. I can send chars fine. When I receive a char the cpu usage for the app goes to 100% and the code in the serial event handler doesn't get executed. The instructions on the Java Comm Serial API How-To for Linux page state that I must install javacomm. Is that true ? Everything builds without it and I can send chars on rxtx just fine, but I can't receive them. Could this be the problem ? I downloaded and installed javacomm. I was not able to add "Driver=gnuio.RXTXCommDriver to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 installed in /usr/java/jre1.5.0_05. I added comm.jar to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext to the library paths. Is this OK ? Does it matter that I am receiving on /dev/ttyUSB0 ? Thanks. -- Kim Lux, Diesel Research Inc. From lunareclipse03 at web.de Sat Feb 11 09:44:46 2006 From: lunareclipse03 at web.de (lunareclipse03@web.de) Date: Sat, 11 Feb 2006 17:44:46 +0100 Subject: [Rxtx] Question about Serial I/O under Win32 Message-ID: <662084330@web.de> Hello everybody, I have a strange problem with a piece of code I made for myself. No, this is not really concerning rxtx, but nevertheless I post this to the list, hoping that some of you can help me. I've written two libraries, one for linux and one for win32. The linux port works quite well, I can send / receive faxes and / or replay voice messages over the telephone line using a voice modem. But the win32 port of the library causes some trouble. If, for example, I send out a fax with a certain modem under linux, it works well. The fax is complete when it comes out of the fax machine. If I then use the same modem to send out a fax under win32, the fax coming out of the fax machine gets "stuck" halfways, but the sending modem thinks that transmission was ok and drops the connection. The answering fax machine then gives me "error while receiving." The "upper layer" java code MUST be right, because if I do the same thing under linux (using the linux library), everything is alright. Now I have to ask: Can somebody please help me out with this??!? Could it be the case that some kind of flow control or COMMTIMEOUTS setting causes this behaviour? I set flow control to RTS/CTS before sending out a fax. How can I DISABLE flow control? Or what do you think? Can something else cause this problems? Thank you all for your time and PLEASE write back soon. Regards, --Sven Ahlemann Am Waldrand 31 45721 Haltern am See Germany ______________________________________________________________ Verschicken Sie romantische, coole und witzige Bilder per SMS! Jetzt bei WEB.DE FreeMail: http://f.web.de/?mc=021193 From lux at diesel-research.com Sat Feb 11 10:06:52 2006 From: lux at diesel-research.com (Kim Lux) Date: Sat, 11 Feb 2006 10:06:52 -0700 Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: <1139631780.23882.10.camel@zd7280> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> <1139631780.23882.10.camel@zd7280> Message-ID: <1139677612.3431.5.camel@zd7280> More on this problem. I copied and pasted simpleRead into a console based Eclipse project and I've got the same result, except that cpu usage doesn't go to 100%. I'm beginning to think there is an issue in rxtx. My imports for simpleRead are: ============================ import gnu.io.*; import java.util.*; //import javax.comm.*; import java.io.*; =========================== Any ideas ? I am trying to read from /dev/ttyUSB0 using a serial to USB adapter which has worked well with minicom and gtkterm. Thanks. On Fri, 2006-02-10 at 21:23 -0700, Kim Lux wrote: > I've got a problem receiving chars with my version of serialRead, > written in an SWT GUI. > > I had a Java pro have a good look at my code and he can't see anything > wrong with it. > > I can send chars fine. When I receive a char the cpu usage for the app > goes to 100% and the code in the serial event handler doesn't get > executed. > > The instructions on the Java Comm Serial API How-To for Linux page state > that I must install javacomm. Is that true ? Everything builds without > it and I can send chars on rxtx just fine, but I can't receive them. > Could this be the problem ? > > I downloaded and installed javacomm. I was not able to add > "Driver=gnuio.RXTXCommDriver > to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not > have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 > installed in /usr/java/jre1.5.0_05. I added comm.jar > to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext > to the library paths. Is this OK ? > > Does it matter that I am receiving on /dev/ttyUSB0 ? > > Thanks. > -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Sun Feb 12 21:01:33 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:01:33 -0700 (MST) Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: <1139677612.3431.5.camel@zd7280> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> <1139631780.23882.10.camel@zd7280> <1139677612.3431.5.camel@zd7280> Message-ID: I suspect what is happening is the select() is breaking out in the native code but the driver does not have support for notifying there are X bytes available. On some traditional Unix based systems, the only way you know data is available is the fd status changes and do an FIORDCHK ioctl. Or perhaps the only thing you can know is the fd status changed. It would take reading through the kernel driver code to know for sure. So on USB, depending upon the driver, the same may need to be done or the driver improved a bit if possible to support. Polling reads will also work but don't use the event driven model of CommAPI which isnt acceptable in the long run. The 100% cpu usage can then be explained because select no longer blocks until the data is read; the eventLoop spins loose. You can put a well placed sleep but rxtx only expects those are needed when it knows data is available. This may not be a super simple thing to understand and fix. I do have ideas to get you started. I'm going to be short on time the next couple weeks. I expect to put some good time in and answer some other questions I saw around the 25th. For now, I'd look at the following and go from there with the hints I've given. JNIEXPORT jint JNICALL RXTXPort(nativeavailable)( JNIEnv *env, jobject jobj ) { int fd = get_java_var( env, jobj,"fd","I" ); int result; /* char message[80]; ENTER( "RXTXPort:nativeavailable" ); On SCO OpenServer FIONREAD always fails for serial devices, so try ioctl FIORDCHK instead; will only tell us whether bytes are available, not how many, but better than nothing. This turns out to be true on Solaris also. taj. */ #ifdef FIORDCHK /* __unixware__ __sun__ probably others */ result = ioctl(fd, FIORDCHK, 0); #else if( ioctl( fd, FIONREAD, &result ) < 0 ) { goto fail; } #endif /* FIORDCHK */ On Sat, 11 Feb 2006, Kim Lux wrote: > > More on this problem. I copied and pasted simpleRead into a console > based Eclipse project and I've got the same result, except that cpu > usage doesn't go to 100%. I'm beginning to think there is an issue in > rxtx. > > My imports for simpleRead are: > > ============================ > import gnu.io.*; > import java.util.*; > //import javax.comm.*; > import java.io.*; > =========================== > > Any ideas ? I am trying to read from /dev/ttyUSB0 using a serial to > USB adapter which has worked well with minicom and gtkterm. > > Thanks. > > > > On Fri, 2006-02-10 at 21:23 -0700, Kim Lux wrote: >> I've got a problem receiving chars with my version of serialRead, >> written in an SWT GUI. >> >> I had a Java pro have a good look at my code and he can't see anything >> wrong with it. >> >> I can send chars fine. When I receive a char the cpu usage for the app >> goes to 100% and the code in the serial event handler doesn't get >> executed. >> >> The instructions on the Java Comm Serial API How-To for Linux page state >> that I must install javacomm. Is that true ? Everything builds without >> it and I can send chars on rxtx just fine, but I can't receive them. >> Could this be the problem ? >> >> I downloaded and installed javacomm. I was not able to add >> "Driver=gnuio.RXTXCommDriver >> to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not >> have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 >> installed in /usr/java/jre1.5.0_05. I added comm.jar >> to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext >> to the library paths. Is this OK ? >> >> Does it matter that I am receiving on /dev/ttyUSB0 ? >> >> Thanks. >> > From tjarvi at qbang.org Sun Feb 12 21:03:30 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:03:30 -0700 (MST) Subject: [Rxtx] One serial port object for both sending and receiving ? In-Reply-To: <1139610545.18177.4.camel@zd7280> References: <1139610545.18177.4.camel@zd7280> Message-ID: On Fri, 10 Feb 2006, Kim Lux wrote: > > Is it OK to use one SerialPort ojbect (ex Serial Port serialPort;) and > use it for both sending and receiving ? > > For example: > > ======================================================================== > static SerialPort serialPort = null; > static OutputStream serialOut = null; > static InputStream serialIn = null; > > > > > // assign it to an outputStream for use > try{ > serialOut = serialPort.getOutputStream(); > System.out.println("Serial output stream has been assigned."); > }//try > catch(IOException e) > { > System.out.println("Error: Couldn't assign output stream to serial > port."); > }//catch > > > //assign it to an inputStream for use > try{ > serialIn = serialPort.getInputStream(); > System.out.println("Serial input stream has been assigned."); > }//try > catch(IOException e) > { > System.out.println("Error: Couldn't assign input stream to serial > port."); > }//catch This should be fine. In fact trying to do it another way will probably not work as you will run into lockfile issues. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun Feb 12 21:13:13 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:13:13 -0700 (MST) Subject: [Rxtx] Question about Serial I/O under Win32 In-Reply-To: <662084330@web.de> References: <662084330@web.de> Message-ID: On Sat, 11 Feb 2006 lunareclipse03 at web.de wrote: > Hello everybody, > > I have a strange problem with a piece of code I made for myself. No, > this is not really concerning rxtx, but nevertheless I post this to the > list, hoping that some of you can help me. I've written two libraries, > one for linux and one for win32. The linux port works quite well, I can > send / receive faxes and / or replay voice messages over the telephone > line using a voice modem. But the win32 port of the library causes some > trouble. If, for example, I send out a fax with a certain modem under > linux, it works well. The fax is complete when it comes out of the fax > machine. If I then use the same modem to send out a fax under win32, the > fax coming out of the fax machine gets "stuck" halfways, but the sending > modem thinks that transmission was ok and drops the connection. The > answering fax machine then gives me "error while receiving." The "upper > layer" java code MUST be right, because if I do the same thing under > linux (using the linux library), everything is alright. Now I have to > ask: Can somebody please help me out with this??!? Could it be the case > that some kind of flow control or COMMTIMEOUTS setting causes this > behaviour? I set flow control to RTS/CTS before sending out a fax. How > can I DISABLE flow control? Or what do you think? Can something else > cause this problems? Thank you all for your time and PLEASE write back > soon. > Hi Sven I'm not too willing to talk about flow control at the low level until I confirm some things with test equipment later. It is not clear if you are using rxtx or writing your own native code. So I'm not sure how to answer much of this :) If you are wondering how to change the flow control using rxtx from java, The BlackBox example from Sun flips this back and forth. SerialPort.java in rxtx 2.1 uses the following: SerialPort.java: public static final int FLOWCONTROL_NONE =0; SerialPort.java: public static final int FLOWCONTROL_RTSCTS_IN =1; SerialPort.java: public static final int FLOWCONTROL_RTSCTS_OUT =2; SerialPort.java: public static final int FLOWCONTROL_XONXOFF_IN =4; SerialPort.java: public static final int FLOWCONTROL_XONXOFF_OUT=8; So if you set flowcontrol to RTSCTS, you can set it to NONE to turn it off. If you are looking for how to do it in native code, the rxtx Source is SerialImp.c (unix/linux/mac os x/w32) and termios.c (w32 only with SerialImp.c) You can track the code: SerialImp.c:JNIEXPORT void JNICALL RXTXPort(setflowcontrol)( JNIEnv *env, jobject jobj, jint flowmode ) termios.c:int tcgetattr( int fd, struct termios *s_termios ) termios.c:int tcsetattr( int fd, int when, struct termios *s_termios ) There may be a problem in the rxtx flow control code though. Rather than guess, I want to test this with a gold standard. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Feb 6 00:00:16 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 00:00:16 -0700 (MST) Subject: [Rxtx] wiki delay until tomorrow night. In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: On Sun, 5 Feb 2006, Trent Jarvi wrote: > On Sun, 5 Feb 2006, Kim Lux wrote: > >> usb ? Tell me more... I need that too. > > usb is a very proper design. Thats all it is. > Maybe rxtx could help usb. But it would start with helping bring back the community that was already there. It's not something I'd love to do but maybe its the right thing to do. It would probably take 2 years to do right. But maybe thats better than what we have now. I honestly don't know what IBM is doing which could just run over everything. Just some thoughts after some fine german wine. -- Trent Jarvi tjarvi at qbang.org From gadelavega at yahoo.com.ar Mon Feb 6 02:17:05 2006 From: gadelavega at yahoo.com.ar (Gonzalo A. de la Vega) Date: Mon, 06 Feb 2006 10:17:05 +0100 Subject: [Rxtx] Serial port ownership question In-Reply-To: References: <20060205113618.30274.qmail@web53501.mail.yahoo.com> <1139157422.4553.9.camel@zd7280> <1139158698.4936.9.camel@zd7280> Message-ID: <43E71411.4050402@yahoo.com.ar> On my Fedora Core 4: ls -l /dev/ttyS* crw-rw---- 1 root uucp 4, 64 Feb 6 2006 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Feb 6 2006 /dev/ttyS1 ... and: grep "ttyUSB" /etc/udev/rules.d/50-udev.rules KERNEL=="ttyUSB*", GROUP="uucp", MODE="0660" So anyone in the "uucp" group can use serial ports. On Gentoo the group is "tty". Trent Jarvi escribi?: > > > On Sun, 5 Feb 2006, Dr. Douglas Lyon wrote: > >> I can confirm that this is the case (only root ownership of >> serial ports, under fedora 4). >> Wow, what were they thinking?! >> - DL >> >>> I've found that the newer kernels have the serial ports owned by root. >>> For example, >>> >>> $ls -al /dev/tty* >>> crw-rw-rw- 1 root root 5, 0 Feb 5 02:06 /dev/tty >>> crw-rw---- 1 root root 4, 0 Feb 5 02:06 /dev/tty0 >>> crw------- 1 root root 4, 1 Feb 5 09:07 /dev/tty1 >>> crw-rw---- 1 root tty 4, 10 Feb 5 02:06 /dev/tty10 >>> crw-rw---- 1 root tty 4, 11 Feb 5 02:06 /dev/tty11 >>> ... > > > This is just not a problem jcp or such are going to solve. Its a > platform spitwad fight. But do look at pam. In fact thats what Sun > is doing too. Maybe Linux followed their lead.. I'm not a pam guy. > I've spent 16 hours trying to understand it but your users wont :) > > Solution? I have no clue. Its two tangent mentalities from my > perspective. > > -- > Trent Jarvi > tjarvi at qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mtnvega at yahoo.com.br Mon Feb 6 05:35:43 2006 From: mtnvega at yahoo.com.br (Luiz Jr) Date: Mon, 6 Feb 2006 12:35:43 +0000 (GMT) Subject: [Rxtx] Documentation Wiki In-Reply-To: <1139157422.4553.9.camel@zd7280> Message-ID: <20060206123543.57256.qmail@web53515.mail.yahoo.com> Hello, Thank you for you answer, but so the usage of the API is pretty much like the Java Communications Api? If yes, what version of the Java Comm Api? Thank you, Luiz A. Brandao Jr Kim Lux escreveu: On Sun, 2006-02-05 at 08:36 -0300, Luiz Jr wrote: > Hello, > > I want to start using the RXTX libraries, but I would to know how, > since I can not access the documentation wiki page I just started using them yesterday. Below is how I installed the libraries, if that helps. I used snippets of code from the SimpleWrite application here to get me going. http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html Instead of "import javax.comm.*;", use "import gnu.io.*;" which is gotten from RXTXcomm.jar, which you will need to include in your project references. I am working in Eclipse. BTW: there is no way to open a port without going through the port list and finding it. Maybe sometime in the future someone (me ?) will write a method called openSerialPort that allows the user to give a port identifier, such as "/dev/tty1" and return a port ready to use. It wouldn't take much to write that and it would save users a lot of code. Hope this helps. ======================================================================= 1) Figure out which java you are running, incase there is more than one installed. $ java -version java version "1.5.0_05" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_05-b05) Java HotSpot(TM) Client VM (build 1.5.0_05-b05, mixed mode, sharing) 2) Find all the jre directories and the one from which you are currently running. kfind (jre) 3) cd to that directory plus /lib/i386 cd /usr/java/jre1.5.0_05/lib/i386 4) Copy the library files (*.so) to that directory. cp /home/krlux/Desktop/'Java Controls'/rxtx-linux/bin/* . 5) Check that the copy was successful ls librxtx* librxtxI2C.so librxtxRaw.so librxtxSerial.so librxtxParallel.so librxtxRS485.so 6) cd to the /lib/ext directory for your java. cd /usr/java/jre1.5.0_05/lib/ext 7) Copy the Jar files there cp /home/krlux/Desktop/'Java Controls'/rxtx-linux/lib/ext/* . 8) Check that it was successful ls RXTX* RXTXcomm.jar Rxtx is now installed on your machine ready to use. =================================================================== -- Kim Lux, Diesel Research Inc. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx --------------------------------- Yahoo! Acesso Gr?tis - Internet r?pida e gr?tis. Instale o discador agora! -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/544aa403/attachment-0053.html From lyon at docjava.com Mon Feb 6 05:49:34 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 06 Feb 2006 07:49:34 -0500 Subject: [Rxtx] wiki delay until tomorrow night. In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: Hi All, I have often thought about USB drivers being needed. For example, the ironman watch will not interface to a mac (windows only). It is USB. My dymo label writer has no Java driver (native only). Etc. Most cheap web cameras are USB (and Java drivers go through JAI, if it supports the camera at all). The JAI code shows how sun did the USB drivers. You have to be a member of the jai project to download the source code. https://jai.dev.java.net has the jai distro. And then you are not allowed to redistribute it. However, we can all learn from it (if so inclined). Basically: cvs -d :pserver:lyon at cvs.dev.java.net:/cvs login cvs -d :pserver:lyon at cvs.dev.java.net:/cvs checkout jai-core You will need to user your own uid and pw to get in. The ant build has over 100 warnings from sun deprecations of its own code. You might say that they were hoisted on their own Picard ;) One interesting thing is that they support several platforms: linux-amd64 64-bit Linux-AMD64 linux-i586 32-bit Linux-x86 solaris-amd64 64-bit Solaris-AMD64 solaris-i586 32-bit Solaris-x86 solaris-sparc 32-bit Solaris-SPARC solaris-sparcv9 64-bit Solaris-SPARC windows-i586 32-bit Windows-x86 Thus, ant is used to provide a multi-platform native method distro. Neat. How do they do it? check this out: And: The core download does not contain any C source code (it was all pre-built). Basically, they are just copying .so and .dll files into build directories. I would love to see the C code for this...but Sun does not post it on the https://jai.dev.java.net site. I don't know why...Perhaps I missed it. - Doug >On Sun, 5 Feb 2006, Trent Jarvi wrote: > >>On Sun, 5 Feb 2006, Kim Lux wrote: >> >>>usb ? Tell me more... I need that too. >> >>usb is a very proper design. Thats all it is. >> > >Maybe rxtx could help usb. But it would start with helping bring >back the community that was already there. > >It's not something I'd love to do but maybe its the right thing to do. > >It would probably take 2 years to do right. But maybe thats better >than what we have now. > >I honestly don't know what IBM is doing which could just run over everything. > >Just some thoughts after some fine german wine. > >-- >Trent Jarvi >tjarvi at qbang.org > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tdelenik at gmail.com Mon Feb 6 05:56:32 2006 From: tdelenik at gmail.com (Thanasis Delenikas) Date: Mon, 6 Feb 2006 14:56:32 +0200 Subject: Fwd: [Rxtx] Documentation Wiki In-Reply-To: <1139157422.4553.9.camel@zd7280> References: <20060205113618.30274.qmail@web53501.mail.yahoo.com> <1139157422.4553.9.camel@zd7280> Message-ID: <310a1a930602060456t129f1dc6p5f2b908f13ab5a0b@mail.gmail.com> Hello all, Kim, this is a snippet from the code I use. The closest to directly opening a specific port without enumeration. << ... portId = CommPortIdentifier.getPortIdentifier(getPort()); serialPort = (SerialPort) portId.open("jSMSEngine", 1971); ... >> where getPort() return the string identifier of the port, i.e. "/dev/ttyS0" or "COM1" or whatever. Thanasis. ---------- Forwarded message ---------- From: Kim Lux Date: Feb 5, 2006 6:37 PM Subject: Re: [Rxtx] Documentation Wiki To: RXTX Developers and Users BTW: there is no way to open a port without going through the port list and finding it. Maybe sometime in the future someone (me ?) will write a method called openSerialPort that allows the user to give a port identifier, such as "/dev/tty1" and return a port ready to use. It wouldn't take much to write that and it would save users a lot of code. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/182ab5b8/attachment-0053.html From tjarvi at qbang.org Mon Feb 6 11:53:57 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 11:53:57 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: On Mon, 6 Feb 2006, Dr. Douglas Lyon wrote: > Hi All, > I have often thought about USB drivers being needed. > For example, the ironman watch will not interface > to a mac (windows only). It is USB. > My dymo label writer has no Java driver (native only). > Etc. > Most cheap web cameras are USB (and Java drivers go > through JAI, if it supports the camera at all). > The JAI code shows how sun did the USB drivers. > You have to be a member of the jai project to download > the source code. > https://jai.dev.java.net has the jai distro. > And then you are not allowed to redistribute it. However, > we can all learn from it (if so inclined). Basically: > cvs -d :pserver:lyon at cvs.dev.java.net:/cvs login > cvs -d :pserver:lyon at cvs.dev.java.net:/cvs checkout jai-core > You will need to user your own uid and pw to get in. > The ant build has over 100 warnings from sun deprecations > of its own code. > > You might say that they were hoisted on their own Picard ;) > > One interesting thing is that they support several platforms: > linux-amd64 64-bit Linux-AMD64 > linux-i586 32-bit Linux-x86 > solaris-amd64 64-bit Solaris-AMD64 > solaris-i586 32-bit Solaris-x86 > solaris-sparc 32-bit Solaris-SPARC > solaris-sparcv9 64-bit Solaris-SPARC > windows-i586 32-bit Windows-x86 > Thus, ant is used to provide a multi-platform native method distro. > Neat. > How do they do it? > check this out: > > > > > > > > > > > > > And: > > > > > > > > > > The core download does not contain any C source code (it was all pre-built). > Basically, they are just copying .so and .dll files into build directories. > > I would love to see the C code for this...but Sun does not post it on the > https://jai.dev.java.net site. > > I don't know why...Perhaps I missed it. > > - Doug > > I've looked at moving rxtx to Ant builds. I think that would help IDEs a great deal. I requested a evalutation desk copy the O'Reilly Ant book for some j2ee material I was teaching. http://www.oreilly.com/catalog/anttdg/ It has a one sentence mention of JNI. So there was not luck there. I saw that there is another Ant book that does mention JNI more. I can't find it now. Ant must be able to support it with extensions. http://ant.apache.org/manual/OptionalTasks/javah.html What the auto(break :) tools do in the rxtx build is 4 things really. 1) gcc compile flags 2) ld compile flags 3) config.h 4) compile flags for customizing rxtx (lockfiles, ...) See 1 All of this information except 4 can be static once obtained. So I'm not attached to the auto tools. If I could find an example of Ant being used for JNI code, I'd be one of the first to start moving that direction. Maybe someone saw an example someplace. The other thing we have not completed discussing is the directory structure. There is interest in making rxtx more IDE friendly. I get more mail about that off the list than how to install rxtx. And I see we have Ken Thompson in da house :) He is our trusted CVS maintainer and the guy that purchased the rxtx.org domain. Old community. We will need Ken for changing the directory structure of source. I would like to open up discussion about both of these as it is more than time. The problem is I have little experience with Ant and even less with IDEs. It would be nice if we could work with Eclipse and NetBeans. http://www.netbeans.org/ (sun and some community) http://www.eclipes.org (ibm,rhat,... perhaps more community) http://maven.apache.org/what-is-maven.html (apache. It is community) borland should sortof be here too but I think thats covered in eclipse. >From what I understand so far, we should morph rxtx to support those three maybe trusting apaches lead with maven. But I use vi. I have little to no clues beyond what people have fed me. Can we agree that thats the right direction to go? -- Trent Jarvi tjarvi at qbang.org From brian at mbari.org Mon Feb 6 14:57:50 2006 From: brian at mbari.org (Brian Schlining) Date: Mon, 6 Feb 2006 13:57:50 -0800 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> > The other thing we have not completed discussing is the directory > structure. There is interest in making rxtx more IDE friendly. I > get more mail about that off the list than how to install rxtx. > > And I see we have Ken Thompson in da house :) He is our trusted > CVS maintainer and the guy that purchased the rxtx.org domain. Old > community. We will need Ken for changing the directory structure of > source. > > I would like to open up discussion about both of these as it is > more than time. The problem is I have little experience with Ant > and even less with IDEs. It would be nice if we could work with > Eclipse and NetBeans. > > http://www.netbeans.org/ (sun and some community) > http://www.eclipes.org (ibm,rhat,... perhaps more community) > http://maven.apache.org/what-is-maven.html (apache. It is community) > borland should sortof be here too but I think thats covered in > eclipse. > >> From what I understand so far, we should morph rxtx to support >> those three > maybe trusting apaches lead with maven. But I use vi. I have > little to no clues beyond what people have fed me. > Maven likes the directory structure below for Java code. (From http:// maven.apache.org/guides/getting-started/index.html) This structure works fine with ant, netbeans, and eclipse. rxtx_root_directory `-- src |-- main | `-- java | `-- gnu | `-- io `-- test `-- java `-- gnu `-- io Brian Schlining Software Engineer http://www.mbari.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/d9451eba/attachment-0053.html From tjarvi at qbang.org Mon Feb 6 15:11:45 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 15:11:45 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: > rxtx_root_directory > `-- src > |-- main > | `-- java > | `-- gnu > | `-- io > `-- test > `-- java > `-- gnu > `-- io > >From what I understand this will just be good. For me it makes no difference. So lets do the rxtx thing. Let if fester for two weeks and if nobody objects, we will do it. I'm not doing this because I care. I'm doing this to eliminate much of my inbox. But test... man is rxtx lacking there in the community aspect. It is covered but not right. _maybe_ I can change that this year. -- Trent Jarvi tjarvi at qbang.org (cat hurding since 1997) From lux at diesel-research.com Mon Feb 6 21:38:49 2006 From: lux at diesel-research.com (Kim Lux) Date: Mon, 06 Feb 2006 21:38:49 -0700 Subject: [Rxtx] How can I use Lock Files with rxtx (in FC4) ? Message-ID: <1139287129.17031.3.camel@zd7280> I am now running an rxtx application on FC4. I am getting: ========================================================= check_group_uucp(): error testing lock file creation Error details: Permission denied check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL ========================================================= $ ls -al /var/lock total 32 drwxrwxr-x 4 root lock 4096 Feb 6 16:04 . drwxr-xr-x 24 root root 4096 Nov 14 01:19 .. drwx------ 2 root root 4096 Apr 27 2005 lvm drwxr-xr-x 2 root root 4096 Feb 6 16:04 subsys How do I fix this for regulator users ? -- Kim Lux, Diesel Research Inc. From dmarkman at mac.com Mon Feb 6 22:24:44 2006 From: dmarkman at mac.com (Dmitry Markman) Date: Tue, 7 Feb 2006 00:24:44 -0500 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: if I understands the issue right in order to be able to use ant for c/c++ compilation you have to install ant's cc task http://ant-contrib.sourceforge.net/cc.html it looks like it should work on mac os x (authors claim, that it's platform independent) but I never tested so all you have to do it's providing right command line for the gcc compiler On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: >> rxtx_root_directory >> `-- src >> |-- main >> | `-- java >> | `-- gnu >> | `-- io >> `-- test >> `-- java >> `-- gnu >> `-- io >> > > >> From what I understand this will just be good. > > For me it makes no difference. So lets do the rxtx thing. Let if > fester for two weeks and if nobody objects, we will do it. > > I'm not doing this because I care. I'm doing this to eliminate > much of my inbox. > > But test... man is rxtx lacking there in the community aspect. It > is covered but not right. _maybe_ I can change that this year. > > -- > Trent Jarvi > tjarvi at qbang.org > (cat hurding since 1997) > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx Dmitry Markman From lux at diesel-research.com Mon Feb 6 23:20:15 2006 From: lux at diesel-research.com (Kim Lux) Date: Mon, 06 Feb 2006 23:20:15 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? Message-ID: <1139293215.3689.4.camel@zd7280> I'm running the code below. portlist.hasMoreElements() is false. /dev has ports in it as listed below. What am I doing wrong ? ========================================================== // Step through the list of ports until we find one that matches // the one we are looking for. portList = CommPortIdentifier.getPortIdentifiers(); while(portList.hasMoreElements()) { portID = (CommPortIdentifier) portList.nextElement(); // if (portID.getName().equals("/dev/ttyUSB0")) { myTA.append("Serial port ttyUSB0 has been found\n"); break; }// if portID equals... }// End of while... ========================================================== ls -al /dev/tty* crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 ... crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 -- Kim Lux, Diesel Research Inc. From david.garnier at trusted-logic.com Tue Feb 7 00:46:30 2006 From: david.garnier at trusted-logic.com (David Garnier) Date: Tue, 07 Feb 2006 08:46:30 +0100 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: <43E85056.2090608@trusted-logic.com> Hello, I think that the make-based build process is fine as it is, apart from the location of the Java source files. It is true that putting the Java source in a directory structure that map 1-to-1 to the Java package structure is the norm and should make it easier for everyone to modify the Java source, with or without an IDE. Ant is a good tool, but in the RXTX case I fail to see the advantage of using it compared to the current make-based process. As Trent said, they are more pressing issues, like testing. Regards, David Dmitry Markman wrote: > if I understands the issue right > in order to be able to use ant for c/c++ compilation > you have to install ant's cc task > http://ant-contrib.sourceforge.net/cc.html > > it looks like it should work on mac os x > (authors claim, that it's platform independent) > but I never tested > > so all you have to do it's providing right command line > for the gcc compiler > > > > > On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: > >>> rxtx_root_directory >>> `-- src >>> |-- main >>> | `-- java >>> | `-- gnu >>> | `-- io >>> `-- test >>> `-- java >>> `-- gnu >>> `-- io >>> >> >> >>> From what I understand this will just be good. >> >> For me it makes no difference. So lets do the rxtx thing. Let if >> fester for two weeks and if nobody objects, we will do it. >> >> I'm not doing this because I care. I'm doing this to eliminate much >> of my inbox. >> >> But test... man is rxtx lacking there in the community aspect. It is >> covered but not right. _maybe_ I can change that this year. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> (cat hurding since 1997) From tjarvi at qbang.org Tue Feb 7 01:11:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 01:11:31 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <43E85056.2090608@trusted-logic.com> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: On Tue, 7 Feb 2006, David Garnier wrote: > Hello, > > I think that the make-based build process is fine as it is, apart from the location of the Java > source files. It is true that putting the Java source in a directory structure that map 1-to-1 to > the Java package structure is the norm and should make it easier for everyone to modify the Java > source, with or without an IDE. > > Ant is a good tool, but in the RXTX case I fail to see the advantage of using it compared to the > current make-based process. As Trent said, they are more pressing issues, like testing. > Hi David I have more experience with testing rxtx than I can talk about. But let it be known, rxtx has gone trough 100's of hours of testing. We are hobby folks interested in toys but there is more. rxtx has had some of the best guidance in the industry there. This is not an easy thing. I may be able to come back in a month from the other side of the corperate fence and help. I suspect the tests could just be made public but they are in a very unusual environment that just wont work in a wider sense. This is something I'll be trying to change. At one point it was agreed we could just make the results public so this isnt just noise.. There is interest and I think its safe to mention that much. The big problem with testing in the past is most of it is done with a loopback connection. So we *still* have major questions regarding things like flow control. rxtx talks to itself over a loopback and it works. regardless of right or wrong. This requires more thought to be done right. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Feb 7 02:46:34 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 02:46:34 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: > The big problem with testing in the past is most of it is done with a > loopback connection. So we *still* have major questions regarding things > like flow control. rxtx talks to itself over a loopback and it works. > regardless of right or wrong. With serial communication there are gold standards. ckermit is probably a definitive 'standard.' Maybe its possible to do ping/pong tests with ckermit? Is it scriptable? There are known issues in rxtx. Probably the worst is some threading issues regarding some JREs with multiple JNI threads setting java variables. Man did I get schooled there. Just switch the c functions to returning variables and things go away. Sometimes they work fine, sometimes they blow up. Without understanding everything, somehow rhat got it right and debian (and especially gentoo) grabbed kernel patches causing all sort of harm. Its not hard to fix once you understand whats going on but nearly impossible to track with a debugger. So I have a good idea what 2.1-8 will have outside of the IDE modifications. rxtx 2.1-7 is a release for everyone to sync with. Its not even as stable as -pre17 as far as I know - I ran no test suites. I'll be chasing it too. We just had so many contributions that it was time. It seriously broke internal scheduals but thats a great thing :) The other thing I want to do in 2.1-8 is automagic baud rates. It turns out lots of shops are doing really funky baud rates for things like automobile test equipment. It is possible but it requires a fair amount of change in the native code. Is anyone looking at this? -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Feb 7 02:57:21 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 07 Feb 2006 04:57:21 -0500 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <43E85056.2090608@trusted-logic.com> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: Hi All, I agree, testing is very important. The problem I have been trying to address is related to cross-platform testing and the robust nature of the installs. Typically, I visit 3 platforms to deploy my product, windows, linux and mac. A build is performed on each platform. The idea that you can build for many platforms from one copy the source code seems attractive. This should enable synchronized deployments of identical code. The question of how to achieve this goal remains open. As Trent mentioned, this is hard. Perhaps Ant will help here (but perhaps not). Ant does seem to help with running unit tests. However, it does not help with multi-platform tests. For that you need many machines and different operating environments. Toward that end, I have created a multi-platform test that can be run from web start, located at: http://show.docjava.com:8086/book/cgij/code/jnlp/serialPort.PortTest.jnlp This is interesting because many people in the community can run the test and we can improve the test, as time permits. No, it is not a perfect solution, however, the idea does help with multi-platform tests using many machines and different operating environments. If the group has a good test for a general serial port set-ups, i would be happy to deploy it, for general evaluation using web start. And as for ANT, it is just an idea. Not all my ideas are good ones! - Doug >Hello, > >I think that the make-based build process is fine as it is, apart >from the location of the Java >source files. It is true that putting the Java source in a directory >structure that map 1-to-1 to >the Java package structure is the norm and should make it easier for >everyone to modify the Java >source, with or without an IDE. > >Ant is a good tool, but in the RXTX case I fail to see the advantage >of using it compared to the >current make-based process. As Trent said, they are more pressing >issues, like testing. > >Regards, >David > >Dmitry Markman wrote: >> if I understands the issue right >> in order to be able to use ant for c/c++ compilation >> you have to install ant's cc task >> http://ant-contrib.sourceforge.net/cc.html >> >> it looks like it should work on mac os x >> (authors claim, that it's platform independent) >> but I never tested >> >> so all you have to do it's providing right command line >> for the gcc compiler >> >> >> >> >> On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: >> >>>> rxtx_root_directory >>>> `-- src >>>> |-- main >>>> | `-- java >>>> | `-- gnu >>>> | `-- io >>>> `-- test >>>> `-- java >>>> `-- gnu >>>> `-- io >>>> >>> >>> >>>> From what I understand this will just be good. >>> >>> For me it makes no difference. So lets do the rxtx thing. Let if >>> fester for two weeks and if nobody objects, we will do it. >>> >>> I'm not doing this because I care. I'm doing this to eliminate much >>> of my inbox. >>> >>> But test... man is rxtx lacking there in the community aspect. It is >>> covered but not right. _maybe_ I can change that this year. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> (cat hurding since 1997) > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From matt.higgins at gmail.com Tue Feb 7 08:28:34 2006 From: matt.higgins at gmail.com (Matt Higgins) Date: Tue, 7 Feb 2006 10:28:34 -0500 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final Message-ID: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? import java.io.*; import java.util.*; import gnu.io.*; public class MySimpleRead implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; public static void main(String[] args) { boolean portFound = false; String defaultPort = "COM1"; if (args.length > 0) { defaultPort = args[0]; } portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; MySimpleRead reader = new MySimpleRead(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } } public MySimpleRead() { try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) { e.printStackTrace(); } try { inputStream = serialPort.getInputStream(); } catch (IOException e) { e.printStackTrace(); } try { serialPort.addEventListener(this); } catch (TooManyListenersException e) { e.printStackTrace(); } try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { e.printStackTrace(); } System.out.println("Baud is " + serialPort.getBaudRate()); System.out.println("Bits is " + serialPort.getDataBits()); System.out.println("Stop is " + serialPort.getStopBits()); System.out.println("Par is " + serialPort.getParity()); serialPort.notifyOnDataAvailable(true); readThread = new Thread(this); readThread.start(); } public void run() { // Thread.sleep(20000); //} catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { System.out.println("An event occurred " + event.getEventType()); switch (event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: byte[] readBuffer = new byte[20]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } System.out.print(new String(readBuffer)); } catch (IOException e) {} break; } } } --------------- Result on windows ------------------------------ Stable Library ============================================================== Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port:: COM1 Baud is 9600 Bits is 8 Stop is 1 Par is 0 ----------------- End Results ----------------------------------------- ------------------ Result on Linux ----------------------------------- Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 Found port: /dev/ttyS0 Baud is 9600 Bits is 8 Stop is 1 Par is 0 An event occurred 1 043100066224 ------------------ End Results --------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/a1431630/attachment-0053.html From brian at mbari.org Tue Feb 7 09:48:37 2006 From: brian at mbari.org (Brian Schlining) Date: Tue, 7 Feb 2006 08:48:37 -0800 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> Message-ID: <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> Hi Matt > The following code works fine on Linux but I never see any data > when run on Windows. This is a cut and paste from the SimpleRead > example. > I am attempting to read data from a bar code scanner. I can fire > up HyperTermianl on windows and see that the device is working > properly as I see the barcodes are scanned and echoed back to the > terminal. However when I run the app I don't see any data. It is > however associating with the com port as the informational bits > print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. Cheers Brian Schlining Software Engineer http://www.mbari.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/16d07f37/attachment-0053.html From lux at diesel-research.com Tue Feb 7 11:59:58 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 11:59:58 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139293215.3689.4.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> Message-ID: <1139338798.8145.4.camel@zd7280> Any ideas on this ? Any reason why portList.hasMoreElements() should be false even though there are devices in /dev ? On Mon, 2006-02-06 at 23:20 -0700, Kim Lux wrote: > I'm running the code below. > > portlist.hasMoreElements() is false. > > /dev has ports in it as listed below. > > What am I doing wrong ? > > > ========================================================== > // Step through the list of ports until we find one that matches > // the one we are looking for. > > portList = CommPortIdentifier.getPortIdentifiers(); > > while(portList.hasMoreElements()) > { > portID = (CommPortIdentifier) portList.nextElement(); // > if (portID.getName().equals("/dev/ttyUSB0")) > { > myTA.append("Serial port ttyUSB0 has been found\n"); > break; > }// if portID equals... > }// End of while... > ========================================================== > > ls -al /dev/tty* > crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty > crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 > crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 > crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 > crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 > ... > crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 > crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 > crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 > > > -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 12:20:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 12:20:25 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139338798.8145.4.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> Message-ID: On Tue, 7 Feb 2006, Kim Lux wrote: > > Any ideas on this ? Any reason why portList.hasMoreElements() should be > false even though there are devices in /dev ? > > > On Mon, 2006-02-06 at 23:20 -0700, Kim Lux wrote: >> I'm running the code below. >> >> portlist.hasMoreElements() is false. >> >> /dev has ports in it as listed below. >> >> What am I doing wrong ? >> >> >> ========================================================== >> // Step through the list of ports until we find one that matches >> // the one we are looking for. >> >> portList = CommPortIdentifier.getPortIdentifiers(); >> >> while(portList.hasMoreElements()) >> { >> portID = (CommPortIdentifier) portList.nextElement(); // >> if (portID.getName().equals("/dev/ttyUSB0")) >> { >> myTA.append("Serial port ttyUSB0 has been found\n"); >> break; >> }// if portID equals... >> }// End of while... >> ========================================================== >> >> ls -al /dev/tty* >> crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty >> crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 >> crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 >> crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 >> crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 >> ... >> crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 >> crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 >> crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 >> >> >> > Hi Kim What rxtx does is try to open the port and do a timed out read. If the kernel/... do not complain it's enumarted. I suspect you could do a crude test by doing something like cat /dev/ttyS0 > /dev/null If that barfs then rxtx wont enumerate the port. hmm looking at your question again, I suspect it's a lockfile problem. This is documented in INSTALL with the source. Its easy enough to test this too.. touch /var/lock/testingrxtxlockfiles && rm -f /var/lock/testingrxtxlockfiles If you are not in the right group it will bail. Root will work regardless. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 12:37:56 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 12:37:56 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> Message-ID: <1139341076.8145.11.camel@zd7280> Exactly which ports does rxtx attempt to put into the list ? /dev/* or /dev/tty* or /dev/tty[0-9[0-9] ? or /dev/ttyS* ? For the record, only /dev/ttyUSB0 is a valid port on the machine I am presently on. Will this be a problem ? On Tue, 2006-02-07 at 12:20 -0700, Trent Jarvi wrote: > This is documented in INSTALL with the source. > I was wondering where that file was. I will download source and dig it up. Thanks. -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 12:51:09 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 12:51:09 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139341076.8145.11.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: On Tue, 7 Feb 2006, Kim Lux wrote: > > Exactly which ports does rxtx attempt to put into the list ? /dev/* > or /dev/tty* or /dev/tty[0-9[0-9] ? or /dev/ttyS* ? > > For the record, only /dev/ttyUSB0 is a valid port on the machine I am > presently on. Will this be a problem ? > > > On Tue, 2006-02-07 at 12:20 -0700, Trent Jarvi wrote: >> This is documented in INSTALL with the source. >> > I was wondering where that file was. I will download source and dig it > up. > > Thanks. > Hmm I'm looking at pre17 so this may have changed. (its just what I have on this machine) if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA" // for the IPAQs }; CandidatePortPrefixes=Temp; } So you may need to add "ttyUSB" to that list. RXTX used to enumerate _everything_ see if(osName.equals("Linux-all-ports") But it became less than practical. This is all in RXTXCommDriver.java hmm I just did a cvs update. if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have to get your fingers into the code. We aim for sane defaults. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 13:06:45 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 13:06:45 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139342805.8145.22.camel@zd7280> On Tue, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > Hmm I'm looking at pre17 so this may have changed. (its just what I have > on this machine) > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA" // for the IPAQs > }; > CandidatePortPrefixes=Temp; > } > > > So you may need to add "ttyUSB" to that list. RXTX used to enumerate > _everything_ see if(osName.equals("Linux-all-ports") But it became less > than practical. > > This is all in RXTXCommDriver.java > > hmm I just did a cvs update. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have > to get your fingers into the code. We aim for sane defaults. Excellent. Thanks for taking the time. -- Kim Lux, Diesel Research Inc. From ideiglenes1 at freemail.hu Tue Feb 7 13:53:39 2006 From: ideiglenes1 at freemail.hu (--) Date: Tue, 07 Feb 2006 21:53:39 +0100 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139345619.22534.2.camel@localhost> Hi! I use this code to get all the extra Linux devices. :) if ("Linux".equals(System.getProperty("os.name"))) { System.setProperty("os.name","Linux-all-ports"); } driver = new RXTXCommDriver(); On k, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > On Tue, 7 Feb 2006, Kim Lux wrote: > > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have > to get your fingers into the code. We aim for sane defaults. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From matt.higgins at gmail.com Tue Feb 7 13:45:54 2006 From: matt.higgins at gmail.com (Matt Higgins) Date: Tue, 7 Feb 2006 15:45:54 -0500 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> Message-ID: <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> Sweet this is exactly what I needed. I was searching the archives through marc.theamisgroup they only have archives back to 1/3/05. Should have hit the mailman archive! Thanks a lot! On 2/7/06, Brian Schlining wrote: > > Hi Matt > > The following code works fine on Linux but I never see any data when run > on Windows. This is a cut and paste from the SimpleRead example. > I am attempting to read data from a bar code scanner. I can fire up > HyperTermianl on windows and see that the device is working properly as I > see the barcodes are scanned and echoed back to the terminal. However when I > run the app I don't see any data. It is however associating with the com > port as the informational bits print fine? > > > You're not the only one whose had this problem, I don't know if Trent has > addressed this is the latest release of RXTX but there is a workaround. > Here's the recent thread from the RXTX mailing list regarding this issues: > > Thanasis Delenikas tdelenik at gmail.com > Wed Jan 18 13:56:23 MST 2006 > > * Previous message: [Rxtx] Re: More close() performance fixes > * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] > > Hi all. > (I've subscribed again from my other email account). > > Trent, > > You are right. Linux *always* works, no matter what flow control you set. > Windows *works only* with hardware flow control (I haven't tested what > happens with software XON/XOFF flow control). > > I assume (but I am not certain) that even with no flow control at all, all > platforms should work. Without flow control, you have the risk of bumping > into overflow or framing errors, but that's your (the end programmer, I > mean) problem. > > >From my side, I shouldn't be working without flow control. That was a bug > too... It was some code forgotten from the old times, when I used to work > with phone emulation drivers which didn't support flow control. The > correct > way is to have some flow control enabled and that's why I suppose this is > a > low-severity bug for RxTx. > > I have no idea which platform shows the correct behaviour, since > my knowledge about Linux and the inner workings of these low-level i/o > operations is limited. > > Regards, > Thanasis Delenikas. > > > > > Message: 2 > > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > > From: Trent Jarvi > > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > > To: RXTX Developers and Users > > Message-ID: > > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > > > Hi all, > > > > > > Trent, I have found something. > > > I read your comment about flow control, so I experimented a bit. > > > > > > If you remember, in my sample program I've used no flow control at all > ( > > i.e. > > > Java constant FLOWCONTROL_NONE). > > > > > > Now, during testing, I've switch to hardware inbound flow control (i.e > . > > Java > > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > > beautifully! > > > > > > I think I will switch to H/W flow control and test things for a while, > > but > > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > > > > > Hi Thanasis, > > > > I'm fairly sure you have identified a bug. I would not worry too much > > about what Sun CommAPI w32 defaults are. I think they did more or less > > whatever the port opened with. Just a guess. Linux tries to stomp on > > ports so they are all the same. > > > > So this started out with Linux worked, Windows XP/.. did not as I > recall. > > Something is wrong in rxtx. Do I understand this right? > > > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > > > Perhaps there is something Wayne or I did not understand when we wrote > > that code. I wasnt programming back in the BBS days so modems are not > my > > thing. I have a few questions. > > > > Is the above matrix confirmed by observation? > > Linux just always worked? > > Which one _should_ work? I'm guessing modems work with hardware flow > > control. I'll have to dig around. > > > > The windows flow control changes a couple things with hardware flow > > control. Following the w32 API documentation is confusing sometimes. > > But it looks like Linux could have a bug too. > > Cheers > > Brian Schlining > Software Engineer > http://www.mbari.org > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/9c989144/attachment-0053.html From tjarvi at qbang.org Tue Feb 7 14:06:14 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 14:06:14 -0700 (MST) Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> Message-ID: >> >> You're not the only one whose had this problem, I don't know if Trent has >> addressed this is the latest release of RXTX but there is a workaround. >> Here's the recent thread from the RXTX mailing list regarding this issues: >> I have not. I expect to have access to some test equipment next month and I'll go through all of this. I really don't know whats going on and I need a gold standard. I thought maybe linux was autodetecting the flow control. Your observations would certainly be welcome. I need to talk to Russell King and see what he is doing. Until then I'd just be toying around over a loopback as usual. This is very high on the list though. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 17:25:05 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 17:25:05 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139358305.17994.2.camel@zd7280> My application now works. I installed the libraries and jar from 2.1-7 (Final). portlist.hasMoreElements is no longer false. The application finds the port for /dev/ttyUSB0. Thanks for your help, Trent (et al) Sorry I bothered you with this. Next time I will look in the source first. I didn't think it was an rxtx issue, I thought it was a Linux setup issue . On Tue, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > Hmm I'm looking at pre17 so this may have changed. (its just what I > have > on this machine) > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux > Serial Ports > "ttySA" // for the > IPAQs > }; > > CandidatePortPrefixes=Temp; > } > > > So you may need to add "ttyUSB" to that list. RXTX used to enumerate > _everything_ see if(osName.equals("Linux-all-ports") But it became > less > than practical. > > This is all in RXTXCommDriver.java > > hmm I just did a cvs update. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux > Serial Ports > "ttySA", // for the > IPAQs > "ttyUSB" // for USB > frobs > }; > > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you > have > to get your fingers into the code. We aim for sane defaults. -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 19:21:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 19:21:54 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139358305.17994.2.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> <1139358305.17994.2.camel@zd7280> Message-ID: >Sorry I bothered you with this. Next time I will look in the source >first. I didn't think it was an rxtx issue, I thought it was a Linux >setup issue . Why would you be sorry? I would have done the same. I'm glad it's working :) -- Trent Jarvi tjarvi at qbang.org From tma at mail.island.net Wed Feb 8 13:39:35 2006 From: tma at mail.island.net (Tom Alldread) Date: Wed, 08 Feb 2006 12:39:35 -0800 Subject: [Rxtx] Win32/Linux Serial Port Data Dropouts In-Reply-To: <200602060702.k167255O007882@www.qbang.org> References: <200602060702.k167255O007882@www.qbang.org> Message-ID: <43EA5707.4020200@mail.island.net> Greetings Folks at RXTX: During the last couple of months I have been alternately testing with javax.comm 2 and RXTX 2.1 under Windows XP and CommApi 3 and RXTX 2.1 under Suse 10.0 Linux. In the process I have learned a little about java multi-threading under NetBeans 5 with Profiler. My java (jdk 1.5_06) application is used for data acquisition and provides a graphical display of A-D conversion data received from a 56KBaud serial port. The actual data throughput is about 10KBaud thus it is well below the speed of the port. I use hardware RTS/CTS flow control which can stall the data acquisition sample rate if necessary. This ensures the display computer has the ability to slow the data acquisition rate should it become too busy to accept the regular data flow. Both the serial port buffer and the java read buffer are set at 16KB. Usually the data transfers into the java read buffer are less than 100 bytes unless the data acquisition is recovering from a stall. The data flow normally hesitates after each 5 KB block as a continue command is needed from the display computer to start the drawing of a new graphics display line. Separate threads have been provided for the serial port event monitoring and data processing. The serial port event thread has been given the maximum priority and data processing thread the minimum priority provided by java. Thread yield statements have been placed within all data processing while/for loops as an effort to ensure quick access to CPU cycles for the serial port event thread. I have found that short data transmissions are essentially error free but occasional dropouts occur with continuous data flow especially under Windows XP. ....................................................................................................................................................................................... Linux results: I am happy to report that RXTX 2.1 appears to work very well under Linux although I did notice some errors when the screen savers were running with my dual monitors. I believe this is a local problem associated with my dual graphics which needs further attention. The recent CommApi 3 Linux release from Sun did not work at all with my program. It seemed to send commands out OK but did not receive any data. Although the serial port event triggered the ISR, the input stream appeared filled with nulls and thus did not contain any data. As my understanding is that CommApi 3 was tested with a Red Hat distribution of Linux I wonder if this problem is distro dependent? Although somewhat off topic here I wonder if anyone reading this has had similar experience? .................................................................................................................................................................................. Windows XP results: There are problems with occasional data dropouts which become more frequent as the sampling rate is increased or if the computer becomes busy with other duties. The dropouts typically consist of a half dozen byte block of lost data. It appears the lost bytes never get added to the java input stream. There has not been any indication of garbled data, overruns or framing errors which suggests the UART communications remains solid. Using javax.comm 2 I found that the setting of SerialPort 'enableReceiveThreshold' to 40 and 'enableReceiveTimeout' of 100mS reduced the dropouts error rate significantly. I found that I could not get RXTX 2.1 to function with the aforementioned threshold and timeout settings. The javax.comm 2 interface is consequently performing better for me under Windows than RXTX 2.1. I wonder if anyone here has any suggestions as to what I might try to improve RXTX 2.1? Although my settings are the same as under Suse 10.0, RXTX 2.1 performs much better for me under Linux than any of the alternatives that I have tried under Windows XP . ............................................................................................................................................................................... I would like to establish, based on the experience of others, if I have reached the normally expected performance limit of java serial port communications? Should I expect to achieve virtually error free serial port data input from a continuous stream under Windows XP java software? I am considering changing my protocol to packets with error checking if necessary but would like to know if the dropout problems I am experiencing are typical or not before I take this rather work intensive plunge. Many thanks in advance for any help! Best Regards, Tom Alldread -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.375 / Virus Database: 267.15.2/253 - Release Date: 2006-02-07 From jlaxson at mac.com Wed Feb 8 23:56:48 2006 From: jlaxson at mac.com (John Laxson) Date: Thu, 9 Feb 2006 00:56:48 -0600 Subject: [Rxtx] PortInUseException: Unknown Application on OSX Message-ID: Hi, I've been trying to get RXTX 2.1.7 going on Mac OS X for a while here, and am running up into a wall here. I've tried with pre- compiled and the source version and get the same problem, a gnu.io.PortInUseException: Unknown Application. I have run the fixperms script included with the source distribution, and id shows me as a member of the uucp group, and permissions on /var/spool/uucp are 775 root:uucp. Running a test program (included at the bottom for clarity) lets me enumerate all the serial ports correctly, but trying to open any of them gives the PortInUseException. If it helps, when I try to open a port that's set to make an outgoing bluetooth connection, there is no delay and no connection attempt at all. Thanks, John Laxson PS: The documentation wiki on qbang.org shows 404, and has for a few days now. My test code: public static void main(String[] args) { SerialPort serialPort; try { Enumeration e = CommPortIdentifier.getPortIdentifiers(); CommPortIdentifier ident; while (e.hasMoreElements()) { ident = (CommPortIdentifier)e.nextElement(); System.out.println(ident.getName()); } ident = CommPortIdentifier.getPortIdentifier("/dev/cu.modem"); serialPort = (SerialPort) ident.open("Me", 5000); } catch (Exception e) { e.printStackTrace(); } } From rajesh.invincible at gmail.com Thu Feb 9 03:39:38 2006 From: rajesh.invincible at gmail.com (Rajesh N) Date: Thu, 9 Feb 2006 16:09:38 +0530 Subject: [Rxtx] Re: Move .java Files in gnu.io filesystem hierarchy - Maven (2) In-Reply-To: <43DF21D2.7090200@ngi.it> References: <43DF21D2.7090200@ngi.it> Message-ID: <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Can anybody tell me how to overcome these EXCEPTIONS I AM WORKING ON SERIAL COMMN IN JAVA ON LINUX. 1. " NOT ALL PARAMETERS SUPPORTED BY THE KERNEL" This i came across the following statement inmy prog. SerialP is A SerialPort object SerialP.setSerialPortParams(9600(BAUDRATE),DATABITS_8,STOPBITS_1,PARITY_NONE) 2. NullPointer Exception at Event Dispatch Now i have checked all my object references for a null reference but i found none i have put up my entire code in try catch blocks but still I AM UNABLE TO CATCH THIS EXCEPTION AND HENCE MY APPLICATION CLOSES HOW DOES THESE GO? PLEASE HELP ME IT IS URGENTTTTTTTTTTTTTTTT yours sincerely RAJESH On 1/31/06, Fabio Frumento wrote: > Hi Xavier, > > I don't know maven at all but the directory hierarchy listed buy Trent > is fine for me... > > I'll take a look to maven, it seems an interesting project > > Regards > > Fabio Frumento > > Trent Jarvi wrote: > > On Tue, 31 Jan 2006, Xavier Frisaye wrote: > > > >> Hi all, > >> > >> If you are going to rearrange the src folder, i will propose to use > >> maven 2 and follow its directory structure > >> > (http://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html). > >> > >> Maven 2 simplify java project and give a standard way to make projects > >> (http://maven.apache.org/). > >> We are using it for internal projects and we are very satisfied. > >> > >> Is anybody interested? > >> > >> I'm not an expert in maven 2 (yet) but i'm agree to help using it if > >> you choose to make so. > >> > > > > so this would be: > > > > rxtx-devel/src/main/java/gnu.io > > rxtx-devel/src/test/java/ManIwish.java > > > > I don't use IDEs very much so I'll let others comment. But I don't see > > a problem with that. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Thu Feb 9 09:50:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 9 Feb 2006 09:50:31 -0700 (MST) Subject: [Rxtx] Re: Move .java Files in gnu.io filesystem hierarchy - Maven (2) In-Reply-To: <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Message-ID: On Thu, 9 Feb 2006, Rajesh N wrote: > Can anybody tell me how to overcome these EXCEPTIONS > I AM WORKING ON SERIAL COMMN IN JAVA ON LINUX. > > 1. " NOT ALL PARAMETERS SUPPORTED BY THE KERNEL" > > This i came across the following statement inmy prog. > SerialP is A SerialPort object > SerialP.setSerialPortParams(9600(BAUDRATE),DATABITS_8,STOPBITS_1,PARITY_NONE) > Strange. The parameters you use are the same the port should open with by default. Could you paste the actual exception you are getting? I don't see that in the rxtx source. Also it would help to know the rxtx version. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Fri Feb 10 15:29:05 2006 From: lux at diesel-research.com (Kim Lux) Date: Fri, 10 Feb 2006 15:29:05 -0700 Subject: [Rxtx] One serial port object for both sending and receiving ? Message-ID: <1139610545.18177.4.camel@zd7280> Is it OK to use one SerialPort ojbect (ex Serial Port serialPort;) and use it for both sending and receiving ? For example: ======================================================================== static SerialPort serialPort = null; static OutputStream serialOut = null; static InputStream serialIn = null; // assign it to an outputStream for use try{ serialOut = serialPort.getOutputStream(); System.out.println("Serial output stream has been assigned."); }//try catch(IOException e) { System.out.println("Error: Couldn't assign output stream to serial port."); }//catch //assign it to an inputStream for use try{ serialIn = serialPort.getInputStream(); System.out.println("Serial input stream has been assigned."); }//try catch(IOException e) { System.out.println("Error: Couldn't assign input stream to serial port."); }//catch ======================================================================== -- Kim Lux, Diesel Research Inc. From lux at diesel-research.com Fri Feb 10 21:23:00 2006 From: lux at diesel-research.com (Kim Lux) Date: Fri, 10 Feb 2006 21:23:00 -0700 Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Message-ID: <1139631780.23882.10.camel@zd7280> I've got a problem receiving chars with my version of serialRead, written in an SWT GUI. I had a Java pro have a good look at my code and he can't see anything wrong with it. I can send chars fine. When I receive a char the cpu usage for the app goes to 100% and the code in the serial event handler doesn't get executed. The instructions on the Java Comm Serial API How-To for Linux page state that I must install javacomm. Is that true ? Everything builds without it and I can send chars on rxtx just fine, but I can't receive them. Could this be the problem ? I downloaded and installed javacomm. I was not able to add "Driver=gnuio.RXTXCommDriver to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 installed in /usr/java/jre1.5.0_05. I added comm.jar to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext to the library paths. Is this OK ? Does it matter that I am receiving on /dev/ttyUSB0 ? Thanks. -- Kim Lux, Diesel Research Inc. From lunareclipse03 at web.de Sat Feb 11 09:44:46 2006 From: lunareclipse03 at web.de (lunareclipse03@web.de) Date: Sat, 11 Feb 2006 17:44:46 +0100 Subject: [Rxtx] Question about Serial I/O under Win32 Message-ID: <662084330@web.de> Hello everybody, I have a strange problem with a piece of code I made for myself. No, this is not really concerning rxtx, but nevertheless I post this to the list, hoping that some of you can help me. I've written two libraries, one for linux and one for win32. The linux port works quite well, I can send / receive faxes and / or replay voice messages over the telephone line using a voice modem. But the win32 port of the library causes some trouble. If, for example, I send out a fax with a certain modem under linux, it works well. The fax is complete when it comes out of the fax machine. If I then use the same modem to send out a fax under win32, the fax coming out of the fax machine gets "stuck" halfways, but the sending modem thinks that transmission was ok and drops the connection. The answering fax machine then gives me "error while receiving." The "upper layer" java code MUST be right, because if I do the same thing under linux (using the linux library), everything is alright. Now I have to ask: Can somebody please help me out with this??!? Could it be the case that some kind of flow control or COMMTIMEOUTS setting causes this behaviour? I set flow control to RTS/CTS before sending out a fax. How can I DISABLE flow control? Or what do you think? Can something else cause this problems? Thank you all for your time and PLEASE write back soon. Regards, --Sven Ahlemann Am Waldrand 31 45721 Haltern am See Germany ______________________________________________________________ Verschicken Sie romantische, coole und witzige Bilder per SMS! Jetzt bei WEB.DE FreeMail: http://f.web.de/?mc=021193 From lux at diesel-research.com Sat Feb 11 10:06:52 2006 From: lux at diesel-research.com (Kim Lux) Date: Sat, 11 Feb 2006 10:06:52 -0700 Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: <1139631780.23882.10.camel@zd7280> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> <1139631780.23882.10.camel@zd7280> Message-ID: <1139677612.3431.5.camel@zd7280> More on this problem. I copied and pasted simpleRead into a console based Eclipse project and I've got the same result, except that cpu usage doesn't go to 100%. I'm beginning to think there is an issue in rxtx. My imports for simpleRead are: ============================ import gnu.io.*; import java.util.*; //import javax.comm.*; import java.io.*; =========================== Any ideas ? I am trying to read from /dev/ttyUSB0 using a serial to USB adapter which has worked well with minicom and gtkterm. Thanks. On Fri, 2006-02-10 at 21:23 -0700, Kim Lux wrote: > I've got a problem receiving chars with my version of serialRead, > written in an SWT GUI. > > I had a Java pro have a good look at my code and he can't see anything > wrong with it. > > I can send chars fine. When I receive a char the cpu usage for the app > goes to 100% and the code in the serial event handler doesn't get > executed. > > The instructions on the Java Comm Serial API How-To for Linux page state > that I must install javacomm. Is that true ? Everything builds without > it and I can send chars on rxtx just fine, but I can't receive them. > Could this be the problem ? > > I downloaded and installed javacomm. I was not able to add > "Driver=gnuio.RXTXCommDriver > to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not > have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 > installed in /usr/java/jre1.5.0_05. I added comm.jar > to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext > to the library paths. Is this OK ? > > Does it matter that I am receiving on /dev/ttyUSB0 ? > > Thanks. > -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Sun Feb 12 21:01:33 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:01:33 -0700 (MST) Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: <1139677612.3431.5.camel@zd7280> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> <1139631780.23882.10.camel@zd7280> <1139677612.3431.5.camel@zd7280> Message-ID: I suspect what is happening is the select() is breaking out in the native code but the driver does not have support for notifying there are X bytes available. On some traditional Unix based systems, the only way you know data is available is the fd status changes and do an FIORDCHK ioctl. Or perhaps the only thing you can know is the fd status changed. It would take reading through the kernel driver code to know for sure. So on USB, depending upon the driver, the same may need to be done or the driver improved a bit if possible to support. Polling reads will also work but don't use the event driven model of CommAPI which isnt acceptable in the long run. The 100% cpu usage can then be explained because select no longer blocks until the data is read; the eventLoop spins loose. You can put a well placed sleep but rxtx only expects those are needed when it knows data is available. This may not be a super simple thing to understand and fix. I do have ideas to get you started. I'm going to be short on time the next couple weeks. I expect to put some good time in and answer some other questions I saw around the 25th. For now, I'd look at the following and go from there with the hints I've given. JNIEXPORT jint JNICALL RXTXPort(nativeavailable)( JNIEnv *env, jobject jobj ) { int fd = get_java_var( env, jobj,"fd","I" ); int result; /* char message[80]; ENTER( "RXTXPort:nativeavailable" ); On SCO OpenServer FIONREAD always fails for serial devices, so try ioctl FIORDCHK instead; will only tell us whether bytes are available, not how many, but better than nothing. This turns out to be true on Solaris also. taj. */ #ifdef FIORDCHK /* __unixware__ __sun__ probably others */ result = ioctl(fd, FIORDCHK, 0); #else if( ioctl( fd, FIONREAD, &result ) < 0 ) { goto fail; } #endif /* FIORDCHK */ On Sat, 11 Feb 2006, Kim Lux wrote: > > More on this problem. I copied and pasted simpleRead into a console > based Eclipse project and I've got the same result, except that cpu > usage doesn't go to 100%. I'm beginning to think there is an issue in > rxtx. > > My imports for simpleRead are: > > ============================ > import gnu.io.*; > import java.util.*; > //import javax.comm.*; > import java.io.*; > =========================== > > Any ideas ? I am trying to read from /dev/ttyUSB0 using a serial to > USB adapter which has worked well with minicom and gtkterm. > > Thanks. > > > > On Fri, 2006-02-10 at 21:23 -0700, Kim Lux wrote: >> I've got a problem receiving chars with my version of serialRead, >> written in an SWT GUI. >> >> I had a Java pro have a good look at my code and he can't see anything >> wrong with it. >> >> I can send chars fine. When I receive a char the cpu usage for the app >> goes to 100% and the code in the serial event handler doesn't get >> executed. >> >> The instructions on the Java Comm Serial API How-To for Linux page state >> that I must install javacomm. Is that true ? Everything builds without >> it and I can send chars on rxtx just fine, but I can't receive them. >> Could this be the problem ? >> >> I downloaded and installed javacomm. I was not able to add >> "Driver=gnuio.RXTXCommDriver >> to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not >> have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 >> installed in /usr/java/jre1.5.0_05. I added comm.jar >> to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext >> to the library paths. Is this OK ? >> >> Does it matter that I am receiving on /dev/ttyUSB0 ? >> >> Thanks. >> > From tjarvi at qbang.org Sun Feb 12 21:03:30 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:03:30 -0700 (MST) Subject: [Rxtx] One serial port object for both sending and receiving ? In-Reply-To: <1139610545.18177.4.camel@zd7280> References: <1139610545.18177.4.camel@zd7280> Message-ID: On Fri, 10 Feb 2006, Kim Lux wrote: > > Is it OK to use one SerialPort ojbect (ex Serial Port serialPort;) and > use it for both sending and receiving ? > > For example: > > ======================================================================== > static SerialPort serialPort = null; > static OutputStream serialOut = null; > static InputStream serialIn = null; > > > > > // assign it to an outputStream for use > try{ > serialOut = serialPort.getOutputStream(); > System.out.println("Serial output stream has been assigned."); > }//try > catch(IOException e) > { > System.out.println("Error: Couldn't assign output stream to serial > port."); > }//catch > > > //assign it to an inputStream for use > try{ > serialIn = serialPort.getInputStream(); > System.out.println("Serial input stream has been assigned."); > }//try > catch(IOException e) > { > System.out.println("Error: Couldn't assign input stream to serial > port."); > }//catch This should be fine. In fact trying to do it another way will probably not work as you will run into lockfile issues. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun Feb 12 21:13:13 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:13:13 -0700 (MST) Subject: [Rxtx] Question about Serial I/O under Win32 In-Reply-To: <662084330@web.de> References: <662084330@web.de> Message-ID: On Sat, 11 Feb 2006 lunareclipse03 at web.de wrote: > Hello everybody, > > I have a strange problem with a piece of code I made for myself. No, > this is not really concerning rxtx, but nevertheless I post this to the > list, hoping that some of you can help me. I've written two libraries, > one for linux and one for win32. The linux port works quite well, I can > send / receive faxes and / or replay voice messages over the telephone > line using a voice modem. But the win32 port of the library causes some > trouble. If, for example, I send out a fax with a certain modem under > linux, it works well. The fax is complete when it comes out of the fax > machine. If I then use the same modem to send out a fax under win32, the > fax coming out of the fax machine gets "stuck" halfways, but the sending > modem thinks that transmission was ok and drops the connection. The > answering fax machine then gives me "error while receiving." The "upper > layer" java code MUST be right, because if I do the same thing under > linux (using the linux library), everything is alright. Now I have to > ask: Can somebody please help me out with this??!? Could it be the case > that some kind of flow control or COMMTIMEOUTS setting causes this > behaviour? I set flow control to RTS/CTS before sending out a fax. How > can I DISABLE flow control? Or what do you think? Can something else > cause this problems? Thank you all for your time and PLEASE write back > soon. > Hi Sven I'm not too willing to talk about flow control at the low level until I confirm some things with test equipment later. It is not clear if you are using rxtx or writing your own native code. So I'm not sure how to answer much of this :) If you are wondering how to change the flow control using rxtx from java, The BlackBox example from Sun flips this back and forth. SerialPort.java in rxtx 2.1 uses the following: SerialPort.java: public static final int FLOWCONTROL_NONE =0; SerialPort.java: public static final int FLOWCONTROL_RTSCTS_IN =1; SerialPort.java: public static final int FLOWCONTROL_RTSCTS_OUT =2; SerialPort.java: public static final int FLOWCONTROL_XONXOFF_IN =4; SerialPort.java: public static final int FLOWCONTROL_XONXOFF_OUT=8; So if you set flowcontrol to RTSCTS, you can set it to NONE to turn it off. If you are looking for how to do it in native code, the rxtx Source is SerialImp.c (unix/linux/mac os x/w32) and termios.c (w32 only with SerialImp.c) You can track the code: SerialImp.c:JNIEXPORT void JNICALL RXTXPort(setflowcontrol)( JNIEnv *env, jobject jobj, jint flowmode ) termios.c:int tcgetattr( int fd, struct termios *s_termios ) termios.c:int tcsetattr( int fd, int when, struct termios *s_termios ) There may be a problem in the rxtx flow control code though. Rather than guess, I want to test this with a gold standard. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Feb 6 00:00:16 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 00:00:16 -0700 (MST) Subject: [Rxtx] wiki delay until tomorrow night. In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: On Sun, 5 Feb 2006, Trent Jarvi wrote: > On Sun, 5 Feb 2006, Kim Lux wrote: > >> usb ? Tell me more... I need that too. > > usb is a very proper design. Thats all it is. > Maybe rxtx could help usb. But it would start with helping bring back the community that was already there. It's not something I'd love to do but maybe its the right thing to do. It would probably take 2 years to do right. But maybe thats better than what we have now. I honestly don't know what IBM is doing which could just run over everything. Just some thoughts after some fine german wine. -- Trent Jarvi tjarvi at qbang.org From gadelavega at yahoo.com.ar Mon Feb 6 02:17:05 2006 From: gadelavega at yahoo.com.ar (Gonzalo A. de la Vega) Date: Mon, 06 Feb 2006 10:17:05 +0100 Subject: [Rxtx] Serial port ownership question In-Reply-To: References: <20060205113618.30274.qmail@web53501.mail.yahoo.com> <1139157422.4553.9.camel@zd7280> <1139158698.4936.9.camel@zd7280> Message-ID: <43E71411.4050402@yahoo.com.ar> On my Fedora Core 4: ls -l /dev/ttyS* crw-rw---- 1 root uucp 4, 64 Feb 6 2006 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Feb 6 2006 /dev/ttyS1 ... and: grep "ttyUSB" /etc/udev/rules.d/50-udev.rules KERNEL=="ttyUSB*", GROUP="uucp", MODE="0660" So anyone in the "uucp" group can use serial ports. On Gentoo the group is "tty". Trent Jarvi escribi?: > > > On Sun, 5 Feb 2006, Dr. Douglas Lyon wrote: > >> I can confirm that this is the case (only root ownership of >> serial ports, under fedora 4). >> Wow, what were they thinking?! >> - DL >> >>> I've found that the newer kernels have the serial ports owned by root. >>> For example, >>> >>> $ls -al /dev/tty* >>> crw-rw-rw- 1 root root 5, 0 Feb 5 02:06 /dev/tty >>> crw-rw---- 1 root root 4, 0 Feb 5 02:06 /dev/tty0 >>> crw------- 1 root root 4, 1 Feb 5 09:07 /dev/tty1 >>> crw-rw---- 1 root tty 4, 10 Feb 5 02:06 /dev/tty10 >>> crw-rw---- 1 root tty 4, 11 Feb 5 02:06 /dev/tty11 >>> ... > > > This is just not a problem jcp or such are going to solve. Its a > platform spitwad fight. But do look at pam. In fact thats what Sun > is doing too. Maybe Linux followed their lead.. I'm not a pam guy. > I've spent 16 hours trying to understand it but your users wont :) > > Solution? I have no clue. Its two tangent mentalities from my > perspective. > > -- > Trent Jarvi > tjarvi at qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mtnvega at yahoo.com.br Mon Feb 6 05:35:43 2006 From: mtnvega at yahoo.com.br (Luiz Jr) Date: Mon, 6 Feb 2006 12:35:43 +0000 (GMT) Subject: [Rxtx] Documentation Wiki In-Reply-To: <1139157422.4553.9.camel@zd7280> Message-ID: <20060206123543.57256.qmail@web53515.mail.yahoo.com> Hello, Thank you for you answer, but so the usage of the API is pretty much like the Java Communications Api? If yes, what version of the Java Comm Api? Thank you, Luiz A. Brandao Jr Kim Lux escreveu: On Sun, 2006-02-05 at 08:36 -0300, Luiz Jr wrote: > Hello, > > I want to start using the RXTX libraries, but I would to know how, > since I can not access the documentation wiki page I just started using them yesterday. Below is how I installed the libraries, if that helps. I used snippets of code from the SimpleWrite application here to get me going. http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html Instead of "import javax.comm.*;", use "import gnu.io.*;" which is gotten from RXTXcomm.jar, which you will need to include in your project references. I am working in Eclipse. BTW: there is no way to open a port without going through the port list and finding it. Maybe sometime in the future someone (me ?) will write a method called openSerialPort that allows the user to give a port identifier, such as "/dev/tty1" and return a port ready to use. It wouldn't take much to write that and it would save users a lot of code. Hope this helps. ======================================================================= 1) Figure out which java you are running, incase there is more than one installed. $ java -version java version "1.5.0_05" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_05-b05) Java HotSpot(TM) Client VM (build 1.5.0_05-b05, mixed mode, sharing) 2) Find all the jre directories and the one from which you are currently running. kfind (jre) 3) cd to that directory plus /lib/i386 cd /usr/java/jre1.5.0_05/lib/i386 4) Copy the library files (*.so) to that directory. cp /home/krlux/Desktop/'Java Controls'/rxtx-linux/bin/* . 5) Check that the copy was successful ls librxtx* librxtxI2C.so librxtxRaw.so librxtxSerial.so librxtxParallel.so librxtxRS485.so 6) cd to the /lib/ext directory for your java. cd /usr/java/jre1.5.0_05/lib/ext 7) Copy the Jar files there cp /home/krlux/Desktop/'Java Controls'/rxtx-linux/lib/ext/* . 8) Check that it was successful ls RXTX* RXTXcomm.jar Rxtx is now installed on your machine ready to use. =================================================================== -- Kim Lux, Diesel Research Inc. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx --------------------------------- Yahoo! Acesso Gr?tis - Internet r?pida e gr?tis. Instale o discador agora! -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/544aa403/attachment-0054.html From lyon at docjava.com Mon Feb 6 05:49:34 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 06 Feb 2006 07:49:34 -0500 Subject: [Rxtx] wiki delay until tomorrow night. In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: Hi All, I have often thought about USB drivers being needed. For example, the ironman watch will not interface to a mac (windows only). It is USB. My dymo label writer has no Java driver (native only). Etc. Most cheap web cameras are USB (and Java drivers go through JAI, if it supports the camera at all). The JAI code shows how sun did the USB drivers. You have to be a member of the jai project to download the source code. https://jai.dev.java.net has the jai distro. And then you are not allowed to redistribute it. However, we can all learn from it (if so inclined). Basically: cvs -d :pserver:lyon at cvs.dev.java.net:/cvs login cvs -d :pserver:lyon at cvs.dev.java.net:/cvs checkout jai-core You will need to user your own uid and pw to get in. The ant build has over 100 warnings from sun deprecations of its own code. You might say that they were hoisted on their own Picard ;) One interesting thing is that they support several platforms: linux-amd64 64-bit Linux-AMD64 linux-i586 32-bit Linux-x86 solaris-amd64 64-bit Solaris-AMD64 solaris-i586 32-bit Solaris-x86 solaris-sparc 32-bit Solaris-SPARC solaris-sparcv9 64-bit Solaris-SPARC windows-i586 32-bit Windows-x86 Thus, ant is used to provide a multi-platform native method distro. Neat. How do they do it? check this out: And: The core download does not contain any C source code (it was all pre-built). Basically, they are just copying .so and .dll files into build directories. I would love to see the C code for this...but Sun does not post it on the https://jai.dev.java.net site. I don't know why...Perhaps I missed it. - Doug >On Sun, 5 Feb 2006, Trent Jarvi wrote: > >>On Sun, 5 Feb 2006, Kim Lux wrote: >> >>>usb ? Tell me more... I need that too. >> >>usb is a very proper design. Thats all it is. >> > >Maybe rxtx could help usb. But it would start with helping bring >back the community that was already there. > >It's not something I'd love to do but maybe its the right thing to do. > >It would probably take 2 years to do right. But maybe thats better >than what we have now. > >I honestly don't know what IBM is doing which could just run over everything. > >Just some thoughts after some fine german wine. > >-- >Trent Jarvi >tjarvi at qbang.org > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tdelenik at gmail.com Mon Feb 6 05:56:32 2006 From: tdelenik at gmail.com (Thanasis Delenikas) Date: Mon, 6 Feb 2006 14:56:32 +0200 Subject: Fwd: [Rxtx] Documentation Wiki In-Reply-To: <1139157422.4553.9.camel@zd7280> References: <20060205113618.30274.qmail@web53501.mail.yahoo.com> <1139157422.4553.9.camel@zd7280> Message-ID: <310a1a930602060456t129f1dc6p5f2b908f13ab5a0b@mail.gmail.com> Hello all, Kim, this is a snippet from the code I use. The closest to directly opening a specific port without enumeration. << ... portId = CommPortIdentifier.getPortIdentifier(getPort()); serialPort = (SerialPort) portId.open("jSMSEngine", 1971); ... >> where getPort() return the string identifier of the port, i.e. "/dev/ttyS0" or "COM1" or whatever. Thanasis. ---------- Forwarded message ---------- From: Kim Lux Date: Feb 5, 2006 6:37 PM Subject: Re: [Rxtx] Documentation Wiki To: RXTX Developers and Users BTW: there is no way to open a port without going through the port list and finding it. Maybe sometime in the future someone (me ?) will write a method called openSerialPort that allows the user to give a port identifier, such as "/dev/tty1" and return a port ready to use. It wouldn't take much to write that and it would save users a lot of code. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/182ab5b8/attachment-0054.html From tjarvi at qbang.org Mon Feb 6 11:53:57 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 11:53:57 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: On Mon, 6 Feb 2006, Dr. Douglas Lyon wrote: > Hi All, > I have often thought about USB drivers being needed. > For example, the ironman watch will not interface > to a mac (windows only). It is USB. > My dymo label writer has no Java driver (native only). > Etc. > Most cheap web cameras are USB (and Java drivers go > through JAI, if it supports the camera at all). > The JAI code shows how sun did the USB drivers. > You have to be a member of the jai project to download > the source code. > https://jai.dev.java.net has the jai distro. > And then you are not allowed to redistribute it. However, > we can all learn from it (if so inclined). Basically: > cvs -d :pserver:lyon at cvs.dev.java.net:/cvs login > cvs -d :pserver:lyon at cvs.dev.java.net:/cvs checkout jai-core > You will need to user your own uid and pw to get in. > The ant build has over 100 warnings from sun deprecations > of its own code. > > You might say that they were hoisted on their own Picard ;) > > One interesting thing is that they support several platforms: > linux-amd64 64-bit Linux-AMD64 > linux-i586 32-bit Linux-x86 > solaris-amd64 64-bit Solaris-AMD64 > solaris-i586 32-bit Solaris-x86 > solaris-sparc 32-bit Solaris-SPARC > solaris-sparcv9 64-bit Solaris-SPARC > windows-i586 32-bit Windows-x86 > Thus, ant is used to provide a multi-platform native method distro. > Neat. > How do they do it? > check this out: > > > > > > > > > > > > > And: > > > > > > > > > > The core download does not contain any C source code (it was all pre-built). > Basically, they are just copying .so and .dll files into build directories. > > I would love to see the C code for this...but Sun does not post it on the > https://jai.dev.java.net site. > > I don't know why...Perhaps I missed it. > > - Doug > > I've looked at moving rxtx to Ant builds. I think that would help IDEs a great deal. I requested a evalutation desk copy the O'Reilly Ant book for some j2ee material I was teaching. http://www.oreilly.com/catalog/anttdg/ It has a one sentence mention of JNI. So there was not luck there. I saw that there is another Ant book that does mention JNI more. I can't find it now. Ant must be able to support it with extensions. http://ant.apache.org/manual/OptionalTasks/javah.html What the auto(break :) tools do in the rxtx build is 4 things really. 1) gcc compile flags 2) ld compile flags 3) config.h 4) compile flags for customizing rxtx (lockfiles, ...) See 1 All of this information except 4 can be static once obtained. So I'm not attached to the auto tools. If I could find an example of Ant being used for JNI code, I'd be one of the first to start moving that direction. Maybe someone saw an example someplace. The other thing we have not completed discussing is the directory structure. There is interest in making rxtx more IDE friendly. I get more mail about that off the list than how to install rxtx. And I see we have Ken Thompson in da house :) He is our trusted CVS maintainer and the guy that purchased the rxtx.org domain. Old community. We will need Ken for changing the directory structure of source. I would like to open up discussion about both of these as it is more than time. The problem is I have little experience with Ant and even less with IDEs. It would be nice if we could work with Eclipse and NetBeans. http://www.netbeans.org/ (sun and some community) http://www.eclipes.org (ibm,rhat,... perhaps more community) http://maven.apache.org/what-is-maven.html (apache. It is community) borland should sortof be here too but I think thats covered in eclipse. >From what I understand so far, we should morph rxtx to support those three maybe trusting apaches lead with maven. But I use vi. I have little to no clues beyond what people have fed me. Can we agree that thats the right direction to go? -- Trent Jarvi tjarvi at qbang.org From brian at mbari.org Mon Feb 6 14:57:50 2006 From: brian at mbari.org (Brian Schlining) Date: Mon, 6 Feb 2006 13:57:50 -0800 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> > The other thing we have not completed discussing is the directory > structure. There is interest in making rxtx more IDE friendly. I > get more mail about that off the list than how to install rxtx. > > And I see we have Ken Thompson in da house :) He is our trusted > CVS maintainer and the guy that purchased the rxtx.org domain. Old > community. We will need Ken for changing the directory structure of > source. > > I would like to open up discussion about both of these as it is > more than time. The problem is I have little experience with Ant > and even less with IDEs. It would be nice if we could work with > Eclipse and NetBeans. > > http://www.netbeans.org/ (sun and some community) > http://www.eclipes.org (ibm,rhat,... perhaps more community) > http://maven.apache.org/what-is-maven.html (apache. It is community) > borland should sortof be here too but I think thats covered in > eclipse. > >> From what I understand so far, we should morph rxtx to support >> those three > maybe trusting apaches lead with maven. But I use vi. I have > little to no clues beyond what people have fed me. > Maven likes the directory structure below for Java code. (From http:// maven.apache.org/guides/getting-started/index.html) This structure works fine with ant, netbeans, and eclipse. rxtx_root_directory `-- src |-- main | `-- java | `-- gnu | `-- io `-- test `-- java `-- gnu `-- io Brian Schlining Software Engineer http://www.mbari.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/d9451eba/attachment-0054.html From tjarvi at qbang.org Mon Feb 6 15:11:45 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 15:11:45 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: > rxtx_root_directory > `-- src > |-- main > | `-- java > | `-- gnu > | `-- io > `-- test > `-- java > `-- gnu > `-- io > >From what I understand this will just be good. For me it makes no difference. So lets do the rxtx thing. Let if fester for two weeks and if nobody objects, we will do it. I'm not doing this because I care. I'm doing this to eliminate much of my inbox. But test... man is rxtx lacking there in the community aspect. It is covered but not right. _maybe_ I can change that this year. -- Trent Jarvi tjarvi at qbang.org (cat hurding since 1997) From lux at diesel-research.com Mon Feb 6 21:38:49 2006 From: lux at diesel-research.com (Kim Lux) Date: Mon, 06 Feb 2006 21:38:49 -0700 Subject: [Rxtx] How can I use Lock Files with rxtx (in FC4) ? Message-ID: <1139287129.17031.3.camel@zd7280> I am now running an rxtx application on FC4. I am getting: ========================================================= check_group_uucp(): error testing lock file creation Error details: Permission denied check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL ========================================================= $ ls -al /var/lock total 32 drwxrwxr-x 4 root lock 4096 Feb 6 16:04 . drwxr-xr-x 24 root root 4096 Nov 14 01:19 .. drwx------ 2 root root 4096 Apr 27 2005 lvm drwxr-xr-x 2 root root 4096 Feb 6 16:04 subsys How do I fix this for regulator users ? -- Kim Lux, Diesel Research Inc. From dmarkman at mac.com Mon Feb 6 22:24:44 2006 From: dmarkman at mac.com (Dmitry Markman) Date: Tue, 7 Feb 2006 00:24:44 -0500 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: if I understands the issue right in order to be able to use ant for c/c++ compilation you have to install ant's cc task http://ant-contrib.sourceforge.net/cc.html it looks like it should work on mac os x (authors claim, that it's platform independent) but I never tested so all you have to do it's providing right command line for the gcc compiler On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: >> rxtx_root_directory >> `-- src >> |-- main >> | `-- java >> | `-- gnu >> | `-- io >> `-- test >> `-- java >> `-- gnu >> `-- io >> > > >> From what I understand this will just be good. > > For me it makes no difference. So lets do the rxtx thing. Let if > fester for two weeks and if nobody objects, we will do it. > > I'm not doing this because I care. I'm doing this to eliminate > much of my inbox. > > But test... man is rxtx lacking there in the community aspect. It > is covered but not right. _maybe_ I can change that this year. > > -- > Trent Jarvi > tjarvi at qbang.org > (cat hurding since 1997) > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx Dmitry Markman From lux at diesel-research.com Mon Feb 6 23:20:15 2006 From: lux at diesel-research.com (Kim Lux) Date: Mon, 06 Feb 2006 23:20:15 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? Message-ID: <1139293215.3689.4.camel@zd7280> I'm running the code below. portlist.hasMoreElements() is false. /dev has ports in it as listed below. What am I doing wrong ? ========================================================== // Step through the list of ports until we find one that matches // the one we are looking for. portList = CommPortIdentifier.getPortIdentifiers(); while(portList.hasMoreElements()) { portID = (CommPortIdentifier) portList.nextElement(); // if (portID.getName().equals("/dev/ttyUSB0")) { myTA.append("Serial port ttyUSB0 has been found\n"); break; }// if portID equals... }// End of while... ========================================================== ls -al /dev/tty* crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 ... crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 -- Kim Lux, Diesel Research Inc. From david.garnier at trusted-logic.com Tue Feb 7 00:46:30 2006 From: david.garnier at trusted-logic.com (David Garnier) Date: Tue, 07 Feb 2006 08:46:30 +0100 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: <43E85056.2090608@trusted-logic.com> Hello, I think that the make-based build process is fine as it is, apart from the location of the Java source files. It is true that putting the Java source in a directory structure that map 1-to-1 to the Java package structure is the norm and should make it easier for everyone to modify the Java source, with or without an IDE. Ant is a good tool, but in the RXTX case I fail to see the advantage of using it compared to the current make-based process. As Trent said, they are more pressing issues, like testing. Regards, David Dmitry Markman wrote: > if I understands the issue right > in order to be able to use ant for c/c++ compilation > you have to install ant's cc task > http://ant-contrib.sourceforge.net/cc.html > > it looks like it should work on mac os x > (authors claim, that it's platform independent) > but I never tested > > so all you have to do it's providing right command line > for the gcc compiler > > > > > On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: > >>> rxtx_root_directory >>> `-- src >>> |-- main >>> | `-- java >>> | `-- gnu >>> | `-- io >>> `-- test >>> `-- java >>> `-- gnu >>> `-- io >>> >> >> >>> From what I understand this will just be good. >> >> For me it makes no difference. So lets do the rxtx thing. Let if >> fester for two weeks and if nobody objects, we will do it. >> >> I'm not doing this because I care. I'm doing this to eliminate much >> of my inbox. >> >> But test... man is rxtx lacking there in the community aspect. It is >> covered but not right. _maybe_ I can change that this year. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> (cat hurding since 1997) From tjarvi at qbang.org Tue Feb 7 01:11:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 01:11:31 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <43E85056.2090608@trusted-logic.com> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: On Tue, 7 Feb 2006, David Garnier wrote: > Hello, > > I think that the make-based build process is fine as it is, apart from the location of the Java > source files. It is true that putting the Java source in a directory structure that map 1-to-1 to > the Java package structure is the norm and should make it easier for everyone to modify the Java > source, with or without an IDE. > > Ant is a good tool, but in the RXTX case I fail to see the advantage of using it compared to the > current make-based process. As Trent said, they are more pressing issues, like testing. > Hi David I have more experience with testing rxtx than I can talk about. But let it be known, rxtx has gone trough 100's of hours of testing. We are hobby folks interested in toys but there is more. rxtx has had some of the best guidance in the industry there. This is not an easy thing. I may be able to come back in a month from the other side of the corperate fence and help. I suspect the tests could just be made public but they are in a very unusual environment that just wont work in a wider sense. This is something I'll be trying to change. At one point it was agreed we could just make the results public so this isnt just noise.. There is interest and I think its safe to mention that much. The big problem with testing in the past is most of it is done with a loopback connection. So we *still* have major questions regarding things like flow control. rxtx talks to itself over a loopback and it works. regardless of right or wrong. This requires more thought to be done right. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Feb 7 02:46:34 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 02:46:34 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: > The big problem with testing in the past is most of it is done with a > loopback connection. So we *still* have major questions regarding things > like flow control. rxtx talks to itself over a loopback and it works. > regardless of right or wrong. With serial communication there are gold standards. ckermit is probably a definitive 'standard.' Maybe its possible to do ping/pong tests with ckermit? Is it scriptable? There are known issues in rxtx. Probably the worst is some threading issues regarding some JREs with multiple JNI threads setting java variables. Man did I get schooled there. Just switch the c functions to returning variables and things go away. Sometimes they work fine, sometimes they blow up. Without understanding everything, somehow rhat got it right and debian (and especially gentoo) grabbed kernel patches causing all sort of harm. Its not hard to fix once you understand whats going on but nearly impossible to track with a debugger. So I have a good idea what 2.1-8 will have outside of the IDE modifications. rxtx 2.1-7 is a release for everyone to sync with. Its not even as stable as -pre17 as far as I know - I ran no test suites. I'll be chasing it too. We just had so many contributions that it was time. It seriously broke internal scheduals but thats a great thing :) The other thing I want to do in 2.1-8 is automagic baud rates. It turns out lots of shops are doing really funky baud rates for things like automobile test equipment. It is possible but it requires a fair amount of change in the native code. Is anyone looking at this? -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Feb 7 02:57:21 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 07 Feb 2006 04:57:21 -0500 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <43E85056.2090608@trusted-logic.com> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: Hi All, I agree, testing is very important. The problem I have been trying to address is related to cross-platform testing and the robust nature of the installs. Typically, I visit 3 platforms to deploy my product, windows, linux and mac. A build is performed on each platform. The idea that you can build for many platforms from one copy the source code seems attractive. This should enable synchronized deployments of identical code. The question of how to achieve this goal remains open. As Trent mentioned, this is hard. Perhaps Ant will help here (but perhaps not). Ant does seem to help with running unit tests. However, it does not help with multi-platform tests. For that you need many machines and different operating environments. Toward that end, I have created a multi-platform test that can be run from web start, located at: http://show.docjava.com:8086/book/cgij/code/jnlp/serialPort.PortTest.jnlp This is interesting because many people in the community can run the test and we can improve the test, as time permits. No, it is not a perfect solution, however, the idea does help with multi-platform tests using many machines and different operating environments. If the group has a good test for a general serial port set-ups, i would be happy to deploy it, for general evaluation using web start. And as for ANT, it is just an idea. Not all my ideas are good ones! - Doug >Hello, > >I think that the make-based build process is fine as it is, apart >from the location of the Java >source files. It is true that putting the Java source in a directory >structure that map 1-to-1 to >the Java package structure is the norm and should make it easier for >everyone to modify the Java >source, with or without an IDE. > >Ant is a good tool, but in the RXTX case I fail to see the advantage >of using it compared to the >current make-based process. As Trent said, they are more pressing >issues, like testing. > >Regards, >David > >Dmitry Markman wrote: >> if I understands the issue right >> in order to be able to use ant for c/c++ compilation >> you have to install ant's cc task >> http://ant-contrib.sourceforge.net/cc.html >> >> it looks like it should work on mac os x >> (authors claim, that it's platform independent) >> but I never tested >> >> so all you have to do it's providing right command line >> for the gcc compiler >> >> >> >> >> On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: >> >>>> rxtx_root_directory >>>> `-- src >>>> |-- main >>>> | `-- java >>>> | `-- gnu >>>> | `-- io >>>> `-- test >>>> `-- java >>>> `-- gnu >>>> `-- io >>>> >>> >>> >>>> From what I understand this will just be good. >>> >>> For me it makes no difference. So lets do the rxtx thing. Let if >>> fester for two weeks and if nobody objects, we will do it. >>> >>> I'm not doing this because I care. I'm doing this to eliminate much >>> of my inbox. >>> >>> But test... man is rxtx lacking there in the community aspect. It is >>> covered but not right. _maybe_ I can change that this year. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> (cat hurding since 1997) > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From matt.higgins at gmail.com Tue Feb 7 08:28:34 2006 From: matt.higgins at gmail.com (Matt Higgins) Date: Tue, 7 Feb 2006 10:28:34 -0500 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final Message-ID: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? import java.io.*; import java.util.*; import gnu.io.*; public class MySimpleRead implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; public static void main(String[] args) { boolean portFound = false; String defaultPort = "COM1"; if (args.length > 0) { defaultPort = args[0]; } portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; MySimpleRead reader = new MySimpleRead(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } } public MySimpleRead() { try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) { e.printStackTrace(); } try { inputStream = serialPort.getInputStream(); } catch (IOException e) { e.printStackTrace(); } try { serialPort.addEventListener(this); } catch (TooManyListenersException e) { e.printStackTrace(); } try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { e.printStackTrace(); } System.out.println("Baud is " + serialPort.getBaudRate()); System.out.println("Bits is " + serialPort.getDataBits()); System.out.println("Stop is " + serialPort.getStopBits()); System.out.println("Par is " + serialPort.getParity()); serialPort.notifyOnDataAvailable(true); readThread = new Thread(this); readThread.start(); } public void run() { // Thread.sleep(20000); //} catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { System.out.println("An event occurred " + event.getEventType()); switch (event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: byte[] readBuffer = new byte[20]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } System.out.print(new String(readBuffer)); } catch (IOException e) {} break; } } } --------------- Result on windows ------------------------------ Stable Library ============================================================== Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port:: COM1 Baud is 9600 Bits is 8 Stop is 1 Par is 0 ----------------- End Results ----------------------------------------- ------------------ Result on Linux ----------------------------------- Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 Found port: /dev/ttyS0 Baud is 9600 Bits is 8 Stop is 1 Par is 0 An event occurred 1 043100066224 ------------------ End Results --------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/a1431630/attachment-0054.html From brian at mbari.org Tue Feb 7 09:48:37 2006 From: brian at mbari.org (Brian Schlining) Date: Tue, 7 Feb 2006 08:48:37 -0800 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> Message-ID: <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> Hi Matt > The following code works fine on Linux but I never see any data > when run on Windows. This is a cut and paste from the SimpleRead > example. > I am attempting to read data from a bar code scanner. I can fire > up HyperTermianl on windows and see that the device is working > properly as I see the barcodes are scanned and echoed back to the > terminal. However when I run the app I don't see any data. It is > however associating with the com port as the informational bits > print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. Cheers Brian Schlining Software Engineer http://www.mbari.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/16d07f37/attachment-0054.html From lux at diesel-research.com Tue Feb 7 11:59:58 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 11:59:58 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139293215.3689.4.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> Message-ID: <1139338798.8145.4.camel@zd7280> Any ideas on this ? Any reason why portList.hasMoreElements() should be false even though there are devices in /dev ? On Mon, 2006-02-06 at 23:20 -0700, Kim Lux wrote: > I'm running the code below. > > portlist.hasMoreElements() is false. > > /dev has ports in it as listed below. > > What am I doing wrong ? > > > ========================================================== > // Step through the list of ports until we find one that matches > // the one we are looking for. > > portList = CommPortIdentifier.getPortIdentifiers(); > > while(portList.hasMoreElements()) > { > portID = (CommPortIdentifier) portList.nextElement(); // > if (portID.getName().equals("/dev/ttyUSB0")) > { > myTA.append("Serial port ttyUSB0 has been found\n"); > break; > }// if portID equals... > }// End of while... > ========================================================== > > ls -al /dev/tty* > crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty > crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 > crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 > crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 > crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 > ... > crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 > crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 > crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 > > > -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 12:20:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 12:20:25 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139338798.8145.4.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> Message-ID: On Tue, 7 Feb 2006, Kim Lux wrote: > > Any ideas on this ? Any reason why portList.hasMoreElements() should be > false even though there are devices in /dev ? > > > On Mon, 2006-02-06 at 23:20 -0700, Kim Lux wrote: >> I'm running the code below. >> >> portlist.hasMoreElements() is false. >> >> /dev has ports in it as listed below. >> >> What am I doing wrong ? >> >> >> ========================================================== >> // Step through the list of ports until we find one that matches >> // the one we are looking for. >> >> portList = CommPortIdentifier.getPortIdentifiers(); >> >> while(portList.hasMoreElements()) >> { >> portID = (CommPortIdentifier) portList.nextElement(); // >> if (portID.getName().equals("/dev/ttyUSB0")) >> { >> myTA.append("Serial port ttyUSB0 has been found\n"); >> break; >> }// if portID equals... >> }// End of while... >> ========================================================== >> >> ls -al /dev/tty* >> crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty >> crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 >> crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 >> crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 >> crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 >> ... >> crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 >> crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 >> crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 >> >> >> > Hi Kim What rxtx does is try to open the port and do a timed out read. If the kernel/... do not complain it's enumarted. I suspect you could do a crude test by doing something like cat /dev/ttyS0 > /dev/null If that barfs then rxtx wont enumerate the port. hmm looking at your question again, I suspect it's a lockfile problem. This is documented in INSTALL with the source. Its easy enough to test this too.. touch /var/lock/testingrxtxlockfiles && rm -f /var/lock/testingrxtxlockfiles If you are not in the right group it will bail. Root will work regardless. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 12:37:56 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 12:37:56 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> Message-ID: <1139341076.8145.11.camel@zd7280> Exactly which ports does rxtx attempt to put into the list ? /dev/* or /dev/tty* or /dev/tty[0-9[0-9] ? or /dev/ttyS* ? For the record, only /dev/ttyUSB0 is a valid port on the machine I am presently on. Will this be a problem ? On Tue, 2006-02-07 at 12:20 -0700, Trent Jarvi wrote: > This is documented in INSTALL with the source. > I was wondering where that file was. I will download source and dig it up. Thanks. -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 12:51:09 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 12:51:09 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139341076.8145.11.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: On Tue, 7 Feb 2006, Kim Lux wrote: > > Exactly which ports does rxtx attempt to put into the list ? /dev/* > or /dev/tty* or /dev/tty[0-9[0-9] ? or /dev/ttyS* ? > > For the record, only /dev/ttyUSB0 is a valid port on the machine I am > presently on. Will this be a problem ? > > > On Tue, 2006-02-07 at 12:20 -0700, Trent Jarvi wrote: >> This is documented in INSTALL with the source. >> > I was wondering where that file was. I will download source and dig it > up. > > Thanks. > Hmm I'm looking at pre17 so this may have changed. (its just what I have on this machine) if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA" // for the IPAQs }; CandidatePortPrefixes=Temp; } So you may need to add "ttyUSB" to that list. RXTX used to enumerate _everything_ see if(osName.equals("Linux-all-ports") But it became less than practical. This is all in RXTXCommDriver.java hmm I just did a cvs update. if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have to get your fingers into the code. We aim for sane defaults. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 13:06:45 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 13:06:45 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139342805.8145.22.camel@zd7280> On Tue, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > Hmm I'm looking at pre17 so this may have changed. (its just what I have > on this machine) > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA" // for the IPAQs > }; > CandidatePortPrefixes=Temp; > } > > > So you may need to add "ttyUSB" to that list. RXTX used to enumerate > _everything_ see if(osName.equals("Linux-all-ports") But it became less > than practical. > > This is all in RXTXCommDriver.java > > hmm I just did a cvs update. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have > to get your fingers into the code. We aim for sane defaults. Excellent. Thanks for taking the time. -- Kim Lux, Diesel Research Inc. From ideiglenes1 at freemail.hu Tue Feb 7 13:53:39 2006 From: ideiglenes1 at freemail.hu (--) Date: Tue, 07 Feb 2006 21:53:39 +0100 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139345619.22534.2.camel@localhost> Hi! I use this code to get all the extra Linux devices. :) if ("Linux".equals(System.getProperty("os.name"))) { System.setProperty("os.name","Linux-all-ports"); } driver = new RXTXCommDriver(); On k, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > On Tue, 7 Feb 2006, Kim Lux wrote: > > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have > to get your fingers into the code. We aim for sane defaults. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From matt.higgins at gmail.com Tue Feb 7 13:45:54 2006 From: matt.higgins at gmail.com (Matt Higgins) Date: Tue, 7 Feb 2006 15:45:54 -0500 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> Message-ID: <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> Sweet this is exactly what I needed. I was searching the archives through marc.theamisgroup they only have archives back to 1/3/05. Should have hit the mailman archive! Thanks a lot! On 2/7/06, Brian Schlining wrote: > > Hi Matt > > The following code works fine on Linux but I never see any data when run > on Windows. This is a cut and paste from the SimpleRead example. > I am attempting to read data from a bar code scanner. I can fire up > HyperTermianl on windows and see that the device is working properly as I > see the barcodes are scanned and echoed back to the terminal. However when I > run the app I don't see any data. It is however associating with the com > port as the informational bits print fine? > > > You're not the only one whose had this problem, I don't know if Trent has > addressed this is the latest release of RXTX but there is a workaround. > Here's the recent thread from the RXTX mailing list regarding this issues: > > Thanasis Delenikas tdelenik at gmail.com > Wed Jan 18 13:56:23 MST 2006 > > * Previous message: [Rxtx] Re: More close() performance fixes > * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] > > Hi all. > (I've subscribed again from my other email account). > > Trent, > > You are right. Linux *always* works, no matter what flow control you set. > Windows *works only* with hardware flow control (I haven't tested what > happens with software XON/XOFF flow control). > > I assume (but I am not certain) that even with no flow control at all, all > platforms should work. Without flow control, you have the risk of bumping > into overflow or framing errors, but that's your (the end programmer, I > mean) problem. > > >From my side, I shouldn't be working without flow control. That was a bug > too... It was some code forgotten from the old times, when I used to work > with phone emulation drivers which didn't support flow control. The > correct > way is to have some flow control enabled and that's why I suppose this is > a > low-severity bug for RxTx. > > I have no idea which platform shows the correct behaviour, since > my knowledge about Linux and the inner workings of these low-level i/o > operations is limited. > > Regards, > Thanasis Delenikas. > > > > > Message: 2 > > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > > From: Trent Jarvi > > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > > To: RXTX Developers and Users > > Message-ID: > > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > > > Hi all, > > > > > > Trent, I have found something. > > > I read your comment about flow control, so I experimented a bit. > > > > > > If you remember, in my sample program I've used no flow control at all > ( > > i.e. > > > Java constant FLOWCONTROL_NONE). > > > > > > Now, during testing, I've switch to hardware inbound flow control (i.e > . > > Java > > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > > beautifully! > > > > > > I think I will switch to H/W flow control and test things for a while, > > but > > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > > > > > Hi Thanasis, > > > > I'm fairly sure you have identified a bug. I would not worry too much > > about what Sun CommAPI w32 defaults are. I think they did more or less > > whatever the port opened with. Just a guess. Linux tries to stomp on > > ports so they are all the same. > > > > So this started out with Linux worked, Windows XP/.. did not as I > recall. > > Something is wrong in rxtx. Do I understand this right? > > > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > > > Perhaps there is something Wayne or I did not understand when we wrote > > that code. I wasnt programming back in the BBS days so modems are not > my > > thing. I have a few questions. > > > > Is the above matrix confirmed by observation? > > Linux just always worked? > > Which one _should_ work? I'm guessing modems work with hardware flow > > control. I'll have to dig around. > > > > The windows flow control changes a couple things with hardware flow > > control. Following the w32 API documentation is confusing sometimes. > > But it looks like Linux could have a bug too. > > Cheers > > Brian Schlining > Software Engineer > http://www.mbari.org > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/9c989144/attachment-0054.html From tjarvi at qbang.org Tue Feb 7 14:06:14 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 14:06:14 -0700 (MST) Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> Message-ID: >> >> You're not the only one whose had this problem, I don't know if Trent has >> addressed this is the latest release of RXTX but there is a workaround. >> Here's the recent thread from the RXTX mailing list regarding this issues: >> I have not. I expect to have access to some test equipment next month and I'll go through all of this. I really don't know whats going on and I need a gold standard. I thought maybe linux was autodetecting the flow control. Your observations would certainly be welcome. I need to talk to Russell King and see what he is doing. Until then I'd just be toying around over a loopback as usual. This is very high on the list though. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 17:25:05 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 17:25:05 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139358305.17994.2.camel@zd7280> My application now works. I installed the libraries and jar from 2.1-7 (Final). portlist.hasMoreElements is no longer false. The application finds the port for /dev/ttyUSB0. Thanks for your help, Trent (et al) Sorry I bothered you with this. Next time I will look in the source first. I didn't think it was an rxtx issue, I thought it was a Linux setup issue . On Tue, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > Hmm I'm looking at pre17 so this may have changed. (its just what I > have > on this machine) > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux > Serial Ports > "ttySA" // for the > IPAQs > }; > > CandidatePortPrefixes=Temp; > } > > > So you may need to add "ttyUSB" to that list. RXTX used to enumerate > _everything_ see if(osName.equals("Linux-all-ports") But it became > less > than practical. > > This is all in RXTXCommDriver.java > > hmm I just did a cvs update. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux > Serial Ports > "ttySA", // for the > IPAQs > "ttyUSB" // for USB > frobs > }; > > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you > have > to get your fingers into the code. We aim for sane defaults. -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 19:21:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 19:21:54 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139358305.17994.2.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> <1139358305.17994.2.camel@zd7280> Message-ID: >Sorry I bothered you with this. Next time I will look in the source >first. I didn't think it was an rxtx issue, I thought it was a Linux >setup issue . Why would you be sorry? I would have done the same. I'm glad it's working :) -- Trent Jarvi tjarvi at qbang.org From tma at mail.island.net Wed Feb 8 13:39:35 2006 From: tma at mail.island.net (Tom Alldread) Date: Wed, 08 Feb 2006 12:39:35 -0800 Subject: [Rxtx] Win32/Linux Serial Port Data Dropouts In-Reply-To: <200602060702.k167255O007882@www.qbang.org> References: <200602060702.k167255O007882@www.qbang.org> Message-ID: <43EA5707.4020200@mail.island.net> Greetings Folks at RXTX: During the last couple of months I have been alternately testing with javax.comm 2 and RXTX 2.1 under Windows XP and CommApi 3 and RXTX 2.1 under Suse 10.0 Linux. In the process I have learned a little about java multi-threading under NetBeans 5 with Profiler. My java (jdk 1.5_06) application is used for data acquisition and provides a graphical display of A-D conversion data received from a 56KBaud serial port. The actual data throughput is about 10KBaud thus it is well below the speed of the port. I use hardware RTS/CTS flow control which can stall the data acquisition sample rate if necessary. This ensures the display computer has the ability to slow the data acquisition rate should it become too busy to accept the regular data flow. Both the serial port buffer and the java read buffer are set at 16KB. Usually the data transfers into the java read buffer are less than 100 bytes unless the data acquisition is recovering from a stall. The data flow normally hesitates after each 5 KB block as a continue command is needed from the display computer to start the drawing of a new graphics display line. Separate threads have been provided for the serial port event monitoring and data processing. The serial port event thread has been given the maximum priority and data processing thread the minimum priority provided by java. Thread yield statements have been placed within all data processing while/for loops as an effort to ensure quick access to CPU cycles for the serial port event thread. I have found that short data transmissions are essentially error free but occasional dropouts occur with continuous data flow especially under Windows XP. ....................................................................................................................................................................................... Linux results: I am happy to report that RXTX 2.1 appears to work very well under Linux although I did notice some errors when the screen savers were running with my dual monitors. I believe this is a local problem associated with my dual graphics which needs further attention. The recent CommApi 3 Linux release from Sun did not work at all with my program. It seemed to send commands out OK but did not receive any data. Although the serial port event triggered the ISR, the input stream appeared filled with nulls and thus did not contain any data. As my understanding is that CommApi 3 was tested with a Red Hat distribution of Linux I wonder if this problem is distro dependent? Although somewhat off topic here I wonder if anyone reading this has had similar experience? .................................................................................................................................................................................. Windows XP results: There are problems with occasional data dropouts which become more frequent as the sampling rate is increased or if the computer becomes busy with other duties. The dropouts typically consist of a half dozen byte block of lost data. It appears the lost bytes never get added to the java input stream. There has not been any indication of garbled data, overruns or framing errors which suggests the UART communications remains solid. Using javax.comm 2 I found that the setting of SerialPort 'enableReceiveThreshold' to 40 and 'enableReceiveTimeout' of 100mS reduced the dropouts error rate significantly. I found that I could not get RXTX 2.1 to function with the aforementioned threshold and timeout settings. The javax.comm 2 interface is consequently performing better for me under Windows than RXTX 2.1. I wonder if anyone here has any suggestions as to what I might try to improve RXTX 2.1? Although my settings are the same as under Suse 10.0, RXTX 2.1 performs much better for me under Linux than any of the alternatives that I have tried under Windows XP . ............................................................................................................................................................................... I would like to establish, based on the experience of others, if I have reached the normally expected performance limit of java serial port communications? Should I expect to achieve virtually error free serial port data input from a continuous stream under Windows XP java software? I am considering changing my protocol to packets with error checking if necessary but would like to know if the dropout problems I am experiencing are typical or not before I take this rather work intensive plunge. Many thanks in advance for any help! Best Regards, Tom Alldread -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.375 / Virus Database: 267.15.2/253 - Release Date: 2006-02-07 From jlaxson at mac.com Wed Feb 8 23:56:48 2006 From: jlaxson at mac.com (John Laxson) Date: Thu, 9 Feb 2006 00:56:48 -0600 Subject: [Rxtx] PortInUseException: Unknown Application on OSX Message-ID: Hi, I've been trying to get RXTX 2.1.7 going on Mac OS X for a while here, and am running up into a wall here. I've tried with pre- compiled and the source version and get the same problem, a gnu.io.PortInUseException: Unknown Application. I have run the fixperms script included with the source distribution, and id shows me as a member of the uucp group, and permissions on /var/spool/uucp are 775 root:uucp. Running a test program (included at the bottom for clarity) lets me enumerate all the serial ports correctly, but trying to open any of them gives the PortInUseException. If it helps, when I try to open a port that's set to make an outgoing bluetooth connection, there is no delay and no connection attempt at all. Thanks, John Laxson PS: The documentation wiki on qbang.org shows 404, and has for a few days now. My test code: public static void main(String[] args) { SerialPort serialPort; try { Enumeration e = CommPortIdentifier.getPortIdentifiers(); CommPortIdentifier ident; while (e.hasMoreElements()) { ident = (CommPortIdentifier)e.nextElement(); System.out.println(ident.getName()); } ident = CommPortIdentifier.getPortIdentifier("/dev/cu.modem"); serialPort = (SerialPort) ident.open("Me", 5000); } catch (Exception e) { e.printStackTrace(); } } From rajesh.invincible at gmail.com Thu Feb 9 03:39:38 2006 From: rajesh.invincible at gmail.com (Rajesh N) Date: Thu, 9 Feb 2006 16:09:38 +0530 Subject: [Rxtx] Re: Move .java Files in gnu.io filesystem hierarchy - Maven (2) In-Reply-To: <43DF21D2.7090200@ngi.it> References: <43DF21D2.7090200@ngi.it> Message-ID: <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Can anybody tell me how to overcome these EXCEPTIONS I AM WORKING ON SERIAL COMMN IN JAVA ON LINUX. 1. " NOT ALL PARAMETERS SUPPORTED BY THE KERNEL" This i came across the following statement inmy prog. SerialP is A SerialPort object SerialP.setSerialPortParams(9600(BAUDRATE),DATABITS_8,STOPBITS_1,PARITY_NONE) 2. NullPointer Exception at Event Dispatch Now i have checked all my object references for a null reference but i found none i have put up my entire code in try catch blocks but still I AM UNABLE TO CATCH THIS EXCEPTION AND HENCE MY APPLICATION CLOSES HOW DOES THESE GO? PLEASE HELP ME IT IS URGENTTTTTTTTTTTTTTTT yours sincerely RAJESH On 1/31/06, Fabio Frumento wrote: > Hi Xavier, > > I don't know maven at all but the directory hierarchy listed buy Trent > is fine for me... > > I'll take a look to maven, it seems an interesting project > > Regards > > Fabio Frumento > > Trent Jarvi wrote: > > On Tue, 31 Jan 2006, Xavier Frisaye wrote: > > > >> Hi all, > >> > >> If you are going to rearrange the src folder, i will propose to use > >> maven 2 and follow its directory structure > >> > (http://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html). > >> > >> Maven 2 simplify java project and give a standard way to make projects > >> (http://maven.apache.org/). > >> We are using it for internal projects and we are very satisfied. > >> > >> Is anybody interested? > >> > >> I'm not an expert in maven 2 (yet) but i'm agree to help using it if > >> you choose to make so. > >> > > > > so this would be: > > > > rxtx-devel/src/main/java/gnu.io > > rxtx-devel/src/test/java/ManIwish.java > > > > I don't use IDEs very much so I'll let others comment. But I don't see > > a problem with that. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Thu Feb 9 09:50:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 9 Feb 2006 09:50:31 -0700 (MST) Subject: [Rxtx] Re: Move .java Files in gnu.io filesystem hierarchy - Maven (2) In-Reply-To: <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Message-ID: On Thu, 9 Feb 2006, Rajesh N wrote: > Can anybody tell me how to overcome these EXCEPTIONS > I AM WORKING ON SERIAL COMMN IN JAVA ON LINUX. > > 1. " NOT ALL PARAMETERS SUPPORTED BY THE KERNEL" > > This i came across the following statement inmy prog. > SerialP is A SerialPort object > SerialP.setSerialPortParams(9600(BAUDRATE),DATABITS_8,STOPBITS_1,PARITY_NONE) > Strange. The parameters you use are the same the port should open with by default. Could you paste the actual exception you are getting? I don't see that in the rxtx source. Also it would help to know the rxtx version. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Fri Feb 10 15:29:05 2006 From: lux at diesel-research.com (Kim Lux) Date: Fri, 10 Feb 2006 15:29:05 -0700 Subject: [Rxtx] One serial port object for both sending and receiving ? Message-ID: <1139610545.18177.4.camel@zd7280> Is it OK to use one SerialPort ojbect (ex Serial Port serialPort;) and use it for both sending and receiving ? For example: ======================================================================== static SerialPort serialPort = null; static OutputStream serialOut = null; static InputStream serialIn = null; // assign it to an outputStream for use try{ serialOut = serialPort.getOutputStream(); System.out.println("Serial output stream has been assigned."); }//try catch(IOException e) { System.out.println("Error: Couldn't assign output stream to serial port."); }//catch //assign it to an inputStream for use try{ serialIn = serialPort.getInputStream(); System.out.println("Serial input stream has been assigned."); }//try catch(IOException e) { System.out.println("Error: Couldn't assign input stream to serial port."); }//catch ======================================================================== -- Kim Lux, Diesel Research Inc. From lux at diesel-research.com Fri Feb 10 21:23:00 2006 From: lux at diesel-research.com (Kim Lux) Date: Fri, 10 Feb 2006 21:23:00 -0700 Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Message-ID: <1139631780.23882.10.camel@zd7280> I've got a problem receiving chars with my version of serialRead, written in an SWT GUI. I had a Java pro have a good look at my code and he can't see anything wrong with it. I can send chars fine. When I receive a char the cpu usage for the app goes to 100% and the code in the serial event handler doesn't get executed. The instructions on the Java Comm Serial API How-To for Linux page state that I must install javacomm. Is that true ? Everything builds without it and I can send chars on rxtx just fine, but I can't receive them. Could this be the problem ? I downloaded and installed javacomm. I was not able to add "Driver=gnuio.RXTXCommDriver to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 installed in /usr/java/jre1.5.0_05. I added comm.jar to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext to the library paths. Is this OK ? Does it matter that I am receiving on /dev/ttyUSB0 ? Thanks. -- Kim Lux, Diesel Research Inc. From lunareclipse03 at web.de Sat Feb 11 09:44:46 2006 From: lunareclipse03 at web.de (lunareclipse03@web.de) Date: Sat, 11 Feb 2006 17:44:46 +0100 Subject: [Rxtx] Question about Serial I/O under Win32 Message-ID: <662084330@web.de> Hello everybody, I have a strange problem with a piece of code I made for myself. No, this is not really concerning rxtx, but nevertheless I post this to the list, hoping that some of you can help me. I've written two libraries, one for linux and one for win32. The linux port works quite well, I can send / receive faxes and / or replay voice messages over the telephone line using a voice modem. But the win32 port of the library causes some trouble. If, for example, I send out a fax with a certain modem under linux, it works well. The fax is complete when it comes out of the fax machine. If I then use the same modem to send out a fax under win32, the fax coming out of the fax machine gets "stuck" halfways, but the sending modem thinks that transmission was ok and drops the connection. The answering fax machine then gives me "error while receiving." The "upper layer" java code MUST be right, because if I do the same thing under linux (using the linux library), everything is alright. Now I have to ask: Can somebody please help me out with this??!? Could it be the case that some kind of flow control or COMMTIMEOUTS setting causes this behaviour? I set flow control to RTS/CTS before sending out a fax. How can I DISABLE flow control? Or what do you think? Can something else cause this problems? Thank you all for your time and PLEASE write back soon. Regards, --Sven Ahlemann Am Waldrand 31 45721 Haltern am See Germany ______________________________________________________________ Verschicken Sie romantische, coole und witzige Bilder per SMS! Jetzt bei WEB.DE FreeMail: http://f.web.de/?mc=021193 From lux at diesel-research.com Sat Feb 11 10:06:52 2006 From: lux at diesel-research.com (Kim Lux) Date: Sat, 11 Feb 2006 10:06:52 -0700 Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: <1139631780.23882.10.camel@zd7280> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> <1139631780.23882.10.camel@zd7280> Message-ID: <1139677612.3431.5.camel@zd7280> More on this problem. I copied and pasted simpleRead into a console based Eclipse project and I've got the same result, except that cpu usage doesn't go to 100%. I'm beginning to think there is an issue in rxtx. My imports for simpleRead are: ============================ import gnu.io.*; import java.util.*; //import javax.comm.*; import java.io.*; =========================== Any ideas ? I am trying to read from /dev/ttyUSB0 using a serial to USB adapter which has worked well with minicom and gtkterm. Thanks. On Fri, 2006-02-10 at 21:23 -0700, Kim Lux wrote: > I've got a problem receiving chars with my version of serialRead, > written in an SWT GUI. > > I had a Java pro have a good look at my code and he can't see anything > wrong with it. > > I can send chars fine. When I receive a char the cpu usage for the app > goes to 100% and the code in the serial event handler doesn't get > executed. > > The instructions on the Java Comm Serial API How-To for Linux page state > that I must install javacomm. Is that true ? Everything builds without > it and I can send chars on rxtx just fine, but I can't receive them. > Could this be the problem ? > > I downloaded and installed javacomm. I was not able to add > "Driver=gnuio.RXTXCommDriver > to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not > have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 > installed in /usr/java/jre1.5.0_05. I added comm.jar > to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext > to the library paths. Is this OK ? > > Does it matter that I am receiving on /dev/ttyUSB0 ? > > Thanks. > -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Sun Feb 12 21:01:33 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:01:33 -0700 (MST) Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: <1139677612.3431.5.camel@zd7280> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> <1139631780.23882.10.camel@zd7280> <1139677612.3431.5.camel@zd7280> Message-ID: I suspect what is happening is the select() is breaking out in the native code but the driver does not have support for notifying there are X bytes available. On some traditional Unix based systems, the only way you know data is available is the fd status changes and do an FIORDCHK ioctl. Or perhaps the only thing you can know is the fd status changed. It would take reading through the kernel driver code to know for sure. So on USB, depending upon the driver, the same may need to be done or the driver improved a bit if possible to support. Polling reads will also work but don't use the event driven model of CommAPI which isnt acceptable in the long run. The 100% cpu usage can then be explained because select no longer blocks until the data is read; the eventLoop spins loose. You can put a well placed sleep but rxtx only expects those are needed when it knows data is available. This may not be a super simple thing to understand and fix. I do have ideas to get you started. I'm going to be short on time the next couple weeks. I expect to put some good time in and answer some other questions I saw around the 25th. For now, I'd look at the following and go from there with the hints I've given. JNIEXPORT jint JNICALL RXTXPort(nativeavailable)( JNIEnv *env, jobject jobj ) { int fd = get_java_var( env, jobj,"fd","I" ); int result; /* char message[80]; ENTER( "RXTXPort:nativeavailable" ); On SCO OpenServer FIONREAD always fails for serial devices, so try ioctl FIORDCHK instead; will only tell us whether bytes are available, not how many, but better than nothing. This turns out to be true on Solaris also. taj. */ #ifdef FIORDCHK /* __unixware__ __sun__ probably others */ result = ioctl(fd, FIORDCHK, 0); #else if( ioctl( fd, FIONREAD, &result ) < 0 ) { goto fail; } #endif /* FIORDCHK */ On Sat, 11 Feb 2006, Kim Lux wrote: > > More on this problem. I copied and pasted simpleRead into a console > based Eclipse project and I've got the same result, except that cpu > usage doesn't go to 100%. I'm beginning to think there is an issue in > rxtx. > > My imports for simpleRead are: > > ============================ > import gnu.io.*; > import java.util.*; > //import javax.comm.*; > import java.io.*; > =========================== > > Any ideas ? I am trying to read from /dev/ttyUSB0 using a serial to > USB adapter which has worked well with minicom and gtkterm. > > Thanks. > > > > On Fri, 2006-02-10 at 21:23 -0700, Kim Lux wrote: >> I've got a problem receiving chars with my version of serialRead, >> written in an SWT GUI. >> >> I had a Java pro have a good look at my code and he can't see anything >> wrong with it. >> >> I can send chars fine. When I receive a char the cpu usage for the app >> goes to 100% and the code in the serial event handler doesn't get >> executed. >> >> The instructions on the Java Comm Serial API How-To for Linux page state >> that I must install javacomm. Is that true ? Everything builds without >> it and I can send chars on rxtx just fine, but I can't receive them. >> Could this be the problem ? >> >> I downloaded and installed javacomm. I was not able to add >> "Driver=gnuio.RXTXCommDriver >> to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not >> have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 >> installed in /usr/java/jre1.5.0_05. I added comm.jar >> to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext >> to the library paths. Is this OK ? >> >> Does it matter that I am receiving on /dev/ttyUSB0 ? >> >> Thanks. >> > From tjarvi at qbang.org Sun Feb 12 21:03:30 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:03:30 -0700 (MST) Subject: [Rxtx] One serial port object for both sending and receiving ? In-Reply-To: <1139610545.18177.4.camel@zd7280> References: <1139610545.18177.4.camel@zd7280> Message-ID: On Fri, 10 Feb 2006, Kim Lux wrote: > > Is it OK to use one SerialPort ojbect (ex Serial Port serialPort;) and > use it for both sending and receiving ? > > For example: > > ======================================================================== > static SerialPort serialPort = null; > static OutputStream serialOut = null; > static InputStream serialIn = null; > > > > > // assign it to an outputStream for use > try{ > serialOut = serialPort.getOutputStream(); > System.out.println("Serial output stream has been assigned."); > }//try > catch(IOException e) > { > System.out.println("Error: Couldn't assign output stream to serial > port."); > }//catch > > > //assign it to an inputStream for use > try{ > serialIn = serialPort.getInputStream(); > System.out.println("Serial input stream has been assigned."); > }//try > catch(IOException e) > { > System.out.println("Error: Couldn't assign input stream to serial > port."); > }//catch This should be fine. In fact trying to do it another way will probably not work as you will run into lockfile issues. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun Feb 12 21:13:13 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:13:13 -0700 (MST) Subject: [Rxtx] Question about Serial I/O under Win32 In-Reply-To: <662084330@web.de> References: <662084330@web.de> Message-ID: On Sat, 11 Feb 2006 lunareclipse03 at web.de wrote: > Hello everybody, > > I have a strange problem with a piece of code I made for myself. No, > this is not really concerning rxtx, but nevertheless I post this to the > list, hoping that some of you can help me. I've written two libraries, > one for linux and one for win32. The linux port works quite well, I can > send / receive faxes and / or replay voice messages over the telephone > line using a voice modem. But the win32 port of the library causes some > trouble. If, for example, I send out a fax with a certain modem under > linux, it works well. The fax is complete when it comes out of the fax > machine. If I then use the same modem to send out a fax under win32, the > fax coming out of the fax machine gets "stuck" halfways, but the sending > modem thinks that transmission was ok and drops the connection. The > answering fax machine then gives me "error while receiving." The "upper > layer" java code MUST be right, because if I do the same thing under > linux (using the linux library), everything is alright. Now I have to > ask: Can somebody please help me out with this??!? Could it be the case > that some kind of flow control or COMMTIMEOUTS setting causes this > behaviour? I set flow control to RTS/CTS before sending out a fax. How > can I DISABLE flow control? Or what do you think? Can something else > cause this problems? Thank you all for your time and PLEASE write back > soon. > Hi Sven I'm not too willing to talk about flow control at the low level until I confirm some things with test equipment later. It is not clear if you are using rxtx or writing your own native code. So I'm not sure how to answer much of this :) If you are wondering how to change the flow control using rxtx from java, The BlackBox example from Sun flips this back and forth. SerialPort.java in rxtx 2.1 uses the following: SerialPort.java: public static final int FLOWCONTROL_NONE =0; SerialPort.java: public static final int FLOWCONTROL_RTSCTS_IN =1; SerialPort.java: public static final int FLOWCONTROL_RTSCTS_OUT =2; SerialPort.java: public static final int FLOWCONTROL_XONXOFF_IN =4; SerialPort.java: public static final int FLOWCONTROL_XONXOFF_OUT=8; So if you set flowcontrol to RTSCTS, you can set it to NONE to turn it off. If you are looking for how to do it in native code, the rxtx Source is SerialImp.c (unix/linux/mac os x/w32) and termios.c (w32 only with SerialImp.c) You can track the code: SerialImp.c:JNIEXPORT void JNICALL RXTXPort(setflowcontrol)( JNIEnv *env, jobject jobj, jint flowmode ) termios.c:int tcgetattr( int fd, struct termios *s_termios ) termios.c:int tcsetattr( int fd, int when, struct termios *s_termios ) There may be a problem in the rxtx flow control code though. Rather than guess, I want to test this with a gold standard. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Feb 6 00:00:16 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 00:00:16 -0700 (MST) Subject: [Rxtx] wiki delay until tomorrow night. In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: On Sun, 5 Feb 2006, Trent Jarvi wrote: > On Sun, 5 Feb 2006, Kim Lux wrote: > >> usb ? Tell me more... I need that too. > > usb is a very proper design. Thats all it is. > Maybe rxtx could help usb. But it would start with helping bring back the community that was already there. It's not something I'd love to do but maybe its the right thing to do. It would probably take 2 years to do right. But maybe thats better than what we have now. I honestly don't know what IBM is doing which could just run over everything. Just some thoughts after some fine german wine. -- Trent Jarvi tjarvi at qbang.org From gadelavega at yahoo.com.ar Mon Feb 6 02:17:05 2006 From: gadelavega at yahoo.com.ar (Gonzalo A. de la Vega) Date: Mon, 06 Feb 2006 10:17:05 +0100 Subject: [Rxtx] Serial port ownership question In-Reply-To: References: <20060205113618.30274.qmail@web53501.mail.yahoo.com> <1139157422.4553.9.camel@zd7280> <1139158698.4936.9.camel@zd7280> Message-ID: <43E71411.4050402@yahoo.com.ar> On my Fedora Core 4: ls -l /dev/ttyS* crw-rw---- 1 root uucp 4, 64 Feb 6 2006 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Feb 6 2006 /dev/ttyS1 ... and: grep "ttyUSB" /etc/udev/rules.d/50-udev.rules KERNEL=="ttyUSB*", GROUP="uucp", MODE="0660" So anyone in the "uucp" group can use serial ports. On Gentoo the group is "tty". Trent Jarvi escribi?: > > > On Sun, 5 Feb 2006, Dr. Douglas Lyon wrote: > >> I can confirm that this is the case (only root ownership of >> serial ports, under fedora 4). >> Wow, what were they thinking?! >> - DL >> >>> I've found that the newer kernels have the serial ports owned by root. >>> For example, >>> >>> $ls -al /dev/tty* >>> crw-rw-rw- 1 root root 5, 0 Feb 5 02:06 /dev/tty >>> crw-rw---- 1 root root 4, 0 Feb 5 02:06 /dev/tty0 >>> crw------- 1 root root 4, 1 Feb 5 09:07 /dev/tty1 >>> crw-rw---- 1 root tty 4, 10 Feb 5 02:06 /dev/tty10 >>> crw-rw---- 1 root tty 4, 11 Feb 5 02:06 /dev/tty11 >>> ... > > > This is just not a problem jcp or such are going to solve. Its a > platform spitwad fight. But do look at pam. In fact thats what Sun > is doing too. Maybe Linux followed their lead.. I'm not a pam guy. > I've spent 16 hours trying to understand it but your users wont :) > > Solution? I have no clue. Its two tangent mentalities from my > perspective. > > -- > Trent Jarvi > tjarvi at qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mtnvega at yahoo.com.br Mon Feb 6 05:35:43 2006 From: mtnvega at yahoo.com.br (Luiz Jr) Date: Mon, 6 Feb 2006 12:35:43 +0000 (GMT) Subject: [Rxtx] Documentation Wiki In-Reply-To: <1139157422.4553.9.camel@zd7280> Message-ID: <20060206123543.57256.qmail@web53515.mail.yahoo.com> Hello, Thank you for you answer, but so the usage of the API is pretty much like the Java Communications Api? If yes, what version of the Java Comm Api? Thank you, Luiz A. Brandao Jr Kim Lux escreveu: On Sun, 2006-02-05 at 08:36 -0300, Luiz Jr wrote: > Hello, > > I want to start using the RXTX libraries, but I would to know how, > since I can not access the documentation wiki page I just started using them yesterday. Below is how I installed the libraries, if that helps. I used snippets of code from the SimpleWrite application here to get me going. http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html Instead of "import javax.comm.*;", use "import gnu.io.*;" which is gotten from RXTXcomm.jar, which you will need to include in your project references. I am working in Eclipse. BTW: there is no way to open a port without going through the port list and finding it. Maybe sometime in the future someone (me ?) will write a method called openSerialPort that allows the user to give a port identifier, such as "/dev/tty1" and return a port ready to use. It wouldn't take much to write that and it would save users a lot of code. Hope this helps. ======================================================================= 1) Figure out which java you are running, incase there is more than one installed. $ java -version java version "1.5.0_05" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_05-b05) Java HotSpot(TM) Client VM (build 1.5.0_05-b05, mixed mode, sharing) 2) Find all the jre directories and the one from which you are currently running. kfind (jre) 3) cd to that directory plus /lib/i386 cd /usr/java/jre1.5.0_05/lib/i386 4) Copy the library files (*.so) to that directory. cp /home/krlux/Desktop/'Java Controls'/rxtx-linux/bin/* . 5) Check that the copy was successful ls librxtx* librxtxI2C.so librxtxRaw.so librxtxSerial.so librxtxParallel.so librxtxRS485.so 6) cd to the /lib/ext directory for your java. cd /usr/java/jre1.5.0_05/lib/ext 7) Copy the Jar files there cp /home/krlux/Desktop/'Java Controls'/rxtx-linux/lib/ext/* . 8) Check that it was successful ls RXTX* RXTXcomm.jar Rxtx is now installed on your machine ready to use. =================================================================== -- Kim Lux, Diesel Research Inc. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx --------------------------------- Yahoo! Acesso Gr?tis - Internet r?pida e gr?tis. Instale o discador agora! -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/544aa403/attachment-0055.html From lyon at docjava.com Mon Feb 6 05:49:34 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 06 Feb 2006 07:49:34 -0500 Subject: [Rxtx] wiki delay until tomorrow night. In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: Hi All, I have often thought about USB drivers being needed. For example, the ironman watch will not interface to a mac (windows only). It is USB. My dymo label writer has no Java driver (native only). Etc. Most cheap web cameras are USB (and Java drivers go through JAI, if it supports the camera at all). The JAI code shows how sun did the USB drivers. You have to be a member of the jai project to download the source code. https://jai.dev.java.net has the jai distro. And then you are not allowed to redistribute it. However, we can all learn from it (if so inclined). Basically: cvs -d :pserver:lyon at cvs.dev.java.net:/cvs login cvs -d :pserver:lyon at cvs.dev.java.net:/cvs checkout jai-core You will need to user your own uid and pw to get in. The ant build has over 100 warnings from sun deprecations of its own code. You might say that they were hoisted on their own Picard ;) One interesting thing is that they support several platforms: linux-amd64 64-bit Linux-AMD64 linux-i586 32-bit Linux-x86 solaris-amd64 64-bit Solaris-AMD64 solaris-i586 32-bit Solaris-x86 solaris-sparc 32-bit Solaris-SPARC solaris-sparcv9 64-bit Solaris-SPARC windows-i586 32-bit Windows-x86 Thus, ant is used to provide a multi-platform native method distro. Neat. How do they do it? check this out: And: The core download does not contain any C source code (it was all pre-built). Basically, they are just copying .so and .dll files into build directories. I would love to see the C code for this...but Sun does not post it on the https://jai.dev.java.net site. I don't know why...Perhaps I missed it. - Doug >On Sun, 5 Feb 2006, Trent Jarvi wrote: > >>On Sun, 5 Feb 2006, Kim Lux wrote: >> >>>usb ? Tell me more... I need that too. >> >>usb is a very proper design. Thats all it is. >> > >Maybe rxtx could help usb. But it would start with helping bring >back the community that was already there. > >It's not something I'd love to do but maybe its the right thing to do. > >It would probably take 2 years to do right. But maybe thats better >than what we have now. > >I honestly don't know what IBM is doing which could just run over everything. > >Just some thoughts after some fine german wine. > >-- >Trent Jarvi >tjarvi at qbang.org > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tdelenik at gmail.com Mon Feb 6 05:56:32 2006 From: tdelenik at gmail.com (Thanasis Delenikas) Date: Mon, 6 Feb 2006 14:56:32 +0200 Subject: Fwd: [Rxtx] Documentation Wiki In-Reply-To: <1139157422.4553.9.camel@zd7280> References: <20060205113618.30274.qmail@web53501.mail.yahoo.com> <1139157422.4553.9.camel@zd7280> Message-ID: <310a1a930602060456t129f1dc6p5f2b908f13ab5a0b@mail.gmail.com> Hello all, Kim, this is a snippet from the code I use. The closest to directly opening a specific port without enumeration. << ... portId = CommPortIdentifier.getPortIdentifier(getPort()); serialPort = (SerialPort) portId.open("jSMSEngine", 1971); ... >> where getPort() return the string identifier of the port, i.e. "/dev/ttyS0" or "COM1" or whatever. Thanasis. ---------- Forwarded message ---------- From: Kim Lux Date: Feb 5, 2006 6:37 PM Subject: Re: [Rxtx] Documentation Wiki To: RXTX Developers and Users BTW: there is no way to open a port without going through the port list and finding it. Maybe sometime in the future someone (me ?) will write a method called openSerialPort that allows the user to give a port identifier, such as "/dev/tty1" and return a port ready to use. It wouldn't take much to write that and it would save users a lot of code. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/182ab5b8/attachment-0055.html From tjarvi at qbang.org Mon Feb 6 11:53:57 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 11:53:57 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: On Mon, 6 Feb 2006, Dr. Douglas Lyon wrote: > Hi All, > I have often thought about USB drivers being needed. > For example, the ironman watch will not interface > to a mac (windows only). It is USB. > My dymo label writer has no Java driver (native only). > Etc. > Most cheap web cameras are USB (and Java drivers go > through JAI, if it supports the camera at all). > The JAI code shows how sun did the USB drivers. > You have to be a member of the jai project to download > the source code. > https://jai.dev.java.net has the jai distro. > And then you are not allowed to redistribute it. However, > we can all learn from it (if so inclined). Basically: > cvs -d :pserver:lyon at cvs.dev.java.net:/cvs login > cvs -d :pserver:lyon at cvs.dev.java.net:/cvs checkout jai-core > You will need to user your own uid and pw to get in. > The ant build has over 100 warnings from sun deprecations > of its own code. > > You might say that they were hoisted on their own Picard ;) > > One interesting thing is that they support several platforms: > linux-amd64 64-bit Linux-AMD64 > linux-i586 32-bit Linux-x86 > solaris-amd64 64-bit Solaris-AMD64 > solaris-i586 32-bit Solaris-x86 > solaris-sparc 32-bit Solaris-SPARC > solaris-sparcv9 64-bit Solaris-SPARC > windows-i586 32-bit Windows-x86 > Thus, ant is used to provide a multi-platform native method distro. > Neat. > How do they do it? > check this out: > > > > > > > > > > > > > And: > > > > > > > > > > The core download does not contain any C source code (it was all pre-built). > Basically, they are just copying .so and .dll files into build directories. > > I would love to see the C code for this...but Sun does not post it on the > https://jai.dev.java.net site. > > I don't know why...Perhaps I missed it. > > - Doug > > I've looked at moving rxtx to Ant builds. I think that would help IDEs a great deal. I requested a evalutation desk copy the O'Reilly Ant book for some j2ee material I was teaching. http://www.oreilly.com/catalog/anttdg/ It has a one sentence mention of JNI. So there was not luck there. I saw that there is another Ant book that does mention JNI more. I can't find it now. Ant must be able to support it with extensions. http://ant.apache.org/manual/OptionalTasks/javah.html What the auto(break :) tools do in the rxtx build is 4 things really. 1) gcc compile flags 2) ld compile flags 3) config.h 4) compile flags for customizing rxtx (lockfiles, ...) See 1 All of this information except 4 can be static once obtained. So I'm not attached to the auto tools. If I could find an example of Ant being used for JNI code, I'd be one of the first to start moving that direction. Maybe someone saw an example someplace. The other thing we have not completed discussing is the directory structure. There is interest in making rxtx more IDE friendly. I get more mail about that off the list than how to install rxtx. And I see we have Ken Thompson in da house :) He is our trusted CVS maintainer and the guy that purchased the rxtx.org domain. Old community. We will need Ken for changing the directory structure of source. I would like to open up discussion about both of these as it is more than time. The problem is I have little experience with Ant and even less with IDEs. It would be nice if we could work with Eclipse and NetBeans. http://www.netbeans.org/ (sun and some community) http://www.eclipes.org (ibm,rhat,... perhaps more community) http://maven.apache.org/what-is-maven.html (apache. It is community) borland should sortof be here too but I think thats covered in eclipse. >From what I understand so far, we should morph rxtx to support those three maybe trusting apaches lead with maven. But I use vi. I have little to no clues beyond what people have fed me. Can we agree that thats the right direction to go? -- Trent Jarvi tjarvi at qbang.org From brian at mbari.org Mon Feb 6 14:57:50 2006 From: brian at mbari.org (Brian Schlining) Date: Mon, 6 Feb 2006 13:57:50 -0800 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> > The other thing we have not completed discussing is the directory > structure. There is interest in making rxtx more IDE friendly. I > get more mail about that off the list than how to install rxtx. > > And I see we have Ken Thompson in da house :) He is our trusted > CVS maintainer and the guy that purchased the rxtx.org domain. Old > community. We will need Ken for changing the directory structure of > source. > > I would like to open up discussion about both of these as it is > more than time. The problem is I have little experience with Ant > and even less with IDEs. It would be nice if we could work with > Eclipse and NetBeans. > > http://www.netbeans.org/ (sun and some community) > http://www.eclipes.org (ibm,rhat,... perhaps more community) > http://maven.apache.org/what-is-maven.html (apache. It is community) > borland should sortof be here too but I think thats covered in > eclipse. > >> From what I understand so far, we should morph rxtx to support >> those three > maybe trusting apaches lead with maven. But I use vi. I have > little to no clues beyond what people have fed me. > Maven likes the directory structure below for Java code. (From http:// maven.apache.org/guides/getting-started/index.html) This structure works fine with ant, netbeans, and eclipse. rxtx_root_directory `-- src |-- main | `-- java | `-- gnu | `-- io `-- test `-- java `-- gnu `-- io Brian Schlining Software Engineer http://www.mbari.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/d9451eba/attachment-0055.html From tjarvi at qbang.org Mon Feb 6 15:11:45 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 15:11:45 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: > rxtx_root_directory > `-- src > |-- main > | `-- java > | `-- gnu > | `-- io > `-- test > `-- java > `-- gnu > `-- io > >From what I understand this will just be good. For me it makes no difference. So lets do the rxtx thing. Let if fester for two weeks and if nobody objects, we will do it. I'm not doing this because I care. I'm doing this to eliminate much of my inbox. But test... man is rxtx lacking there in the community aspect. It is covered but not right. _maybe_ I can change that this year. -- Trent Jarvi tjarvi at qbang.org (cat hurding since 1997) From lux at diesel-research.com Mon Feb 6 21:38:49 2006 From: lux at diesel-research.com (Kim Lux) Date: Mon, 06 Feb 2006 21:38:49 -0700 Subject: [Rxtx] How can I use Lock Files with rxtx (in FC4) ? Message-ID: <1139287129.17031.3.camel@zd7280> I am now running an rxtx application on FC4. I am getting: ========================================================= check_group_uucp(): error testing lock file creation Error details: Permission denied check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL ========================================================= $ ls -al /var/lock total 32 drwxrwxr-x 4 root lock 4096 Feb 6 16:04 . drwxr-xr-x 24 root root 4096 Nov 14 01:19 .. drwx------ 2 root root 4096 Apr 27 2005 lvm drwxr-xr-x 2 root root 4096 Feb 6 16:04 subsys How do I fix this for regulator users ? -- Kim Lux, Diesel Research Inc. From dmarkman at mac.com Mon Feb 6 22:24:44 2006 From: dmarkman at mac.com (Dmitry Markman) Date: Tue, 7 Feb 2006 00:24:44 -0500 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: if I understands the issue right in order to be able to use ant for c/c++ compilation you have to install ant's cc task http://ant-contrib.sourceforge.net/cc.html it looks like it should work on mac os x (authors claim, that it's platform independent) but I never tested so all you have to do it's providing right command line for the gcc compiler On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: >> rxtx_root_directory >> `-- src >> |-- main >> | `-- java >> | `-- gnu >> | `-- io >> `-- test >> `-- java >> `-- gnu >> `-- io >> > > >> From what I understand this will just be good. > > For me it makes no difference. So lets do the rxtx thing. Let if > fester for two weeks and if nobody objects, we will do it. > > I'm not doing this because I care. I'm doing this to eliminate > much of my inbox. > > But test... man is rxtx lacking there in the community aspect. It > is covered but not right. _maybe_ I can change that this year. > > -- > Trent Jarvi > tjarvi at qbang.org > (cat hurding since 1997) > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx Dmitry Markman From lux at diesel-research.com Mon Feb 6 23:20:15 2006 From: lux at diesel-research.com (Kim Lux) Date: Mon, 06 Feb 2006 23:20:15 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? Message-ID: <1139293215.3689.4.camel@zd7280> I'm running the code below. portlist.hasMoreElements() is false. /dev has ports in it as listed below. What am I doing wrong ? ========================================================== // Step through the list of ports until we find one that matches // the one we are looking for. portList = CommPortIdentifier.getPortIdentifiers(); while(portList.hasMoreElements()) { portID = (CommPortIdentifier) portList.nextElement(); // if (portID.getName().equals("/dev/ttyUSB0")) { myTA.append("Serial port ttyUSB0 has been found\n"); break; }// if portID equals... }// End of while... ========================================================== ls -al /dev/tty* crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 ... crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 -- Kim Lux, Diesel Research Inc. From david.garnier at trusted-logic.com Tue Feb 7 00:46:30 2006 From: david.garnier at trusted-logic.com (David Garnier) Date: Tue, 07 Feb 2006 08:46:30 +0100 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: <43E85056.2090608@trusted-logic.com> Hello, I think that the make-based build process is fine as it is, apart from the location of the Java source files. It is true that putting the Java source in a directory structure that map 1-to-1 to the Java package structure is the norm and should make it easier for everyone to modify the Java source, with or without an IDE. Ant is a good tool, but in the RXTX case I fail to see the advantage of using it compared to the current make-based process. As Trent said, they are more pressing issues, like testing. Regards, David Dmitry Markman wrote: > if I understands the issue right > in order to be able to use ant for c/c++ compilation > you have to install ant's cc task > http://ant-contrib.sourceforge.net/cc.html > > it looks like it should work on mac os x > (authors claim, that it's platform independent) > but I never tested > > so all you have to do it's providing right command line > for the gcc compiler > > > > > On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: > >>> rxtx_root_directory >>> `-- src >>> |-- main >>> | `-- java >>> | `-- gnu >>> | `-- io >>> `-- test >>> `-- java >>> `-- gnu >>> `-- io >>> >> >> >>> From what I understand this will just be good. >> >> For me it makes no difference. So lets do the rxtx thing. Let if >> fester for two weeks and if nobody objects, we will do it. >> >> I'm not doing this because I care. I'm doing this to eliminate much >> of my inbox. >> >> But test... man is rxtx lacking there in the community aspect. It is >> covered but not right. _maybe_ I can change that this year. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> (cat hurding since 1997) From tjarvi at qbang.org Tue Feb 7 01:11:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 01:11:31 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <43E85056.2090608@trusted-logic.com> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: On Tue, 7 Feb 2006, David Garnier wrote: > Hello, > > I think that the make-based build process is fine as it is, apart from the location of the Java > source files. It is true that putting the Java source in a directory structure that map 1-to-1 to > the Java package structure is the norm and should make it easier for everyone to modify the Java > source, with or without an IDE. > > Ant is a good tool, but in the RXTX case I fail to see the advantage of using it compared to the > current make-based process. As Trent said, they are more pressing issues, like testing. > Hi David I have more experience with testing rxtx than I can talk about. But let it be known, rxtx has gone trough 100's of hours of testing. We are hobby folks interested in toys but there is more. rxtx has had some of the best guidance in the industry there. This is not an easy thing. I may be able to come back in a month from the other side of the corperate fence and help. I suspect the tests could just be made public but they are in a very unusual environment that just wont work in a wider sense. This is something I'll be trying to change. At one point it was agreed we could just make the results public so this isnt just noise.. There is interest and I think its safe to mention that much. The big problem with testing in the past is most of it is done with a loopback connection. So we *still* have major questions regarding things like flow control. rxtx talks to itself over a loopback and it works. regardless of right or wrong. This requires more thought to be done right. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Feb 7 02:46:34 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 02:46:34 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: > The big problem with testing in the past is most of it is done with a > loopback connection. So we *still* have major questions regarding things > like flow control. rxtx talks to itself over a loopback and it works. > regardless of right or wrong. With serial communication there are gold standards. ckermit is probably a definitive 'standard.' Maybe its possible to do ping/pong tests with ckermit? Is it scriptable? There are known issues in rxtx. Probably the worst is some threading issues regarding some JREs with multiple JNI threads setting java variables. Man did I get schooled there. Just switch the c functions to returning variables and things go away. Sometimes they work fine, sometimes they blow up. Without understanding everything, somehow rhat got it right and debian (and especially gentoo) grabbed kernel patches causing all sort of harm. Its not hard to fix once you understand whats going on but nearly impossible to track with a debugger. So I have a good idea what 2.1-8 will have outside of the IDE modifications. rxtx 2.1-7 is a release for everyone to sync with. Its not even as stable as -pre17 as far as I know - I ran no test suites. I'll be chasing it too. We just had so many contributions that it was time. It seriously broke internal scheduals but thats a great thing :) The other thing I want to do in 2.1-8 is automagic baud rates. It turns out lots of shops are doing really funky baud rates for things like automobile test equipment. It is possible but it requires a fair amount of change in the native code. Is anyone looking at this? -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Feb 7 02:57:21 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 07 Feb 2006 04:57:21 -0500 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <43E85056.2090608@trusted-logic.com> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: Hi All, I agree, testing is very important. The problem I have been trying to address is related to cross-platform testing and the robust nature of the installs. Typically, I visit 3 platforms to deploy my product, windows, linux and mac. A build is performed on each platform. The idea that you can build for many platforms from one copy the source code seems attractive. This should enable synchronized deployments of identical code. The question of how to achieve this goal remains open. As Trent mentioned, this is hard. Perhaps Ant will help here (but perhaps not). Ant does seem to help with running unit tests. However, it does not help with multi-platform tests. For that you need many machines and different operating environments. Toward that end, I have created a multi-platform test that can be run from web start, located at: http://show.docjava.com:8086/book/cgij/code/jnlp/serialPort.PortTest.jnlp This is interesting because many people in the community can run the test and we can improve the test, as time permits. No, it is not a perfect solution, however, the idea does help with multi-platform tests using many machines and different operating environments. If the group has a good test for a general serial port set-ups, i would be happy to deploy it, for general evaluation using web start. And as for ANT, it is just an idea. Not all my ideas are good ones! - Doug >Hello, > >I think that the make-based build process is fine as it is, apart >from the location of the Java >source files. It is true that putting the Java source in a directory >structure that map 1-to-1 to >the Java package structure is the norm and should make it easier for >everyone to modify the Java >source, with or without an IDE. > >Ant is a good tool, but in the RXTX case I fail to see the advantage >of using it compared to the >current make-based process. As Trent said, they are more pressing >issues, like testing. > >Regards, >David > >Dmitry Markman wrote: >> if I understands the issue right >> in order to be able to use ant for c/c++ compilation >> you have to install ant's cc task >> http://ant-contrib.sourceforge.net/cc.html >> >> it looks like it should work on mac os x >> (authors claim, that it's platform independent) >> but I never tested >> >> so all you have to do it's providing right command line >> for the gcc compiler >> >> >> >> >> On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: >> >>>> rxtx_root_directory >>>> `-- src >>>> |-- main >>>> | `-- java >>>> | `-- gnu >>>> | `-- io >>>> `-- test >>>> `-- java >>>> `-- gnu >>>> `-- io >>>> >>> >>> >>>> From what I understand this will just be good. >>> >>> For me it makes no difference. So lets do the rxtx thing. Let if >>> fester for two weeks and if nobody objects, we will do it. >>> >>> I'm not doing this because I care. I'm doing this to eliminate much >>> of my inbox. >>> >>> But test... man is rxtx lacking there in the community aspect. It is >>> covered but not right. _maybe_ I can change that this year. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> (cat hurding since 1997) > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From matt.higgins at gmail.com Tue Feb 7 08:28:34 2006 From: matt.higgins at gmail.com (Matt Higgins) Date: Tue, 7 Feb 2006 10:28:34 -0500 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final Message-ID: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? import java.io.*; import java.util.*; import gnu.io.*; public class MySimpleRead implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; public static void main(String[] args) { boolean portFound = false; String defaultPort = "COM1"; if (args.length > 0) { defaultPort = args[0]; } portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; MySimpleRead reader = new MySimpleRead(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } } public MySimpleRead() { try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) { e.printStackTrace(); } try { inputStream = serialPort.getInputStream(); } catch (IOException e) { e.printStackTrace(); } try { serialPort.addEventListener(this); } catch (TooManyListenersException e) { e.printStackTrace(); } try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { e.printStackTrace(); } System.out.println("Baud is " + serialPort.getBaudRate()); System.out.println("Bits is " + serialPort.getDataBits()); System.out.println("Stop is " + serialPort.getStopBits()); System.out.println("Par is " + serialPort.getParity()); serialPort.notifyOnDataAvailable(true); readThread = new Thread(this); readThread.start(); } public void run() { // Thread.sleep(20000); //} catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { System.out.println("An event occurred " + event.getEventType()); switch (event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: byte[] readBuffer = new byte[20]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } System.out.print(new String(readBuffer)); } catch (IOException e) {} break; } } } --------------- Result on windows ------------------------------ Stable Library ============================================================== Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port:: COM1 Baud is 9600 Bits is 8 Stop is 1 Par is 0 ----------------- End Results ----------------------------------------- ------------------ Result on Linux ----------------------------------- Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 Found port: /dev/ttyS0 Baud is 9600 Bits is 8 Stop is 1 Par is 0 An event occurred 1 043100066224 ------------------ End Results --------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/a1431630/attachment-0055.html From brian at mbari.org Tue Feb 7 09:48:37 2006 From: brian at mbari.org (Brian Schlining) Date: Tue, 7 Feb 2006 08:48:37 -0800 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> Message-ID: <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> Hi Matt > The following code works fine on Linux but I never see any data > when run on Windows. This is a cut and paste from the SimpleRead > example. > I am attempting to read data from a bar code scanner. I can fire > up HyperTermianl on windows and see that the device is working > properly as I see the barcodes are scanned and echoed back to the > terminal. However when I run the app I don't see any data. It is > however associating with the com port as the informational bits > print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. Cheers Brian Schlining Software Engineer http://www.mbari.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/16d07f37/attachment-0055.html From lux at diesel-research.com Tue Feb 7 11:59:58 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 11:59:58 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139293215.3689.4.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> Message-ID: <1139338798.8145.4.camel@zd7280> Any ideas on this ? Any reason why portList.hasMoreElements() should be false even though there are devices in /dev ? On Mon, 2006-02-06 at 23:20 -0700, Kim Lux wrote: > I'm running the code below. > > portlist.hasMoreElements() is false. > > /dev has ports in it as listed below. > > What am I doing wrong ? > > > ========================================================== > // Step through the list of ports until we find one that matches > // the one we are looking for. > > portList = CommPortIdentifier.getPortIdentifiers(); > > while(portList.hasMoreElements()) > { > portID = (CommPortIdentifier) portList.nextElement(); // > if (portID.getName().equals("/dev/ttyUSB0")) > { > myTA.append("Serial port ttyUSB0 has been found\n"); > break; > }// if portID equals... > }// End of while... > ========================================================== > > ls -al /dev/tty* > crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty > crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 > crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 > crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 > crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 > ... > crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 > crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 > crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 > > > -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 12:20:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 12:20:25 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139338798.8145.4.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> Message-ID: On Tue, 7 Feb 2006, Kim Lux wrote: > > Any ideas on this ? Any reason why portList.hasMoreElements() should be > false even though there are devices in /dev ? > > > On Mon, 2006-02-06 at 23:20 -0700, Kim Lux wrote: >> I'm running the code below. >> >> portlist.hasMoreElements() is false. >> >> /dev has ports in it as listed below. >> >> What am I doing wrong ? >> >> >> ========================================================== >> // Step through the list of ports until we find one that matches >> // the one we are looking for. >> >> portList = CommPortIdentifier.getPortIdentifiers(); >> >> while(portList.hasMoreElements()) >> { >> portID = (CommPortIdentifier) portList.nextElement(); // >> if (portID.getName().equals("/dev/ttyUSB0")) >> { >> myTA.append("Serial port ttyUSB0 has been found\n"); >> break; >> }// if portID equals... >> }// End of while... >> ========================================================== >> >> ls -al /dev/tty* >> crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty >> crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 >> crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 >> crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 >> crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 >> ... >> crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 >> crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 >> crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 >> >> >> > Hi Kim What rxtx does is try to open the port and do a timed out read. If the kernel/... do not complain it's enumarted. I suspect you could do a crude test by doing something like cat /dev/ttyS0 > /dev/null If that barfs then rxtx wont enumerate the port. hmm looking at your question again, I suspect it's a lockfile problem. This is documented in INSTALL with the source. Its easy enough to test this too.. touch /var/lock/testingrxtxlockfiles && rm -f /var/lock/testingrxtxlockfiles If you are not in the right group it will bail. Root will work regardless. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 12:37:56 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 12:37:56 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> Message-ID: <1139341076.8145.11.camel@zd7280> Exactly which ports does rxtx attempt to put into the list ? /dev/* or /dev/tty* or /dev/tty[0-9[0-9] ? or /dev/ttyS* ? For the record, only /dev/ttyUSB0 is a valid port on the machine I am presently on. Will this be a problem ? On Tue, 2006-02-07 at 12:20 -0700, Trent Jarvi wrote: > This is documented in INSTALL with the source. > I was wondering where that file was. I will download source and dig it up. Thanks. -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 12:51:09 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 12:51:09 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139341076.8145.11.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: On Tue, 7 Feb 2006, Kim Lux wrote: > > Exactly which ports does rxtx attempt to put into the list ? /dev/* > or /dev/tty* or /dev/tty[0-9[0-9] ? or /dev/ttyS* ? > > For the record, only /dev/ttyUSB0 is a valid port on the machine I am > presently on. Will this be a problem ? > > > On Tue, 2006-02-07 at 12:20 -0700, Trent Jarvi wrote: >> This is documented in INSTALL with the source. >> > I was wondering where that file was. I will download source and dig it > up. > > Thanks. > Hmm I'm looking at pre17 so this may have changed. (its just what I have on this machine) if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA" // for the IPAQs }; CandidatePortPrefixes=Temp; } So you may need to add "ttyUSB" to that list. RXTX used to enumerate _everything_ see if(osName.equals("Linux-all-ports") But it became less than practical. This is all in RXTXCommDriver.java hmm I just did a cvs update. if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have to get your fingers into the code. We aim for sane defaults. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 13:06:45 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 13:06:45 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139342805.8145.22.camel@zd7280> On Tue, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > Hmm I'm looking at pre17 so this may have changed. (its just what I have > on this machine) > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA" // for the IPAQs > }; > CandidatePortPrefixes=Temp; > } > > > So you may need to add "ttyUSB" to that list. RXTX used to enumerate > _everything_ see if(osName.equals("Linux-all-ports") But it became less > than practical. > > This is all in RXTXCommDriver.java > > hmm I just did a cvs update. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have > to get your fingers into the code. We aim for sane defaults. Excellent. Thanks for taking the time. -- Kim Lux, Diesel Research Inc. From ideiglenes1 at freemail.hu Tue Feb 7 13:53:39 2006 From: ideiglenes1 at freemail.hu (--) Date: Tue, 07 Feb 2006 21:53:39 +0100 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139345619.22534.2.camel@localhost> Hi! I use this code to get all the extra Linux devices. :) if ("Linux".equals(System.getProperty("os.name"))) { System.setProperty("os.name","Linux-all-ports"); } driver = new RXTXCommDriver(); On k, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > On Tue, 7 Feb 2006, Kim Lux wrote: > > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have > to get your fingers into the code. We aim for sane defaults. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From matt.higgins at gmail.com Tue Feb 7 13:45:54 2006 From: matt.higgins at gmail.com (Matt Higgins) Date: Tue, 7 Feb 2006 15:45:54 -0500 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> Message-ID: <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> Sweet this is exactly what I needed. I was searching the archives through marc.theamisgroup they only have archives back to 1/3/05. Should have hit the mailman archive! Thanks a lot! On 2/7/06, Brian Schlining wrote: > > Hi Matt > > The following code works fine on Linux but I never see any data when run > on Windows. This is a cut and paste from the SimpleRead example. > I am attempting to read data from a bar code scanner. I can fire up > HyperTermianl on windows and see that the device is working properly as I > see the barcodes are scanned and echoed back to the terminal. However when I > run the app I don't see any data. It is however associating with the com > port as the informational bits print fine? > > > You're not the only one whose had this problem, I don't know if Trent has > addressed this is the latest release of RXTX but there is a workaround. > Here's the recent thread from the RXTX mailing list regarding this issues: > > Thanasis Delenikas tdelenik at gmail.com > Wed Jan 18 13:56:23 MST 2006 > > * Previous message: [Rxtx] Re: More close() performance fixes > * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] > > Hi all. > (I've subscribed again from my other email account). > > Trent, > > You are right. Linux *always* works, no matter what flow control you set. > Windows *works only* with hardware flow control (I haven't tested what > happens with software XON/XOFF flow control). > > I assume (but I am not certain) that even with no flow control at all, all > platforms should work. Without flow control, you have the risk of bumping > into overflow or framing errors, but that's your (the end programmer, I > mean) problem. > > >From my side, I shouldn't be working without flow control. That was a bug > too... It was some code forgotten from the old times, when I used to work > with phone emulation drivers which didn't support flow control. The > correct > way is to have some flow control enabled and that's why I suppose this is > a > low-severity bug for RxTx. > > I have no idea which platform shows the correct behaviour, since > my knowledge about Linux and the inner workings of these low-level i/o > operations is limited. > > Regards, > Thanasis Delenikas. > > > > > Message: 2 > > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > > From: Trent Jarvi > > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > > To: RXTX Developers and Users > > Message-ID: > > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > > > Hi all, > > > > > > Trent, I have found something. > > > I read your comment about flow control, so I experimented a bit. > > > > > > If you remember, in my sample program I've used no flow control at all > ( > > i.e. > > > Java constant FLOWCONTROL_NONE). > > > > > > Now, during testing, I've switch to hardware inbound flow control (i.e > . > > Java > > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > > beautifully! > > > > > > I think I will switch to H/W flow control and test things for a while, > > but > > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > > > > > Hi Thanasis, > > > > I'm fairly sure you have identified a bug. I would not worry too much > > about what Sun CommAPI w32 defaults are. I think they did more or less > > whatever the port opened with. Just a guess. Linux tries to stomp on > > ports so they are all the same. > > > > So this started out with Linux worked, Windows XP/.. did not as I > recall. > > Something is wrong in rxtx. Do I understand this right? > > > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > > > Perhaps there is something Wayne or I did not understand when we wrote > > that code. I wasnt programming back in the BBS days so modems are not > my > > thing. I have a few questions. > > > > Is the above matrix confirmed by observation? > > Linux just always worked? > > Which one _should_ work? I'm guessing modems work with hardware flow > > control. I'll have to dig around. > > > > The windows flow control changes a couple things with hardware flow > > control. Following the w32 API documentation is confusing sometimes. > > But it looks like Linux could have a bug too. > > Cheers > > Brian Schlining > Software Engineer > http://www.mbari.org > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/9c989144/attachment-0055.html From tjarvi at qbang.org Tue Feb 7 14:06:14 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 14:06:14 -0700 (MST) Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> Message-ID: >> >> You're not the only one whose had this problem, I don't know if Trent has >> addressed this is the latest release of RXTX but there is a workaround. >> Here's the recent thread from the RXTX mailing list regarding this issues: >> I have not. I expect to have access to some test equipment next month and I'll go through all of this. I really don't know whats going on and I need a gold standard. I thought maybe linux was autodetecting the flow control. Your observations would certainly be welcome. I need to talk to Russell King and see what he is doing. Until then I'd just be toying around over a loopback as usual. This is very high on the list though. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 17:25:05 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 17:25:05 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139358305.17994.2.camel@zd7280> My application now works. I installed the libraries and jar from 2.1-7 (Final). portlist.hasMoreElements is no longer false. The application finds the port for /dev/ttyUSB0. Thanks for your help, Trent (et al) Sorry I bothered you with this. Next time I will look in the source first. I didn't think it was an rxtx issue, I thought it was a Linux setup issue . On Tue, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > Hmm I'm looking at pre17 so this may have changed. (its just what I > have > on this machine) > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux > Serial Ports > "ttySA" // for the > IPAQs > }; > > CandidatePortPrefixes=Temp; > } > > > So you may need to add "ttyUSB" to that list. RXTX used to enumerate > _everything_ see if(osName.equals("Linux-all-ports") But it became > less > than practical. > > This is all in RXTXCommDriver.java > > hmm I just did a cvs update. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux > Serial Ports > "ttySA", // for the > IPAQs > "ttyUSB" // for USB > frobs > }; > > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you > have > to get your fingers into the code. We aim for sane defaults. -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 19:21:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 19:21:54 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139358305.17994.2.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> <1139358305.17994.2.camel@zd7280> Message-ID: >Sorry I bothered you with this. Next time I will look in the source >first. I didn't think it was an rxtx issue, I thought it was a Linux >setup issue . Why would you be sorry? I would have done the same. I'm glad it's working :) -- Trent Jarvi tjarvi at qbang.org From tma at mail.island.net Wed Feb 8 13:39:35 2006 From: tma at mail.island.net (Tom Alldread) Date: Wed, 08 Feb 2006 12:39:35 -0800 Subject: [Rxtx] Win32/Linux Serial Port Data Dropouts In-Reply-To: <200602060702.k167255O007882@www.qbang.org> References: <200602060702.k167255O007882@www.qbang.org> Message-ID: <43EA5707.4020200@mail.island.net> Greetings Folks at RXTX: During the last couple of months I have been alternately testing with javax.comm 2 and RXTX 2.1 under Windows XP and CommApi 3 and RXTX 2.1 under Suse 10.0 Linux. In the process I have learned a little about java multi-threading under NetBeans 5 with Profiler. My java (jdk 1.5_06) application is used for data acquisition and provides a graphical display of A-D conversion data received from a 56KBaud serial port. The actual data throughput is about 10KBaud thus it is well below the speed of the port. I use hardware RTS/CTS flow control which can stall the data acquisition sample rate if necessary. This ensures the display computer has the ability to slow the data acquisition rate should it become too busy to accept the regular data flow. Both the serial port buffer and the java read buffer are set at 16KB. Usually the data transfers into the java read buffer are less than 100 bytes unless the data acquisition is recovering from a stall. The data flow normally hesitates after each 5 KB block as a continue command is needed from the display computer to start the drawing of a new graphics display line. Separate threads have been provided for the serial port event monitoring and data processing. The serial port event thread has been given the maximum priority and data processing thread the minimum priority provided by java. Thread yield statements have been placed within all data processing while/for loops as an effort to ensure quick access to CPU cycles for the serial port event thread. I have found that short data transmissions are essentially error free but occasional dropouts occur with continuous data flow especially under Windows XP. ....................................................................................................................................................................................... Linux results: I am happy to report that RXTX 2.1 appears to work very well under Linux although I did notice some errors when the screen savers were running with my dual monitors. I believe this is a local problem associated with my dual graphics which needs further attention. The recent CommApi 3 Linux release from Sun did not work at all with my program. It seemed to send commands out OK but did not receive any data. Although the serial port event triggered the ISR, the input stream appeared filled with nulls and thus did not contain any data. As my understanding is that CommApi 3 was tested with a Red Hat distribution of Linux I wonder if this problem is distro dependent? Although somewhat off topic here I wonder if anyone reading this has had similar experience? .................................................................................................................................................................................. Windows XP results: There are problems with occasional data dropouts which become more frequent as the sampling rate is increased or if the computer becomes busy with other duties. The dropouts typically consist of a half dozen byte block of lost data. It appears the lost bytes never get added to the java input stream. There has not been any indication of garbled data, overruns or framing errors which suggests the UART communications remains solid. Using javax.comm 2 I found that the setting of SerialPort 'enableReceiveThreshold' to 40 and 'enableReceiveTimeout' of 100mS reduced the dropouts error rate significantly. I found that I could not get RXTX 2.1 to function with the aforementioned threshold and timeout settings. The javax.comm 2 interface is consequently performing better for me under Windows than RXTX 2.1. I wonder if anyone here has any suggestions as to what I might try to improve RXTX 2.1? Although my settings are the same as under Suse 10.0, RXTX 2.1 performs much better for me under Linux than any of the alternatives that I have tried under Windows XP . ............................................................................................................................................................................... I would like to establish, based on the experience of others, if I have reached the normally expected performance limit of java serial port communications? Should I expect to achieve virtually error free serial port data input from a continuous stream under Windows XP java software? I am considering changing my protocol to packets with error checking if necessary but would like to know if the dropout problems I am experiencing are typical or not before I take this rather work intensive plunge. Many thanks in advance for any help! Best Regards, Tom Alldread -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.375 / Virus Database: 267.15.2/253 - Release Date: 2006-02-07 From jlaxson at mac.com Wed Feb 8 23:56:48 2006 From: jlaxson at mac.com (John Laxson) Date: Thu, 9 Feb 2006 00:56:48 -0600 Subject: [Rxtx] PortInUseException: Unknown Application on OSX Message-ID: Hi, I've been trying to get RXTX 2.1.7 going on Mac OS X for a while here, and am running up into a wall here. I've tried with pre- compiled and the source version and get the same problem, a gnu.io.PortInUseException: Unknown Application. I have run the fixperms script included with the source distribution, and id shows me as a member of the uucp group, and permissions on /var/spool/uucp are 775 root:uucp. Running a test program (included at the bottom for clarity) lets me enumerate all the serial ports correctly, but trying to open any of them gives the PortInUseException. If it helps, when I try to open a port that's set to make an outgoing bluetooth connection, there is no delay and no connection attempt at all. Thanks, John Laxson PS: The documentation wiki on qbang.org shows 404, and has for a few days now. My test code: public static void main(String[] args) { SerialPort serialPort; try { Enumeration e = CommPortIdentifier.getPortIdentifiers(); CommPortIdentifier ident; while (e.hasMoreElements()) { ident = (CommPortIdentifier)e.nextElement(); System.out.println(ident.getName()); } ident = CommPortIdentifier.getPortIdentifier("/dev/cu.modem"); serialPort = (SerialPort) ident.open("Me", 5000); } catch (Exception e) { e.printStackTrace(); } } From rajesh.invincible at gmail.com Thu Feb 9 03:39:38 2006 From: rajesh.invincible at gmail.com (Rajesh N) Date: Thu, 9 Feb 2006 16:09:38 +0530 Subject: [Rxtx] Re: Move .java Files in gnu.io filesystem hierarchy - Maven (2) In-Reply-To: <43DF21D2.7090200@ngi.it> References: <43DF21D2.7090200@ngi.it> Message-ID: <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Can anybody tell me how to overcome these EXCEPTIONS I AM WORKING ON SERIAL COMMN IN JAVA ON LINUX. 1. " NOT ALL PARAMETERS SUPPORTED BY THE KERNEL" This i came across the following statement inmy prog. SerialP is A SerialPort object SerialP.setSerialPortParams(9600(BAUDRATE),DATABITS_8,STOPBITS_1,PARITY_NONE) 2. NullPointer Exception at Event Dispatch Now i have checked all my object references for a null reference but i found none i have put up my entire code in try catch blocks but still I AM UNABLE TO CATCH THIS EXCEPTION AND HENCE MY APPLICATION CLOSES HOW DOES THESE GO? PLEASE HELP ME IT IS URGENTTTTTTTTTTTTTTTT yours sincerely RAJESH On 1/31/06, Fabio Frumento wrote: > Hi Xavier, > > I don't know maven at all but the directory hierarchy listed buy Trent > is fine for me... > > I'll take a look to maven, it seems an interesting project > > Regards > > Fabio Frumento > > Trent Jarvi wrote: > > On Tue, 31 Jan 2006, Xavier Frisaye wrote: > > > >> Hi all, > >> > >> If you are going to rearrange the src folder, i will propose to use > >> maven 2 and follow its directory structure > >> > (http://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html). > >> > >> Maven 2 simplify java project and give a standard way to make projects > >> (http://maven.apache.org/). > >> We are using it for internal projects and we are very satisfied. > >> > >> Is anybody interested? > >> > >> I'm not an expert in maven 2 (yet) but i'm agree to help using it if > >> you choose to make so. > >> > > > > so this would be: > > > > rxtx-devel/src/main/java/gnu.io > > rxtx-devel/src/test/java/ManIwish.java > > > > I don't use IDEs very much so I'll let others comment. But I don't see > > a problem with that. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Thu Feb 9 09:50:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 9 Feb 2006 09:50:31 -0700 (MST) Subject: [Rxtx] Re: Move .java Files in gnu.io filesystem hierarchy - Maven (2) In-Reply-To: <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Message-ID: On Thu, 9 Feb 2006, Rajesh N wrote: > Can anybody tell me how to overcome these EXCEPTIONS > I AM WORKING ON SERIAL COMMN IN JAVA ON LINUX. > > 1. " NOT ALL PARAMETERS SUPPORTED BY THE KERNEL" > > This i came across the following statement inmy prog. > SerialP is A SerialPort object > SerialP.setSerialPortParams(9600(BAUDRATE),DATABITS_8,STOPBITS_1,PARITY_NONE) > Strange. The parameters you use are the same the port should open with by default. Could you paste the actual exception you are getting? I don't see that in the rxtx source. Also it would help to know the rxtx version. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Fri Feb 10 15:29:05 2006 From: lux at diesel-research.com (Kim Lux) Date: Fri, 10 Feb 2006 15:29:05 -0700 Subject: [Rxtx] One serial port object for both sending and receiving ? Message-ID: <1139610545.18177.4.camel@zd7280> Is it OK to use one SerialPort ojbect (ex Serial Port serialPort;) and use it for both sending and receiving ? For example: ======================================================================== static SerialPort serialPort = null; static OutputStream serialOut = null; static InputStream serialIn = null; // assign it to an outputStream for use try{ serialOut = serialPort.getOutputStream(); System.out.println("Serial output stream has been assigned."); }//try catch(IOException e) { System.out.println("Error: Couldn't assign output stream to serial port."); }//catch //assign it to an inputStream for use try{ serialIn = serialPort.getInputStream(); System.out.println("Serial input stream has been assigned."); }//try catch(IOException e) { System.out.println("Error: Couldn't assign input stream to serial port."); }//catch ======================================================================== -- Kim Lux, Diesel Research Inc. From lux at diesel-research.com Fri Feb 10 21:23:00 2006 From: lux at diesel-research.com (Kim Lux) Date: Fri, 10 Feb 2006 21:23:00 -0700 Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Message-ID: <1139631780.23882.10.camel@zd7280> I've got a problem receiving chars with my version of serialRead, written in an SWT GUI. I had a Java pro have a good look at my code and he can't see anything wrong with it. I can send chars fine. When I receive a char the cpu usage for the app goes to 100% and the code in the serial event handler doesn't get executed. The instructions on the Java Comm Serial API How-To for Linux page state that I must install javacomm. Is that true ? Everything builds without it and I can send chars on rxtx just fine, but I can't receive them. Could this be the problem ? I downloaded and installed javacomm. I was not able to add "Driver=gnuio.RXTXCommDriver to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 installed in /usr/java/jre1.5.0_05. I added comm.jar to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext to the library paths. Is this OK ? Does it matter that I am receiving on /dev/ttyUSB0 ? Thanks. -- Kim Lux, Diesel Research Inc. From lunareclipse03 at web.de Sat Feb 11 09:44:46 2006 From: lunareclipse03 at web.de (lunareclipse03@web.de) Date: Sat, 11 Feb 2006 17:44:46 +0100 Subject: [Rxtx] Question about Serial I/O under Win32 Message-ID: <662084330@web.de> Hello everybody, I have a strange problem with a piece of code I made for myself. No, this is not really concerning rxtx, but nevertheless I post this to the list, hoping that some of you can help me. I've written two libraries, one for linux and one for win32. The linux port works quite well, I can send / receive faxes and / or replay voice messages over the telephone line using a voice modem. But the win32 port of the library causes some trouble. If, for example, I send out a fax with a certain modem under linux, it works well. The fax is complete when it comes out of the fax machine. If I then use the same modem to send out a fax under win32, the fax coming out of the fax machine gets "stuck" halfways, but the sending modem thinks that transmission was ok and drops the connection. The answering fax machine then gives me "error while receiving." The "upper layer" java code MUST be right, because if I do the same thing under linux (using the linux library), everything is alright. Now I have to ask: Can somebody please help me out with this??!? Could it be the case that some kind of flow control or COMMTIMEOUTS setting causes this behaviour? I set flow control to RTS/CTS before sending out a fax. How can I DISABLE flow control? Or what do you think? Can something else cause this problems? Thank you all for your time and PLEASE write back soon. Regards, --Sven Ahlemann Am Waldrand 31 45721 Haltern am See Germany ______________________________________________________________ Verschicken Sie romantische, coole und witzige Bilder per SMS! Jetzt bei WEB.DE FreeMail: http://f.web.de/?mc=021193 From lux at diesel-research.com Sat Feb 11 10:06:52 2006 From: lux at diesel-research.com (Kim Lux) Date: Sat, 11 Feb 2006 10:06:52 -0700 Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: <1139631780.23882.10.camel@zd7280> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> <1139631780.23882.10.camel@zd7280> Message-ID: <1139677612.3431.5.camel@zd7280> More on this problem. I copied and pasted simpleRead into a console based Eclipse project and I've got the same result, except that cpu usage doesn't go to 100%. I'm beginning to think there is an issue in rxtx. My imports for simpleRead are: ============================ import gnu.io.*; import java.util.*; //import javax.comm.*; import java.io.*; =========================== Any ideas ? I am trying to read from /dev/ttyUSB0 using a serial to USB adapter which has worked well with minicom and gtkterm. Thanks. On Fri, 2006-02-10 at 21:23 -0700, Kim Lux wrote: > I've got a problem receiving chars with my version of serialRead, > written in an SWT GUI. > > I had a Java pro have a good look at my code and he can't see anything > wrong with it. > > I can send chars fine. When I receive a char the cpu usage for the app > goes to 100% and the code in the serial event handler doesn't get > executed. > > The instructions on the Java Comm Serial API How-To for Linux page state > that I must install javacomm. Is that true ? Everything builds without > it and I can send chars on rxtx just fine, but I can't receive them. > Could this be the problem ? > > I downloaded and installed javacomm. I was not able to add > "Driver=gnuio.RXTXCommDriver > to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not > have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 > installed in /usr/java/jre1.5.0_05. I added comm.jar > to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext > to the library paths. Is this OK ? > > Does it matter that I am receiving on /dev/ttyUSB0 ? > > Thanks. > -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Sun Feb 12 21:01:33 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:01:33 -0700 (MST) Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: <1139677612.3431.5.camel@zd7280> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> <1139631780.23882.10.camel@zd7280> <1139677612.3431.5.camel@zd7280> Message-ID: I suspect what is happening is the select() is breaking out in the native code but the driver does not have support for notifying there are X bytes available. On some traditional Unix based systems, the only way you know data is available is the fd status changes and do an FIORDCHK ioctl. Or perhaps the only thing you can know is the fd status changed. It would take reading through the kernel driver code to know for sure. So on USB, depending upon the driver, the same may need to be done or the driver improved a bit if possible to support. Polling reads will also work but don't use the event driven model of CommAPI which isnt acceptable in the long run. The 100% cpu usage can then be explained because select no longer blocks until the data is read; the eventLoop spins loose. You can put a well placed sleep but rxtx only expects those are needed when it knows data is available. This may not be a super simple thing to understand and fix. I do have ideas to get you started. I'm going to be short on time the next couple weeks. I expect to put some good time in and answer some other questions I saw around the 25th. For now, I'd look at the following and go from there with the hints I've given. JNIEXPORT jint JNICALL RXTXPort(nativeavailable)( JNIEnv *env, jobject jobj ) { int fd = get_java_var( env, jobj,"fd","I" ); int result; /* char message[80]; ENTER( "RXTXPort:nativeavailable" ); On SCO OpenServer FIONREAD always fails for serial devices, so try ioctl FIORDCHK instead; will only tell us whether bytes are available, not how many, but better than nothing. This turns out to be true on Solaris also. taj. */ #ifdef FIORDCHK /* __unixware__ __sun__ probably others */ result = ioctl(fd, FIORDCHK, 0); #else if( ioctl( fd, FIONREAD, &result ) < 0 ) { goto fail; } #endif /* FIORDCHK */ On Sat, 11 Feb 2006, Kim Lux wrote: > > More on this problem. I copied and pasted simpleRead into a console > based Eclipse project and I've got the same result, except that cpu > usage doesn't go to 100%. I'm beginning to think there is an issue in > rxtx. > > My imports for simpleRead are: > > ============================ > import gnu.io.*; > import java.util.*; > //import javax.comm.*; > import java.io.*; > =========================== > > Any ideas ? I am trying to read from /dev/ttyUSB0 using a serial to > USB adapter which has worked well with minicom and gtkterm. > > Thanks. > > > > On Fri, 2006-02-10 at 21:23 -0700, Kim Lux wrote: >> I've got a problem receiving chars with my version of serialRead, >> written in an SWT GUI. >> >> I had a Java pro have a good look at my code and he can't see anything >> wrong with it. >> >> I can send chars fine. When I receive a char the cpu usage for the app >> goes to 100% and the code in the serial event handler doesn't get >> executed. >> >> The instructions on the Java Comm Serial API How-To for Linux page state >> that I must install javacomm. Is that true ? Everything builds without >> it and I can send chars on rxtx just fine, but I can't receive them. >> Could this be the problem ? >> >> I downloaded and installed javacomm. I was not able to add >> "Driver=gnuio.RXTXCommDriver >> to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not >> have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 >> installed in /usr/java/jre1.5.0_05. I added comm.jar >> to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext >> to the library paths. Is this OK ? >> >> Does it matter that I am receiving on /dev/ttyUSB0 ? >> >> Thanks. >> > From tjarvi at qbang.org Sun Feb 12 21:03:30 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:03:30 -0700 (MST) Subject: [Rxtx] One serial port object for both sending and receiving ? In-Reply-To: <1139610545.18177.4.camel@zd7280> References: <1139610545.18177.4.camel@zd7280> Message-ID: On Fri, 10 Feb 2006, Kim Lux wrote: > > Is it OK to use one SerialPort ojbect (ex Serial Port serialPort;) and > use it for both sending and receiving ? > > For example: > > ======================================================================== > static SerialPort serialPort = null; > static OutputStream serialOut = null; > static InputStream serialIn = null; > > > > > // assign it to an outputStream for use > try{ > serialOut = serialPort.getOutputStream(); > System.out.println("Serial output stream has been assigned."); > }//try > catch(IOException e) > { > System.out.println("Error: Couldn't assign output stream to serial > port."); > }//catch > > > //assign it to an inputStream for use > try{ > serialIn = serialPort.getInputStream(); > System.out.println("Serial input stream has been assigned."); > }//try > catch(IOException e) > { > System.out.println("Error: Couldn't assign input stream to serial > port."); > }//catch This should be fine. In fact trying to do it another way will probably not work as you will run into lockfile issues. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun Feb 12 21:13:13 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:13:13 -0700 (MST) Subject: [Rxtx] Question about Serial I/O under Win32 In-Reply-To: <662084330@web.de> References: <662084330@web.de> Message-ID: On Sat, 11 Feb 2006 lunareclipse03 at web.de wrote: > Hello everybody, > > I have a strange problem with a piece of code I made for myself. No, > this is not really concerning rxtx, but nevertheless I post this to the > list, hoping that some of you can help me. I've written two libraries, > one for linux and one for win32. The linux port works quite well, I can > send / receive faxes and / or replay voice messages over the telephone > line using a voice modem. But the win32 port of the library causes some > trouble. If, for example, I send out a fax with a certain modem under > linux, it works well. The fax is complete when it comes out of the fax > machine. If I then use the same modem to send out a fax under win32, the > fax coming out of the fax machine gets "stuck" halfways, but the sending > modem thinks that transmission was ok and drops the connection. The > answering fax machine then gives me "error while receiving." The "upper > layer" java code MUST be right, because if I do the same thing under > linux (using the linux library), everything is alright. Now I have to > ask: Can somebody please help me out with this??!? Could it be the case > that some kind of flow control or COMMTIMEOUTS setting causes this > behaviour? I set flow control to RTS/CTS before sending out a fax. How > can I DISABLE flow control? Or what do you think? Can something else > cause this problems? Thank you all for your time and PLEASE write back > soon. > Hi Sven I'm not too willing to talk about flow control at the low level until I confirm some things with test equipment later. It is not clear if you are using rxtx or writing your own native code. So I'm not sure how to answer much of this :) If you are wondering how to change the flow control using rxtx from java, The BlackBox example from Sun flips this back and forth. SerialPort.java in rxtx 2.1 uses the following: SerialPort.java: public static final int FLOWCONTROL_NONE =0; SerialPort.java: public static final int FLOWCONTROL_RTSCTS_IN =1; SerialPort.java: public static final int FLOWCONTROL_RTSCTS_OUT =2; SerialPort.java: public static final int FLOWCONTROL_XONXOFF_IN =4; SerialPort.java: public static final int FLOWCONTROL_XONXOFF_OUT=8; So if you set flowcontrol to RTSCTS, you can set it to NONE to turn it off. If you are looking for how to do it in native code, the rxtx Source is SerialImp.c (unix/linux/mac os x/w32) and termios.c (w32 only with SerialImp.c) You can track the code: SerialImp.c:JNIEXPORT void JNICALL RXTXPort(setflowcontrol)( JNIEnv *env, jobject jobj, jint flowmode ) termios.c:int tcgetattr( int fd, struct termios *s_termios ) termios.c:int tcsetattr( int fd, int when, struct termios *s_termios ) There may be a problem in the rxtx flow control code though. Rather than guess, I want to test this with a gold standard. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Feb 6 00:00:16 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 00:00:16 -0700 (MST) Subject: [Rxtx] wiki delay until tomorrow night. In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: On Sun, 5 Feb 2006, Trent Jarvi wrote: > On Sun, 5 Feb 2006, Kim Lux wrote: > >> usb ? Tell me more... I need that too. > > usb is a very proper design. Thats all it is. > Maybe rxtx could help usb. But it would start with helping bring back the community that was already there. It's not something I'd love to do but maybe its the right thing to do. It would probably take 2 years to do right. But maybe thats better than what we have now. I honestly don't know what IBM is doing which could just run over everything. Just some thoughts after some fine german wine. -- Trent Jarvi tjarvi at qbang.org From gadelavega at yahoo.com.ar Mon Feb 6 02:17:05 2006 From: gadelavega at yahoo.com.ar (Gonzalo A. de la Vega) Date: Mon, 06 Feb 2006 10:17:05 +0100 Subject: [Rxtx] Serial port ownership question In-Reply-To: References: <20060205113618.30274.qmail@web53501.mail.yahoo.com> <1139157422.4553.9.camel@zd7280> <1139158698.4936.9.camel@zd7280> Message-ID: <43E71411.4050402@yahoo.com.ar> On my Fedora Core 4: ls -l /dev/ttyS* crw-rw---- 1 root uucp 4, 64 Feb 6 2006 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Feb 6 2006 /dev/ttyS1 ... and: grep "ttyUSB" /etc/udev/rules.d/50-udev.rules KERNEL=="ttyUSB*", GROUP="uucp", MODE="0660" So anyone in the "uucp" group can use serial ports. On Gentoo the group is "tty". Trent Jarvi escribi?: > > > On Sun, 5 Feb 2006, Dr. Douglas Lyon wrote: > >> I can confirm that this is the case (only root ownership of >> serial ports, under fedora 4). >> Wow, what were they thinking?! >> - DL >> >>> I've found that the newer kernels have the serial ports owned by root. >>> For example, >>> >>> $ls -al /dev/tty* >>> crw-rw-rw- 1 root root 5, 0 Feb 5 02:06 /dev/tty >>> crw-rw---- 1 root root 4, 0 Feb 5 02:06 /dev/tty0 >>> crw------- 1 root root 4, 1 Feb 5 09:07 /dev/tty1 >>> crw-rw---- 1 root tty 4, 10 Feb 5 02:06 /dev/tty10 >>> crw-rw---- 1 root tty 4, 11 Feb 5 02:06 /dev/tty11 >>> ... > > > This is just not a problem jcp or such are going to solve. Its a > platform spitwad fight. But do look at pam. In fact thats what Sun > is doing too. Maybe Linux followed their lead.. I'm not a pam guy. > I've spent 16 hours trying to understand it but your users wont :) > > Solution? I have no clue. Its two tangent mentalities from my > perspective. > > -- > Trent Jarvi > tjarvi at qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mtnvega at yahoo.com.br Mon Feb 6 05:35:43 2006 From: mtnvega at yahoo.com.br (Luiz Jr) Date: Mon, 6 Feb 2006 12:35:43 +0000 (GMT) Subject: [Rxtx] Documentation Wiki In-Reply-To: <1139157422.4553.9.camel@zd7280> Message-ID: <20060206123543.57256.qmail@web53515.mail.yahoo.com> Hello, Thank you for you answer, but so the usage of the API is pretty much like the Java Communications Api? If yes, what version of the Java Comm Api? Thank you, Luiz A. Brandao Jr Kim Lux escreveu: On Sun, 2006-02-05 at 08:36 -0300, Luiz Jr wrote: > Hello, > > I want to start using the RXTX libraries, but I would to know how, > since I can not access the documentation wiki page I just started using them yesterday. Below is how I installed the libraries, if that helps. I used snippets of code from the SimpleWrite application here to get me going. http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html Instead of "import javax.comm.*;", use "import gnu.io.*;" which is gotten from RXTXcomm.jar, which you will need to include in your project references. I am working in Eclipse. BTW: there is no way to open a port without going through the port list and finding it. Maybe sometime in the future someone (me ?) will write a method called openSerialPort that allows the user to give a port identifier, such as "/dev/tty1" and return a port ready to use. It wouldn't take much to write that and it would save users a lot of code. Hope this helps. ======================================================================= 1) Figure out which java you are running, incase there is more than one installed. $ java -version java version "1.5.0_05" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_05-b05) Java HotSpot(TM) Client VM (build 1.5.0_05-b05, mixed mode, sharing) 2) Find all the jre directories and the one from which you are currently running. kfind (jre) 3) cd to that directory plus /lib/i386 cd /usr/java/jre1.5.0_05/lib/i386 4) Copy the library files (*.so) to that directory. cp /home/krlux/Desktop/'Java Controls'/rxtx-linux/bin/* . 5) Check that the copy was successful ls librxtx* librxtxI2C.so librxtxRaw.so librxtxSerial.so librxtxParallel.so librxtxRS485.so 6) cd to the /lib/ext directory for your java. cd /usr/java/jre1.5.0_05/lib/ext 7) Copy the Jar files there cp /home/krlux/Desktop/'Java Controls'/rxtx-linux/lib/ext/* . 8) Check that it was successful ls RXTX* RXTXcomm.jar Rxtx is now installed on your machine ready to use. =================================================================== -- Kim Lux, Diesel Research Inc. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx --------------------------------- Yahoo! Acesso Gr?tis - Internet r?pida e gr?tis. Instale o discador agora! -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/544aa403/attachment-0056.html From lyon at docjava.com Mon Feb 6 05:49:34 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 06 Feb 2006 07:49:34 -0500 Subject: [Rxtx] wiki delay until tomorrow night. In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: Hi All, I have often thought about USB drivers being needed. For example, the ironman watch will not interface to a mac (windows only). It is USB. My dymo label writer has no Java driver (native only). Etc. Most cheap web cameras are USB (and Java drivers go through JAI, if it supports the camera at all). The JAI code shows how sun did the USB drivers. You have to be a member of the jai project to download the source code. https://jai.dev.java.net has the jai distro. And then you are not allowed to redistribute it. However, we can all learn from it (if so inclined). Basically: cvs -d :pserver:lyon at cvs.dev.java.net:/cvs login cvs -d :pserver:lyon at cvs.dev.java.net:/cvs checkout jai-core You will need to user your own uid and pw to get in. The ant build has over 100 warnings from sun deprecations of its own code. You might say that they were hoisted on their own Picard ;) One interesting thing is that they support several platforms: linux-amd64 64-bit Linux-AMD64 linux-i586 32-bit Linux-x86 solaris-amd64 64-bit Solaris-AMD64 solaris-i586 32-bit Solaris-x86 solaris-sparc 32-bit Solaris-SPARC solaris-sparcv9 64-bit Solaris-SPARC windows-i586 32-bit Windows-x86 Thus, ant is used to provide a multi-platform native method distro. Neat. How do they do it? check this out: And: The core download does not contain any C source code (it was all pre-built). Basically, they are just copying .so and .dll files into build directories. I would love to see the C code for this...but Sun does not post it on the https://jai.dev.java.net site. I don't know why...Perhaps I missed it. - Doug >On Sun, 5 Feb 2006, Trent Jarvi wrote: > >>On Sun, 5 Feb 2006, Kim Lux wrote: >> >>>usb ? Tell me more... I need that too. >> >>usb is a very proper design. Thats all it is. >> > >Maybe rxtx could help usb. But it would start with helping bring >back the community that was already there. > >It's not something I'd love to do but maybe its the right thing to do. > >It would probably take 2 years to do right. But maybe thats better >than what we have now. > >I honestly don't know what IBM is doing which could just run over everything. > >Just some thoughts after some fine german wine. > >-- >Trent Jarvi >tjarvi at qbang.org > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tdelenik at gmail.com Mon Feb 6 05:56:32 2006 From: tdelenik at gmail.com (Thanasis Delenikas) Date: Mon, 6 Feb 2006 14:56:32 +0200 Subject: Fwd: [Rxtx] Documentation Wiki In-Reply-To: <1139157422.4553.9.camel@zd7280> References: <20060205113618.30274.qmail@web53501.mail.yahoo.com> <1139157422.4553.9.camel@zd7280> Message-ID: <310a1a930602060456t129f1dc6p5f2b908f13ab5a0b@mail.gmail.com> Hello all, Kim, this is a snippet from the code I use. The closest to directly opening a specific port without enumeration. << ... portId = CommPortIdentifier.getPortIdentifier(getPort()); serialPort = (SerialPort) portId.open("jSMSEngine", 1971); ... >> where getPort() return the string identifier of the port, i.e. "/dev/ttyS0" or "COM1" or whatever. Thanasis. ---------- Forwarded message ---------- From: Kim Lux Date: Feb 5, 2006 6:37 PM Subject: Re: [Rxtx] Documentation Wiki To: RXTX Developers and Users BTW: there is no way to open a port without going through the port list and finding it. Maybe sometime in the future someone (me ?) will write a method called openSerialPort that allows the user to give a port identifier, such as "/dev/tty1" and return a port ready to use. It wouldn't take much to write that and it would save users a lot of code. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/182ab5b8/attachment-0056.html From tjarvi at qbang.org Mon Feb 6 11:53:57 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 11:53:57 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: On Mon, 6 Feb 2006, Dr. Douglas Lyon wrote: > Hi All, > I have often thought about USB drivers being needed. > For example, the ironman watch will not interface > to a mac (windows only). It is USB. > My dymo label writer has no Java driver (native only). > Etc. > Most cheap web cameras are USB (and Java drivers go > through JAI, if it supports the camera at all). > The JAI code shows how sun did the USB drivers. > You have to be a member of the jai project to download > the source code. > https://jai.dev.java.net has the jai distro. > And then you are not allowed to redistribute it. However, > we can all learn from it (if so inclined). Basically: > cvs -d :pserver:lyon at cvs.dev.java.net:/cvs login > cvs -d :pserver:lyon at cvs.dev.java.net:/cvs checkout jai-core > You will need to user your own uid and pw to get in. > The ant build has over 100 warnings from sun deprecations > of its own code. > > You might say that they were hoisted on their own Picard ;) > > One interesting thing is that they support several platforms: > linux-amd64 64-bit Linux-AMD64 > linux-i586 32-bit Linux-x86 > solaris-amd64 64-bit Solaris-AMD64 > solaris-i586 32-bit Solaris-x86 > solaris-sparc 32-bit Solaris-SPARC > solaris-sparcv9 64-bit Solaris-SPARC > windows-i586 32-bit Windows-x86 > Thus, ant is used to provide a multi-platform native method distro. > Neat. > How do they do it? > check this out: > > > > > > > > > > > > > And: > > > > > > > > > > The core download does not contain any C source code (it was all pre-built). > Basically, they are just copying .so and .dll files into build directories. > > I would love to see the C code for this...but Sun does not post it on the > https://jai.dev.java.net site. > > I don't know why...Perhaps I missed it. > > - Doug > > I've looked at moving rxtx to Ant builds. I think that would help IDEs a great deal. I requested a evalutation desk copy the O'Reilly Ant book for some j2ee material I was teaching. http://www.oreilly.com/catalog/anttdg/ It has a one sentence mention of JNI. So there was not luck there. I saw that there is another Ant book that does mention JNI more. I can't find it now. Ant must be able to support it with extensions. http://ant.apache.org/manual/OptionalTasks/javah.html What the auto(break :) tools do in the rxtx build is 4 things really. 1) gcc compile flags 2) ld compile flags 3) config.h 4) compile flags for customizing rxtx (lockfiles, ...) See 1 All of this information except 4 can be static once obtained. So I'm not attached to the auto tools. If I could find an example of Ant being used for JNI code, I'd be one of the first to start moving that direction. Maybe someone saw an example someplace. The other thing we have not completed discussing is the directory structure. There is interest in making rxtx more IDE friendly. I get more mail about that off the list than how to install rxtx. And I see we have Ken Thompson in da house :) He is our trusted CVS maintainer and the guy that purchased the rxtx.org domain. Old community. We will need Ken for changing the directory structure of source. I would like to open up discussion about both of these as it is more than time. The problem is I have little experience with Ant and even less with IDEs. It would be nice if we could work with Eclipse and NetBeans. http://www.netbeans.org/ (sun and some community) http://www.eclipes.org (ibm,rhat,... perhaps more community) http://maven.apache.org/what-is-maven.html (apache. It is community) borland should sortof be here too but I think thats covered in eclipse. >From what I understand so far, we should morph rxtx to support those three maybe trusting apaches lead with maven. But I use vi. I have little to no clues beyond what people have fed me. Can we agree that thats the right direction to go? -- Trent Jarvi tjarvi at qbang.org From brian at mbari.org Mon Feb 6 14:57:50 2006 From: brian at mbari.org (Brian Schlining) Date: Mon, 6 Feb 2006 13:57:50 -0800 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> > The other thing we have not completed discussing is the directory > structure. There is interest in making rxtx more IDE friendly. I > get more mail about that off the list than how to install rxtx. > > And I see we have Ken Thompson in da house :) He is our trusted > CVS maintainer and the guy that purchased the rxtx.org domain. Old > community. We will need Ken for changing the directory structure of > source. > > I would like to open up discussion about both of these as it is > more than time. The problem is I have little experience with Ant > and even less with IDEs. It would be nice if we could work with > Eclipse and NetBeans. > > http://www.netbeans.org/ (sun and some community) > http://www.eclipes.org (ibm,rhat,... perhaps more community) > http://maven.apache.org/what-is-maven.html (apache. It is community) > borland should sortof be here too but I think thats covered in > eclipse. > >> From what I understand so far, we should morph rxtx to support >> those three > maybe trusting apaches lead with maven. But I use vi. I have > little to no clues beyond what people have fed me. > Maven likes the directory structure below for Java code. (From http:// maven.apache.org/guides/getting-started/index.html) This structure works fine with ant, netbeans, and eclipse. rxtx_root_directory `-- src |-- main | `-- java | `-- gnu | `-- io `-- test `-- java `-- gnu `-- io Brian Schlining Software Engineer http://www.mbari.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/d9451eba/attachment-0056.html From tjarvi at qbang.org Mon Feb 6 15:11:45 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 15:11:45 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: > rxtx_root_directory > `-- src > |-- main > | `-- java > | `-- gnu > | `-- io > `-- test > `-- java > `-- gnu > `-- io > >From what I understand this will just be good. For me it makes no difference. So lets do the rxtx thing. Let if fester for two weeks and if nobody objects, we will do it. I'm not doing this because I care. I'm doing this to eliminate much of my inbox. But test... man is rxtx lacking there in the community aspect. It is covered but not right. _maybe_ I can change that this year. -- Trent Jarvi tjarvi at qbang.org (cat hurding since 1997) From lux at diesel-research.com Mon Feb 6 21:38:49 2006 From: lux at diesel-research.com (Kim Lux) Date: Mon, 06 Feb 2006 21:38:49 -0700 Subject: [Rxtx] How can I use Lock Files with rxtx (in FC4) ? Message-ID: <1139287129.17031.3.camel@zd7280> I am now running an rxtx application on FC4. I am getting: ========================================================= check_group_uucp(): error testing lock file creation Error details: Permission denied check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL ========================================================= $ ls -al /var/lock total 32 drwxrwxr-x 4 root lock 4096 Feb 6 16:04 . drwxr-xr-x 24 root root 4096 Nov 14 01:19 .. drwx------ 2 root root 4096 Apr 27 2005 lvm drwxr-xr-x 2 root root 4096 Feb 6 16:04 subsys How do I fix this for regulator users ? -- Kim Lux, Diesel Research Inc. From dmarkman at mac.com Mon Feb 6 22:24:44 2006 From: dmarkman at mac.com (Dmitry Markman) Date: Tue, 7 Feb 2006 00:24:44 -0500 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: if I understands the issue right in order to be able to use ant for c/c++ compilation you have to install ant's cc task http://ant-contrib.sourceforge.net/cc.html it looks like it should work on mac os x (authors claim, that it's platform independent) but I never tested so all you have to do it's providing right command line for the gcc compiler On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: >> rxtx_root_directory >> `-- src >> |-- main >> | `-- java >> | `-- gnu >> | `-- io >> `-- test >> `-- java >> `-- gnu >> `-- io >> > > >> From what I understand this will just be good. > > For me it makes no difference. So lets do the rxtx thing. Let if > fester for two weeks and if nobody objects, we will do it. > > I'm not doing this because I care. I'm doing this to eliminate > much of my inbox. > > But test... man is rxtx lacking there in the community aspect. It > is covered but not right. _maybe_ I can change that this year. > > -- > Trent Jarvi > tjarvi at qbang.org > (cat hurding since 1997) > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx Dmitry Markman From lux at diesel-research.com Mon Feb 6 23:20:15 2006 From: lux at diesel-research.com (Kim Lux) Date: Mon, 06 Feb 2006 23:20:15 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? Message-ID: <1139293215.3689.4.camel@zd7280> I'm running the code below. portlist.hasMoreElements() is false. /dev has ports in it as listed below. What am I doing wrong ? ========================================================== // Step through the list of ports until we find one that matches // the one we are looking for. portList = CommPortIdentifier.getPortIdentifiers(); while(portList.hasMoreElements()) { portID = (CommPortIdentifier) portList.nextElement(); // if (portID.getName().equals("/dev/ttyUSB0")) { myTA.append("Serial port ttyUSB0 has been found\n"); break; }// if portID equals... }// End of while... ========================================================== ls -al /dev/tty* crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 ... crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 -- Kim Lux, Diesel Research Inc. From david.garnier at trusted-logic.com Tue Feb 7 00:46:30 2006 From: david.garnier at trusted-logic.com (David Garnier) Date: Tue, 07 Feb 2006 08:46:30 +0100 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: <43E85056.2090608@trusted-logic.com> Hello, I think that the make-based build process is fine as it is, apart from the location of the Java source files. It is true that putting the Java source in a directory structure that map 1-to-1 to the Java package structure is the norm and should make it easier for everyone to modify the Java source, with or without an IDE. Ant is a good tool, but in the RXTX case I fail to see the advantage of using it compared to the current make-based process. As Trent said, they are more pressing issues, like testing. Regards, David Dmitry Markman wrote: > if I understands the issue right > in order to be able to use ant for c/c++ compilation > you have to install ant's cc task > http://ant-contrib.sourceforge.net/cc.html > > it looks like it should work on mac os x > (authors claim, that it's platform independent) > but I never tested > > so all you have to do it's providing right command line > for the gcc compiler > > > > > On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: > >>> rxtx_root_directory >>> `-- src >>> |-- main >>> | `-- java >>> | `-- gnu >>> | `-- io >>> `-- test >>> `-- java >>> `-- gnu >>> `-- io >>> >> >> >>> From what I understand this will just be good. >> >> For me it makes no difference. So lets do the rxtx thing. Let if >> fester for two weeks and if nobody objects, we will do it. >> >> I'm not doing this because I care. I'm doing this to eliminate much >> of my inbox. >> >> But test... man is rxtx lacking there in the community aspect. It is >> covered but not right. _maybe_ I can change that this year. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> (cat hurding since 1997) From tjarvi at qbang.org Tue Feb 7 01:11:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 01:11:31 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <43E85056.2090608@trusted-logic.com> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: On Tue, 7 Feb 2006, David Garnier wrote: > Hello, > > I think that the make-based build process is fine as it is, apart from the location of the Java > source files. It is true that putting the Java source in a directory structure that map 1-to-1 to > the Java package structure is the norm and should make it easier for everyone to modify the Java > source, with or without an IDE. > > Ant is a good tool, but in the RXTX case I fail to see the advantage of using it compared to the > current make-based process. As Trent said, they are more pressing issues, like testing. > Hi David I have more experience with testing rxtx than I can talk about. But let it be known, rxtx has gone trough 100's of hours of testing. We are hobby folks interested in toys but there is more. rxtx has had some of the best guidance in the industry there. This is not an easy thing. I may be able to come back in a month from the other side of the corperate fence and help. I suspect the tests could just be made public but they are in a very unusual environment that just wont work in a wider sense. This is something I'll be trying to change. At one point it was agreed we could just make the results public so this isnt just noise.. There is interest and I think its safe to mention that much. The big problem with testing in the past is most of it is done with a loopback connection. So we *still* have major questions regarding things like flow control. rxtx talks to itself over a loopback and it works. regardless of right or wrong. This requires more thought to be done right. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Feb 7 02:46:34 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 02:46:34 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: > The big problem with testing in the past is most of it is done with a > loopback connection. So we *still* have major questions regarding things > like flow control. rxtx talks to itself over a loopback and it works. > regardless of right or wrong. With serial communication there are gold standards. ckermit is probably a definitive 'standard.' Maybe its possible to do ping/pong tests with ckermit? Is it scriptable? There are known issues in rxtx. Probably the worst is some threading issues regarding some JREs with multiple JNI threads setting java variables. Man did I get schooled there. Just switch the c functions to returning variables and things go away. Sometimes they work fine, sometimes they blow up. Without understanding everything, somehow rhat got it right and debian (and especially gentoo) grabbed kernel patches causing all sort of harm. Its not hard to fix once you understand whats going on but nearly impossible to track with a debugger. So I have a good idea what 2.1-8 will have outside of the IDE modifications. rxtx 2.1-7 is a release for everyone to sync with. Its not even as stable as -pre17 as far as I know - I ran no test suites. I'll be chasing it too. We just had so many contributions that it was time. It seriously broke internal scheduals but thats a great thing :) The other thing I want to do in 2.1-8 is automagic baud rates. It turns out lots of shops are doing really funky baud rates for things like automobile test equipment. It is possible but it requires a fair amount of change in the native code. Is anyone looking at this? -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Feb 7 02:57:21 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 07 Feb 2006 04:57:21 -0500 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <43E85056.2090608@trusted-logic.com> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: Hi All, I agree, testing is very important. The problem I have been trying to address is related to cross-platform testing and the robust nature of the installs. Typically, I visit 3 platforms to deploy my product, windows, linux and mac. A build is performed on each platform. The idea that you can build for many platforms from one copy the source code seems attractive. This should enable synchronized deployments of identical code. The question of how to achieve this goal remains open. As Trent mentioned, this is hard. Perhaps Ant will help here (but perhaps not). Ant does seem to help with running unit tests. However, it does not help with multi-platform tests. For that you need many machines and different operating environments. Toward that end, I have created a multi-platform test that can be run from web start, located at: http://show.docjava.com:8086/book/cgij/code/jnlp/serialPort.PortTest.jnlp This is interesting because many people in the community can run the test and we can improve the test, as time permits. No, it is not a perfect solution, however, the idea does help with multi-platform tests using many machines and different operating environments. If the group has a good test for a general serial port set-ups, i would be happy to deploy it, for general evaluation using web start. And as for ANT, it is just an idea. Not all my ideas are good ones! - Doug >Hello, > >I think that the make-based build process is fine as it is, apart >from the location of the Java >source files. It is true that putting the Java source in a directory >structure that map 1-to-1 to >the Java package structure is the norm and should make it easier for >everyone to modify the Java >source, with or without an IDE. > >Ant is a good tool, but in the RXTX case I fail to see the advantage >of using it compared to the >current make-based process. As Trent said, they are more pressing >issues, like testing. > >Regards, >David > >Dmitry Markman wrote: >> if I understands the issue right >> in order to be able to use ant for c/c++ compilation >> you have to install ant's cc task >> http://ant-contrib.sourceforge.net/cc.html >> >> it looks like it should work on mac os x >> (authors claim, that it's platform independent) >> but I never tested >> >> so all you have to do it's providing right command line >> for the gcc compiler >> >> >> >> >> On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: >> >>>> rxtx_root_directory >>>> `-- src >>>> |-- main >>>> | `-- java >>>> | `-- gnu >>>> | `-- io >>>> `-- test >>>> `-- java >>>> `-- gnu >>>> `-- io >>>> >>> >>> >>>> From what I understand this will just be good. >>> >>> For me it makes no difference. So lets do the rxtx thing. Let if >>> fester for two weeks and if nobody objects, we will do it. >>> >>> I'm not doing this because I care. I'm doing this to eliminate much >>> of my inbox. >>> >>> But test... man is rxtx lacking there in the community aspect. It is >>> covered but not right. _maybe_ I can change that this year. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> (cat hurding since 1997) > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From matt.higgins at gmail.com Tue Feb 7 08:28:34 2006 From: matt.higgins at gmail.com (Matt Higgins) Date: Tue, 7 Feb 2006 10:28:34 -0500 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final Message-ID: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? import java.io.*; import java.util.*; import gnu.io.*; public class MySimpleRead implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; public static void main(String[] args) { boolean portFound = false; String defaultPort = "COM1"; if (args.length > 0) { defaultPort = args[0]; } portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; MySimpleRead reader = new MySimpleRead(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } } public MySimpleRead() { try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) { e.printStackTrace(); } try { inputStream = serialPort.getInputStream(); } catch (IOException e) { e.printStackTrace(); } try { serialPort.addEventListener(this); } catch (TooManyListenersException e) { e.printStackTrace(); } try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { e.printStackTrace(); } System.out.println("Baud is " + serialPort.getBaudRate()); System.out.println("Bits is " + serialPort.getDataBits()); System.out.println("Stop is " + serialPort.getStopBits()); System.out.println("Par is " + serialPort.getParity()); serialPort.notifyOnDataAvailable(true); readThread = new Thread(this); readThread.start(); } public void run() { // Thread.sleep(20000); //} catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { System.out.println("An event occurred " + event.getEventType()); switch (event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: byte[] readBuffer = new byte[20]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } System.out.print(new String(readBuffer)); } catch (IOException e) {} break; } } } --------------- Result on windows ------------------------------ Stable Library ============================================================== Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port:: COM1 Baud is 9600 Bits is 8 Stop is 1 Par is 0 ----------------- End Results ----------------------------------------- ------------------ Result on Linux ----------------------------------- Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 Found port: /dev/ttyS0 Baud is 9600 Bits is 8 Stop is 1 Par is 0 An event occurred 1 043100066224 ------------------ End Results --------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/a1431630/attachment-0056.html From brian at mbari.org Tue Feb 7 09:48:37 2006 From: brian at mbari.org (Brian Schlining) Date: Tue, 7 Feb 2006 08:48:37 -0800 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> Message-ID: <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> Hi Matt > The following code works fine on Linux but I never see any data > when run on Windows. This is a cut and paste from the SimpleRead > example. > I am attempting to read data from a bar code scanner. I can fire > up HyperTermianl on windows and see that the device is working > properly as I see the barcodes are scanned and echoed back to the > terminal. However when I run the app I don't see any data. It is > however associating with the com port as the informational bits > print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. Cheers Brian Schlining Software Engineer http://www.mbari.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/16d07f37/attachment-0056.html From lux at diesel-research.com Tue Feb 7 11:59:58 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 11:59:58 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139293215.3689.4.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> Message-ID: <1139338798.8145.4.camel@zd7280> Any ideas on this ? Any reason why portList.hasMoreElements() should be false even though there are devices in /dev ? On Mon, 2006-02-06 at 23:20 -0700, Kim Lux wrote: > I'm running the code below. > > portlist.hasMoreElements() is false. > > /dev has ports in it as listed below. > > What am I doing wrong ? > > > ========================================================== > // Step through the list of ports until we find one that matches > // the one we are looking for. > > portList = CommPortIdentifier.getPortIdentifiers(); > > while(portList.hasMoreElements()) > { > portID = (CommPortIdentifier) portList.nextElement(); // > if (portID.getName().equals("/dev/ttyUSB0")) > { > myTA.append("Serial port ttyUSB0 has been found\n"); > break; > }// if portID equals... > }// End of while... > ========================================================== > > ls -al /dev/tty* > crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty > crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 > crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 > crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 > crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 > ... > crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 > crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 > crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 > > > -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 12:20:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 12:20:25 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139338798.8145.4.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> Message-ID: On Tue, 7 Feb 2006, Kim Lux wrote: > > Any ideas on this ? Any reason why portList.hasMoreElements() should be > false even though there are devices in /dev ? > > > On Mon, 2006-02-06 at 23:20 -0700, Kim Lux wrote: >> I'm running the code below. >> >> portlist.hasMoreElements() is false. >> >> /dev has ports in it as listed below. >> >> What am I doing wrong ? >> >> >> ========================================================== >> // Step through the list of ports until we find one that matches >> // the one we are looking for. >> >> portList = CommPortIdentifier.getPortIdentifiers(); >> >> while(portList.hasMoreElements()) >> { >> portID = (CommPortIdentifier) portList.nextElement(); // >> if (portID.getName().equals("/dev/ttyUSB0")) >> { >> myTA.append("Serial port ttyUSB0 has been found\n"); >> break; >> }// if portID equals... >> }// End of while... >> ========================================================== >> >> ls -al /dev/tty* >> crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty >> crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 >> crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 >> crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 >> crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 >> ... >> crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 >> crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 >> crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 >> >> >> > Hi Kim What rxtx does is try to open the port and do a timed out read. If the kernel/... do not complain it's enumarted. I suspect you could do a crude test by doing something like cat /dev/ttyS0 > /dev/null If that barfs then rxtx wont enumerate the port. hmm looking at your question again, I suspect it's a lockfile problem. This is documented in INSTALL with the source. Its easy enough to test this too.. touch /var/lock/testingrxtxlockfiles && rm -f /var/lock/testingrxtxlockfiles If you are not in the right group it will bail. Root will work regardless. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 12:37:56 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 12:37:56 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> Message-ID: <1139341076.8145.11.camel@zd7280> Exactly which ports does rxtx attempt to put into the list ? /dev/* or /dev/tty* or /dev/tty[0-9[0-9] ? or /dev/ttyS* ? For the record, only /dev/ttyUSB0 is a valid port on the machine I am presently on. Will this be a problem ? On Tue, 2006-02-07 at 12:20 -0700, Trent Jarvi wrote: > This is documented in INSTALL with the source. > I was wondering where that file was. I will download source and dig it up. Thanks. -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 12:51:09 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 12:51:09 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139341076.8145.11.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: On Tue, 7 Feb 2006, Kim Lux wrote: > > Exactly which ports does rxtx attempt to put into the list ? /dev/* > or /dev/tty* or /dev/tty[0-9[0-9] ? or /dev/ttyS* ? > > For the record, only /dev/ttyUSB0 is a valid port on the machine I am > presently on. Will this be a problem ? > > > On Tue, 2006-02-07 at 12:20 -0700, Trent Jarvi wrote: >> This is documented in INSTALL with the source. >> > I was wondering where that file was. I will download source and dig it > up. > > Thanks. > Hmm I'm looking at pre17 so this may have changed. (its just what I have on this machine) if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA" // for the IPAQs }; CandidatePortPrefixes=Temp; } So you may need to add "ttyUSB" to that list. RXTX used to enumerate _everything_ see if(osName.equals("Linux-all-ports") But it became less than practical. This is all in RXTXCommDriver.java hmm I just did a cvs update. if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have to get your fingers into the code. We aim for sane defaults. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 13:06:45 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 13:06:45 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139342805.8145.22.camel@zd7280> On Tue, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > Hmm I'm looking at pre17 so this may have changed. (its just what I have > on this machine) > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA" // for the IPAQs > }; > CandidatePortPrefixes=Temp; > } > > > So you may need to add "ttyUSB" to that list. RXTX used to enumerate > _everything_ see if(osName.equals("Linux-all-ports") But it became less > than practical. > > This is all in RXTXCommDriver.java > > hmm I just did a cvs update. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have > to get your fingers into the code. We aim for sane defaults. Excellent. Thanks for taking the time. -- Kim Lux, Diesel Research Inc. From ideiglenes1 at freemail.hu Tue Feb 7 13:53:39 2006 From: ideiglenes1 at freemail.hu (--) Date: Tue, 07 Feb 2006 21:53:39 +0100 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139345619.22534.2.camel@localhost> Hi! I use this code to get all the extra Linux devices. :) if ("Linux".equals(System.getProperty("os.name"))) { System.setProperty("os.name","Linux-all-ports"); } driver = new RXTXCommDriver(); On k, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > On Tue, 7 Feb 2006, Kim Lux wrote: > > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have > to get your fingers into the code. We aim for sane defaults. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From matt.higgins at gmail.com Tue Feb 7 13:45:54 2006 From: matt.higgins at gmail.com (Matt Higgins) Date: Tue, 7 Feb 2006 15:45:54 -0500 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> Message-ID: <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> Sweet this is exactly what I needed. I was searching the archives through marc.theamisgroup they only have archives back to 1/3/05. Should have hit the mailman archive! Thanks a lot! On 2/7/06, Brian Schlining wrote: > > Hi Matt > > The following code works fine on Linux but I never see any data when run > on Windows. This is a cut and paste from the SimpleRead example. > I am attempting to read data from a bar code scanner. I can fire up > HyperTermianl on windows and see that the device is working properly as I > see the barcodes are scanned and echoed back to the terminal. However when I > run the app I don't see any data. It is however associating with the com > port as the informational bits print fine? > > > You're not the only one whose had this problem, I don't know if Trent has > addressed this is the latest release of RXTX but there is a workaround. > Here's the recent thread from the RXTX mailing list regarding this issues: > > Thanasis Delenikas tdelenik at gmail.com > Wed Jan 18 13:56:23 MST 2006 > > * Previous message: [Rxtx] Re: More close() performance fixes > * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] > > Hi all. > (I've subscribed again from my other email account). > > Trent, > > You are right. Linux *always* works, no matter what flow control you set. > Windows *works only* with hardware flow control (I haven't tested what > happens with software XON/XOFF flow control). > > I assume (but I am not certain) that even with no flow control at all, all > platforms should work. Without flow control, you have the risk of bumping > into overflow or framing errors, but that's your (the end programmer, I > mean) problem. > > >From my side, I shouldn't be working without flow control. That was a bug > too... It was some code forgotten from the old times, when I used to work > with phone emulation drivers which didn't support flow control. The > correct > way is to have some flow control enabled and that's why I suppose this is > a > low-severity bug for RxTx. > > I have no idea which platform shows the correct behaviour, since > my knowledge about Linux and the inner workings of these low-level i/o > operations is limited. > > Regards, > Thanasis Delenikas. > > > > > Message: 2 > > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > > From: Trent Jarvi > > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > > To: RXTX Developers and Users > > Message-ID: > > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > > > Hi all, > > > > > > Trent, I have found something. > > > I read your comment about flow control, so I experimented a bit. > > > > > > If you remember, in my sample program I've used no flow control at all > ( > > i.e. > > > Java constant FLOWCONTROL_NONE). > > > > > > Now, during testing, I've switch to hardware inbound flow control (i.e > . > > Java > > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > > beautifully! > > > > > > I think I will switch to H/W flow control and test things for a while, > > but > > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > > > > > Hi Thanasis, > > > > I'm fairly sure you have identified a bug. I would not worry too much > > about what Sun CommAPI w32 defaults are. I think they did more or less > > whatever the port opened with. Just a guess. Linux tries to stomp on > > ports so they are all the same. > > > > So this started out with Linux worked, Windows XP/.. did not as I > recall. > > Something is wrong in rxtx. Do I understand this right? > > > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > > > Perhaps there is something Wayne or I did not understand when we wrote > > that code. I wasnt programming back in the BBS days so modems are not > my > > thing. I have a few questions. > > > > Is the above matrix confirmed by observation? > > Linux just always worked? > > Which one _should_ work? I'm guessing modems work with hardware flow > > control. I'll have to dig around. > > > > The windows flow control changes a couple things with hardware flow > > control. Following the w32 API documentation is confusing sometimes. > > But it looks like Linux could have a bug too. > > Cheers > > Brian Schlining > Software Engineer > http://www.mbari.org > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/9c989144/attachment-0056.html From tjarvi at qbang.org Tue Feb 7 14:06:14 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 14:06:14 -0700 (MST) Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> Message-ID: >> >> You're not the only one whose had this problem, I don't know if Trent has >> addressed this is the latest release of RXTX but there is a workaround. >> Here's the recent thread from the RXTX mailing list regarding this issues: >> I have not. I expect to have access to some test equipment next month and I'll go through all of this. I really don't know whats going on and I need a gold standard. I thought maybe linux was autodetecting the flow control. Your observations would certainly be welcome. I need to talk to Russell King and see what he is doing. Until then I'd just be toying around over a loopback as usual. This is very high on the list though. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 17:25:05 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 17:25:05 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139358305.17994.2.camel@zd7280> My application now works. I installed the libraries and jar from 2.1-7 (Final). portlist.hasMoreElements is no longer false. The application finds the port for /dev/ttyUSB0. Thanks for your help, Trent (et al) Sorry I bothered you with this. Next time I will look in the source first. I didn't think it was an rxtx issue, I thought it was a Linux setup issue . On Tue, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > Hmm I'm looking at pre17 so this may have changed. (its just what I > have > on this machine) > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux > Serial Ports > "ttySA" // for the > IPAQs > }; > > CandidatePortPrefixes=Temp; > } > > > So you may need to add "ttyUSB" to that list. RXTX used to enumerate > _everything_ see if(osName.equals("Linux-all-ports") But it became > less > than practical. > > This is all in RXTXCommDriver.java > > hmm I just did a cvs update. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux > Serial Ports > "ttySA", // for the > IPAQs > "ttyUSB" // for USB > frobs > }; > > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you > have > to get your fingers into the code. We aim for sane defaults. -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 19:21:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 19:21:54 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139358305.17994.2.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> <1139358305.17994.2.camel@zd7280> Message-ID: >Sorry I bothered you with this. Next time I will look in the source >first. I didn't think it was an rxtx issue, I thought it was a Linux >setup issue . Why would you be sorry? I would have done the same. I'm glad it's working :) -- Trent Jarvi tjarvi at qbang.org From tma at mail.island.net Wed Feb 8 13:39:35 2006 From: tma at mail.island.net (Tom Alldread) Date: Wed, 08 Feb 2006 12:39:35 -0800 Subject: [Rxtx] Win32/Linux Serial Port Data Dropouts In-Reply-To: <200602060702.k167255O007882@www.qbang.org> References: <200602060702.k167255O007882@www.qbang.org> Message-ID: <43EA5707.4020200@mail.island.net> Greetings Folks at RXTX: During the last couple of months I have been alternately testing with javax.comm 2 and RXTX 2.1 under Windows XP and CommApi 3 and RXTX 2.1 under Suse 10.0 Linux. In the process I have learned a little about java multi-threading under NetBeans 5 with Profiler. My java (jdk 1.5_06) application is used for data acquisition and provides a graphical display of A-D conversion data received from a 56KBaud serial port. The actual data throughput is about 10KBaud thus it is well below the speed of the port. I use hardware RTS/CTS flow control which can stall the data acquisition sample rate if necessary. This ensures the display computer has the ability to slow the data acquisition rate should it become too busy to accept the regular data flow. Both the serial port buffer and the java read buffer are set at 16KB. Usually the data transfers into the java read buffer are less than 100 bytes unless the data acquisition is recovering from a stall. The data flow normally hesitates after each 5 KB block as a continue command is needed from the display computer to start the drawing of a new graphics display line. Separate threads have been provided for the serial port event monitoring and data processing. The serial port event thread has been given the maximum priority and data processing thread the minimum priority provided by java. Thread yield statements have been placed within all data processing while/for loops as an effort to ensure quick access to CPU cycles for the serial port event thread. I have found that short data transmissions are essentially error free but occasional dropouts occur with continuous data flow especially under Windows XP. ....................................................................................................................................................................................... Linux results: I am happy to report that RXTX 2.1 appears to work very well under Linux although I did notice some errors when the screen savers were running with my dual monitors. I believe this is a local problem associated with my dual graphics which needs further attention. The recent CommApi 3 Linux release from Sun did not work at all with my program. It seemed to send commands out OK but did not receive any data. Although the serial port event triggered the ISR, the input stream appeared filled with nulls and thus did not contain any data. As my understanding is that CommApi 3 was tested with a Red Hat distribution of Linux I wonder if this problem is distro dependent? Although somewhat off topic here I wonder if anyone reading this has had similar experience? .................................................................................................................................................................................. Windows XP results: There are problems with occasional data dropouts which become more frequent as the sampling rate is increased or if the computer becomes busy with other duties. The dropouts typically consist of a half dozen byte block of lost data. It appears the lost bytes never get added to the java input stream. There has not been any indication of garbled data, overruns or framing errors which suggests the UART communications remains solid. Using javax.comm 2 I found that the setting of SerialPort 'enableReceiveThreshold' to 40 and 'enableReceiveTimeout' of 100mS reduced the dropouts error rate significantly. I found that I could not get RXTX 2.1 to function with the aforementioned threshold and timeout settings. The javax.comm 2 interface is consequently performing better for me under Windows than RXTX 2.1. I wonder if anyone here has any suggestions as to what I might try to improve RXTX 2.1? Although my settings are the same as under Suse 10.0, RXTX 2.1 performs much better for me under Linux than any of the alternatives that I have tried under Windows XP . ............................................................................................................................................................................... I would like to establish, based on the experience of others, if I have reached the normally expected performance limit of java serial port communications? Should I expect to achieve virtually error free serial port data input from a continuous stream under Windows XP java software? I am considering changing my protocol to packets with error checking if necessary but would like to know if the dropout problems I am experiencing are typical or not before I take this rather work intensive plunge. Many thanks in advance for any help! Best Regards, Tom Alldread -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.375 / Virus Database: 267.15.2/253 - Release Date: 2006-02-07 From jlaxson at mac.com Wed Feb 8 23:56:48 2006 From: jlaxson at mac.com (John Laxson) Date: Thu, 9 Feb 2006 00:56:48 -0600 Subject: [Rxtx] PortInUseException: Unknown Application on OSX Message-ID: Hi, I've been trying to get RXTX 2.1.7 going on Mac OS X for a while here, and am running up into a wall here. I've tried with pre- compiled and the source version and get the same problem, a gnu.io.PortInUseException: Unknown Application. I have run the fixperms script included with the source distribution, and id shows me as a member of the uucp group, and permissions on /var/spool/uucp are 775 root:uucp. Running a test program (included at the bottom for clarity) lets me enumerate all the serial ports correctly, but trying to open any of them gives the PortInUseException. If it helps, when I try to open a port that's set to make an outgoing bluetooth connection, there is no delay and no connection attempt at all. Thanks, John Laxson PS: The documentation wiki on qbang.org shows 404, and has for a few days now. My test code: public static void main(String[] args) { SerialPort serialPort; try { Enumeration e = CommPortIdentifier.getPortIdentifiers(); CommPortIdentifier ident; while (e.hasMoreElements()) { ident = (CommPortIdentifier)e.nextElement(); System.out.println(ident.getName()); } ident = CommPortIdentifier.getPortIdentifier("/dev/cu.modem"); serialPort = (SerialPort) ident.open("Me", 5000); } catch (Exception e) { e.printStackTrace(); } } From rajesh.invincible at gmail.com Thu Feb 9 03:39:38 2006 From: rajesh.invincible at gmail.com (Rajesh N) Date: Thu, 9 Feb 2006 16:09:38 +0530 Subject: [Rxtx] Re: Move .java Files in gnu.io filesystem hierarchy - Maven (2) In-Reply-To: <43DF21D2.7090200@ngi.it> References: <43DF21D2.7090200@ngi.it> Message-ID: <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Can anybody tell me how to overcome these EXCEPTIONS I AM WORKING ON SERIAL COMMN IN JAVA ON LINUX. 1. " NOT ALL PARAMETERS SUPPORTED BY THE KERNEL" This i came across the following statement inmy prog. SerialP is A SerialPort object SerialP.setSerialPortParams(9600(BAUDRATE),DATABITS_8,STOPBITS_1,PARITY_NONE) 2. NullPointer Exception at Event Dispatch Now i have checked all my object references for a null reference but i found none i have put up my entire code in try catch blocks but still I AM UNABLE TO CATCH THIS EXCEPTION AND HENCE MY APPLICATION CLOSES HOW DOES THESE GO? PLEASE HELP ME IT IS URGENTTTTTTTTTTTTTTTT yours sincerely RAJESH On 1/31/06, Fabio Frumento wrote: > Hi Xavier, > > I don't know maven at all but the directory hierarchy listed buy Trent > is fine for me... > > I'll take a look to maven, it seems an interesting project > > Regards > > Fabio Frumento > > Trent Jarvi wrote: > > On Tue, 31 Jan 2006, Xavier Frisaye wrote: > > > >> Hi all, > >> > >> If you are going to rearrange the src folder, i will propose to use > >> maven 2 and follow its directory structure > >> > (http://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html). > >> > >> Maven 2 simplify java project and give a standard way to make projects > >> (http://maven.apache.org/). > >> We are using it for internal projects and we are very satisfied. > >> > >> Is anybody interested? > >> > >> I'm not an expert in maven 2 (yet) but i'm agree to help using it if > >> you choose to make so. > >> > > > > so this would be: > > > > rxtx-devel/src/main/java/gnu.io > > rxtx-devel/src/test/java/ManIwish.java > > > > I don't use IDEs very much so I'll let others comment. But I don't see > > a problem with that. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Thu Feb 9 09:50:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 9 Feb 2006 09:50:31 -0700 (MST) Subject: [Rxtx] Re: Move .java Files in gnu.io filesystem hierarchy - Maven (2) In-Reply-To: <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Message-ID: On Thu, 9 Feb 2006, Rajesh N wrote: > Can anybody tell me how to overcome these EXCEPTIONS > I AM WORKING ON SERIAL COMMN IN JAVA ON LINUX. > > 1. " NOT ALL PARAMETERS SUPPORTED BY THE KERNEL" > > This i came across the following statement inmy prog. > SerialP is A SerialPort object > SerialP.setSerialPortParams(9600(BAUDRATE),DATABITS_8,STOPBITS_1,PARITY_NONE) > Strange. The parameters you use are the same the port should open with by default. Could you paste the actual exception you are getting? I don't see that in the rxtx source. Also it would help to know the rxtx version. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Fri Feb 10 15:29:05 2006 From: lux at diesel-research.com (Kim Lux) Date: Fri, 10 Feb 2006 15:29:05 -0700 Subject: [Rxtx] One serial port object for both sending and receiving ? Message-ID: <1139610545.18177.4.camel@zd7280> Is it OK to use one SerialPort ojbect (ex Serial Port serialPort;) and use it for both sending and receiving ? For example: ======================================================================== static SerialPort serialPort = null; static OutputStream serialOut = null; static InputStream serialIn = null; // assign it to an outputStream for use try{ serialOut = serialPort.getOutputStream(); System.out.println("Serial output stream has been assigned."); }//try catch(IOException e) { System.out.println("Error: Couldn't assign output stream to serial port."); }//catch //assign it to an inputStream for use try{ serialIn = serialPort.getInputStream(); System.out.println("Serial input stream has been assigned."); }//try catch(IOException e) { System.out.println("Error: Couldn't assign input stream to serial port."); }//catch ======================================================================== -- Kim Lux, Diesel Research Inc. From lux at diesel-research.com Fri Feb 10 21:23:00 2006 From: lux at diesel-research.com (Kim Lux) Date: Fri, 10 Feb 2006 21:23:00 -0700 Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Message-ID: <1139631780.23882.10.camel@zd7280> I've got a problem receiving chars with my version of serialRead, written in an SWT GUI. I had a Java pro have a good look at my code and he can't see anything wrong with it. I can send chars fine. When I receive a char the cpu usage for the app goes to 100% and the code in the serial event handler doesn't get executed. The instructions on the Java Comm Serial API How-To for Linux page state that I must install javacomm. Is that true ? Everything builds without it and I can send chars on rxtx just fine, but I can't receive them. Could this be the problem ? I downloaded and installed javacomm. I was not able to add "Driver=gnuio.RXTXCommDriver to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 installed in /usr/java/jre1.5.0_05. I added comm.jar to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext to the library paths. Is this OK ? Does it matter that I am receiving on /dev/ttyUSB0 ? Thanks. -- Kim Lux, Diesel Research Inc. From lunareclipse03 at web.de Sat Feb 11 09:44:46 2006 From: lunareclipse03 at web.de (lunareclipse03@web.de) Date: Sat, 11 Feb 2006 17:44:46 +0100 Subject: [Rxtx] Question about Serial I/O under Win32 Message-ID: <662084330@web.de> Hello everybody, I have a strange problem with a piece of code I made for myself. No, this is not really concerning rxtx, but nevertheless I post this to the list, hoping that some of you can help me. I've written two libraries, one for linux and one for win32. The linux port works quite well, I can send / receive faxes and / or replay voice messages over the telephone line using a voice modem. But the win32 port of the library causes some trouble. If, for example, I send out a fax with a certain modem under linux, it works well. The fax is complete when it comes out of the fax machine. If I then use the same modem to send out a fax under win32, the fax coming out of the fax machine gets "stuck" halfways, but the sending modem thinks that transmission was ok and drops the connection. The answering fax machine then gives me "error while receiving." The "upper layer" java code MUST be right, because if I do the same thing under linux (using the linux library), everything is alright. Now I have to ask: Can somebody please help me out with this??!? Could it be the case that some kind of flow control or COMMTIMEOUTS setting causes this behaviour? I set flow control to RTS/CTS before sending out a fax. How can I DISABLE flow control? Or what do you think? Can something else cause this problems? Thank you all for your time and PLEASE write back soon. Regards, --Sven Ahlemann Am Waldrand 31 45721 Haltern am See Germany ______________________________________________________________ Verschicken Sie romantische, coole und witzige Bilder per SMS! Jetzt bei WEB.DE FreeMail: http://f.web.de/?mc=021193 From lux at diesel-research.com Sat Feb 11 10:06:52 2006 From: lux at diesel-research.com (Kim Lux) Date: Sat, 11 Feb 2006 10:06:52 -0700 Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: <1139631780.23882.10.camel@zd7280> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> <1139631780.23882.10.camel@zd7280> Message-ID: <1139677612.3431.5.camel@zd7280> More on this problem. I copied and pasted simpleRead into a console based Eclipse project and I've got the same result, except that cpu usage doesn't go to 100%. I'm beginning to think there is an issue in rxtx. My imports for simpleRead are: ============================ import gnu.io.*; import java.util.*; //import javax.comm.*; import java.io.*; =========================== Any ideas ? I am trying to read from /dev/ttyUSB0 using a serial to USB adapter which has worked well with minicom and gtkterm. Thanks. On Fri, 2006-02-10 at 21:23 -0700, Kim Lux wrote: > I've got a problem receiving chars with my version of serialRead, > written in an SWT GUI. > > I had a Java pro have a good look at my code and he can't see anything > wrong with it. > > I can send chars fine. When I receive a char the cpu usage for the app > goes to 100% and the code in the serial event handler doesn't get > executed. > > The instructions on the Java Comm Serial API How-To for Linux page state > that I must install javacomm. Is that true ? Everything builds without > it and I can send chars on rxtx just fine, but I can't receive them. > Could this be the problem ? > > I downloaded and installed javacomm. I was not able to add > "Driver=gnuio.RXTXCommDriver > to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not > have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 > installed in /usr/java/jre1.5.0_05. I added comm.jar > to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext > to the library paths. Is this OK ? > > Does it matter that I am receiving on /dev/ttyUSB0 ? > > Thanks. > -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Sun Feb 12 21:01:33 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:01:33 -0700 (MST) Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: <1139677612.3431.5.camel@zd7280> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> <1139631780.23882.10.camel@zd7280> <1139677612.3431.5.camel@zd7280> Message-ID: I suspect what is happening is the select() is breaking out in the native code but the driver does not have support for notifying there are X bytes available. On some traditional Unix based systems, the only way you know data is available is the fd status changes and do an FIORDCHK ioctl. Or perhaps the only thing you can know is the fd status changed. It would take reading through the kernel driver code to know for sure. So on USB, depending upon the driver, the same may need to be done or the driver improved a bit if possible to support. Polling reads will also work but don't use the event driven model of CommAPI which isnt acceptable in the long run. The 100% cpu usage can then be explained because select no longer blocks until the data is read; the eventLoop spins loose. You can put a well placed sleep but rxtx only expects those are needed when it knows data is available. This may not be a super simple thing to understand and fix. I do have ideas to get you started. I'm going to be short on time the next couple weeks. I expect to put some good time in and answer some other questions I saw around the 25th. For now, I'd look at the following and go from there with the hints I've given. JNIEXPORT jint JNICALL RXTXPort(nativeavailable)( JNIEnv *env, jobject jobj ) { int fd = get_java_var( env, jobj,"fd","I" ); int result; /* char message[80]; ENTER( "RXTXPort:nativeavailable" ); On SCO OpenServer FIONREAD always fails for serial devices, so try ioctl FIORDCHK instead; will only tell us whether bytes are available, not how many, but better than nothing. This turns out to be true on Solaris also. taj. */ #ifdef FIORDCHK /* __unixware__ __sun__ probably others */ result = ioctl(fd, FIORDCHK, 0); #else if( ioctl( fd, FIONREAD, &result ) < 0 ) { goto fail; } #endif /* FIORDCHK */ On Sat, 11 Feb 2006, Kim Lux wrote: > > More on this problem. I copied and pasted simpleRead into a console > based Eclipse project and I've got the same result, except that cpu > usage doesn't go to 100%. I'm beginning to think there is an issue in > rxtx. > > My imports for simpleRead are: > > ============================ > import gnu.io.*; > import java.util.*; > //import javax.comm.*; > import java.io.*; > =========================== > > Any ideas ? I am trying to read from /dev/ttyUSB0 using a serial to > USB adapter which has worked well with minicom and gtkterm. > > Thanks. > > > > On Fri, 2006-02-10 at 21:23 -0700, Kim Lux wrote: >> I've got a problem receiving chars with my version of serialRead, >> written in an SWT GUI. >> >> I had a Java pro have a good look at my code and he can't see anything >> wrong with it. >> >> I can send chars fine. When I receive a char the cpu usage for the app >> goes to 100% and the code in the serial event handler doesn't get >> executed. >> >> The instructions on the Java Comm Serial API How-To for Linux page state >> that I must install javacomm. Is that true ? Everything builds without >> it and I can send chars on rxtx just fine, but I can't receive them. >> Could this be the problem ? >> >> I downloaded and installed javacomm. I was not able to add >> "Driver=gnuio.RXTXCommDriver >> to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not >> have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 >> installed in /usr/java/jre1.5.0_05. I added comm.jar >> to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext >> to the library paths. Is this OK ? >> >> Does it matter that I am receiving on /dev/ttyUSB0 ? >> >> Thanks. >> > From tjarvi at qbang.org Sun Feb 12 21:03:30 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:03:30 -0700 (MST) Subject: [Rxtx] One serial port object for both sending and receiving ? In-Reply-To: <1139610545.18177.4.camel@zd7280> References: <1139610545.18177.4.camel@zd7280> Message-ID: On Fri, 10 Feb 2006, Kim Lux wrote: > > Is it OK to use one SerialPort ojbect (ex Serial Port serialPort;) and > use it for both sending and receiving ? > > For example: > > ======================================================================== > static SerialPort serialPort = null; > static OutputStream serialOut = null; > static InputStream serialIn = null; > > > > > // assign it to an outputStream for use > try{ > serialOut = serialPort.getOutputStream(); > System.out.println("Serial output stream has been assigned."); > }//try > catch(IOException e) > { > System.out.println("Error: Couldn't assign output stream to serial > port."); > }//catch > > > //assign it to an inputStream for use > try{ > serialIn = serialPort.getInputStream(); > System.out.println("Serial input stream has been assigned."); > }//try > catch(IOException e) > { > System.out.println("Error: Couldn't assign input stream to serial > port."); > }//catch This should be fine. In fact trying to do it another way will probably not work as you will run into lockfile issues. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun Feb 12 21:13:13 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:13:13 -0700 (MST) Subject: [Rxtx] Question about Serial I/O under Win32 In-Reply-To: <662084330@web.de> References: <662084330@web.de> Message-ID: On Sat, 11 Feb 2006 lunareclipse03 at web.de wrote: > Hello everybody, > > I have a strange problem with a piece of code I made for myself. No, > this is not really concerning rxtx, but nevertheless I post this to the > list, hoping that some of you can help me. I've written two libraries, > one for linux and one for win32. The linux port works quite well, I can > send / receive faxes and / or replay voice messages over the telephone > line using a voice modem. But the win32 port of the library causes some > trouble. If, for example, I send out a fax with a certain modem under > linux, it works well. The fax is complete when it comes out of the fax > machine. If I then use the same modem to send out a fax under win32, the > fax coming out of the fax machine gets "stuck" halfways, but the sending > modem thinks that transmission was ok and drops the connection. The > answering fax machine then gives me "error while receiving." The "upper > layer" java code MUST be right, because if I do the same thing under > linux (using the linux library), everything is alright. Now I have to > ask: Can somebody please help me out with this??!? Could it be the case > that some kind of flow control or COMMTIMEOUTS setting causes this > behaviour? I set flow control to RTS/CTS before sending out a fax. How > can I DISABLE flow control? Or what do you think? Can something else > cause this problems? Thank you all for your time and PLEASE write back > soon. > Hi Sven I'm not too willing to talk about flow control at the low level until I confirm some things with test equipment later. It is not clear if you are using rxtx or writing your own native code. So I'm not sure how to answer much of this :) If you are wondering how to change the flow control using rxtx from java, The BlackBox example from Sun flips this back and forth. SerialPort.java in rxtx 2.1 uses the following: SerialPort.java: public static final int FLOWCONTROL_NONE =0; SerialPort.java: public static final int FLOWCONTROL_RTSCTS_IN =1; SerialPort.java: public static final int FLOWCONTROL_RTSCTS_OUT =2; SerialPort.java: public static final int FLOWCONTROL_XONXOFF_IN =4; SerialPort.java: public static final int FLOWCONTROL_XONXOFF_OUT=8; So if you set flowcontrol to RTSCTS, you can set it to NONE to turn it off. If you are looking for how to do it in native code, the rxtx Source is SerialImp.c (unix/linux/mac os x/w32) and termios.c (w32 only with SerialImp.c) You can track the code: SerialImp.c:JNIEXPORT void JNICALL RXTXPort(setflowcontrol)( JNIEnv *env, jobject jobj, jint flowmode ) termios.c:int tcgetattr( int fd, struct termios *s_termios ) termios.c:int tcsetattr( int fd, int when, struct termios *s_termios ) There may be a problem in the rxtx flow control code though. Rather than guess, I want to test this with a gold standard. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Feb 6 00:00:16 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 00:00:16 -0700 (MST) Subject: [Rxtx] wiki delay until tomorrow night. In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: On Sun, 5 Feb 2006, Trent Jarvi wrote: > On Sun, 5 Feb 2006, Kim Lux wrote: > >> usb ? Tell me more... I need that too. > > usb is a very proper design. Thats all it is. > Maybe rxtx could help usb. But it would start with helping bring back the community that was already there. It's not something I'd love to do but maybe its the right thing to do. It would probably take 2 years to do right. But maybe thats better than what we have now. I honestly don't know what IBM is doing which could just run over everything. Just some thoughts after some fine german wine. -- Trent Jarvi tjarvi at qbang.org From gadelavega at yahoo.com.ar Mon Feb 6 02:17:05 2006 From: gadelavega at yahoo.com.ar (Gonzalo A. de la Vega) Date: Mon, 06 Feb 2006 10:17:05 +0100 Subject: [Rxtx] Serial port ownership question In-Reply-To: References: <20060205113618.30274.qmail@web53501.mail.yahoo.com> <1139157422.4553.9.camel@zd7280> <1139158698.4936.9.camel@zd7280> Message-ID: <43E71411.4050402@yahoo.com.ar> On my Fedora Core 4: ls -l /dev/ttyS* crw-rw---- 1 root uucp 4, 64 Feb 6 2006 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Feb 6 2006 /dev/ttyS1 ... and: grep "ttyUSB" /etc/udev/rules.d/50-udev.rules KERNEL=="ttyUSB*", GROUP="uucp", MODE="0660" So anyone in the "uucp" group can use serial ports. On Gentoo the group is "tty". Trent Jarvi escribi?: > > > On Sun, 5 Feb 2006, Dr. Douglas Lyon wrote: > >> I can confirm that this is the case (only root ownership of >> serial ports, under fedora 4). >> Wow, what were they thinking?! >> - DL >> >>> I've found that the newer kernels have the serial ports owned by root. >>> For example, >>> >>> $ls -al /dev/tty* >>> crw-rw-rw- 1 root root 5, 0 Feb 5 02:06 /dev/tty >>> crw-rw---- 1 root root 4, 0 Feb 5 02:06 /dev/tty0 >>> crw------- 1 root root 4, 1 Feb 5 09:07 /dev/tty1 >>> crw-rw---- 1 root tty 4, 10 Feb 5 02:06 /dev/tty10 >>> crw-rw---- 1 root tty 4, 11 Feb 5 02:06 /dev/tty11 >>> ... > > > This is just not a problem jcp or such are going to solve. Its a > platform spitwad fight. But do look at pam. In fact thats what Sun > is doing too. Maybe Linux followed their lead.. I'm not a pam guy. > I've spent 16 hours trying to understand it but your users wont :) > > Solution? I have no clue. Its two tangent mentalities from my > perspective. > > -- > Trent Jarvi > tjarvi at qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mtnvega at yahoo.com.br Mon Feb 6 05:35:43 2006 From: mtnvega at yahoo.com.br (Luiz Jr) Date: Mon, 6 Feb 2006 12:35:43 +0000 (GMT) Subject: [Rxtx] Documentation Wiki In-Reply-To: <1139157422.4553.9.camel@zd7280> Message-ID: <20060206123543.57256.qmail@web53515.mail.yahoo.com> Hello, Thank you for you answer, but so the usage of the API is pretty much like the Java Communications Api? If yes, what version of the Java Comm Api? Thank you, Luiz A. Brandao Jr Kim Lux escreveu: On Sun, 2006-02-05 at 08:36 -0300, Luiz Jr wrote: > Hello, > > I want to start using the RXTX libraries, but I would to know how, > since I can not access the documentation wiki page I just started using them yesterday. Below is how I installed the libraries, if that helps. I used snippets of code from the SimpleWrite application here to get me going. http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html Instead of "import javax.comm.*;", use "import gnu.io.*;" which is gotten from RXTXcomm.jar, which you will need to include in your project references. I am working in Eclipse. BTW: there is no way to open a port without going through the port list and finding it. Maybe sometime in the future someone (me ?) will write a method called openSerialPort that allows the user to give a port identifier, such as "/dev/tty1" and return a port ready to use. It wouldn't take much to write that and it would save users a lot of code. Hope this helps. ======================================================================= 1) Figure out which java you are running, incase there is more than one installed. $ java -version java version "1.5.0_05" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_05-b05) Java HotSpot(TM) Client VM (build 1.5.0_05-b05, mixed mode, sharing) 2) Find all the jre directories and the one from which you are currently running. kfind (jre) 3) cd to that directory plus /lib/i386 cd /usr/java/jre1.5.0_05/lib/i386 4) Copy the library files (*.so) to that directory. cp /home/krlux/Desktop/'Java Controls'/rxtx-linux/bin/* . 5) Check that the copy was successful ls librxtx* librxtxI2C.so librxtxRaw.so librxtxSerial.so librxtxParallel.so librxtxRS485.so 6) cd to the /lib/ext directory for your java. cd /usr/java/jre1.5.0_05/lib/ext 7) Copy the Jar files there cp /home/krlux/Desktop/'Java Controls'/rxtx-linux/lib/ext/* . 8) Check that it was successful ls RXTX* RXTXcomm.jar Rxtx is now installed on your machine ready to use. =================================================================== -- Kim Lux, Diesel Research Inc. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx --------------------------------- Yahoo! Acesso Gr?tis - Internet r?pida e gr?tis. Instale o discador agora! -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/544aa403/attachment-0057.html From lyon at docjava.com Mon Feb 6 05:49:34 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 06 Feb 2006 07:49:34 -0500 Subject: [Rxtx] wiki delay until tomorrow night. In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: Hi All, I have often thought about USB drivers being needed. For example, the ironman watch will not interface to a mac (windows only). It is USB. My dymo label writer has no Java driver (native only). Etc. Most cheap web cameras are USB (and Java drivers go through JAI, if it supports the camera at all). The JAI code shows how sun did the USB drivers. You have to be a member of the jai project to download the source code. https://jai.dev.java.net has the jai distro. And then you are not allowed to redistribute it. However, we can all learn from it (if so inclined). Basically: cvs -d :pserver:lyon at cvs.dev.java.net:/cvs login cvs -d :pserver:lyon at cvs.dev.java.net:/cvs checkout jai-core You will need to user your own uid and pw to get in. The ant build has over 100 warnings from sun deprecations of its own code. You might say that they were hoisted on their own Picard ;) One interesting thing is that they support several platforms: linux-amd64 64-bit Linux-AMD64 linux-i586 32-bit Linux-x86 solaris-amd64 64-bit Solaris-AMD64 solaris-i586 32-bit Solaris-x86 solaris-sparc 32-bit Solaris-SPARC solaris-sparcv9 64-bit Solaris-SPARC windows-i586 32-bit Windows-x86 Thus, ant is used to provide a multi-platform native method distro. Neat. How do they do it? check this out: And: The core download does not contain any C source code (it was all pre-built). Basically, they are just copying .so and .dll files into build directories. I would love to see the C code for this...but Sun does not post it on the https://jai.dev.java.net site. I don't know why...Perhaps I missed it. - Doug >On Sun, 5 Feb 2006, Trent Jarvi wrote: > >>On Sun, 5 Feb 2006, Kim Lux wrote: >> >>>usb ? Tell me more... I need that too. >> >>usb is a very proper design. Thats all it is. >> > >Maybe rxtx could help usb. But it would start with helping bring >back the community that was already there. > >It's not something I'd love to do but maybe its the right thing to do. > >It would probably take 2 years to do right. But maybe thats better >than what we have now. > >I honestly don't know what IBM is doing which could just run over everything. > >Just some thoughts after some fine german wine. > >-- >Trent Jarvi >tjarvi at qbang.org > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tdelenik at gmail.com Mon Feb 6 05:56:32 2006 From: tdelenik at gmail.com (Thanasis Delenikas) Date: Mon, 6 Feb 2006 14:56:32 +0200 Subject: Fwd: [Rxtx] Documentation Wiki In-Reply-To: <1139157422.4553.9.camel@zd7280> References: <20060205113618.30274.qmail@web53501.mail.yahoo.com> <1139157422.4553.9.camel@zd7280> Message-ID: <310a1a930602060456t129f1dc6p5f2b908f13ab5a0b@mail.gmail.com> Hello all, Kim, this is a snippet from the code I use. The closest to directly opening a specific port without enumeration. << ... portId = CommPortIdentifier.getPortIdentifier(getPort()); serialPort = (SerialPort) portId.open("jSMSEngine", 1971); ... >> where getPort() return the string identifier of the port, i.e. "/dev/ttyS0" or "COM1" or whatever. Thanasis. ---------- Forwarded message ---------- From: Kim Lux Date: Feb 5, 2006 6:37 PM Subject: Re: [Rxtx] Documentation Wiki To: RXTX Developers and Users BTW: there is no way to open a port without going through the port list and finding it. Maybe sometime in the future someone (me ?) will write a method called openSerialPort that allows the user to give a port identifier, such as "/dev/tty1" and return a port ready to use. It wouldn't take much to write that and it would save users a lot of code. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/182ab5b8/attachment-0057.html From tjarvi at qbang.org Mon Feb 6 11:53:57 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 11:53:57 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: On Mon, 6 Feb 2006, Dr. Douglas Lyon wrote: > Hi All, > I have often thought about USB drivers being needed. > For example, the ironman watch will not interface > to a mac (windows only). It is USB. > My dymo label writer has no Java driver (native only). > Etc. > Most cheap web cameras are USB (and Java drivers go > through JAI, if it supports the camera at all). > The JAI code shows how sun did the USB drivers. > You have to be a member of the jai project to download > the source code. > https://jai.dev.java.net has the jai distro. > And then you are not allowed to redistribute it. However, > we can all learn from it (if so inclined). Basically: > cvs -d :pserver:lyon at cvs.dev.java.net:/cvs login > cvs -d :pserver:lyon at cvs.dev.java.net:/cvs checkout jai-core > You will need to user your own uid and pw to get in. > The ant build has over 100 warnings from sun deprecations > of its own code. > > You might say that they were hoisted on their own Picard ;) > > One interesting thing is that they support several platforms: > linux-amd64 64-bit Linux-AMD64 > linux-i586 32-bit Linux-x86 > solaris-amd64 64-bit Solaris-AMD64 > solaris-i586 32-bit Solaris-x86 > solaris-sparc 32-bit Solaris-SPARC > solaris-sparcv9 64-bit Solaris-SPARC > windows-i586 32-bit Windows-x86 > Thus, ant is used to provide a multi-platform native method distro. > Neat. > How do they do it? > check this out: > > > > > > > > > > > > > And: > > > > > > > > > > The core download does not contain any C source code (it was all pre-built). > Basically, they are just copying .so and .dll files into build directories. > > I would love to see the C code for this...but Sun does not post it on the > https://jai.dev.java.net site. > > I don't know why...Perhaps I missed it. > > - Doug > > I've looked at moving rxtx to Ant builds. I think that would help IDEs a great deal. I requested a evalutation desk copy the O'Reilly Ant book for some j2ee material I was teaching. http://www.oreilly.com/catalog/anttdg/ It has a one sentence mention of JNI. So there was not luck there. I saw that there is another Ant book that does mention JNI more. I can't find it now. Ant must be able to support it with extensions. http://ant.apache.org/manual/OptionalTasks/javah.html What the auto(break :) tools do in the rxtx build is 4 things really. 1) gcc compile flags 2) ld compile flags 3) config.h 4) compile flags for customizing rxtx (lockfiles, ...) See 1 All of this information except 4 can be static once obtained. So I'm not attached to the auto tools. If I could find an example of Ant being used for JNI code, I'd be one of the first to start moving that direction. Maybe someone saw an example someplace. The other thing we have not completed discussing is the directory structure. There is interest in making rxtx more IDE friendly. I get more mail about that off the list than how to install rxtx. And I see we have Ken Thompson in da house :) He is our trusted CVS maintainer and the guy that purchased the rxtx.org domain. Old community. We will need Ken for changing the directory structure of source. I would like to open up discussion about both of these as it is more than time. The problem is I have little experience with Ant and even less with IDEs. It would be nice if we could work with Eclipse and NetBeans. http://www.netbeans.org/ (sun and some community) http://www.eclipes.org (ibm,rhat,... perhaps more community) http://maven.apache.org/what-is-maven.html (apache. It is community) borland should sortof be here too but I think thats covered in eclipse. >From what I understand so far, we should morph rxtx to support those three maybe trusting apaches lead with maven. But I use vi. I have little to no clues beyond what people have fed me. Can we agree that thats the right direction to go? -- Trent Jarvi tjarvi at qbang.org From brian at mbari.org Mon Feb 6 14:57:50 2006 From: brian at mbari.org (Brian Schlining) Date: Mon, 6 Feb 2006 13:57:50 -0800 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> > The other thing we have not completed discussing is the directory > structure. There is interest in making rxtx more IDE friendly. I > get more mail about that off the list than how to install rxtx. > > And I see we have Ken Thompson in da house :) He is our trusted > CVS maintainer and the guy that purchased the rxtx.org domain. Old > community. We will need Ken for changing the directory structure of > source. > > I would like to open up discussion about both of these as it is > more than time. The problem is I have little experience with Ant > and even less with IDEs. It would be nice if we could work with > Eclipse and NetBeans. > > http://www.netbeans.org/ (sun and some community) > http://www.eclipes.org (ibm,rhat,... perhaps more community) > http://maven.apache.org/what-is-maven.html (apache. It is community) > borland should sortof be here too but I think thats covered in > eclipse. > >> From what I understand so far, we should morph rxtx to support >> those three > maybe trusting apaches lead with maven. But I use vi. I have > little to no clues beyond what people have fed me. > Maven likes the directory structure below for Java code. (From http:// maven.apache.org/guides/getting-started/index.html) This structure works fine with ant, netbeans, and eclipse. rxtx_root_directory `-- src |-- main | `-- java | `-- gnu | `-- io `-- test `-- java `-- gnu `-- io Brian Schlining Software Engineer http://www.mbari.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/d9451eba/attachment-0057.html From tjarvi at qbang.org Mon Feb 6 15:11:45 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 15:11:45 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: > rxtx_root_directory > `-- src > |-- main > | `-- java > | `-- gnu > | `-- io > `-- test > `-- java > `-- gnu > `-- io > >From what I understand this will just be good. For me it makes no difference. So lets do the rxtx thing. Let if fester for two weeks and if nobody objects, we will do it. I'm not doing this because I care. I'm doing this to eliminate much of my inbox. But test... man is rxtx lacking there in the community aspect. It is covered but not right. _maybe_ I can change that this year. -- Trent Jarvi tjarvi at qbang.org (cat hurding since 1997) From lux at diesel-research.com Mon Feb 6 21:38:49 2006 From: lux at diesel-research.com (Kim Lux) Date: Mon, 06 Feb 2006 21:38:49 -0700 Subject: [Rxtx] How can I use Lock Files with rxtx (in FC4) ? Message-ID: <1139287129.17031.3.camel@zd7280> I am now running an rxtx application on FC4. I am getting: ========================================================= check_group_uucp(): error testing lock file creation Error details: Permission denied check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL ========================================================= $ ls -al /var/lock total 32 drwxrwxr-x 4 root lock 4096 Feb 6 16:04 . drwxr-xr-x 24 root root 4096 Nov 14 01:19 .. drwx------ 2 root root 4096 Apr 27 2005 lvm drwxr-xr-x 2 root root 4096 Feb 6 16:04 subsys How do I fix this for regulator users ? -- Kim Lux, Diesel Research Inc. From dmarkman at mac.com Mon Feb 6 22:24:44 2006 From: dmarkman at mac.com (Dmitry Markman) Date: Tue, 7 Feb 2006 00:24:44 -0500 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: if I understands the issue right in order to be able to use ant for c/c++ compilation you have to install ant's cc task http://ant-contrib.sourceforge.net/cc.html it looks like it should work on mac os x (authors claim, that it's platform independent) but I never tested so all you have to do it's providing right command line for the gcc compiler On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: >> rxtx_root_directory >> `-- src >> |-- main >> | `-- java >> | `-- gnu >> | `-- io >> `-- test >> `-- java >> `-- gnu >> `-- io >> > > >> From what I understand this will just be good. > > For me it makes no difference. So lets do the rxtx thing. Let if > fester for two weeks and if nobody objects, we will do it. > > I'm not doing this because I care. I'm doing this to eliminate > much of my inbox. > > But test... man is rxtx lacking there in the community aspect. It > is covered but not right. _maybe_ I can change that this year. > > -- > Trent Jarvi > tjarvi at qbang.org > (cat hurding since 1997) > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx Dmitry Markman From lux at diesel-research.com Mon Feb 6 23:20:15 2006 From: lux at diesel-research.com (Kim Lux) Date: Mon, 06 Feb 2006 23:20:15 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? Message-ID: <1139293215.3689.4.camel@zd7280> I'm running the code below. portlist.hasMoreElements() is false. /dev has ports in it as listed below. What am I doing wrong ? ========================================================== // Step through the list of ports until we find one that matches // the one we are looking for. portList = CommPortIdentifier.getPortIdentifiers(); while(portList.hasMoreElements()) { portID = (CommPortIdentifier) portList.nextElement(); // if (portID.getName().equals("/dev/ttyUSB0")) { myTA.append("Serial port ttyUSB0 has been found\n"); break; }// if portID equals... }// End of while... ========================================================== ls -al /dev/tty* crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 ... crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 -- Kim Lux, Diesel Research Inc. From david.garnier at trusted-logic.com Tue Feb 7 00:46:30 2006 From: david.garnier at trusted-logic.com (David Garnier) Date: Tue, 07 Feb 2006 08:46:30 +0100 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: <43E85056.2090608@trusted-logic.com> Hello, I think that the make-based build process is fine as it is, apart from the location of the Java source files. It is true that putting the Java source in a directory structure that map 1-to-1 to the Java package structure is the norm and should make it easier for everyone to modify the Java source, with or without an IDE. Ant is a good tool, but in the RXTX case I fail to see the advantage of using it compared to the current make-based process. As Trent said, they are more pressing issues, like testing. Regards, David Dmitry Markman wrote: > if I understands the issue right > in order to be able to use ant for c/c++ compilation > you have to install ant's cc task > http://ant-contrib.sourceforge.net/cc.html > > it looks like it should work on mac os x > (authors claim, that it's platform independent) > but I never tested > > so all you have to do it's providing right command line > for the gcc compiler > > > > > On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: > >>> rxtx_root_directory >>> `-- src >>> |-- main >>> | `-- java >>> | `-- gnu >>> | `-- io >>> `-- test >>> `-- java >>> `-- gnu >>> `-- io >>> >> >> >>> From what I understand this will just be good. >> >> For me it makes no difference. So lets do the rxtx thing. Let if >> fester for two weeks and if nobody objects, we will do it. >> >> I'm not doing this because I care. I'm doing this to eliminate much >> of my inbox. >> >> But test... man is rxtx lacking there in the community aspect. It is >> covered but not right. _maybe_ I can change that this year. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> (cat hurding since 1997) From tjarvi at qbang.org Tue Feb 7 01:11:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 01:11:31 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <43E85056.2090608@trusted-logic.com> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: On Tue, 7 Feb 2006, David Garnier wrote: > Hello, > > I think that the make-based build process is fine as it is, apart from the location of the Java > source files. It is true that putting the Java source in a directory structure that map 1-to-1 to > the Java package structure is the norm and should make it easier for everyone to modify the Java > source, with or without an IDE. > > Ant is a good tool, but in the RXTX case I fail to see the advantage of using it compared to the > current make-based process. As Trent said, they are more pressing issues, like testing. > Hi David I have more experience with testing rxtx than I can talk about. But let it be known, rxtx has gone trough 100's of hours of testing. We are hobby folks interested in toys but there is more. rxtx has had some of the best guidance in the industry there. This is not an easy thing. I may be able to come back in a month from the other side of the corperate fence and help. I suspect the tests could just be made public but they are in a very unusual environment that just wont work in a wider sense. This is something I'll be trying to change. At one point it was agreed we could just make the results public so this isnt just noise.. There is interest and I think its safe to mention that much. The big problem with testing in the past is most of it is done with a loopback connection. So we *still* have major questions regarding things like flow control. rxtx talks to itself over a loopback and it works. regardless of right or wrong. This requires more thought to be done right. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Feb 7 02:46:34 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 02:46:34 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: > The big problem with testing in the past is most of it is done with a > loopback connection. So we *still* have major questions regarding things > like flow control. rxtx talks to itself over a loopback and it works. > regardless of right or wrong. With serial communication there are gold standards. ckermit is probably a definitive 'standard.' Maybe its possible to do ping/pong tests with ckermit? Is it scriptable? There are known issues in rxtx. Probably the worst is some threading issues regarding some JREs with multiple JNI threads setting java variables. Man did I get schooled there. Just switch the c functions to returning variables and things go away. Sometimes they work fine, sometimes they blow up. Without understanding everything, somehow rhat got it right and debian (and especially gentoo) grabbed kernel patches causing all sort of harm. Its not hard to fix once you understand whats going on but nearly impossible to track with a debugger. So I have a good idea what 2.1-8 will have outside of the IDE modifications. rxtx 2.1-7 is a release for everyone to sync with. Its not even as stable as -pre17 as far as I know - I ran no test suites. I'll be chasing it too. We just had so many contributions that it was time. It seriously broke internal scheduals but thats a great thing :) The other thing I want to do in 2.1-8 is automagic baud rates. It turns out lots of shops are doing really funky baud rates for things like automobile test equipment. It is possible but it requires a fair amount of change in the native code. Is anyone looking at this? -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Feb 7 02:57:21 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 07 Feb 2006 04:57:21 -0500 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <43E85056.2090608@trusted-logic.com> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: Hi All, I agree, testing is very important. The problem I have been trying to address is related to cross-platform testing and the robust nature of the installs. Typically, I visit 3 platforms to deploy my product, windows, linux and mac. A build is performed on each platform. The idea that you can build for many platforms from one copy the source code seems attractive. This should enable synchronized deployments of identical code. The question of how to achieve this goal remains open. As Trent mentioned, this is hard. Perhaps Ant will help here (but perhaps not). Ant does seem to help with running unit tests. However, it does not help with multi-platform tests. For that you need many machines and different operating environments. Toward that end, I have created a multi-platform test that can be run from web start, located at: http://show.docjava.com:8086/book/cgij/code/jnlp/serialPort.PortTest.jnlp This is interesting because many people in the community can run the test and we can improve the test, as time permits. No, it is not a perfect solution, however, the idea does help with multi-platform tests using many machines and different operating environments. If the group has a good test for a general serial port set-ups, i would be happy to deploy it, for general evaluation using web start. And as for ANT, it is just an idea. Not all my ideas are good ones! - Doug >Hello, > >I think that the make-based build process is fine as it is, apart >from the location of the Java >source files. It is true that putting the Java source in a directory >structure that map 1-to-1 to >the Java package structure is the norm and should make it easier for >everyone to modify the Java >source, with or without an IDE. > >Ant is a good tool, but in the RXTX case I fail to see the advantage >of using it compared to the >current make-based process. As Trent said, they are more pressing >issues, like testing. > >Regards, >David > >Dmitry Markman wrote: >> if I understands the issue right >> in order to be able to use ant for c/c++ compilation >> you have to install ant's cc task >> http://ant-contrib.sourceforge.net/cc.html >> >> it looks like it should work on mac os x >> (authors claim, that it's platform independent) >> but I never tested >> >> so all you have to do it's providing right command line >> for the gcc compiler >> >> >> >> >> On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: >> >>>> rxtx_root_directory >>>> `-- src >>>> |-- main >>>> | `-- java >>>> | `-- gnu >>>> | `-- io >>>> `-- test >>>> `-- java >>>> `-- gnu >>>> `-- io >>>> >>> >>> >>>> From what I understand this will just be good. >>> >>> For me it makes no difference. So lets do the rxtx thing. Let if >>> fester for two weeks and if nobody objects, we will do it. >>> >>> I'm not doing this because I care. I'm doing this to eliminate much >>> of my inbox. >>> >>> But test... man is rxtx lacking there in the community aspect. It is >>> covered but not right. _maybe_ I can change that this year. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> (cat hurding since 1997) > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From matt.higgins at gmail.com Tue Feb 7 08:28:34 2006 From: matt.higgins at gmail.com (Matt Higgins) Date: Tue, 7 Feb 2006 10:28:34 -0500 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final Message-ID: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? import java.io.*; import java.util.*; import gnu.io.*; public class MySimpleRead implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; public static void main(String[] args) { boolean portFound = false; String defaultPort = "COM1"; if (args.length > 0) { defaultPort = args[0]; } portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; MySimpleRead reader = new MySimpleRead(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } } public MySimpleRead() { try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) { e.printStackTrace(); } try { inputStream = serialPort.getInputStream(); } catch (IOException e) { e.printStackTrace(); } try { serialPort.addEventListener(this); } catch (TooManyListenersException e) { e.printStackTrace(); } try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { e.printStackTrace(); } System.out.println("Baud is " + serialPort.getBaudRate()); System.out.println("Bits is " + serialPort.getDataBits()); System.out.println("Stop is " + serialPort.getStopBits()); System.out.println("Par is " + serialPort.getParity()); serialPort.notifyOnDataAvailable(true); readThread = new Thread(this); readThread.start(); } public void run() { // Thread.sleep(20000); //} catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { System.out.println("An event occurred " + event.getEventType()); switch (event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: byte[] readBuffer = new byte[20]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } System.out.print(new String(readBuffer)); } catch (IOException e) {} break; } } } --------------- Result on windows ------------------------------ Stable Library ============================================================== Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port:: COM1 Baud is 9600 Bits is 8 Stop is 1 Par is 0 ----------------- End Results ----------------------------------------- ------------------ Result on Linux ----------------------------------- Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 Found port: /dev/ttyS0 Baud is 9600 Bits is 8 Stop is 1 Par is 0 An event occurred 1 043100066224 ------------------ End Results --------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/a1431630/attachment-0057.html From brian at mbari.org Tue Feb 7 09:48:37 2006 From: brian at mbari.org (Brian Schlining) Date: Tue, 7 Feb 2006 08:48:37 -0800 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> Message-ID: <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> Hi Matt > The following code works fine on Linux but I never see any data > when run on Windows. This is a cut and paste from the SimpleRead > example. > I am attempting to read data from a bar code scanner. I can fire > up HyperTermianl on windows and see that the device is working > properly as I see the barcodes are scanned and echoed back to the > terminal. However when I run the app I don't see any data. It is > however associating with the com port as the informational bits > print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. Cheers Brian Schlining Software Engineer http://www.mbari.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/16d07f37/attachment-0057.html From lux at diesel-research.com Tue Feb 7 11:59:58 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 11:59:58 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139293215.3689.4.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> Message-ID: <1139338798.8145.4.camel@zd7280> Any ideas on this ? Any reason why portList.hasMoreElements() should be false even though there are devices in /dev ? On Mon, 2006-02-06 at 23:20 -0700, Kim Lux wrote: > I'm running the code below. > > portlist.hasMoreElements() is false. > > /dev has ports in it as listed below. > > What am I doing wrong ? > > > ========================================================== > // Step through the list of ports until we find one that matches > // the one we are looking for. > > portList = CommPortIdentifier.getPortIdentifiers(); > > while(portList.hasMoreElements()) > { > portID = (CommPortIdentifier) portList.nextElement(); // > if (portID.getName().equals("/dev/ttyUSB0")) > { > myTA.append("Serial port ttyUSB0 has been found\n"); > break; > }// if portID equals... > }// End of while... > ========================================================== > > ls -al /dev/tty* > crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty > crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 > crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 > crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 > crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 > ... > crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 > crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 > crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 > > > -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 12:20:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 12:20:25 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139338798.8145.4.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> Message-ID: On Tue, 7 Feb 2006, Kim Lux wrote: > > Any ideas on this ? Any reason why portList.hasMoreElements() should be > false even though there are devices in /dev ? > > > On Mon, 2006-02-06 at 23:20 -0700, Kim Lux wrote: >> I'm running the code below. >> >> portlist.hasMoreElements() is false. >> >> /dev has ports in it as listed below. >> >> What am I doing wrong ? >> >> >> ========================================================== >> // Step through the list of ports until we find one that matches >> // the one we are looking for. >> >> portList = CommPortIdentifier.getPortIdentifiers(); >> >> while(portList.hasMoreElements()) >> { >> portID = (CommPortIdentifier) portList.nextElement(); // >> if (portID.getName().equals("/dev/ttyUSB0")) >> { >> myTA.append("Serial port ttyUSB0 has been found\n"); >> break; >> }// if portID equals... >> }// End of while... >> ========================================================== >> >> ls -al /dev/tty* >> crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty >> crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 >> crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 >> crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 >> crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 >> ... >> crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 >> crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 >> crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 >> >> >> > Hi Kim What rxtx does is try to open the port and do a timed out read. If the kernel/... do not complain it's enumarted. I suspect you could do a crude test by doing something like cat /dev/ttyS0 > /dev/null If that barfs then rxtx wont enumerate the port. hmm looking at your question again, I suspect it's a lockfile problem. This is documented in INSTALL with the source. Its easy enough to test this too.. touch /var/lock/testingrxtxlockfiles && rm -f /var/lock/testingrxtxlockfiles If you are not in the right group it will bail. Root will work regardless. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 12:37:56 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 12:37:56 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> Message-ID: <1139341076.8145.11.camel@zd7280> Exactly which ports does rxtx attempt to put into the list ? /dev/* or /dev/tty* or /dev/tty[0-9[0-9] ? or /dev/ttyS* ? For the record, only /dev/ttyUSB0 is a valid port on the machine I am presently on. Will this be a problem ? On Tue, 2006-02-07 at 12:20 -0700, Trent Jarvi wrote: > This is documented in INSTALL with the source. > I was wondering where that file was. I will download source and dig it up. Thanks. -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 12:51:09 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 12:51:09 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139341076.8145.11.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: On Tue, 7 Feb 2006, Kim Lux wrote: > > Exactly which ports does rxtx attempt to put into the list ? /dev/* > or /dev/tty* or /dev/tty[0-9[0-9] ? or /dev/ttyS* ? > > For the record, only /dev/ttyUSB0 is a valid port on the machine I am > presently on. Will this be a problem ? > > > On Tue, 2006-02-07 at 12:20 -0700, Trent Jarvi wrote: >> This is documented in INSTALL with the source. >> > I was wondering where that file was. I will download source and dig it > up. > > Thanks. > Hmm I'm looking at pre17 so this may have changed. (its just what I have on this machine) if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA" // for the IPAQs }; CandidatePortPrefixes=Temp; } So you may need to add "ttyUSB" to that list. RXTX used to enumerate _everything_ see if(osName.equals("Linux-all-ports") But it became less than practical. This is all in RXTXCommDriver.java hmm I just did a cvs update. if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have to get your fingers into the code. We aim for sane defaults. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 13:06:45 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 13:06:45 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139342805.8145.22.camel@zd7280> On Tue, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > Hmm I'm looking at pre17 so this may have changed. (its just what I have > on this machine) > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA" // for the IPAQs > }; > CandidatePortPrefixes=Temp; > } > > > So you may need to add "ttyUSB" to that list. RXTX used to enumerate > _everything_ see if(osName.equals("Linux-all-ports") But it became less > than practical. > > This is all in RXTXCommDriver.java > > hmm I just did a cvs update. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have > to get your fingers into the code. We aim for sane defaults. Excellent. Thanks for taking the time. -- Kim Lux, Diesel Research Inc. From ideiglenes1 at freemail.hu Tue Feb 7 13:53:39 2006 From: ideiglenes1 at freemail.hu (--) Date: Tue, 07 Feb 2006 21:53:39 +0100 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139345619.22534.2.camel@localhost> Hi! I use this code to get all the extra Linux devices. :) if ("Linux".equals(System.getProperty("os.name"))) { System.setProperty("os.name","Linux-all-ports"); } driver = new RXTXCommDriver(); On k, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > On Tue, 7 Feb 2006, Kim Lux wrote: > > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have > to get your fingers into the code. We aim for sane defaults. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From matt.higgins at gmail.com Tue Feb 7 13:45:54 2006 From: matt.higgins at gmail.com (Matt Higgins) Date: Tue, 7 Feb 2006 15:45:54 -0500 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> Message-ID: <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> Sweet this is exactly what I needed. I was searching the archives through marc.theamisgroup they only have archives back to 1/3/05. Should have hit the mailman archive! Thanks a lot! On 2/7/06, Brian Schlining wrote: > > Hi Matt > > The following code works fine on Linux but I never see any data when run > on Windows. This is a cut and paste from the SimpleRead example. > I am attempting to read data from a bar code scanner. I can fire up > HyperTermianl on windows and see that the device is working properly as I > see the barcodes are scanned and echoed back to the terminal. However when I > run the app I don't see any data. It is however associating with the com > port as the informational bits print fine? > > > You're not the only one whose had this problem, I don't know if Trent has > addressed this is the latest release of RXTX but there is a workaround. > Here's the recent thread from the RXTX mailing list regarding this issues: > > Thanasis Delenikas tdelenik at gmail.com > Wed Jan 18 13:56:23 MST 2006 > > * Previous message: [Rxtx] Re: More close() performance fixes > * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] > > Hi all. > (I've subscribed again from my other email account). > > Trent, > > You are right. Linux *always* works, no matter what flow control you set. > Windows *works only* with hardware flow control (I haven't tested what > happens with software XON/XOFF flow control). > > I assume (but I am not certain) that even with no flow control at all, all > platforms should work. Without flow control, you have the risk of bumping > into overflow or framing errors, but that's your (the end programmer, I > mean) problem. > > >From my side, I shouldn't be working without flow control. That was a bug > too... It was some code forgotten from the old times, when I used to work > with phone emulation drivers which didn't support flow control. The > correct > way is to have some flow control enabled and that's why I suppose this is > a > low-severity bug for RxTx. > > I have no idea which platform shows the correct behaviour, since > my knowledge about Linux and the inner workings of these low-level i/o > operations is limited. > > Regards, > Thanasis Delenikas. > > > > > Message: 2 > > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > > From: Trent Jarvi > > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > > To: RXTX Developers and Users > > Message-ID: > > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > > > Hi all, > > > > > > Trent, I have found something. > > > I read your comment about flow control, so I experimented a bit. > > > > > > If you remember, in my sample program I've used no flow control at all > ( > > i.e. > > > Java constant FLOWCONTROL_NONE). > > > > > > Now, during testing, I've switch to hardware inbound flow control (i.e > . > > Java > > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > > beautifully! > > > > > > I think I will switch to H/W flow control and test things for a while, > > but > > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > > > > > Hi Thanasis, > > > > I'm fairly sure you have identified a bug. I would not worry too much > > about what Sun CommAPI w32 defaults are. I think they did more or less > > whatever the port opened with. Just a guess. Linux tries to stomp on > > ports so they are all the same. > > > > So this started out with Linux worked, Windows XP/.. did not as I > recall. > > Something is wrong in rxtx. Do I understand this right? > > > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > > > Perhaps there is something Wayne or I did not understand when we wrote > > that code. I wasnt programming back in the BBS days so modems are not > my > > thing. I have a few questions. > > > > Is the above matrix confirmed by observation? > > Linux just always worked? > > Which one _should_ work? I'm guessing modems work with hardware flow > > control. I'll have to dig around. > > > > The windows flow control changes a couple things with hardware flow > > control. Following the w32 API documentation is confusing sometimes. > > But it looks like Linux could have a bug too. > > Cheers > > Brian Schlining > Software Engineer > http://www.mbari.org > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/9c989144/attachment-0057.html From tjarvi at qbang.org Tue Feb 7 14:06:14 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 14:06:14 -0700 (MST) Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> Message-ID: >> >> You're not the only one whose had this problem, I don't know if Trent has >> addressed this is the latest release of RXTX but there is a workaround. >> Here's the recent thread from the RXTX mailing list regarding this issues: >> I have not. I expect to have access to some test equipment next month and I'll go through all of this. I really don't know whats going on and I need a gold standard. I thought maybe linux was autodetecting the flow control. Your observations would certainly be welcome. I need to talk to Russell King and see what he is doing. Until then I'd just be toying around over a loopback as usual. This is very high on the list though. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 17:25:05 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 17:25:05 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139358305.17994.2.camel@zd7280> My application now works. I installed the libraries and jar from 2.1-7 (Final). portlist.hasMoreElements is no longer false. The application finds the port for /dev/ttyUSB0. Thanks for your help, Trent (et al) Sorry I bothered you with this. Next time I will look in the source first. I didn't think it was an rxtx issue, I thought it was a Linux setup issue . On Tue, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > Hmm I'm looking at pre17 so this may have changed. (its just what I > have > on this machine) > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux > Serial Ports > "ttySA" // for the > IPAQs > }; > > CandidatePortPrefixes=Temp; > } > > > So you may need to add "ttyUSB" to that list. RXTX used to enumerate > _everything_ see if(osName.equals("Linux-all-ports") But it became > less > than practical. > > This is all in RXTXCommDriver.java > > hmm I just did a cvs update. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux > Serial Ports > "ttySA", // for the > IPAQs > "ttyUSB" // for USB > frobs > }; > > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you > have > to get your fingers into the code. We aim for sane defaults. -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 19:21:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 19:21:54 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139358305.17994.2.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> <1139358305.17994.2.camel@zd7280> Message-ID: >Sorry I bothered you with this. Next time I will look in the source >first. I didn't think it was an rxtx issue, I thought it was a Linux >setup issue . Why would you be sorry? I would have done the same. I'm glad it's working :) -- Trent Jarvi tjarvi at qbang.org From tma at mail.island.net Wed Feb 8 13:39:35 2006 From: tma at mail.island.net (Tom Alldread) Date: Wed, 08 Feb 2006 12:39:35 -0800 Subject: [Rxtx] Win32/Linux Serial Port Data Dropouts In-Reply-To: <200602060702.k167255O007882@www.qbang.org> References: <200602060702.k167255O007882@www.qbang.org> Message-ID: <43EA5707.4020200@mail.island.net> Greetings Folks at RXTX: During the last couple of months I have been alternately testing with javax.comm 2 and RXTX 2.1 under Windows XP and CommApi 3 and RXTX 2.1 under Suse 10.0 Linux. In the process I have learned a little about java multi-threading under NetBeans 5 with Profiler. My java (jdk 1.5_06) application is used for data acquisition and provides a graphical display of A-D conversion data received from a 56KBaud serial port. The actual data throughput is about 10KBaud thus it is well below the speed of the port. I use hardware RTS/CTS flow control which can stall the data acquisition sample rate if necessary. This ensures the display computer has the ability to slow the data acquisition rate should it become too busy to accept the regular data flow. Both the serial port buffer and the java read buffer are set at 16KB. Usually the data transfers into the java read buffer are less than 100 bytes unless the data acquisition is recovering from a stall. The data flow normally hesitates after each 5 KB block as a continue command is needed from the display computer to start the drawing of a new graphics display line. Separate threads have been provided for the serial port event monitoring and data processing. The serial port event thread has been given the maximum priority and data processing thread the minimum priority provided by java. Thread yield statements have been placed within all data processing while/for loops as an effort to ensure quick access to CPU cycles for the serial port event thread. I have found that short data transmissions are essentially error free but occasional dropouts occur with continuous data flow especially under Windows XP. ....................................................................................................................................................................................... Linux results: I am happy to report that RXTX 2.1 appears to work very well under Linux although I did notice some errors when the screen savers were running with my dual monitors. I believe this is a local problem associated with my dual graphics which needs further attention. The recent CommApi 3 Linux release from Sun did not work at all with my program. It seemed to send commands out OK but did not receive any data. Although the serial port event triggered the ISR, the input stream appeared filled with nulls and thus did not contain any data. As my understanding is that CommApi 3 was tested with a Red Hat distribution of Linux I wonder if this problem is distro dependent? Although somewhat off topic here I wonder if anyone reading this has had similar experience? .................................................................................................................................................................................. Windows XP results: There are problems with occasional data dropouts which become more frequent as the sampling rate is increased or if the computer becomes busy with other duties. The dropouts typically consist of a half dozen byte block of lost data. It appears the lost bytes never get added to the java input stream. There has not been any indication of garbled data, overruns or framing errors which suggests the UART communications remains solid. Using javax.comm 2 I found that the setting of SerialPort 'enableReceiveThreshold' to 40 and 'enableReceiveTimeout' of 100mS reduced the dropouts error rate significantly. I found that I could not get RXTX 2.1 to function with the aforementioned threshold and timeout settings. The javax.comm 2 interface is consequently performing better for me under Windows than RXTX 2.1. I wonder if anyone here has any suggestions as to what I might try to improve RXTX 2.1? Although my settings are the same as under Suse 10.0, RXTX 2.1 performs much better for me under Linux than any of the alternatives that I have tried under Windows XP . ............................................................................................................................................................................... I would like to establish, based on the experience of others, if I have reached the normally expected performance limit of java serial port communications? Should I expect to achieve virtually error free serial port data input from a continuous stream under Windows XP java software? I am considering changing my protocol to packets with error checking if necessary but would like to know if the dropout problems I am experiencing are typical or not before I take this rather work intensive plunge. Many thanks in advance for any help! Best Regards, Tom Alldread -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.375 / Virus Database: 267.15.2/253 - Release Date: 2006-02-07 From jlaxson at mac.com Wed Feb 8 23:56:48 2006 From: jlaxson at mac.com (John Laxson) Date: Thu, 9 Feb 2006 00:56:48 -0600 Subject: [Rxtx] PortInUseException: Unknown Application on OSX Message-ID: Hi, I've been trying to get RXTX 2.1.7 going on Mac OS X for a while here, and am running up into a wall here. I've tried with pre- compiled and the source version and get the same problem, a gnu.io.PortInUseException: Unknown Application. I have run the fixperms script included with the source distribution, and id shows me as a member of the uucp group, and permissions on /var/spool/uucp are 775 root:uucp. Running a test program (included at the bottom for clarity) lets me enumerate all the serial ports correctly, but trying to open any of them gives the PortInUseException. If it helps, when I try to open a port that's set to make an outgoing bluetooth connection, there is no delay and no connection attempt at all. Thanks, John Laxson PS: The documentation wiki on qbang.org shows 404, and has for a few days now. My test code: public static void main(String[] args) { SerialPort serialPort; try { Enumeration e = CommPortIdentifier.getPortIdentifiers(); CommPortIdentifier ident; while (e.hasMoreElements()) { ident = (CommPortIdentifier)e.nextElement(); System.out.println(ident.getName()); } ident = CommPortIdentifier.getPortIdentifier("/dev/cu.modem"); serialPort = (SerialPort) ident.open("Me", 5000); } catch (Exception e) { e.printStackTrace(); } } From rajesh.invincible at gmail.com Thu Feb 9 03:39:38 2006 From: rajesh.invincible at gmail.com (Rajesh N) Date: Thu, 9 Feb 2006 16:09:38 +0530 Subject: [Rxtx] Re: Move .java Files in gnu.io filesystem hierarchy - Maven (2) In-Reply-To: <43DF21D2.7090200@ngi.it> References: <43DF21D2.7090200@ngi.it> Message-ID: <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Can anybody tell me how to overcome these EXCEPTIONS I AM WORKING ON SERIAL COMMN IN JAVA ON LINUX. 1. " NOT ALL PARAMETERS SUPPORTED BY THE KERNEL" This i came across the following statement inmy prog. SerialP is A SerialPort object SerialP.setSerialPortParams(9600(BAUDRATE),DATABITS_8,STOPBITS_1,PARITY_NONE) 2. NullPointer Exception at Event Dispatch Now i have checked all my object references for a null reference but i found none i have put up my entire code in try catch blocks but still I AM UNABLE TO CATCH THIS EXCEPTION AND HENCE MY APPLICATION CLOSES HOW DOES THESE GO? PLEASE HELP ME IT IS URGENTTTTTTTTTTTTTTTT yours sincerely RAJESH On 1/31/06, Fabio Frumento wrote: > Hi Xavier, > > I don't know maven at all but the directory hierarchy listed buy Trent > is fine for me... > > I'll take a look to maven, it seems an interesting project > > Regards > > Fabio Frumento > > Trent Jarvi wrote: > > On Tue, 31 Jan 2006, Xavier Frisaye wrote: > > > >> Hi all, > >> > >> If you are going to rearrange the src folder, i will propose to use > >> maven 2 and follow its directory structure > >> > (http://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html). > >> > >> Maven 2 simplify java project and give a standard way to make projects > >> (http://maven.apache.org/). > >> We are using it for internal projects and we are very satisfied. > >> > >> Is anybody interested? > >> > >> I'm not an expert in maven 2 (yet) but i'm agree to help using it if > >> you choose to make so. > >> > > > > so this would be: > > > > rxtx-devel/src/main/java/gnu.io > > rxtx-devel/src/test/java/ManIwish.java > > > > I don't use IDEs very much so I'll let others comment. But I don't see > > a problem with that. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Thu Feb 9 09:50:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 9 Feb 2006 09:50:31 -0700 (MST) Subject: [Rxtx] Re: Move .java Files in gnu.io filesystem hierarchy - Maven (2) In-Reply-To: <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Message-ID: On Thu, 9 Feb 2006, Rajesh N wrote: > Can anybody tell me how to overcome these EXCEPTIONS > I AM WORKING ON SERIAL COMMN IN JAVA ON LINUX. > > 1. " NOT ALL PARAMETERS SUPPORTED BY THE KERNEL" > > This i came across the following statement inmy prog. > SerialP is A SerialPort object > SerialP.setSerialPortParams(9600(BAUDRATE),DATABITS_8,STOPBITS_1,PARITY_NONE) > Strange. The parameters you use are the same the port should open with by default. Could you paste the actual exception you are getting? I don't see that in the rxtx source. Also it would help to know the rxtx version. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Fri Feb 10 15:29:05 2006 From: lux at diesel-research.com (Kim Lux) Date: Fri, 10 Feb 2006 15:29:05 -0700 Subject: [Rxtx] One serial port object for both sending and receiving ? Message-ID: <1139610545.18177.4.camel@zd7280> Is it OK to use one SerialPort ojbect (ex Serial Port serialPort;) and use it for both sending and receiving ? For example: ======================================================================== static SerialPort serialPort = null; static OutputStream serialOut = null; static InputStream serialIn = null; // assign it to an outputStream for use try{ serialOut = serialPort.getOutputStream(); System.out.println("Serial output stream has been assigned."); }//try catch(IOException e) { System.out.println("Error: Couldn't assign output stream to serial port."); }//catch //assign it to an inputStream for use try{ serialIn = serialPort.getInputStream(); System.out.println("Serial input stream has been assigned."); }//try catch(IOException e) { System.out.println("Error: Couldn't assign input stream to serial port."); }//catch ======================================================================== -- Kim Lux, Diesel Research Inc. From lux at diesel-research.com Fri Feb 10 21:23:00 2006 From: lux at diesel-research.com (Kim Lux) Date: Fri, 10 Feb 2006 21:23:00 -0700 Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Message-ID: <1139631780.23882.10.camel@zd7280> I've got a problem receiving chars with my version of serialRead, written in an SWT GUI. I had a Java pro have a good look at my code and he can't see anything wrong with it. I can send chars fine. When I receive a char the cpu usage for the app goes to 100% and the code in the serial event handler doesn't get executed. The instructions on the Java Comm Serial API How-To for Linux page state that I must install javacomm. Is that true ? Everything builds without it and I can send chars on rxtx just fine, but I can't receive them. Could this be the problem ? I downloaded and installed javacomm. I was not able to add "Driver=gnuio.RXTXCommDriver to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 installed in /usr/java/jre1.5.0_05. I added comm.jar to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext to the library paths. Is this OK ? Does it matter that I am receiving on /dev/ttyUSB0 ? Thanks. -- Kim Lux, Diesel Research Inc. From lunareclipse03 at web.de Sat Feb 11 09:44:46 2006 From: lunareclipse03 at web.de (lunareclipse03@web.de) Date: Sat, 11 Feb 2006 17:44:46 +0100 Subject: [Rxtx] Question about Serial I/O under Win32 Message-ID: <662084330@web.de> Hello everybody, I have a strange problem with a piece of code I made for myself. No, this is not really concerning rxtx, but nevertheless I post this to the list, hoping that some of you can help me. I've written two libraries, one for linux and one for win32. The linux port works quite well, I can send / receive faxes and / or replay voice messages over the telephone line using a voice modem. But the win32 port of the library causes some trouble. If, for example, I send out a fax with a certain modem under linux, it works well. The fax is complete when it comes out of the fax machine. If I then use the same modem to send out a fax under win32, the fax coming out of the fax machine gets "stuck" halfways, but the sending modem thinks that transmission was ok and drops the connection. The answering fax machine then gives me "error while receiving." The "upper layer" java code MUST be right, because if I do the same thing under linux (using the linux library), everything is alright. Now I have to ask: Can somebody please help me out with this??!? Could it be the case that some kind of flow control or COMMTIMEOUTS setting causes this behaviour? I set flow control to RTS/CTS before sending out a fax. How can I DISABLE flow control? Or what do you think? Can something else cause this problems? Thank you all for your time and PLEASE write back soon. Regards, --Sven Ahlemann Am Waldrand 31 45721 Haltern am See Germany ______________________________________________________________ Verschicken Sie romantische, coole und witzige Bilder per SMS! Jetzt bei WEB.DE FreeMail: http://f.web.de/?mc=021193 From lux at diesel-research.com Sat Feb 11 10:06:52 2006 From: lux at diesel-research.com (Kim Lux) Date: Sat, 11 Feb 2006 10:06:52 -0700 Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: <1139631780.23882.10.camel@zd7280> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> <1139631780.23882.10.camel@zd7280> Message-ID: <1139677612.3431.5.camel@zd7280> More on this problem. I copied and pasted simpleRead into a console based Eclipse project and I've got the same result, except that cpu usage doesn't go to 100%. I'm beginning to think there is an issue in rxtx. My imports for simpleRead are: ============================ import gnu.io.*; import java.util.*; //import javax.comm.*; import java.io.*; =========================== Any ideas ? I am trying to read from /dev/ttyUSB0 using a serial to USB adapter which has worked well with minicom and gtkterm. Thanks. On Fri, 2006-02-10 at 21:23 -0700, Kim Lux wrote: > I've got a problem receiving chars with my version of serialRead, > written in an SWT GUI. > > I had a Java pro have a good look at my code and he can't see anything > wrong with it. > > I can send chars fine. When I receive a char the cpu usage for the app > goes to 100% and the code in the serial event handler doesn't get > executed. > > The instructions on the Java Comm Serial API How-To for Linux page state > that I must install javacomm. Is that true ? Everything builds without > it and I can send chars on rxtx just fine, but I can't receive them. > Could this be the problem ? > > I downloaded and installed javacomm. I was not able to add > "Driver=gnuio.RXTXCommDriver > to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not > have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 > installed in /usr/java/jre1.5.0_05. I added comm.jar > to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext > to the library paths. Is this OK ? > > Does it matter that I am receiving on /dev/ttyUSB0 ? > > Thanks. > -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Sun Feb 12 21:01:33 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:01:33 -0700 (MST) Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: <1139677612.3431.5.camel@zd7280> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> <1139631780.23882.10.camel@zd7280> <1139677612.3431.5.camel@zd7280> Message-ID: I suspect what is happening is the select() is breaking out in the native code but the driver does not have support for notifying there are X bytes available. On some traditional Unix based systems, the only way you know data is available is the fd status changes and do an FIORDCHK ioctl. Or perhaps the only thing you can know is the fd status changed. It would take reading through the kernel driver code to know for sure. So on USB, depending upon the driver, the same may need to be done or the driver improved a bit if possible to support. Polling reads will also work but don't use the event driven model of CommAPI which isnt acceptable in the long run. The 100% cpu usage can then be explained because select no longer blocks until the data is read; the eventLoop spins loose. You can put a well placed sleep but rxtx only expects those are needed when it knows data is available. This may not be a super simple thing to understand and fix. I do have ideas to get you started. I'm going to be short on time the next couple weeks. I expect to put some good time in and answer some other questions I saw around the 25th. For now, I'd look at the following and go from there with the hints I've given. JNIEXPORT jint JNICALL RXTXPort(nativeavailable)( JNIEnv *env, jobject jobj ) { int fd = get_java_var( env, jobj,"fd","I" ); int result; /* char message[80]; ENTER( "RXTXPort:nativeavailable" ); On SCO OpenServer FIONREAD always fails for serial devices, so try ioctl FIORDCHK instead; will only tell us whether bytes are available, not how many, but better than nothing. This turns out to be true on Solaris also. taj. */ #ifdef FIORDCHK /* __unixware__ __sun__ probably others */ result = ioctl(fd, FIORDCHK, 0); #else if( ioctl( fd, FIONREAD, &result ) < 0 ) { goto fail; } #endif /* FIORDCHK */ On Sat, 11 Feb 2006, Kim Lux wrote: > > More on this problem. I copied and pasted simpleRead into a console > based Eclipse project and I've got the same result, except that cpu > usage doesn't go to 100%. I'm beginning to think there is an issue in > rxtx. > > My imports for simpleRead are: > > ============================ > import gnu.io.*; > import java.util.*; > //import javax.comm.*; > import java.io.*; > =========================== > > Any ideas ? I am trying to read from /dev/ttyUSB0 using a serial to > USB adapter which has worked well with minicom and gtkterm. > > Thanks. > > > > On Fri, 2006-02-10 at 21:23 -0700, Kim Lux wrote: >> I've got a problem receiving chars with my version of serialRead, >> written in an SWT GUI. >> >> I had a Java pro have a good look at my code and he can't see anything >> wrong with it. >> >> I can send chars fine. When I receive a char the cpu usage for the app >> goes to 100% and the code in the serial event handler doesn't get >> executed. >> >> The instructions on the Java Comm Serial API How-To for Linux page state >> that I must install javacomm. Is that true ? Everything builds without >> it and I can send chars on rxtx just fine, but I can't receive them. >> Could this be the problem ? >> >> I downloaded and installed javacomm. I was not able to add >> "Driver=gnuio.RXTXCommDriver >> to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not >> have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 >> installed in /usr/java/jre1.5.0_05. I added comm.jar >> to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext >> to the library paths. Is this OK ? >> >> Does it matter that I am receiving on /dev/ttyUSB0 ? >> >> Thanks. >> > From tjarvi at qbang.org Sun Feb 12 21:03:30 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:03:30 -0700 (MST) Subject: [Rxtx] One serial port object for both sending and receiving ? In-Reply-To: <1139610545.18177.4.camel@zd7280> References: <1139610545.18177.4.camel@zd7280> Message-ID: On Fri, 10 Feb 2006, Kim Lux wrote: > > Is it OK to use one SerialPort ojbect (ex Serial Port serialPort;) and > use it for both sending and receiving ? > > For example: > > ======================================================================== > static SerialPort serialPort = null; > static OutputStream serialOut = null; > static InputStream serialIn = null; > > > > > // assign it to an outputStream for use > try{ > serialOut = serialPort.getOutputStream(); > System.out.println("Serial output stream has been assigned."); > }//try > catch(IOException e) > { > System.out.println("Error: Couldn't assign output stream to serial > port."); > }//catch > > > //assign it to an inputStream for use > try{ > serialIn = serialPort.getInputStream(); > System.out.println("Serial input stream has been assigned."); > }//try > catch(IOException e) > { > System.out.println("Error: Couldn't assign input stream to serial > port."); > }//catch This should be fine. In fact trying to do it another way will probably not work as you will run into lockfile issues. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun Feb 12 21:13:13 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:13:13 -0700 (MST) Subject: [Rxtx] Question about Serial I/O under Win32 In-Reply-To: <662084330@web.de> References: <662084330@web.de> Message-ID: On Sat, 11 Feb 2006 lunareclipse03 at web.de wrote: > Hello everybody, > > I have a strange problem with a piece of code I made for myself. No, > this is not really concerning rxtx, but nevertheless I post this to the > list, hoping that some of you can help me. I've written two libraries, > one for linux and one for win32. The linux port works quite well, I can > send / receive faxes and / or replay voice messages over the telephone > line using a voice modem. But the win32 port of the library causes some > trouble. If, for example, I send out a fax with a certain modem under > linux, it works well. The fax is complete when it comes out of the fax > machine. If I then use the same modem to send out a fax under win32, the > fax coming out of the fax machine gets "stuck" halfways, but the sending > modem thinks that transmission was ok and drops the connection. The > answering fax machine then gives me "error while receiving." The "upper > layer" java code MUST be right, because if I do the same thing under > linux (using the linux library), everything is alright. Now I have to > ask: Can somebody please help me out with this??!? Could it be the case > that some kind of flow control or COMMTIMEOUTS setting causes this > behaviour? I set flow control to RTS/CTS before sending out a fax. How > can I DISABLE flow control? Or what do you think? Can something else > cause this problems? Thank you all for your time and PLEASE write back > soon. > Hi Sven I'm not too willing to talk about flow control at the low level until I confirm some things with test equipment later. It is not clear if you are using rxtx or writing your own native code. So I'm not sure how to answer much of this :) If you are wondering how to change the flow control using rxtx from java, The BlackBox example from Sun flips this back and forth. SerialPort.java in rxtx 2.1 uses the following: SerialPort.java: public static final int FLOWCONTROL_NONE =0; SerialPort.java: public static final int FLOWCONTROL_RTSCTS_IN =1; SerialPort.java: public static final int FLOWCONTROL_RTSCTS_OUT =2; SerialPort.java: public static final int FLOWCONTROL_XONXOFF_IN =4; SerialPort.java: public static final int FLOWCONTROL_XONXOFF_OUT=8; So if you set flowcontrol to RTSCTS, you can set it to NONE to turn it off. If you are looking for how to do it in native code, the rxtx Source is SerialImp.c (unix/linux/mac os x/w32) and termios.c (w32 only with SerialImp.c) You can track the code: SerialImp.c:JNIEXPORT void JNICALL RXTXPort(setflowcontrol)( JNIEnv *env, jobject jobj, jint flowmode ) termios.c:int tcgetattr( int fd, struct termios *s_termios ) termios.c:int tcsetattr( int fd, int when, struct termios *s_termios ) There may be a problem in the rxtx flow control code though. Rather than guess, I want to test this with a gold standard. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Feb 6 00:00:16 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 00:00:16 -0700 (MST) Subject: [Rxtx] wiki delay until tomorrow night. In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: On Sun, 5 Feb 2006, Trent Jarvi wrote: > On Sun, 5 Feb 2006, Kim Lux wrote: > >> usb ? Tell me more... I need that too. > > usb is a very proper design. Thats all it is. > Maybe rxtx could help usb. But it would start with helping bring back the community that was already there. It's not something I'd love to do but maybe its the right thing to do. It would probably take 2 years to do right. But maybe thats better than what we have now. I honestly don't know what IBM is doing which could just run over everything. Just some thoughts after some fine german wine. -- Trent Jarvi tjarvi at qbang.org From gadelavega at yahoo.com.ar Mon Feb 6 02:17:05 2006 From: gadelavega at yahoo.com.ar (Gonzalo A. de la Vega) Date: Mon, 06 Feb 2006 10:17:05 +0100 Subject: [Rxtx] Serial port ownership question In-Reply-To: References: <20060205113618.30274.qmail@web53501.mail.yahoo.com> <1139157422.4553.9.camel@zd7280> <1139158698.4936.9.camel@zd7280> Message-ID: <43E71411.4050402@yahoo.com.ar> On my Fedora Core 4: ls -l /dev/ttyS* crw-rw---- 1 root uucp 4, 64 Feb 6 2006 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Feb 6 2006 /dev/ttyS1 ... and: grep "ttyUSB" /etc/udev/rules.d/50-udev.rules KERNEL=="ttyUSB*", GROUP="uucp", MODE="0660" So anyone in the "uucp" group can use serial ports. On Gentoo the group is "tty". Trent Jarvi escribi?: > > > On Sun, 5 Feb 2006, Dr. Douglas Lyon wrote: > >> I can confirm that this is the case (only root ownership of >> serial ports, under fedora 4). >> Wow, what were they thinking?! >> - DL >> >>> I've found that the newer kernels have the serial ports owned by root. >>> For example, >>> >>> $ls -al /dev/tty* >>> crw-rw-rw- 1 root root 5, 0 Feb 5 02:06 /dev/tty >>> crw-rw---- 1 root root 4, 0 Feb 5 02:06 /dev/tty0 >>> crw------- 1 root root 4, 1 Feb 5 09:07 /dev/tty1 >>> crw-rw---- 1 root tty 4, 10 Feb 5 02:06 /dev/tty10 >>> crw-rw---- 1 root tty 4, 11 Feb 5 02:06 /dev/tty11 >>> ... > > > This is just not a problem jcp or such are going to solve. Its a > platform spitwad fight. But do look at pam. In fact thats what Sun > is doing too. Maybe Linux followed their lead.. I'm not a pam guy. > I've spent 16 hours trying to understand it but your users wont :) > > Solution? I have no clue. Its two tangent mentalities from my > perspective. > > -- > Trent Jarvi > tjarvi at qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mtnvega at yahoo.com.br Mon Feb 6 05:35:43 2006 From: mtnvega at yahoo.com.br (Luiz Jr) Date: Mon, 6 Feb 2006 12:35:43 +0000 (GMT) Subject: [Rxtx] Documentation Wiki In-Reply-To: <1139157422.4553.9.camel@zd7280> Message-ID: <20060206123543.57256.qmail@web53515.mail.yahoo.com> Hello, Thank you for you answer, but so the usage of the API is pretty much like the Java Communications Api? If yes, what version of the Java Comm Api? Thank you, Luiz A. Brandao Jr Kim Lux escreveu: On Sun, 2006-02-05 at 08:36 -0300, Luiz Jr wrote: > Hello, > > I want to start using the RXTX libraries, but I would to know how, > since I can not access the documentation wiki page I just started using them yesterday. Below is how I installed the libraries, if that helps. I used snippets of code from the SimpleWrite application here to get me going. http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html Instead of "import javax.comm.*;", use "import gnu.io.*;" which is gotten from RXTXcomm.jar, which you will need to include in your project references. I am working in Eclipse. BTW: there is no way to open a port without going through the port list and finding it. Maybe sometime in the future someone (me ?) will write a method called openSerialPort that allows the user to give a port identifier, such as "/dev/tty1" and return a port ready to use. It wouldn't take much to write that and it would save users a lot of code. Hope this helps. ======================================================================= 1) Figure out which java you are running, incase there is more than one installed. $ java -version java version "1.5.0_05" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_05-b05) Java HotSpot(TM) Client VM (build 1.5.0_05-b05, mixed mode, sharing) 2) Find all the jre directories and the one from which you are currently running. kfind (jre) 3) cd to that directory plus /lib/i386 cd /usr/java/jre1.5.0_05/lib/i386 4) Copy the library files (*.so) to that directory. cp /home/krlux/Desktop/'Java Controls'/rxtx-linux/bin/* . 5) Check that the copy was successful ls librxtx* librxtxI2C.so librxtxRaw.so librxtxSerial.so librxtxParallel.so librxtxRS485.so 6) cd to the /lib/ext directory for your java. cd /usr/java/jre1.5.0_05/lib/ext 7) Copy the Jar files there cp /home/krlux/Desktop/'Java Controls'/rxtx-linux/lib/ext/* . 8) Check that it was successful ls RXTX* RXTXcomm.jar Rxtx is now installed on your machine ready to use. =================================================================== -- Kim Lux, Diesel Research Inc. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx --------------------------------- Yahoo! Acesso Gr?tis - Internet r?pida e gr?tis. Instale o discador agora! -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/544aa403/attachment-0058.html From lyon at docjava.com Mon Feb 6 05:49:34 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 06 Feb 2006 07:49:34 -0500 Subject: [Rxtx] wiki delay until tomorrow night. In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: Hi All, I have often thought about USB drivers being needed. For example, the ironman watch will not interface to a mac (windows only). It is USB. My dymo label writer has no Java driver (native only). Etc. Most cheap web cameras are USB (and Java drivers go through JAI, if it supports the camera at all). The JAI code shows how sun did the USB drivers. You have to be a member of the jai project to download the source code. https://jai.dev.java.net has the jai distro. And then you are not allowed to redistribute it. However, we can all learn from it (if so inclined). Basically: cvs -d :pserver:lyon at cvs.dev.java.net:/cvs login cvs -d :pserver:lyon at cvs.dev.java.net:/cvs checkout jai-core You will need to user your own uid and pw to get in. The ant build has over 100 warnings from sun deprecations of its own code. You might say that they were hoisted on their own Picard ;) One interesting thing is that they support several platforms: linux-amd64 64-bit Linux-AMD64 linux-i586 32-bit Linux-x86 solaris-amd64 64-bit Solaris-AMD64 solaris-i586 32-bit Solaris-x86 solaris-sparc 32-bit Solaris-SPARC solaris-sparcv9 64-bit Solaris-SPARC windows-i586 32-bit Windows-x86 Thus, ant is used to provide a multi-platform native method distro. Neat. How do they do it? check this out: And: The core download does not contain any C source code (it was all pre-built). Basically, they are just copying .so and .dll files into build directories. I would love to see the C code for this...but Sun does not post it on the https://jai.dev.java.net site. I don't know why...Perhaps I missed it. - Doug >On Sun, 5 Feb 2006, Trent Jarvi wrote: > >>On Sun, 5 Feb 2006, Kim Lux wrote: >> >>>usb ? Tell me more... I need that too. >> >>usb is a very proper design. Thats all it is. >> > >Maybe rxtx could help usb. But it would start with helping bring >back the community that was already there. > >It's not something I'd love to do but maybe its the right thing to do. > >It would probably take 2 years to do right. But maybe thats better >than what we have now. > >I honestly don't know what IBM is doing which could just run over everything. > >Just some thoughts after some fine german wine. > >-- >Trent Jarvi >tjarvi at qbang.org > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tdelenik at gmail.com Mon Feb 6 05:56:32 2006 From: tdelenik at gmail.com (Thanasis Delenikas) Date: Mon, 6 Feb 2006 14:56:32 +0200 Subject: Fwd: [Rxtx] Documentation Wiki In-Reply-To: <1139157422.4553.9.camel@zd7280> References: <20060205113618.30274.qmail@web53501.mail.yahoo.com> <1139157422.4553.9.camel@zd7280> Message-ID: <310a1a930602060456t129f1dc6p5f2b908f13ab5a0b@mail.gmail.com> Hello all, Kim, this is a snippet from the code I use. The closest to directly opening a specific port without enumeration. << ... portId = CommPortIdentifier.getPortIdentifier(getPort()); serialPort = (SerialPort) portId.open("jSMSEngine", 1971); ... >> where getPort() return the string identifier of the port, i.e. "/dev/ttyS0" or "COM1" or whatever. Thanasis. ---------- Forwarded message ---------- From: Kim Lux Date: Feb 5, 2006 6:37 PM Subject: Re: [Rxtx] Documentation Wiki To: RXTX Developers and Users BTW: there is no way to open a port without going through the port list and finding it. Maybe sometime in the future someone (me ?) will write a method called openSerialPort that allows the user to give a port identifier, such as "/dev/tty1" and return a port ready to use. It wouldn't take much to write that and it would save users a lot of code. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/182ab5b8/attachment-0058.html From tjarvi at qbang.org Mon Feb 6 11:53:57 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 11:53:57 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: On Mon, 6 Feb 2006, Dr. Douglas Lyon wrote: > Hi All, > I have often thought about USB drivers being needed. > For example, the ironman watch will not interface > to a mac (windows only). It is USB. > My dymo label writer has no Java driver (native only). > Etc. > Most cheap web cameras are USB (and Java drivers go > through JAI, if it supports the camera at all). > The JAI code shows how sun did the USB drivers. > You have to be a member of the jai project to download > the source code. > https://jai.dev.java.net has the jai distro. > And then you are not allowed to redistribute it. However, > we can all learn from it (if so inclined). Basically: > cvs -d :pserver:lyon at cvs.dev.java.net:/cvs login > cvs -d :pserver:lyon at cvs.dev.java.net:/cvs checkout jai-core > You will need to user your own uid and pw to get in. > The ant build has over 100 warnings from sun deprecations > of its own code. > > You might say that they were hoisted on their own Picard ;) > > One interesting thing is that they support several platforms: > linux-amd64 64-bit Linux-AMD64 > linux-i586 32-bit Linux-x86 > solaris-amd64 64-bit Solaris-AMD64 > solaris-i586 32-bit Solaris-x86 > solaris-sparc 32-bit Solaris-SPARC > solaris-sparcv9 64-bit Solaris-SPARC > windows-i586 32-bit Windows-x86 > Thus, ant is used to provide a multi-platform native method distro. > Neat. > How do they do it? > check this out: > > > > > > > > > > > > > And: > > > > > > > > > > The core download does not contain any C source code (it was all pre-built). > Basically, they are just copying .so and .dll files into build directories. > > I would love to see the C code for this...but Sun does not post it on the > https://jai.dev.java.net site. > > I don't know why...Perhaps I missed it. > > - Doug > > I've looked at moving rxtx to Ant builds. I think that would help IDEs a great deal. I requested a evalutation desk copy the O'Reilly Ant book for some j2ee material I was teaching. http://www.oreilly.com/catalog/anttdg/ It has a one sentence mention of JNI. So there was not luck there. I saw that there is another Ant book that does mention JNI more. I can't find it now. Ant must be able to support it with extensions. http://ant.apache.org/manual/OptionalTasks/javah.html What the auto(break :) tools do in the rxtx build is 4 things really. 1) gcc compile flags 2) ld compile flags 3) config.h 4) compile flags for customizing rxtx (lockfiles, ...) See 1 All of this information except 4 can be static once obtained. So I'm not attached to the auto tools. If I could find an example of Ant being used for JNI code, I'd be one of the first to start moving that direction. Maybe someone saw an example someplace. The other thing we have not completed discussing is the directory structure. There is interest in making rxtx more IDE friendly. I get more mail about that off the list than how to install rxtx. And I see we have Ken Thompson in da house :) He is our trusted CVS maintainer and the guy that purchased the rxtx.org domain. Old community. We will need Ken for changing the directory structure of source. I would like to open up discussion about both of these as it is more than time. The problem is I have little experience with Ant and even less with IDEs. It would be nice if we could work with Eclipse and NetBeans. http://www.netbeans.org/ (sun and some community) http://www.eclipes.org (ibm,rhat,... perhaps more community) http://maven.apache.org/what-is-maven.html (apache. It is community) borland should sortof be here too but I think thats covered in eclipse. >From what I understand so far, we should morph rxtx to support those three maybe trusting apaches lead with maven. But I use vi. I have little to no clues beyond what people have fed me. Can we agree that thats the right direction to go? -- Trent Jarvi tjarvi at qbang.org From brian at mbari.org Mon Feb 6 14:57:50 2006 From: brian at mbari.org (Brian Schlining) Date: Mon, 6 Feb 2006 13:57:50 -0800 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> > The other thing we have not completed discussing is the directory > structure. There is interest in making rxtx more IDE friendly. I > get more mail about that off the list than how to install rxtx. > > And I see we have Ken Thompson in da house :) He is our trusted > CVS maintainer and the guy that purchased the rxtx.org domain. Old > community. We will need Ken for changing the directory structure of > source. > > I would like to open up discussion about both of these as it is > more than time. The problem is I have little experience with Ant > and even less with IDEs. It would be nice if we could work with > Eclipse and NetBeans. > > http://www.netbeans.org/ (sun and some community) > http://www.eclipes.org (ibm,rhat,... perhaps more community) > http://maven.apache.org/what-is-maven.html (apache. It is community) > borland should sortof be here too but I think thats covered in > eclipse. > >> From what I understand so far, we should morph rxtx to support >> those three > maybe trusting apaches lead with maven. But I use vi. I have > little to no clues beyond what people have fed me. > Maven likes the directory structure below for Java code. (From http:// maven.apache.org/guides/getting-started/index.html) This structure works fine with ant, netbeans, and eclipse. rxtx_root_directory `-- src |-- main | `-- java | `-- gnu | `-- io `-- test `-- java `-- gnu `-- io Brian Schlining Software Engineer http://www.mbari.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/d9451eba/attachment-0058.html From tjarvi at qbang.org Mon Feb 6 15:11:45 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 15:11:45 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: > rxtx_root_directory > `-- src > |-- main > | `-- java > | `-- gnu > | `-- io > `-- test > `-- java > `-- gnu > `-- io > >From what I understand this will just be good. For me it makes no difference. So lets do the rxtx thing. Let if fester for two weeks and if nobody objects, we will do it. I'm not doing this because I care. I'm doing this to eliminate much of my inbox. But test... man is rxtx lacking there in the community aspect. It is covered but not right. _maybe_ I can change that this year. -- Trent Jarvi tjarvi at qbang.org (cat hurding since 1997) From lux at diesel-research.com Mon Feb 6 21:38:49 2006 From: lux at diesel-research.com (Kim Lux) Date: Mon, 06 Feb 2006 21:38:49 -0700 Subject: [Rxtx] How can I use Lock Files with rxtx (in FC4) ? Message-ID: <1139287129.17031.3.camel@zd7280> I am now running an rxtx application on FC4. I am getting: ========================================================= check_group_uucp(): error testing lock file creation Error details: Permission denied check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL ========================================================= $ ls -al /var/lock total 32 drwxrwxr-x 4 root lock 4096 Feb 6 16:04 . drwxr-xr-x 24 root root 4096 Nov 14 01:19 .. drwx------ 2 root root 4096 Apr 27 2005 lvm drwxr-xr-x 2 root root 4096 Feb 6 16:04 subsys How do I fix this for regulator users ? -- Kim Lux, Diesel Research Inc. From dmarkman at mac.com Mon Feb 6 22:24:44 2006 From: dmarkman at mac.com (Dmitry Markman) Date: Tue, 7 Feb 2006 00:24:44 -0500 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: if I understands the issue right in order to be able to use ant for c/c++ compilation you have to install ant's cc task http://ant-contrib.sourceforge.net/cc.html it looks like it should work on mac os x (authors claim, that it's platform independent) but I never tested so all you have to do it's providing right command line for the gcc compiler On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: >> rxtx_root_directory >> `-- src >> |-- main >> | `-- java >> | `-- gnu >> | `-- io >> `-- test >> `-- java >> `-- gnu >> `-- io >> > > >> From what I understand this will just be good. > > For me it makes no difference. So lets do the rxtx thing. Let if > fester for two weeks and if nobody objects, we will do it. > > I'm not doing this because I care. I'm doing this to eliminate > much of my inbox. > > But test... man is rxtx lacking there in the community aspect. It > is covered but not right. _maybe_ I can change that this year. > > -- > Trent Jarvi > tjarvi at qbang.org > (cat hurding since 1997) > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx Dmitry Markman From lux at diesel-research.com Mon Feb 6 23:20:15 2006 From: lux at diesel-research.com (Kim Lux) Date: Mon, 06 Feb 2006 23:20:15 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? Message-ID: <1139293215.3689.4.camel@zd7280> I'm running the code below. portlist.hasMoreElements() is false. /dev has ports in it as listed below. What am I doing wrong ? ========================================================== // Step through the list of ports until we find one that matches // the one we are looking for. portList = CommPortIdentifier.getPortIdentifiers(); while(portList.hasMoreElements()) { portID = (CommPortIdentifier) portList.nextElement(); // if (portID.getName().equals("/dev/ttyUSB0")) { myTA.append("Serial port ttyUSB0 has been found\n"); break; }// if portID equals... }// End of while... ========================================================== ls -al /dev/tty* crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 ... crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 -- Kim Lux, Diesel Research Inc. From david.garnier at trusted-logic.com Tue Feb 7 00:46:30 2006 From: david.garnier at trusted-logic.com (David Garnier) Date: Tue, 07 Feb 2006 08:46:30 +0100 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: <43E85056.2090608@trusted-logic.com> Hello, I think that the make-based build process is fine as it is, apart from the location of the Java source files. It is true that putting the Java source in a directory structure that map 1-to-1 to the Java package structure is the norm and should make it easier for everyone to modify the Java source, with or without an IDE. Ant is a good tool, but in the RXTX case I fail to see the advantage of using it compared to the current make-based process. As Trent said, they are more pressing issues, like testing. Regards, David Dmitry Markman wrote: > if I understands the issue right > in order to be able to use ant for c/c++ compilation > you have to install ant's cc task > http://ant-contrib.sourceforge.net/cc.html > > it looks like it should work on mac os x > (authors claim, that it's platform independent) > but I never tested > > so all you have to do it's providing right command line > for the gcc compiler > > > > > On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: > >>> rxtx_root_directory >>> `-- src >>> |-- main >>> | `-- java >>> | `-- gnu >>> | `-- io >>> `-- test >>> `-- java >>> `-- gnu >>> `-- io >>> >> >> >>> From what I understand this will just be good. >> >> For me it makes no difference. So lets do the rxtx thing. Let if >> fester for two weeks and if nobody objects, we will do it. >> >> I'm not doing this because I care. I'm doing this to eliminate much >> of my inbox. >> >> But test... man is rxtx lacking there in the community aspect. It is >> covered but not right. _maybe_ I can change that this year. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> (cat hurding since 1997) From tjarvi at qbang.org Tue Feb 7 01:11:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 01:11:31 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <43E85056.2090608@trusted-logic.com> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: On Tue, 7 Feb 2006, David Garnier wrote: > Hello, > > I think that the make-based build process is fine as it is, apart from the location of the Java > source files. It is true that putting the Java source in a directory structure that map 1-to-1 to > the Java package structure is the norm and should make it easier for everyone to modify the Java > source, with or without an IDE. > > Ant is a good tool, but in the RXTX case I fail to see the advantage of using it compared to the > current make-based process. As Trent said, they are more pressing issues, like testing. > Hi David I have more experience with testing rxtx than I can talk about. But let it be known, rxtx has gone trough 100's of hours of testing. We are hobby folks interested in toys but there is more. rxtx has had some of the best guidance in the industry there. This is not an easy thing. I may be able to come back in a month from the other side of the corperate fence and help. I suspect the tests could just be made public but they are in a very unusual environment that just wont work in a wider sense. This is something I'll be trying to change. At one point it was agreed we could just make the results public so this isnt just noise.. There is interest and I think its safe to mention that much. The big problem with testing in the past is most of it is done with a loopback connection. So we *still* have major questions regarding things like flow control. rxtx talks to itself over a loopback and it works. regardless of right or wrong. This requires more thought to be done right. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Feb 7 02:46:34 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 02:46:34 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: > The big problem with testing in the past is most of it is done with a > loopback connection. So we *still* have major questions regarding things > like flow control. rxtx talks to itself over a loopback and it works. > regardless of right or wrong. With serial communication there are gold standards. ckermit is probably a definitive 'standard.' Maybe its possible to do ping/pong tests with ckermit? Is it scriptable? There are known issues in rxtx. Probably the worst is some threading issues regarding some JREs with multiple JNI threads setting java variables. Man did I get schooled there. Just switch the c functions to returning variables and things go away. Sometimes they work fine, sometimes they blow up. Without understanding everything, somehow rhat got it right and debian (and especially gentoo) grabbed kernel patches causing all sort of harm. Its not hard to fix once you understand whats going on but nearly impossible to track with a debugger. So I have a good idea what 2.1-8 will have outside of the IDE modifications. rxtx 2.1-7 is a release for everyone to sync with. Its not even as stable as -pre17 as far as I know - I ran no test suites. I'll be chasing it too. We just had so many contributions that it was time. It seriously broke internal scheduals but thats a great thing :) The other thing I want to do in 2.1-8 is automagic baud rates. It turns out lots of shops are doing really funky baud rates for things like automobile test equipment. It is possible but it requires a fair amount of change in the native code. Is anyone looking at this? -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Feb 7 02:57:21 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 07 Feb 2006 04:57:21 -0500 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <43E85056.2090608@trusted-logic.com> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: Hi All, I agree, testing is very important. The problem I have been trying to address is related to cross-platform testing and the robust nature of the installs. Typically, I visit 3 platforms to deploy my product, windows, linux and mac. A build is performed on each platform. The idea that you can build for many platforms from one copy the source code seems attractive. This should enable synchronized deployments of identical code. The question of how to achieve this goal remains open. As Trent mentioned, this is hard. Perhaps Ant will help here (but perhaps not). Ant does seem to help with running unit tests. However, it does not help with multi-platform tests. For that you need many machines and different operating environments. Toward that end, I have created a multi-platform test that can be run from web start, located at: http://show.docjava.com:8086/book/cgij/code/jnlp/serialPort.PortTest.jnlp This is interesting because many people in the community can run the test and we can improve the test, as time permits. No, it is not a perfect solution, however, the idea does help with multi-platform tests using many machines and different operating environments. If the group has a good test for a general serial port set-ups, i would be happy to deploy it, for general evaluation using web start. And as for ANT, it is just an idea. Not all my ideas are good ones! - Doug >Hello, > >I think that the make-based build process is fine as it is, apart >from the location of the Java >source files. It is true that putting the Java source in a directory >structure that map 1-to-1 to >the Java package structure is the norm and should make it easier for >everyone to modify the Java >source, with or without an IDE. > >Ant is a good tool, but in the RXTX case I fail to see the advantage >of using it compared to the >current make-based process. As Trent said, they are more pressing >issues, like testing. > >Regards, >David > >Dmitry Markman wrote: >> if I understands the issue right >> in order to be able to use ant for c/c++ compilation >> you have to install ant's cc task >> http://ant-contrib.sourceforge.net/cc.html >> >> it looks like it should work on mac os x >> (authors claim, that it's platform independent) >> but I never tested >> >> so all you have to do it's providing right command line >> for the gcc compiler >> >> >> >> >> On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: >> >>>> rxtx_root_directory >>>> `-- src >>>> |-- main >>>> | `-- java >>>> | `-- gnu >>>> | `-- io >>>> `-- test >>>> `-- java >>>> `-- gnu >>>> `-- io >>>> >>> >>> >>>> From what I understand this will just be good. >>> >>> For me it makes no difference. So lets do the rxtx thing. Let if >>> fester for two weeks and if nobody objects, we will do it. >>> >>> I'm not doing this because I care. I'm doing this to eliminate much >>> of my inbox. >>> >>> But test... man is rxtx lacking there in the community aspect. It is >>> covered but not right. _maybe_ I can change that this year. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> (cat hurding since 1997) > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From matt.higgins at gmail.com Tue Feb 7 08:28:34 2006 From: matt.higgins at gmail.com (Matt Higgins) Date: Tue, 7 Feb 2006 10:28:34 -0500 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final Message-ID: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? import java.io.*; import java.util.*; import gnu.io.*; public class MySimpleRead implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; public static void main(String[] args) { boolean portFound = false; String defaultPort = "COM1"; if (args.length > 0) { defaultPort = args[0]; } portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; MySimpleRead reader = new MySimpleRead(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } } public MySimpleRead() { try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) { e.printStackTrace(); } try { inputStream = serialPort.getInputStream(); } catch (IOException e) { e.printStackTrace(); } try { serialPort.addEventListener(this); } catch (TooManyListenersException e) { e.printStackTrace(); } try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { e.printStackTrace(); } System.out.println("Baud is " + serialPort.getBaudRate()); System.out.println("Bits is " + serialPort.getDataBits()); System.out.println("Stop is " + serialPort.getStopBits()); System.out.println("Par is " + serialPort.getParity()); serialPort.notifyOnDataAvailable(true); readThread = new Thread(this); readThread.start(); } public void run() { // Thread.sleep(20000); //} catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { System.out.println("An event occurred " + event.getEventType()); switch (event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: byte[] readBuffer = new byte[20]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } System.out.print(new String(readBuffer)); } catch (IOException e) {} break; } } } --------------- Result on windows ------------------------------ Stable Library ============================================================== Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port:: COM1 Baud is 9600 Bits is 8 Stop is 1 Par is 0 ----------------- End Results ----------------------------------------- ------------------ Result on Linux ----------------------------------- Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 Found port: /dev/ttyS0 Baud is 9600 Bits is 8 Stop is 1 Par is 0 An event occurred 1 043100066224 ------------------ End Results --------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/a1431630/attachment-0058.html From brian at mbari.org Tue Feb 7 09:48:37 2006 From: brian at mbari.org (Brian Schlining) Date: Tue, 7 Feb 2006 08:48:37 -0800 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> Message-ID: <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> Hi Matt > The following code works fine on Linux but I never see any data > when run on Windows. This is a cut and paste from the SimpleRead > example. > I am attempting to read data from a bar code scanner. I can fire > up HyperTermianl on windows and see that the device is working > properly as I see the barcodes are scanned and echoed back to the > terminal. However when I run the app I don't see any data. It is > however associating with the com port as the informational bits > print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. Cheers Brian Schlining Software Engineer http://www.mbari.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/16d07f37/attachment-0058.html From lux at diesel-research.com Tue Feb 7 11:59:58 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 11:59:58 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139293215.3689.4.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> Message-ID: <1139338798.8145.4.camel@zd7280> Any ideas on this ? Any reason why portList.hasMoreElements() should be false even though there are devices in /dev ? On Mon, 2006-02-06 at 23:20 -0700, Kim Lux wrote: > I'm running the code below. > > portlist.hasMoreElements() is false. > > /dev has ports in it as listed below. > > What am I doing wrong ? > > > ========================================================== > // Step through the list of ports until we find one that matches > // the one we are looking for. > > portList = CommPortIdentifier.getPortIdentifiers(); > > while(portList.hasMoreElements()) > { > portID = (CommPortIdentifier) portList.nextElement(); // > if (portID.getName().equals("/dev/ttyUSB0")) > { > myTA.append("Serial port ttyUSB0 has been found\n"); > break; > }// if portID equals... > }// End of while... > ========================================================== > > ls -al /dev/tty* > crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty > crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 > crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 > crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 > crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 > ... > crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 > crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 > crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 > > > -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 12:20:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 12:20:25 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139338798.8145.4.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> Message-ID: On Tue, 7 Feb 2006, Kim Lux wrote: > > Any ideas on this ? Any reason why portList.hasMoreElements() should be > false even though there are devices in /dev ? > > > On Mon, 2006-02-06 at 23:20 -0700, Kim Lux wrote: >> I'm running the code below. >> >> portlist.hasMoreElements() is false. >> >> /dev has ports in it as listed below. >> >> What am I doing wrong ? >> >> >> ========================================================== >> // Step through the list of ports until we find one that matches >> // the one we are looking for. >> >> portList = CommPortIdentifier.getPortIdentifiers(); >> >> while(portList.hasMoreElements()) >> { >> portID = (CommPortIdentifier) portList.nextElement(); // >> if (portID.getName().equals("/dev/ttyUSB0")) >> { >> myTA.append("Serial port ttyUSB0 has been found\n"); >> break; >> }// if portID equals... >> }// End of while... >> ========================================================== >> >> ls -al /dev/tty* >> crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty >> crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 >> crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 >> crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 >> crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 >> ... >> crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 >> crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 >> crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 >> >> >> > Hi Kim What rxtx does is try to open the port and do a timed out read. If the kernel/... do not complain it's enumarted. I suspect you could do a crude test by doing something like cat /dev/ttyS0 > /dev/null If that barfs then rxtx wont enumerate the port. hmm looking at your question again, I suspect it's a lockfile problem. This is documented in INSTALL with the source. Its easy enough to test this too.. touch /var/lock/testingrxtxlockfiles && rm -f /var/lock/testingrxtxlockfiles If you are not in the right group it will bail. Root will work regardless. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 12:37:56 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 12:37:56 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> Message-ID: <1139341076.8145.11.camel@zd7280> Exactly which ports does rxtx attempt to put into the list ? /dev/* or /dev/tty* or /dev/tty[0-9[0-9] ? or /dev/ttyS* ? For the record, only /dev/ttyUSB0 is a valid port on the machine I am presently on. Will this be a problem ? On Tue, 2006-02-07 at 12:20 -0700, Trent Jarvi wrote: > This is documented in INSTALL with the source. > I was wondering where that file was. I will download source and dig it up. Thanks. -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 12:51:09 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 12:51:09 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139341076.8145.11.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: On Tue, 7 Feb 2006, Kim Lux wrote: > > Exactly which ports does rxtx attempt to put into the list ? /dev/* > or /dev/tty* or /dev/tty[0-9[0-9] ? or /dev/ttyS* ? > > For the record, only /dev/ttyUSB0 is a valid port on the machine I am > presently on. Will this be a problem ? > > > On Tue, 2006-02-07 at 12:20 -0700, Trent Jarvi wrote: >> This is documented in INSTALL with the source. >> > I was wondering where that file was. I will download source and dig it > up. > > Thanks. > Hmm I'm looking at pre17 so this may have changed. (its just what I have on this machine) if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA" // for the IPAQs }; CandidatePortPrefixes=Temp; } So you may need to add "ttyUSB" to that list. RXTX used to enumerate _everything_ see if(osName.equals("Linux-all-ports") But it became less than practical. This is all in RXTXCommDriver.java hmm I just did a cvs update. if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have to get your fingers into the code. We aim for sane defaults. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 13:06:45 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 13:06:45 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139342805.8145.22.camel@zd7280> On Tue, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > Hmm I'm looking at pre17 so this may have changed. (its just what I have > on this machine) > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA" // for the IPAQs > }; > CandidatePortPrefixes=Temp; > } > > > So you may need to add "ttyUSB" to that list. RXTX used to enumerate > _everything_ see if(osName.equals("Linux-all-ports") But it became less > than practical. > > This is all in RXTXCommDriver.java > > hmm I just did a cvs update. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have > to get your fingers into the code. We aim for sane defaults. Excellent. Thanks for taking the time. -- Kim Lux, Diesel Research Inc. From ideiglenes1 at freemail.hu Tue Feb 7 13:53:39 2006 From: ideiglenes1 at freemail.hu (--) Date: Tue, 07 Feb 2006 21:53:39 +0100 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139345619.22534.2.camel@localhost> Hi! I use this code to get all the extra Linux devices. :) if ("Linux".equals(System.getProperty("os.name"))) { System.setProperty("os.name","Linux-all-ports"); } driver = new RXTXCommDriver(); On k, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > On Tue, 7 Feb 2006, Kim Lux wrote: > > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have > to get your fingers into the code. We aim for sane defaults. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From matt.higgins at gmail.com Tue Feb 7 13:45:54 2006 From: matt.higgins at gmail.com (Matt Higgins) Date: Tue, 7 Feb 2006 15:45:54 -0500 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> Message-ID: <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> Sweet this is exactly what I needed. I was searching the archives through marc.theamisgroup they only have archives back to 1/3/05. Should have hit the mailman archive! Thanks a lot! On 2/7/06, Brian Schlining wrote: > > Hi Matt > > The following code works fine on Linux but I never see any data when run > on Windows. This is a cut and paste from the SimpleRead example. > I am attempting to read data from a bar code scanner. I can fire up > HyperTermianl on windows and see that the device is working properly as I > see the barcodes are scanned and echoed back to the terminal. However when I > run the app I don't see any data. It is however associating with the com > port as the informational bits print fine? > > > You're not the only one whose had this problem, I don't know if Trent has > addressed this is the latest release of RXTX but there is a workaround. > Here's the recent thread from the RXTX mailing list regarding this issues: > > Thanasis Delenikas tdelenik at gmail.com > Wed Jan 18 13:56:23 MST 2006 > > * Previous message: [Rxtx] Re: More close() performance fixes > * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] > > Hi all. > (I've subscribed again from my other email account). > > Trent, > > You are right. Linux *always* works, no matter what flow control you set. > Windows *works only* with hardware flow control (I haven't tested what > happens with software XON/XOFF flow control). > > I assume (but I am not certain) that even with no flow control at all, all > platforms should work. Without flow control, you have the risk of bumping > into overflow or framing errors, but that's your (the end programmer, I > mean) problem. > > >From my side, I shouldn't be working without flow control. That was a bug > too... It was some code forgotten from the old times, when I used to work > with phone emulation drivers which didn't support flow control. The > correct > way is to have some flow control enabled and that's why I suppose this is > a > low-severity bug for RxTx. > > I have no idea which platform shows the correct behaviour, since > my knowledge about Linux and the inner workings of these low-level i/o > operations is limited. > > Regards, > Thanasis Delenikas. > > > > > Message: 2 > > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > > From: Trent Jarvi > > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > > To: RXTX Developers and Users > > Message-ID: > > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > > > Hi all, > > > > > > Trent, I have found something. > > > I read your comment about flow control, so I experimented a bit. > > > > > > If you remember, in my sample program I've used no flow control at all > ( > > i.e. > > > Java constant FLOWCONTROL_NONE). > > > > > > Now, during testing, I've switch to hardware inbound flow control (i.e > . > > Java > > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > > beautifully! > > > > > > I think I will switch to H/W flow control and test things for a while, > > but > > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > > > > > Hi Thanasis, > > > > I'm fairly sure you have identified a bug. I would not worry too much > > about what Sun CommAPI w32 defaults are. I think they did more or less > > whatever the port opened with. Just a guess. Linux tries to stomp on > > ports so they are all the same. > > > > So this started out with Linux worked, Windows XP/.. did not as I > recall. > > Something is wrong in rxtx. Do I understand this right? > > > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > > > Perhaps there is something Wayne or I did not understand when we wrote > > that code. I wasnt programming back in the BBS days so modems are not > my > > thing. I have a few questions. > > > > Is the above matrix confirmed by observation? > > Linux just always worked? > > Which one _should_ work? I'm guessing modems work with hardware flow > > control. I'll have to dig around. > > > > The windows flow control changes a couple things with hardware flow > > control. Following the w32 API documentation is confusing sometimes. > > But it looks like Linux could have a bug too. > > Cheers > > Brian Schlining > Software Engineer > http://www.mbari.org > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/9c989144/attachment-0058.html From tjarvi at qbang.org Tue Feb 7 14:06:14 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 14:06:14 -0700 (MST) Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> Message-ID: >> >> You're not the only one whose had this problem, I don't know if Trent has >> addressed this is the latest release of RXTX but there is a workaround. >> Here's the recent thread from the RXTX mailing list regarding this issues: >> I have not. I expect to have access to some test equipment next month and I'll go through all of this. I really don't know whats going on and I need a gold standard. I thought maybe linux was autodetecting the flow control. Your observations would certainly be welcome. I need to talk to Russell King and see what he is doing. Until then I'd just be toying around over a loopback as usual. This is very high on the list though. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 17:25:05 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 17:25:05 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139358305.17994.2.camel@zd7280> My application now works. I installed the libraries and jar from 2.1-7 (Final). portlist.hasMoreElements is no longer false. The application finds the port for /dev/ttyUSB0. Thanks for your help, Trent (et al) Sorry I bothered you with this. Next time I will look in the source first. I didn't think it was an rxtx issue, I thought it was a Linux setup issue . On Tue, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > Hmm I'm looking at pre17 so this may have changed. (its just what I > have > on this machine) > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux > Serial Ports > "ttySA" // for the > IPAQs > }; > > CandidatePortPrefixes=Temp; > } > > > So you may need to add "ttyUSB" to that list. RXTX used to enumerate > _everything_ see if(osName.equals("Linux-all-ports") But it became > less > than practical. > > This is all in RXTXCommDriver.java > > hmm I just did a cvs update. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux > Serial Ports > "ttySA", // for the > IPAQs > "ttyUSB" // for USB > frobs > }; > > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you > have > to get your fingers into the code. We aim for sane defaults. -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 19:21:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 19:21:54 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139358305.17994.2.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> <1139358305.17994.2.camel@zd7280> Message-ID: >Sorry I bothered you with this. Next time I will look in the source >first. I didn't think it was an rxtx issue, I thought it was a Linux >setup issue . Why would you be sorry? I would have done the same. I'm glad it's working :) -- Trent Jarvi tjarvi at qbang.org From tma at mail.island.net Wed Feb 8 13:39:35 2006 From: tma at mail.island.net (Tom Alldread) Date: Wed, 08 Feb 2006 12:39:35 -0800 Subject: [Rxtx] Win32/Linux Serial Port Data Dropouts In-Reply-To: <200602060702.k167255O007882@www.qbang.org> References: <200602060702.k167255O007882@www.qbang.org> Message-ID: <43EA5707.4020200@mail.island.net> Greetings Folks at RXTX: During the last couple of months I have been alternately testing with javax.comm 2 and RXTX 2.1 under Windows XP and CommApi 3 and RXTX 2.1 under Suse 10.0 Linux. In the process I have learned a little about java multi-threading under NetBeans 5 with Profiler. My java (jdk 1.5_06) application is used for data acquisition and provides a graphical display of A-D conversion data received from a 56KBaud serial port. The actual data throughput is about 10KBaud thus it is well below the speed of the port. I use hardware RTS/CTS flow control which can stall the data acquisition sample rate if necessary. This ensures the display computer has the ability to slow the data acquisition rate should it become too busy to accept the regular data flow. Both the serial port buffer and the java read buffer are set at 16KB. Usually the data transfers into the java read buffer are less than 100 bytes unless the data acquisition is recovering from a stall. The data flow normally hesitates after each 5 KB block as a continue command is needed from the display computer to start the drawing of a new graphics display line. Separate threads have been provided for the serial port event monitoring and data processing. The serial port event thread has been given the maximum priority and data processing thread the minimum priority provided by java. Thread yield statements have been placed within all data processing while/for loops as an effort to ensure quick access to CPU cycles for the serial port event thread. I have found that short data transmissions are essentially error free but occasional dropouts occur with continuous data flow especially under Windows XP. ....................................................................................................................................................................................... Linux results: I am happy to report that RXTX 2.1 appears to work very well under Linux although I did notice some errors when the screen savers were running with my dual monitors. I believe this is a local problem associated with my dual graphics which needs further attention. The recent CommApi 3 Linux release from Sun did not work at all with my program. It seemed to send commands out OK but did not receive any data. Although the serial port event triggered the ISR, the input stream appeared filled with nulls and thus did not contain any data. As my understanding is that CommApi 3 was tested with a Red Hat distribution of Linux I wonder if this problem is distro dependent? Although somewhat off topic here I wonder if anyone reading this has had similar experience? .................................................................................................................................................................................. Windows XP results: There are problems with occasional data dropouts which become more frequent as the sampling rate is increased or if the computer becomes busy with other duties. The dropouts typically consist of a half dozen byte block of lost data. It appears the lost bytes never get added to the java input stream. There has not been any indication of garbled data, overruns or framing errors which suggests the UART communications remains solid. Using javax.comm 2 I found that the setting of SerialPort 'enableReceiveThreshold' to 40 and 'enableReceiveTimeout' of 100mS reduced the dropouts error rate significantly. I found that I could not get RXTX 2.1 to function with the aforementioned threshold and timeout settings. The javax.comm 2 interface is consequently performing better for me under Windows than RXTX 2.1. I wonder if anyone here has any suggestions as to what I might try to improve RXTX 2.1? Although my settings are the same as under Suse 10.0, RXTX 2.1 performs much better for me under Linux than any of the alternatives that I have tried under Windows XP . ............................................................................................................................................................................... I would like to establish, based on the experience of others, if I have reached the normally expected performance limit of java serial port communications? Should I expect to achieve virtually error free serial port data input from a continuous stream under Windows XP java software? I am considering changing my protocol to packets with error checking if necessary but would like to know if the dropout problems I am experiencing are typical or not before I take this rather work intensive plunge. Many thanks in advance for any help! Best Regards, Tom Alldread -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.375 / Virus Database: 267.15.2/253 - Release Date: 2006-02-07 From jlaxson at mac.com Wed Feb 8 23:56:48 2006 From: jlaxson at mac.com (John Laxson) Date: Thu, 9 Feb 2006 00:56:48 -0600 Subject: [Rxtx] PortInUseException: Unknown Application on OSX Message-ID: Hi, I've been trying to get RXTX 2.1.7 going on Mac OS X for a while here, and am running up into a wall here. I've tried with pre- compiled and the source version and get the same problem, a gnu.io.PortInUseException: Unknown Application. I have run the fixperms script included with the source distribution, and id shows me as a member of the uucp group, and permissions on /var/spool/uucp are 775 root:uucp. Running a test program (included at the bottom for clarity) lets me enumerate all the serial ports correctly, but trying to open any of them gives the PortInUseException. If it helps, when I try to open a port that's set to make an outgoing bluetooth connection, there is no delay and no connection attempt at all. Thanks, John Laxson PS: The documentation wiki on qbang.org shows 404, and has for a few days now. My test code: public static void main(String[] args) { SerialPort serialPort; try { Enumeration e = CommPortIdentifier.getPortIdentifiers(); CommPortIdentifier ident; while (e.hasMoreElements()) { ident = (CommPortIdentifier)e.nextElement(); System.out.println(ident.getName()); } ident = CommPortIdentifier.getPortIdentifier("/dev/cu.modem"); serialPort = (SerialPort) ident.open("Me", 5000); } catch (Exception e) { e.printStackTrace(); } } From rajesh.invincible at gmail.com Thu Feb 9 03:39:38 2006 From: rajesh.invincible at gmail.com (Rajesh N) Date: Thu, 9 Feb 2006 16:09:38 +0530 Subject: [Rxtx] Re: Move .java Files in gnu.io filesystem hierarchy - Maven (2) In-Reply-To: <43DF21D2.7090200@ngi.it> References: <43DF21D2.7090200@ngi.it> Message-ID: <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Can anybody tell me how to overcome these EXCEPTIONS I AM WORKING ON SERIAL COMMN IN JAVA ON LINUX. 1. " NOT ALL PARAMETERS SUPPORTED BY THE KERNEL" This i came across the following statement inmy prog. SerialP is A SerialPort object SerialP.setSerialPortParams(9600(BAUDRATE),DATABITS_8,STOPBITS_1,PARITY_NONE) 2. NullPointer Exception at Event Dispatch Now i have checked all my object references for a null reference but i found none i have put up my entire code in try catch blocks but still I AM UNABLE TO CATCH THIS EXCEPTION AND HENCE MY APPLICATION CLOSES HOW DOES THESE GO? PLEASE HELP ME IT IS URGENTTTTTTTTTTTTTTTT yours sincerely RAJESH On 1/31/06, Fabio Frumento wrote: > Hi Xavier, > > I don't know maven at all but the directory hierarchy listed buy Trent > is fine for me... > > I'll take a look to maven, it seems an interesting project > > Regards > > Fabio Frumento > > Trent Jarvi wrote: > > On Tue, 31 Jan 2006, Xavier Frisaye wrote: > > > >> Hi all, > >> > >> If you are going to rearrange the src folder, i will propose to use > >> maven 2 and follow its directory structure > >> > (http://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html). > >> > >> Maven 2 simplify java project and give a standard way to make projects > >> (http://maven.apache.org/). > >> We are using it for internal projects and we are very satisfied. > >> > >> Is anybody interested? > >> > >> I'm not an expert in maven 2 (yet) but i'm agree to help using it if > >> you choose to make so. > >> > > > > so this would be: > > > > rxtx-devel/src/main/java/gnu.io > > rxtx-devel/src/test/java/ManIwish.java > > > > I don't use IDEs very much so I'll let others comment. But I don't see > > a problem with that. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Thu Feb 9 09:50:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 9 Feb 2006 09:50:31 -0700 (MST) Subject: [Rxtx] Re: Move .java Files in gnu.io filesystem hierarchy - Maven (2) In-Reply-To: <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Message-ID: On Thu, 9 Feb 2006, Rajesh N wrote: > Can anybody tell me how to overcome these EXCEPTIONS > I AM WORKING ON SERIAL COMMN IN JAVA ON LINUX. > > 1. " NOT ALL PARAMETERS SUPPORTED BY THE KERNEL" > > This i came across the following statement inmy prog. > SerialP is A SerialPort object > SerialP.setSerialPortParams(9600(BAUDRATE),DATABITS_8,STOPBITS_1,PARITY_NONE) > Strange. The parameters you use are the same the port should open with by default. Could you paste the actual exception you are getting? I don't see that in the rxtx source. Also it would help to know the rxtx version. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Fri Feb 10 15:29:05 2006 From: lux at diesel-research.com (Kim Lux) Date: Fri, 10 Feb 2006 15:29:05 -0700 Subject: [Rxtx] One serial port object for both sending and receiving ? Message-ID: <1139610545.18177.4.camel@zd7280> Is it OK to use one SerialPort ojbect (ex Serial Port serialPort;) and use it for both sending and receiving ? For example: ======================================================================== static SerialPort serialPort = null; static OutputStream serialOut = null; static InputStream serialIn = null; // assign it to an outputStream for use try{ serialOut = serialPort.getOutputStream(); System.out.println("Serial output stream has been assigned."); }//try catch(IOException e) { System.out.println("Error: Couldn't assign output stream to serial port."); }//catch //assign it to an inputStream for use try{ serialIn = serialPort.getInputStream(); System.out.println("Serial input stream has been assigned."); }//try catch(IOException e) { System.out.println("Error: Couldn't assign input stream to serial port."); }//catch ======================================================================== -- Kim Lux, Diesel Research Inc. From lux at diesel-research.com Fri Feb 10 21:23:00 2006 From: lux at diesel-research.com (Kim Lux) Date: Fri, 10 Feb 2006 21:23:00 -0700 Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Message-ID: <1139631780.23882.10.camel@zd7280> I've got a problem receiving chars with my version of serialRead, written in an SWT GUI. I had a Java pro have a good look at my code and he can't see anything wrong with it. I can send chars fine. When I receive a char the cpu usage for the app goes to 100% and the code in the serial event handler doesn't get executed. The instructions on the Java Comm Serial API How-To for Linux page state that I must install javacomm. Is that true ? Everything builds without it and I can send chars on rxtx just fine, but I can't receive them. Could this be the problem ? I downloaded and installed javacomm. I was not able to add "Driver=gnuio.RXTXCommDriver to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 installed in /usr/java/jre1.5.0_05. I added comm.jar to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext to the library paths. Is this OK ? Does it matter that I am receiving on /dev/ttyUSB0 ? Thanks. -- Kim Lux, Diesel Research Inc. From lunareclipse03 at web.de Sat Feb 11 09:44:46 2006 From: lunareclipse03 at web.de (lunareclipse03@web.de) Date: Sat, 11 Feb 2006 17:44:46 +0100 Subject: [Rxtx] Question about Serial I/O under Win32 Message-ID: <662084330@web.de> Hello everybody, I have a strange problem with a piece of code I made for myself. No, this is not really concerning rxtx, but nevertheless I post this to the list, hoping that some of you can help me. I've written two libraries, one for linux and one for win32. The linux port works quite well, I can send / receive faxes and / or replay voice messages over the telephone line using a voice modem. But the win32 port of the library causes some trouble. If, for example, I send out a fax with a certain modem under linux, it works well. The fax is complete when it comes out of the fax machine. If I then use the same modem to send out a fax under win32, the fax coming out of the fax machine gets "stuck" halfways, but the sending modem thinks that transmission was ok and drops the connection. The answering fax machine then gives me "error while receiving." The "upper layer" java code MUST be right, because if I do the same thing under linux (using the linux library), everything is alright. Now I have to ask: Can somebody please help me out with this??!? Could it be the case that some kind of flow control or COMMTIMEOUTS setting causes this behaviour? I set flow control to RTS/CTS before sending out a fax. How can I DISABLE flow control? Or what do you think? Can something else cause this problems? Thank you all for your time and PLEASE write back soon. Regards, --Sven Ahlemann Am Waldrand 31 45721 Haltern am See Germany ______________________________________________________________ Verschicken Sie romantische, coole und witzige Bilder per SMS! Jetzt bei WEB.DE FreeMail: http://f.web.de/?mc=021193 From lux at diesel-research.com Sat Feb 11 10:06:52 2006 From: lux at diesel-research.com (Kim Lux) Date: Sat, 11 Feb 2006 10:06:52 -0700 Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: <1139631780.23882.10.camel@zd7280> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> <1139631780.23882.10.camel@zd7280> Message-ID: <1139677612.3431.5.camel@zd7280> More on this problem. I copied and pasted simpleRead into a console based Eclipse project and I've got the same result, except that cpu usage doesn't go to 100%. I'm beginning to think there is an issue in rxtx. My imports for simpleRead are: ============================ import gnu.io.*; import java.util.*; //import javax.comm.*; import java.io.*; =========================== Any ideas ? I am trying to read from /dev/ttyUSB0 using a serial to USB adapter which has worked well with minicom and gtkterm. Thanks. On Fri, 2006-02-10 at 21:23 -0700, Kim Lux wrote: > I've got a problem receiving chars with my version of serialRead, > written in an SWT GUI. > > I had a Java pro have a good look at my code and he can't see anything > wrong with it. > > I can send chars fine. When I receive a char the cpu usage for the app > goes to 100% and the code in the serial event handler doesn't get > executed. > > The instructions on the Java Comm Serial API How-To for Linux page state > that I must install javacomm. Is that true ? Everything builds without > it and I can send chars on rxtx just fine, but I can't receive them. > Could this be the problem ? > > I downloaded and installed javacomm. I was not able to add > "Driver=gnuio.RXTXCommDriver > to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not > have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 > installed in /usr/java/jre1.5.0_05. I added comm.jar > to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext > to the library paths. Is this OK ? > > Does it matter that I am receiving on /dev/ttyUSB0 ? > > Thanks. > -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Sun Feb 12 21:01:33 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:01:33 -0700 (MST) Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: <1139677612.3431.5.camel@zd7280> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> <1139631780.23882.10.camel@zd7280> <1139677612.3431.5.camel@zd7280> Message-ID: I suspect what is happening is the select() is breaking out in the native code but the driver does not have support for notifying there are X bytes available. On some traditional Unix based systems, the only way you know data is available is the fd status changes and do an FIORDCHK ioctl. Or perhaps the only thing you can know is the fd status changed. It would take reading through the kernel driver code to know for sure. So on USB, depending upon the driver, the same may need to be done or the driver improved a bit if possible to support. Polling reads will also work but don't use the event driven model of CommAPI which isnt acceptable in the long run. The 100% cpu usage can then be explained because select no longer blocks until the data is read; the eventLoop spins loose. You can put a well placed sleep but rxtx only expects those are needed when it knows data is available. This may not be a super simple thing to understand and fix. I do have ideas to get you started. I'm going to be short on time the next couple weeks. I expect to put some good time in and answer some other questions I saw around the 25th. For now, I'd look at the following and go from there with the hints I've given. JNIEXPORT jint JNICALL RXTXPort(nativeavailable)( JNIEnv *env, jobject jobj ) { int fd = get_java_var( env, jobj,"fd","I" ); int result; /* char message[80]; ENTER( "RXTXPort:nativeavailable" ); On SCO OpenServer FIONREAD always fails for serial devices, so try ioctl FIORDCHK instead; will only tell us whether bytes are available, not how many, but better than nothing. This turns out to be true on Solaris also. taj. */ #ifdef FIORDCHK /* __unixware__ __sun__ probably others */ result = ioctl(fd, FIORDCHK, 0); #else if( ioctl( fd, FIONREAD, &result ) < 0 ) { goto fail; } #endif /* FIORDCHK */ On Sat, 11 Feb 2006, Kim Lux wrote: > > More on this problem. I copied and pasted simpleRead into a console > based Eclipse project and I've got the same result, except that cpu > usage doesn't go to 100%. I'm beginning to think there is an issue in > rxtx. > > My imports for simpleRead are: > > ============================ > import gnu.io.*; > import java.util.*; > //import javax.comm.*; > import java.io.*; > =========================== > > Any ideas ? I am trying to read from /dev/ttyUSB0 using a serial to > USB adapter which has worked well with minicom and gtkterm. > > Thanks. > > > > On Fri, 2006-02-10 at 21:23 -0700, Kim Lux wrote: >> I've got a problem receiving chars with my version of serialRead, >> written in an SWT GUI. >> >> I had a Java pro have a good look at my code and he can't see anything >> wrong with it. >> >> I can send chars fine. When I receive a char the cpu usage for the app >> goes to 100% and the code in the serial event handler doesn't get >> executed. >> >> The instructions on the Java Comm Serial API How-To for Linux page state >> that I must install javacomm. Is that true ? Everything builds without >> it and I can send chars on rxtx just fine, but I can't receive them. >> Could this be the problem ? >> >> I downloaded and installed javacomm. I was not able to add >> "Driver=gnuio.RXTXCommDriver >> to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not >> have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 >> installed in /usr/java/jre1.5.0_05. I added comm.jar >> to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext >> to the library paths. Is this OK ? >> >> Does it matter that I am receiving on /dev/ttyUSB0 ? >> >> Thanks. >> > From tjarvi at qbang.org Sun Feb 12 21:03:30 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:03:30 -0700 (MST) Subject: [Rxtx] One serial port object for both sending and receiving ? In-Reply-To: <1139610545.18177.4.camel@zd7280> References: <1139610545.18177.4.camel@zd7280> Message-ID: On Fri, 10 Feb 2006, Kim Lux wrote: > > Is it OK to use one SerialPort ojbect (ex Serial Port serialPort;) and > use it for both sending and receiving ? > > For example: > > ======================================================================== > static SerialPort serialPort = null; > static OutputStream serialOut = null; > static InputStream serialIn = null; > > > > > // assign it to an outputStream for use > try{ > serialOut = serialPort.getOutputStream(); > System.out.println("Serial output stream has been assigned."); > }//try > catch(IOException e) > { > System.out.println("Error: Couldn't assign output stream to serial > port."); > }//catch > > > //assign it to an inputStream for use > try{ > serialIn = serialPort.getInputStream(); > System.out.println("Serial input stream has been assigned."); > }//try > catch(IOException e) > { > System.out.println("Error: Couldn't assign input stream to serial > port."); > }//catch This should be fine. In fact trying to do it another way will probably not work as you will run into lockfile issues. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun Feb 12 21:13:13 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:13:13 -0700 (MST) Subject: [Rxtx] Question about Serial I/O under Win32 In-Reply-To: <662084330@web.de> References: <662084330@web.de> Message-ID: On Sat, 11 Feb 2006 lunareclipse03 at web.de wrote: > Hello everybody, > > I have a strange problem with a piece of code I made for myself. No, > this is not really concerning rxtx, but nevertheless I post this to the > list, hoping that some of you can help me. I've written two libraries, > one for linux and one for win32. The linux port works quite well, I can > send / receive faxes and / or replay voice messages over the telephone > line using a voice modem. But the win32 port of the library causes some > trouble. If, for example, I send out a fax with a certain modem under > linux, it works well. The fax is complete when it comes out of the fax > machine. If I then use the same modem to send out a fax under win32, the > fax coming out of the fax machine gets "stuck" halfways, but the sending > modem thinks that transmission was ok and drops the connection. The > answering fax machine then gives me "error while receiving." The "upper > layer" java code MUST be right, because if I do the same thing under > linux (using the linux library), everything is alright. Now I have to > ask: Can somebody please help me out with this??!? Could it be the case > that some kind of flow control or COMMTIMEOUTS setting causes this > behaviour? I set flow control to RTS/CTS before sending out a fax. How > can I DISABLE flow control? Or what do you think? Can something else > cause this problems? Thank you all for your time and PLEASE write back > soon. > Hi Sven I'm not too willing to talk about flow control at the low level until I confirm some things with test equipment later. It is not clear if you are using rxtx or writing your own native code. So I'm not sure how to answer much of this :) If you are wondering how to change the flow control using rxtx from java, The BlackBox example from Sun flips this back and forth. SerialPort.java in rxtx 2.1 uses the following: SerialPort.java: public static final int FLOWCONTROL_NONE =0; SerialPort.java: public static final int FLOWCONTROL_RTSCTS_IN =1; SerialPort.java: public static final int FLOWCONTROL_RTSCTS_OUT =2; SerialPort.java: public static final int FLOWCONTROL_XONXOFF_IN =4; SerialPort.java: public static final int FLOWCONTROL_XONXOFF_OUT=8; So if you set flowcontrol to RTSCTS, you can set it to NONE to turn it off. If you are looking for how to do it in native code, the rxtx Source is SerialImp.c (unix/linux/mac os x/w32) and termios.c (w32 only with SerialImp.c) You can track the code: SerialImp.c:JNIEXPORT void JNICALL RXTXPort(setflowcontrol)( JNIEnv *env, jobject jobj, jint flowmode ) termios.c:int tcgetattr( int fd, struct termios *s_termios ) termios.c:int tcsetattr( int fd, int when, struct termios *s_termios ) There may be a problem in the rxtx flow control code though. Rather than guess, I want to test this with a gold standard. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Feb 6 00:00:16 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 00:00:16 -0700 (MST) Subject: [Rxtx] wiki delay until tomorrow night. In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: On Sun, 5 Feb 2006, Trent Jarvi wrote: > On Sun, 5 Feb 2006, Kim Lux wrote: > >> usb ? Tell me more... I need that too. > > usb is a very proper design. Thats all it is. > Maybe rxtx could help usb. But it would start with helping bring back the community that was already there. It's not something I'd love to do but maybe its the right thing to do. It would probably take 2 years to do right. But maybe thats better than what we have now. I honestly don't know what IBM is doing which could just run over everything. Just some thoughts after some fine german wine. -- Trent Jarvi tjarvi at qbang.org From gadelavega at yahoo.com.ar Mon Feb 6 02:17:05 2006 From: gadelavega at yahoo.com.ar (Gonzalo A. de la Vega) Date: Mon, 06 Feb 2006 10:17:05 +0100 Subject: [Rxtx] Serial port ownership question In-Reply-To: References: <20060205113618.30274.qmail@web53501.mail.yahoo.com> <1139157422.4553.9.camel@zd7280> <1139158698.4936.9.camel@zd7280> Message-ID: <43E71411.4050402@yahoo.com.ar> On my Fedora Core 4: ls -l /dev/ttyS* crw-rw---- 1 root uucp 4, 64 Feb 6 2006 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Feb 6 2006 /dev/ttyS1 ... and: grep "ttyUSB" /etc/udev/rules.d/50-udev.rules KERNEL=="ttyUSB*", GROUP="uucp", MODE="0660" So anyone in the "uucp" group can use serial ports. On Gentoo the group is "tty". Trent Jarvi escribi?: > > > On Sun, 5 Feb 2006, Dr. Douglas Lyon wrote: > >> I can confirm that this is the case (only root ownership of >> serial ports, under fedora 4). >> Wow, what were they thinking?! >> - DL >> >>> I've found that the newer kernels have the serial ports owned by root. >>> For example, >>> >>> $ls -al /dev/tty* >>> crw-rw-rw- 1 root root 5, 0 Feb 5 02:06 /dev/tty >>> crw-rw---- 1 root root 4, 0 Feb 5 02:06 /dev/tty0 >>> crw------- 1 root root 4, 1 Feb 5 09:07 /dev/tty1 >>> crw-rw---- 1 root tty 4, 10 Feb 5 02:06 /dev/tty10 >>> crw-rw---- 1 root tty 4, 11 Feb 5 02:06 /dev/tty11 >>> ... > > > This is just not a problem jcp or such are going to solve. Its a > platform spitwad fight. But do look at pam. In fact thats what Sun > is doing too. Maybe Linux followed their lead.. I'm not a pam guy. > I've spent 16 hours trying to understand it but your users wont :) > > Solution? I have no clue. Its two tangent mentalities from my > perspective. > > -- > Trent Jarvi > tjarvi at qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mtnvega at yahoo.com.br Mon Feb 6 05:35:43 2006 From: mtnvega at yahoo.com.br (Luiz Jr) Date: Mon, 6 Feb 2006 12:35:43 +0000 (GMT) Subject: [Rxtx] Documentation Wiki In-Reply-To: <1139157422.4553.9.camel@zd7280> Message-ID: <20060206123543.57256.qmail@web53515.mail.yahoo.com> Hello, Thank you for you answer, but so the usage of the API is pretty much like the Java Communications Api? If yes, what version of the Java Comm Api? Thank you, Luiz A. Brandao Jr Kim Lux escreveu: On Sun, 2006-02-05 at 08:36 -0300, Luiz Jr wrote: > Hello, > > I want to start using the RXTX libraries, but I would to know how, > since I can not access the documentation wiki page I just started using them yesterday. Below is how I installed the libraries, if that helps. I used snippets of code from the SimpleWrite application here to get me going. http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html Instead of "import javax.comm.*;", use "import gnu.io.*;" which is gotten from RXTXcomm.jar, which you will need to include in your project references. I am working in Eclipse. BTW: there is no way to open a port without going through the port list and finding it. Maybe sometime in the future someone (me ?) will write a method called openSerialPort that allows the user to give a port identifier, such as "/dev/tty1" and return a port ready to use. It wouldn't take much to write that and it would save users a lot of code. Hope this helps. ======================================================================= 1) Figure out which java you are running, incase there is more than one installed. $ java -version java version "1.5.0_05" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_05-b05) Java HotSpot(TM) Client VM (build 1.5.0_05-b05, mixed mode, sharing) 2) Find all the jre directories and the one from which you are currently running. kfind (jre) 3) cd to that directory plus /lib/i386 cd /usr/java/jre1.5.0_05/lib/i386 4) Copy the library files (*.so) to that directory. cp /home/krlux/Desktop/'Java Controls'/rxtx-linux/bin/* . 5) Check that the copy was successful ls librxtx* librxtxI2C.so librxtxRaw.so librxtxSerial.so librxtxParallel.so librxtxRS485.so 6) cd to the /lib/ext directory for your java. cd /usr/java/jre1.5.0_05/lib/ext 7) Copy the Jar files there cp /home/krlux/Desktop/'Java Controls'/rxtx-linux/lib/ext/* . 8) Check that it was successful ls RXTX* RXTXcomm.jar Rxtx is now installed on your machine ready to use. =================================================================== -- Kim Lux, Diesel Research Inc. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx --------------------------------- Yahoo! Acesso Gr?tis - Internet r?pida e gr?tis. Instale o discador agora! -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/544aa403/attachment-0059.html From lyon at docjava.com Mon Feb 6 05:49:34 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 06 Feb 2006 07:49:34 -0500 Subject: [Rxtx] wiki delay until tomorrow night. In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: Hi All, I have often thought about USB drivers being needed. For example, the ironman watch will not interface to a mac (windows only). It is USB. My dymo label writer has no Java driver (native only). Etc. Most cheap web cameras are USB (and Java drivers go through JAI, if it supports the camera at all). The JAI code shows how sun did the USB drivers. You have to be a member of the jai project to download the source code. https://jai.dev.java.net has the jai distro. And then you are not allowed to redistribute it. However, we can all learn from it (if so inclined). Basically: cvs -d :pserver:lyon at cvs.dev.java.net:/cvs login cvs -d :pserver:lyon at cvs.dev.java.net:/cvs checkout jai-core You will need to user your own uid and pw to get in. The ant build has over 100 warnings from sun deprecations of its own code. You might say that they were hoisted on their own Picard ;) One interesting thing is that they support several platforms: linux-amd64 64-bit Linux-AMD64 linux-i586 32-bit Linux-x86 solaris-amd64 64-bit Solaris-AMD64 solaris-i586 32-bit Solaris-x86 solaris-sparc 32-bit Solaris-SPARC solaris-sparcv9 64-bit Solaris-SPARC windows-i586 32-bit Windows-x86 Thus, ant is used to provide a multi-platform native method distro. Neat. How do they do it? check this out: And: The core download does not contain any C source code (it was all pre-built). Basically, they are just copying .so and .dll files into build directories. I would love to see the C code for this...but Sun does not post it on the https://jai.dev.java.net site. I don't know why...Perhaps I missed it. - Doug >On Sun, 5 Feb 2006, Trent Jarvi wrote: > >>On Sun, 5 Feb 2006, Kim Lux wrote: >> >>>usb ? Tell me more... I need that too. >> >>usb is a very proper design. Thats all it is. >> > >Maybe rxtx could help usb. But it would start with helping bring >back the community that was already there. > >It's not something I'd love to do but maybe its the right thing to do. > >It would probably take 2 years to do right. But maybe thats better >than what we have now. > >I honestly don't know what IBM is doing which could just run over everything. > >Just some thoughts after some fine german wine. > >-- >Trent Jarvi >tjarvi at qbang.org > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tdelenik at gmail.com Mon Feb 6 05:56:32 2006 From: tdelenik at gmail.com (Thanasis Delenikas) Date: Mon, 6 Feb 2006 14:56:32 +0200 Subject: Fwd: [Rxtx] Documentation Wiki In-Reply-To: <1139157422.4553.9.camel@zd7280> References: <20060205113618.30274.qmail@web53501.mail.yahoo.com> <1139157422.4553.9.camel@zd7280> Message-ID: <310a1a930602060456t129f1dc6p5f2b908f13ab5a0b@mail.gmail.com> Hello all, Kim, this is a snippet from the code I use. The closest to directly opening a specific port without enumeration. << ... portId = CommPortIdentifier.getPortIdentifier(getPort()); serialPort = (SerialPort) portId.open("jSMSEngine", 1971); ... >> where getPort() return the string identifier of the port, i.e. "/dev/ttyS0" or "COM1" or whatever. Thanasis. ---------- Forwarded message ---------- From: Kim Lux Date: Feb 5, 2006 6:37 PM Subject: Re: [Rxtx] Documentation Wiki To: RXTX Developers and Users BTW: there is no way to open a port without going through the port list and finding it. Maybe sometime in the future someone (me ?) will write a method called openSerialPort that allows the user to give a port identifier, such as "/dev/tty1" and return a port ready to use. It wouldn't take much to write that and it would save users a lot of code. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/182ab5b8/attachment-0059.html From tjarvi at qbang.org Mon Feb 6 11:53:57 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 11:53:57 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: On Mon, 6 Feb 2006, Dr. Douglas Lyon wrote: > Hi All, > I have often thought about USB drivers being needed. > For example, the ironman watch will not interface > to a mac (windows only). It is USB. > My dymo label writer has no Java driver (native only). > Etc. > Most cheap web cameras are USB (and Java drivers go > through JAI, if it supports the camera at all). > The JAI code shows how sun did the USB drivers. > You have to be a member of the jai project to download > the source code. > https://jai.dev.java.net has the jai distro. > And then you are not allowed to redistribute it. However, > we can all learn from it (if so inclined). Basically: > cvs -d :pserver:lyon at cvs.dev.java.net:/cvs login > cvs -d :pserver:lyon at cvs.dev.java.net:/cvs checkout jai-core > You will need to user your own uid and pw to get in. > The ant build has over 100 warnings from sun deprecations > of its own code. > > You might say that they were hoisted on their own Picard ;) > > One interesting thing is that they support several platforms: > linux-amd64 64-bit Linux-AMD64 > linux-i586 32-bit Linux-x86 > solaris-amd64 64-bit Solaris-AMD64 > solaris-i586 32-bit Solaris-x86 > solaris-sparc 32-bit Solaris-SPARC > solaris-sparcv9 64-bit Solaris-SPARC > windows-i586 32-bit Windows-x86 > Thus, ant is used to provide a multi-platform native method distro. > Neat. > How do they do it? > check this out: > > > > > > > > > > > > > And: > > > > > > > > > > The core download does not contain any C source code (it was all pre-built). > Basically, they are just copying .so and .dll files into build directories. > > I would love to see the C code for this...but Sun does not post it on the > https://jai.dev.java.net site. > > I don't know why...Perhaps I missed it. > > - Doug > > I've looked at moving rxtx to Ant builds. I think that would help IDEs a great deal. I requested a evalutation desk copy the O'Reilly Ant book for some j2ee material I was teaching. http://www.oreilly.com/catalog/anttdg/ It has a one sentence mention of JNI. So there was not luck there. I saw that there is another Ant book that does mention JNI more. I can't find it now. Ant must be able to support it with extensions. http://ant.apache.org/manual/OptionalTasks/javah.html What the auto(break :) tools do in the rxtx build is 4 things really. 1) gcc compile flags 2) ld compile flags 3) config.h 4) compile flags for customizing rxtx (lockfiles, ...) See 1 All of this information except 4 can be static once obtained. So I'm not attached to the auto tools. If I could find an example of Ant being used for JNI code, I'd be one of the first to start moving that direction. Maybe someone saw an example someplace. The other thing we have not completed discussing is the directory structure. There is interest in making rxtx more IDE friendly. I get more mail about that off the list than how to install rxtx. And I see we have Ken Thompson in da house :) He is our trusted CVS maintainer and the guy that purchased the rxtx.org domain. Old community. We will need Ken for changing the directory structure of source. I would like to open up discussion about both of these as it is more than time. The problem is I have little experience with Ant and even less with IDEs. It would be nice if we could work with Eclipse and NetBeans. http://www.netbeans.org/ (sun and some community) http://www.eclipes.org (ibm,rhat,... perhaps more community) http://maven.apache.org/what-is-maven.html (apache. It is community) borland should sortof be here too but I think thats covered in eclipse. >From what I understand so far, we should morph rxtx to support those three maybe trusting apaches lead with maven. But I use vi. I have little to no clues beyond what people have fed me. Can we agree that thats the right direction to go? -- Trent Jarvi tjarvi at qbang.org From brian at mbari.org Mon Feb 6 14:57:50 2006 From: brian at mbari.org (Brian Schlining) Date: Mon, 6 Feb 2006 13:57:50 -0800 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> > The other thing we have not completed discussing is the directory > structure. There is interest in making rxtx more IDE friendly. I > get more mail about that off the list than how to install rxtx. > > And I see we have Ken Thompson in da house :) He is our trusted > CVS maintainer and the guy that purchased the rxtx.org domain. Old > community. We will need Ken for changing the directory structure of > source. > > I would like to open up discussion about both of these as it is > more than time. The problem is I have little experience with Ant > and even less with IDEs. It would be nice if we could work with > Eclipse and NetBeans. > > http://www.netbeans.org/ (sun and some community) > http://www.eclipes.org (ibm,rhat,... perhaps more community) > http://maven.apache.org/what-is-maven.html (apache. It is community) > borland should sortof be here too but I think thats covered in > eclipse. > >> From what I understand so far, we should morph rxtx to support >> those three > maybe trusting apaches lead with maven. But I use vi. I have > little to no clues beyond what people have fed me. > Maven likes the directory structure below for Java code. (From http:// maven.apache.org/guides/getting-started/index.html) This structure works fine with ant, netbeans, and eclipse. rxtx_root_directory `-- src |-- main | `-- java | `-- gnu | `-- io `-- test `-- java `-- gnu `-- io Brian Schlining Software Engineer http://www.mbari.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/d9451eba/attachment-0059.html From tjarvi at qbang.org Mon Feb 6 15:11:45 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 15:11:45 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: > rxtx_root_directory > `-- src > |-- main > | `-- java > | `-- gnu > | `-- io > `-- test > `-- java > `-- gnu > `-- io > >From what I understand this will just be good. For me it makes no difference. So lets do the rxtx thing. Let if fester for two weeks and if nobody objects, we will do it. I'm not doing this because I care. I'm doing this to eliminate much of my inbox. But test... man is rxtx lacking there in the community aspect. It is covered but not right. _maybe_ I can change that this year. -- Trent Jarvi tjarvi at qbang.org (cat hurding since 1997) From lux at diesel-research.com Mon Feb 6 21:38:49 2006 From: lux at diesel-research.com (Kim Lux) Date: Mon, 06 Feb 2006 21:38:49 -0700 Subject: [Rxtx] How can I use Lock Files with rxtx (in FC4) ? Message-ID: <1139287129.17031.3.camel@zd7280> I am now running an rxtx application on FC4. I am getting: ========================================================= check_group_uucp(): error testing lock file creation Error details: Permission denied check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL ========================================================= $ ls -al /var/lock total 32 drwxrwxr-x 4 root lock 4096 Feb 6 16:04 . drwxr-xr-x 24 root root 4096 Nov 14 01:19 .. drwx------ 2 root root 4096 Apr 27 2005 lvm drwxr-xr-x 2 root root 4096 Feb 6 16:04 subsys How do I fix this for regulator users ? -- Kim Lux, Diesel Research Inc. From dmarkman at mac.com Mon Feb 6 22:24:44 2006 From: dmarkman at mac.com (Dmitry Markman) Date: Tue, 7 Feb 2006 00:24:44 -0500 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: if I understands the issue right in order to be able to use ant for c/c++ compilation you have to install ant's cc task http://ant-contrib.sourceforge.net/cc.html it looks like it should work on mac os x (authors claim, that it's platform independent) but I never tested so all you have to do it's providing right command line for the gcc compiler On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: >> rxtx_root_directory >> `-- src >> |-- main >> | `-- java >> | `-- gnu >> | `-- io >> `-- test >> `-- java >> `-- gnu >> `-- io >> > > >> From what I understand this will just be good. > > For me it makes no difference. So lets do the rxtx thing. Let if > fester for two weeks and if nobody objects, we will do it. > > I'm not doing this because I care. I'm doing this to eliminate > much of my inbox. > > But test... man is rxtx lacking there in the community aspect. It > is covered but not right. _maybe_ I can change that this year. > > -- > Trent Jarvi > tjarvi at qbang.org > (cat hurding since 1997) > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx Dmitry Markman From lux at diesel-research.com Mon Feb 6 23:20:15 2006 From: lux at diesel-research.com (Kim Lux) Date: Mon, 06 Feb 2006 23:20:15 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? Message-ID: <1139293215.3689.4.camel@zd7280> I'm running the code below. portlist.hasMoreElements() is false. /dev has ports in it as listed below. What am I doing wrong ? ========================================================== // Step through the list of ports until we find one that matches // the one we are looking for. portList = CommPortIdentifier.getPortIdentifiers(); while(portList.hasMoreElements()) { portID = (CommPortIdentifier) portList.nextElement(); // if (portID.getName().equals("/dev/ttyUSB0")) { myTA.append("Serial port ttyUSB0 has been found\n"); break; }// if portID equals... }// End of while... ========================================================== ls -al /dev/tty* crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 ... crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 -- Kim Lux, Diesel Research Inc. From david.garnier at trusted-logic.com Tue Feb 7 00:46:30 2006 From: david.garnier at trusted-logic.com (David Garnier) Date: Tue, 07 Feb 2006 08:46:30 +0100 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: <43E85056.2090608@trusted-logic.com> Hello, I think that the make-based build process is fine as it is, apart from the location of the Java source files. It is true that putting the Java source in a directory structure that map 1-to-1 to the Java package structure is the norm and should make it easier for everyone to modify the Java source, with or without an IDE. Ant is a good tool, but in the RXTX case I fail to see the advantage of using it compared to the current make-based process. As Trent said, they are more pressing issues, like testing. Regards, David Dmitry Markman wrote: > if I understands the issue right > in order to be able to use ant for c/c++ compilation > you have to install ant's cc task > http://ant-contrib.sourceforge.net/cc.html > > it looks like it should work on mac os x > (authors claim, that it's platform independent) > but I never tested > > so all you have to do it's providing right command line > for the gcc compiler > > > > > On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: > >>> rxtx_root_directory >>> `-- src >>> |-- main >>> | `-- java >>> | `-- gnu >>> | `-- io >>> `-- test >>> `-- java >>> `-- gnu >>> `-- io >>> >> >> >>> From what I understand this will just be good. >> >> For me it makes no difference. So lets do the rxtx thing. Let if >> fester for two weeks and if nobody objects, we will do it. >> >> I'm not doing this because I care. I'm doing this to eliminate much >> of my inbox. >> >> But test... man is rxtx lacking there in the community aspect. It is >> covered but not right. _maybe_ I can change that this year. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> (cat hurding since 1997) From tjarvi at qbang.org Tue Feb 7 01:11:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 01:11:31 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <43E85056.2090608@trusted-logic.com> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: On Tue, 7 Feb 2006, David Garnier wrote: > Hello, > > I think that the make-based build process is fine as it is, apart from the location of the Java > source files. It is true that putting the Java source in a directory structure that map 1-to-1 to > the Java package structure is the norm and should make it easier for everyone to modify the Java > source, with or without an IDE. > > Ant is a good tool, but in the RXTX case I fail to see the advantage of using it compared to the > current make-based process. As Trent said, they are more pressing issues, like testing. > Hi David I have more experience with testing rxtx than I can talk about. But let it be known, rxtx has gone trough 100's of hours of testing. We are hobby folks interested in toys but there is more. rxtx has had some of the best guidance in the industry there. This is not an easy thing. I may be able to come back in a month from the other side of the corperate fence and help. I suspect the tests could just be made public but they are in a very unusual environment that just wont work in a wider sense. This is something I'll be trying to change. At one point it was agreed we could just make the results public so this isnt just noise.. There is interest and I think its safe to mention that much. The big problem with testing in the past is most of it is done with a loopback connection. So we *still* have major questions regarding things like flow control. rxtx talks to itself over a loopback and it works. regardless of right or wrong. This requires more thought to be done right. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Feb 7 02:46:34 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 02:46:34 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: > The big problem with testing in the past is most of it is done with a > loopback connection. So we *still* have major questions regarding things > like flow control. rxtx talks to itself over a loopback and it works. > regardless of right or wrong. With serial communication there are gold standards. ckermit is probably a definitive 'standard.' Maybe its possible to do ping/pong tests with ckermit? Is it scriptable? There are known issues in rxtx. Probably the worst is some threading issues regarding some JREs with multiple JNI threads setting java variables. Man did I get schooled there. Just switch the c functions to returning variables and things go away. Sometimes they work fine, sometimes they blow up. Without understanding everything, somehow rhat got it right and debian (and especially gentoo) grabbed kernel patches causing all sort of harm. Its not hard to fix once you understand whats going on but nearly impossible to track with a debugger. So I have a good idea what 2.1-8 will have outside of the IDE modifications. rxtx 2.1-7 is a release for everyone to sync with. Its not even as stable as -pre17 as far as I know - I ran no test suites. I'll be chasing it too. We just had so many contributions that it was time. It seriously broke internal scheduals but thats a great thing :) The other thing I want to do in 2.1-8 is automagic baud rates. It turns out lots of shops are doing really funky baud rates for things like automobile test equipment. It is possible but it requires a fair amount of change in the native code. Is anyone looking at this? -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Feb 7 02:57:21 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 07 Feb 2006 04:57:21 -0500 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <43E85056.2090608@trusted-logic.com> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: Hi All, I agree, testing is very important. The problem I have been trying to address is related to cross-platform testing and the robust nature of the installs. Typically, I visit 3 platforms to deploy my product, windows, linux and mac. A build is performed on each platform. The idea that you can build for many platforms from one copy the source code seems attractive. This should enable synchronized deployments of identical code. The question of how to achieve this goal remains open. As Trent mentioned, this is hard. Perhaps Ant will help here (but perhaps not). Ant does seem to help with running unit tests. However, it does not help with multi-platform tests. For that you need many machines and different operating environments. Toward that end, I have created a multi-platform test that can be run from web start, located at: http://show.docjava.com:8086/book/cgij/code/jnlp/serialPort.PortTest.jnlp This is interesting because many people in the community can run the test and we can improve the test, as time permits. No, it is not a perfect solution, however, the idea does help with multi-platform tests using many machines and different operating environments. If the group has a good test for a general serial port set-ups, i would be happy to deploy it, for general evaluation using web start. And as for ANT, it is just an idea. Not all my ideas are good ones! - Doug >Hello, > >I think that the make-based build process is fine as it is, apart >from the location of the Java >source files. It is true that putting the Java source in a directory >structure that map 1-to-1 to >the Java package structure is the norm and should make it easier for >everyone to modify the Java >source, with or without an IDE. > >Ant is a good tool, but in the RXTX case I fail to see the advantage >of using it compared to the >current make-based process. As Trent said, they are more pressing >issues, like testing. > >Regards, >David > >Dmitry Markman wrote: >> if I understands the issue right >> in order to be able to use ant for c/c++ compilation >> you have to install ant's cc task >> http://ant-contrib.sourceforge.net/cc.html >> >> it looks like it should work on mac os x >> (authors claim, that it's platform independent) >> but I never tested >> >> so all you have to do it's providing right command line >> for the gcc compiler >> >> >> >> >> On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: >> >>>> rxtx_root_directory >>>> `-- src >>>> |-- main >>>> | `-- java >>>> | `-- gnu >>>> | `-- io >>>> `-- test >>>> `-- java >>>> `-- gnu >>>> `-- io >>>> >>> >>> >>>> From what I understand this will just be good. >>> >>> For me it makes no difference. So lets do the rxtx thing. Let if >>> fester for two weeks and if nobody objects, we will do it. >>> >>> I'm not doing this because I care. I'm doing this to eliminate much >>> of my inbox. >>> >>> But test... man is rxtx lacking there in the community aspect. It is >>> covered but not right. _maybe_ I can change that this year. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> (cat hurding since 1997) > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From matt.higgins at gmail.com Tue Feb 7 08:28:34 2006 From: matt.higgins at gmail.com (Matt Higgins) Date: Tue, 7 Feb 2006 10:28:34 -0500 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final Message-ID: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? import java.io.*; import java.util.*; import gnu.io.*; public class MySimpleRead implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; public static void main(String[] args) { boolean portFound = false; String defaultPort = "COM1"; if (args.length > 0) { defaultPort = args[0]; } portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; MySimpleRead reader = new MySimpleRead(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } } public MySimpleRead() { try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) { e.printStackTrace(); } try { inputStream = serialPort.getInputStream(); } catch (IOException e) { e.printStackTrace(); } try { serialPort.addEventListener(this); } catch (TooManyListenersException e) { e.printStackTrace(); } try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { e.printStackTrace(); } System.out.println("Baud is " + serialPort.getBaudRate()); System.out.println("Bits is " + serialPort.getDataBits()); System.out.println("Stop is " + serialPort.getStopBits()); System.out.println("Par is " + serialPort.getParity()); serialPort.notifyOnDataAvailable(true); readThread = new Thread(this); readThread.start(); } public void run() { // Thread.sleep(20000); //} catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { System.out.println("An event occurred " + event.getEventType()); switch (event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: byte[] readBuffer = new byte[20]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } System.out.print(new String(readBuffer)); } catch (IOException e) {} break; } } } --------------- Result on windows ------------------------------ Stable Library ============================================================== Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port:: COM1 Baud is 9600 Bits is 8 Stop is 1 Par is 0 ----------------- End Results ----------------------------------------- ------------------ Result on Linux ----------------------------------- Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 Found port: /dev/ttyS0 Baud is 9600 Bits is 8 Stop is 1 Par is 0 An event occurred 1 043100066224 ------------------ End Results --------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/a1431630/attachment-0059.html From brian at mbari.org Tue Feb 7 09:48:37 2006 From: brian at mbari.org (Brian Schlining) Date: Tue, 7 Feb 2006 08:48:37 -0800 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> Message-ID: <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> Hi Matt > The following code works fine on Linux but I never see any data > when run on Windows. This is a cut and paste from the SimpleRead > example. > I am attempting to read data from a bar code scanner. I can fire > up HyperTermianl on windows and see that the device is working > properly as I see the barcodes are scanned and echoed back to the > terminal. However when I run the app I don't see any data. It is > however associating with the com port as the informational bits > print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. Cheers Brian Schlining Software Engineer http://www.mbari.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/16d07f37/attachment-0059.html From lux at diesel-research.com Tue Feb 7 11:59:58 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 11:59:58 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139293215.3689.4.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> Message-ID: <1139338798.8145.4.camel@zd7280> Any ideas on this ? Any reason why portList.hasMoreElements() should be false even though there are devices in /dev ? On Mon, 2006-02-06 at 23:20 -0700, Kim Lux wrote: > I'm running the code below. > > portlist.hasMoreElements() is false. > > /dev has ports in it as listed below. > > What am I doing wrong ? > > > ========================================================== > // Step through the list of ports until we find one that matches > // the one we are looking for. > > portList = CommPortIdentifier.getPortIdentifiers(); > > while(portList.hasMoreElements()) > { > portID = (CommPortIdentifier) portList.nextElement(); // > if (portID.getName().equals("/dev/ttyUSB0")) > { > myTA.append("Serial port ttyUSB0 has been found\n"); > break; > }// if portID equals... > }// End of while... > ========================================================== > > ls -al /dev/tty* > crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty > crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 > crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 > crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 > crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 > ... > crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 > crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 > crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 > > > -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 12:20:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 12:20:25 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139338798.8145.4.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> Message-ID: On Tue, 7 Feb 2006, Kim Lux wrote: > > Any ideas on this ? Any reason why portList.hasMoreElements() should be > false even though there are devices in /dev ? > > > On Mon, 2006-02-06 at 23:20 -0700, Kim Lux wrote: >> I'm running the code below. >> >> portlist.hasMoreElements() is false. >> >> /dev has ports in it as listed below. >> >> What am I doing wrong ? >> >> >> ========================================================== >> // Step through the list of ports until we find one that matches >> // the one we are looking for. >> >> portList = CommPortIdentifier.getPortIdentifiers(); >> >> while(portList.hasMoreElements()) >> { >> portID = (CommPortIdentifier) portList.nextElement(); // >> if (portID.getName().equals("/dev/ttyUSB0")) >> { >> myTA.append("Serial port ttyUSB0 has been found\n"); >> break; >> }// if portID equals... >> }// End of while... >> ========================================================== >> >> ls -al /dev/tty* >> crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty >> crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 >> crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 >> crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 >> crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 >> ... >> crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 >> crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 >> crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 >> >> >> > Hi Kim What rxtx does is try to open the port and do a timed out read. If the kernel/... do not complain it's enumarted. I suspect you could do a crude test by doing something like cat /dev/ttyS0 > /dev/null If that barfs then rxtx wont enumerate the port. hmm looking at your question again, I suspect it's a lockfile problem. This is documented in INSTALL with the source. Its easy enough to test this too.. touch /var/lock/testingrxtxlockfiles && rm -f /var/lock/testingrxtxlockfiles If you are not in the right group it will bail. Root will work regardless. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 12:37:56 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 12:37:56 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> Message-ID: <1139341076.8145.11.camel@zd7280> Exactly which ports does rxtx attempt to put into the list ? /dev/* or /dev/tty* or /dev/tty[0-9[0-9] ? or /dev/ttyS* ? For the record, only /dev/ttyUSB0 is a valid port on the machine I am presently on. Will this be a problem ? On Tue, 2006-02-07 at 12:20 -0700, Trent Jarvi wrote: > This is documented in INSTALL with the source. > I was wondering where that file was. I will download source and dig it up. Thanks. -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 12:51:09 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 12:51:09 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139341076.8145.11.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: On Tue, 7 Feb 2006, Kim Lux wrote: > > Exactly which ports does rxtx attempt to put into the list ? /dev/* > or /dev/tty* or /dev/tty[0-9[0-9] ? or /dev/ttyS* ? > > For the record, only /dev/ttyUSB0 is a valid port on the machine I am > presently on. Will this be a problem ? > > > On Tue, 2006-02-07 at 12:20 -0700, Trent Jarvi wrote: >> This is documented in INSTALL with the source. >> > I was wondering where that file was. I will download source and dig it > up. > > Thanks. > Hmm I'm looking at pre17 so this may have changed. (its just what I have on this machine) if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA" // for the IPAQs }; CandidatePortPrefixes=Temp; } So you may need to add "ttyUSB" to that list. RXTX used to enumerate _everything_ see if(osName.equals("Linux-all-ports") But it became less than practical. This is all in RXTXCommDriver.java hmm I just did a cvs update. if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have to get your fingers into the code. We aim for sane defaults. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 13:06:45 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 13:06:45 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139342805.8145.22.camel@zd7280> On Tue, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > Hmm I'm looking at pre17 so this may have changed. (its just what I have > on this machine) > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA" // for the IPAQs > }; > CandidatePortPrefixes=Temp; > } > > > So you may need to add "ttyUSB" to that list. RXTX used to enumerate > _everything_ see if(osName.equals("Linux-all-ports") But it became less > than practical. > > This is all in RXTXCommDriver.java > > hmm I just did a cvs update. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have > to get your fingers into the code. We aim for sane defaults. Excellent. Thanks for taking the time. -- Kim Lux, Diesel Research Inc. From ideiglenes1 at freemail.hu Tue Feb 7 13:53:39 2006 From: ideiglenes1 at freemail.hu (--) Date: Tue, 07 Feb 2006 21:53:39 +0100 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139345619.22534.2.camel@localhost> Hi! I use this code to get all the extra Linux devices. :) if ("Linux".equals(System.getProperty("os.name"))) { System.setProperty("os.name","Linux-all-ports"); } driver = new RXTXCommDriver(); On k, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > On Tue, 7 Feb 2006, Kim Lux wrote: > > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have > to get your fingers into the code. We aim for sane defaults. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From matt.higgins at gmail.com Tue Feb 7 13:45:54 2006 From: matt.higgins at gmail.com (Matt Higgins) Date: Tue, 7 Feb 2006 15:45:54 -0500 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> Message-ID: <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> Sweet this is exactly what I needed. I was searching the archives through marc.theamisgroup they only have archives back to 1/3/05. Should have hit the mailman archive! Thanks a lot! On 2/7/06, Brian Schlining wrote: > > Hi Matt > > The following code works fine on Linux but I never see any data when run > on Windows. This is a cut and paste from the SimpleRead example. > I am attempting to read data from a bar code scanner. I can fire up > HyperTermianl on windows and see that the device is working properly as I > see the barcodes are scanned and echoed back to the terminal. However when I > run the app I don't see any data. It is however associating with the com > port as the informational bits print fine? > > > You're not the only one whose had this problem, I don't know if Trent has > addressed this is the latest release of RXTX but there is a workaround. > Here's the recent thread from the RXTX mailing list regarding this issues: > > Thanasis Delenikas tdelenik at gmail.com > Wed Jan 18 13:56:23 MST 2006 > > * Previous message: [Rxtx] Re: More close() performance fixes > * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] > > Hi all. > (I've subscribed again from my other email account). > > Trent, > > You are right. Linux *always* works, no matter what flow control you set. > Windows *works only* with hardware flow control (I haven't tested what > happens with software XON/XOFF flow control). > > I assume (but I am not certain) that even with no flow control at all, all > platforms should work. Without flow control, you have the risk of bumping > into overflow or framing errors, but that's your (the end programmer, I > mean) problem. > > >From my side, I shouldn't be working without flow control. That was a bug > too... It was some code forgotten from the old times, when I used to work > with phone emulation drivers which didn't support flow control. The > correct > way is to have some flow control enabled and that's why I suppose this is > a > low-severity bug for RxTx. > > I have no idea which platform shows the correct behaviour, since > my knowledge about Linux and the inner workings of these low-level i/o > operations is limited. > > Regards, > Thanasis Delenikas. > > > > > Message: 2 > > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > > From: Trent Jarvi > > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > > To: RXTX Developers and Users > > Message-ID: > > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > > > Hi all, > > > > > > Trent, I have found something. > > > I read your comment about flow control, so I experimented a bit. > > > > > > If you remember, in my sample program I've used no flow control at all > ( > > i.e. > > > Java constant FLOWCONTROL_NONE). > > > > > > Now, during testing, I've switch to hardware inbound flow control (i.e > . > > Java > > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > > beautifully! > > > > > > I think I will switch to H/W flow control and test things for a while, > > but > > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > > > > > Hi Thanasis, > > > > I'm fairly sure you have identified a bug. I would not worry too much > > about what Sun CommAPI w32 defaults are. I think they did more or less > > whatever the port opened with. Just a guess. Linux tries to stomp on > > ports so they are all the same. > > > > So this started out with Linux worked, Windows XP/.. did not as I > recall. > > Something is wrong in rxtx. Do I understand this right? > > > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > > > Perhaps there is something Wayne or I did not understand when we wrote > > that code. I wasnt programming back in the BBS days so modems are not > my > > thing. I have a few questions. > > > > Is the above matrix confirmed by observation? > > Linux just always worked? > > Which one _should_ work? I'm guessing modems work with hardware flow > > control. I'll have to dig around. > > > > The windows flow control changes a couple things with hardware flow > > control. Following the w32 API documentation is confusing sometimes. > > But it looks like Linux could have a bug too. > > Cheers > > Brian Schlining > Software Engineer > http://www.mbari.org > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/9c989144/attachment-0059.html From tjarvi at qbang.org Tue Feb 7 14:06:14 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 14:06:14 -0700 (MST) Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> Message-ID: >> >> You're not the only one whose had this problem, I don't know if Trent has >> addressed this is the latest release of RXTX but there is a workaround. >> Here's the recent thread from the RXTX mailing list regarding this issues: >> I have not. I expect to have access to some test equipment next month and I'll go through all of this. I really don't know whats going on and I need a gold standard. I thought maybe linux was autodetecting the flow control. Your observations would certainly be welcome. I need to talk to Russell King and see what he is doing. Until then I'd just be toying around over a loopback as usual. This is very high on the list though. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 17:25:05 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 17:25:05 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139358305.17994.2.camel@zd7280> My application now works. I installed the libraries and jar from 2.1-7 (Final). portlist.hasMoreElements is no longer false. The application finds the port for /dev/ttyUSB0. Thanks for your help, Trent (et al) Sorry I bothered you with this. Next time I will look in the source first. I didn't think it was an rxtx issue, I thought it was a Linux setup issue . On Tue, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > Hmm I'm looking at pre17 so this may have changed. (its just what I > have > on this machine) > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux > Serial Ports > "ttySA" // for the > IPAQs > }; > > CandidatePortPrefixes=Temp; > } > > > So you may need to add "ttyUSB" to that list. RXTX used to enumerate > _everything_ see if(osName.equals("Linux-all-ports") But it became > less > than practical. > > This is all in RXTXCommDriver.java > > hmm I just did a cvs update. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux > Serial Ports > "ttySA", // for the > IPAQs > "ttyUSB" // for USB > frobs > }; > > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you > have > to get your fingers into the code. We aim for sane defaults. -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 19:21:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 19:21:54 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139358305.17994.2.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> <1139358305.17994.2.camel@zd7280> Message-ID: >Sorry I bothered you with this. Next time I will look in the source >first. I didn't think it was an rxtx issue, I thought it was a Linux >setup issue . Why would you be sorry? I would have done the same. I'm glad it's working :) -- Trent Jarvi tjarvi at qbang.org From tma at mail.island.net Wed Feb 8 13:39:35 2006 From: tma at mail.island.net (Tom Alldread) Date: Wed, 08 Feb 2006 12:39:35 -0800 Subject: [Rxtx] Win32/Linux Serial Port Data Dropouts In-Reply-To: <200602060702.k167255O007882@www.qbang.org> References: <200602060702.k167255O007882@www.qbang.org> Message-ID: <43EA5707.4020200@mail.island.net> Greetings Folks at RXTX: During the last couple of months I have been alternately testing with javax.comm 2 and RXTX 2.1 under Windows XP and CommApi 3 and RXTX 2.1 under Suse 10.0 Linux. In the process I have learned a little about java multi-threading under NetBeans 5 with Profiler. My java (jdk 1.5_06) application is used for data acquisition and provides a graphical display of A-D conversion data received from a 56KBaud serial port. The actual data throughput is about 10KBaud thus it is well below the speed of the port. I use hardware RTS/CTS flow control which can stall the data acquisition sample rate if necessary. This ensures the display computer has the ability to slow the data acquisition rate should it become too busy to accept the regular data flow. Both the serial port buffer and the java read buffer are set at 16KB. Usually the data transfers into the java read buffer are less than 100 bytes unless the data acquisition is recovering from a stall. The data flow normally hesitates after each 5 KB block as a continue command is needed from the display computer to start the drawing of a new graphics display line. Separate threads have been provided for the serial port event monitoring and data processing. The serial port event thread has been given the maximum priority and data processing thread the minimum priority provided by java. Thread yield statements have been placed within all data processing while/for loops as an effort to ensure quick access to CPU cycles for the serial port event thread. I have found that short data transmissions are essentially error free but occasional dropouts occur with continuous data flow especially under Windows XP. ....................................................................................................................................................................................... Linux results: I am happy to report that RXTX 2.1 appears to work very well under Linux although I did notice some errors when the screen savers were running with my dual monitors. I believe this is a local problem associated with my dual graphics which needs further attention. The recent CommApi 3 Linux release from Sun did not work at all with my program. It seemed to send commands out OK but did not receive any data. Although the serial port event triggered the ISR, the input stream appeared filled with nulls and thus did not contain any data. As my understanding is that CommApi 3 was tested with a Red Hat distribution of Linux I wonder if this problem is distro dependent? Although somewhat off topic here I wonder if anyone reading this has had similar experience? .................................................................................................................................................................................. Windows XP results: There are problems with occasional data dropouts which become more frequent as the sampling rate is increased or if the computer becomes busy with other duties. The dropouts typically consist of a half dozen byte block of lost data. It appears the lost bytes never get added to the java input stream. There has not been any indication of garbled data, overruns or framing errors which suggests the UART communications remains solid. Using javax.comm 2 I found that the setting of SerialPort 'enableReceiveThreshold' to 40 and 'enableReceiveTimeout' of 100mS reduced the dropouts error rate significantly. I found that I could not get RXTX 2.1 to function with the aforementioned threshold and timeout settings. The javax.comm 2 interface is consequently performing better for me under Windows than RXTX 2.1. I wonder if anyone here has any suggestions as to what I might try to improve RXTX 2.1? Although my settings are the same as under Suse 10.0, RXTX 2.1 performs much better for me under Linux than any of the alternatives that I have tried under Windows XP . ............................................................................................................................................................................... I would like to establish, based on the experience of others, if I have reached the normally expected performance limit of java serial port communications? Should I expect to achieve virtually error free serial port data input from a continuous stream under Windows XP java software? I am considering changing my protocol to packets with error checking if necessary but would like to know if the dropout problems I am experiencing are typical or not before I take this rather work intensive plunge. Many thanks in advance for any help! Best Regards, Tom Alldread -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.375 / Virus Database: 267.15.2/253 - Release Date: 2006-02-07 From jlaxson at mac.com Wed Feb 8 23:56:48 2006 From: jlaxson at mac.com (John Laxson) Date: Thu, 9 Feb 2006 00:56:48 -0600 Subject: [Rxtx] PortInUseException: Unknown Application on OSX Message-ID: Hi, I've been trying to get RXTX 2.1.7 going on Mac OS X for a while here, and am running up into a wall here. I've tried with pre- compiled and the source version and get the same problem, a gnu.io.PortInUseException: Unknown Application. I have run the fixperms script included with the source distribution, and id shows me as a member of the uucp group, and permissions on /var/spool/uucp are 775 root:uucp. Running a test program (included at the bottom for clarity) lets me enumerate all the serial ports correctly, but trying to open any of them gives the PortInUseException. If it helps, when I try to open a port that's set to make an outgoing bluetooth connection, there is no delay and no connection attempt at all. Thanks, John Laxson PS: The documentation wiki on qbang.org shows 404, and has for a few days now. My test code: public static void main(String[] args) { SerialPort serialPort; try { Enumeration e = CommPortIdentifier.getPortIdentifiers(); CommPortIdentifier ident; while (e.hasMoreElements()) { ident = (CommPortIdentifier)e.nextElement(); System.out.println(ident.getName()); } ident = CommPortIdentifier.getPortIdentifier("/dev/cu.modem"); serialPort = (SerialPort) ident.open("Me", 5000); } catch (Exception e) { e.printStackTrace(); } } From rajesh.invincible at gmail.com Thu Feb 9 03:39:38 2006 From: rajesh.invincible at gmail.com (Rajesh N) Date: Thu, 9 Feb 2006 16:09:38 +0530 Subject: [Rxtx] Re: Move .java Files in gnu.io filesystem hierarchy - Maven (2) In-Reply-To: <43DF21D2.7090200@ngi.it> References: <43DF21D2.7090200@ngi.it> Message-ID: <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Can anybody tell me how to overcome these EXCEPTIONS I AM WORKING ON SERIAL COMMN IN JAVA ON LINUX. 1. " NOT ALL PARAMETERS SUPPORTED BY THE KERNEL" This i came across the following statement inmy prog. SerialP is A SerialPort object SerialP.setSerialPortParams(9600(BAUDRATE),DATABITS_8,STOPBITS_1,PARITY_NONE) 2. NullPointer Exception at Event Dispatch Now i have checked all my object references for a null reference but i found none i have put up my entire code in try catch blocks but still I AM UNABLE TO CATCH THIS EXCEPTION AND HENCE MY APPLICATION CLOSES HOW DOES THESE GO? PLEASE HELP ME IT IS URGENTTTTTTTTTTTTTTTT yours sincerely RAJESH On 1/31/06, Fabio Frumento wrote: > Hi Xavier, > > I don't know maven at all but the directory hierarchy listed buy Trent > is fine for me... > > I'll take a look to maven, it seems an interesting project > > Regards > > Fabio Frumento > > Trent Jarvi wrote: > > On Tue, 31 Jan 2006, Xavier Frisaye wrote: > > > >> Hi all, > >> > >> If you are going to rearrange the src folder, i will propose to use > >> maven 2 and follow its directory structure > >> > (http://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html). > >> > >> Maven 2 simplify java project and give a standard way to make projects > >> (http://maven.apache.org/). > >> We are using it for internal projects and we are very satisfied. > >> > >> Is anybody interested? > >> > >> I'm not an expert in maven 2 (yet) but i'm agree to help using it if > >> you choose to make so. > >> > > > > so this would be: > > > > rxtx-devel/src/main/java/gnu.io > > rxtx-devel/src/test/java/ManIwish.java > > > > I don't use IDEs very much so I'll let others comment. But I don't see > > a problem with that. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Thu Feb 9 09:50:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 9 Feb 2006 09:50:31 -0700 (MST) Subject: [Rxtx] Re: Move .java Files in gnu.io filesystem hierarchy - Maven (2) In-Reply-To: <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Message-ID: On Thu, 9 Feb 2006, Rajesh N wrote: > Can anybody tell me how to overcome these EXCEPTIONS > I AM WORKING ON SERIAL COMMN IN JAVA ON LINUX. > > 1. " NOT ALL PARAMETERS SUPPORTED BY THE KERNEL" > > This i came across the following statement inmy prog. > SerialP is A SerialPort object > SerialP.setSerialPortParams(9600(BAUDRATE),DATABITS_8,STOPBITS_1,PARITY_NONE) > Strange. The parameters you use are the same the port should open with by default. Could you paste the actual exception you are getting? I don't see that in the rxtx source. Also it would help to know the rxtx version. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Fri Feb 10 15:29:05 2006 From: lux at diesel-research.com (Kim Lux) Date: Fri, 10 Feb 2006 15:29:05 -0700 Subject: [Rxtx] One serial port object for both sending and receiving ? Message-ID: <1139610545.18177.4.camel@zd7280> Is it OK to use one SerialPort ojbect (ex Serial Port serialPort;) and use it for both sending and receiving ? For example: ======================================================================== static SerialPort serialPort = null; static OutputStream serialOut = null; static InputStream serialIn = null; // assign it to an outputStream for use try{ serialOut = serialPort.getOutputStream(); System.out.println("Serial output stream has been assigned."); }//try catch(IOException e) { System.out.println("Error: Couldn't assign output stream to serial port."); }//catch //assign it to an inputStream for use try{ serialIn = serialPort.getInputStream(); System.out.println("Serial input stream has been assigned."); }//try catch(IOException e) { System.out.println("Error: Couldn't assign input stream to serial port."); }//catch ======================================================================== -- Kim Lux, Diesel Research Inc. From lux at diesel-research.com Fri Feb 10 21:23:00 2006 From: lux at diesel-research.com (Kim Lux) Date: Fri, 10 Feb 2006 21:23:00 -0700 Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Message-ID: <1139631780.23882.10.camel@zd7280> I've got a problem receiving chars with my version of serialRead, written in an SWT GUI. I had a Java pro have a good look at my code and he can't see anything wrong with it. I can send chars fine. When I receive a char the cpu usage for the app goes to 100% and the code in the serial event handler doesn't get executed. The instructions on the Java Comm Serial API How-To for Linux page state that I must install javacomm. Is that true ? Everything builds without it and I can send chars on rxtx just fine, but I can't receive them. Could this be the problem ? I downloaded and installed javacomm. I was not able to add "Driver=gnuio.RXTXCommDriver to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 installed in /usr/java/jre1.5.0_05. I added comm.jar to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext to the library paths. Is this OK ? Does it matter that I am receiving on /dev/ttyUSB0 ? Thanks. -- Kim Lux, Diesel Research Inc. From lunareclipse03 at web.de Sat Feb 11 09:44:46 2006 From: lunareclipse03 at web.de (lunareclipse03@web.de) Date: Sat, 11 Feb 2006 17:44:46 +0100 Subject: [Rxtx] Question about Serial I/O under Win32 Message-ID: <662084330@web.de> Hello everybody, I have a strange problem with a piece of code I made for myself. No, this is not really concerning rxtx, but nevertheless I post this to the list, hoping that some of you can help me. I've written two libraries, one for linux and one for win32. The linux port works quite well, I can send / receive faxes and / or replay voice messages over the telephone line using a voice modem. But the win32 port of the library causes some trouble. If, for example, I send out a fax with a certain modem under linux, it works well. The fax is complete when it comes out of the fax machine. If I then use the same modem to send out a fax under win32, the fax coming out of the fax machine gets "stuck" halfways, but the sending modem thinks that transmission was ok and drops the connection. The answering fax machine then gives me "error while receiving." The "upper layer" java code MUST be right, because if I do the same thing under linux (using the linux library), everything is alright. Now I have to ask: Can somebody please help me out with this??!? Could it be the case that some kind of flow control or COMMTIMEOUTS setting causes this behaviour? I set flow control to RTS/CTS before sending out a fax. How can I DISABLE flow control? Or what do you think? Can something else cause this problems? Thank you all for your time and PLEASE write back soon. Regards, --Sven Ahlemann Am Waldrand 31 45721 Haltern am See Germany ______________________________________________________________ Verschicken Sie romantische, coole und witzige Bilder per SMS! Jetzt bei WEB.DE FreeMail: http://f.web.de/?mc=021193 From lux at diesel-research.com Sat Feb 11 10:06:52 2006 From: lux at diesel-research.com (Kim Lux) Date: Sat, 11 Feb 2006 10:06:52 -0700 Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: <1139631780.23882.10.camel@zd7280> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> <1139631780.23882.10.camel@zd7280> Message-ID: <1139677612.3431.5.camel@zd7280> More on this problem. I copied and pasted simpleRead into a console based Eclipse project and I've got the same result, except that cpu usage doesn't go to 100%. I'm beginning to think there is an issue in rxtx. My imports for simpleRead are: ============================ import gnu.io.*; import java.util.*; //import javax.comm.*; import java.io.*; =========================== Any ideas ? I am trying to read from /dev/ttyUSB0 using a serial to USB adapter which has worked well with minicom and gtkterm. Thanks. On Fri, 2006-02-10 at 21:23 -0700, Kim Lux wrote: > I've got a problem receiving chars with my version of serialRead, > written in an SWT GUI. > > I had a Java pro have a good look at my code and he can't see anything > wrong with it. > > I can send chars fine. When I receive a char the cpu usage for the app > goes to 100% and the code in the serial event handler doesn't get > executed. > > The instructions on the Java Comm Serial API How-To for Linux page state > that I must install javacomm. Is that true ? Everything builds without > it and I can send chars on rxtx just fine, but I can't receive them. > Could this be the problem ? > > I downloaded and installed javacomm. I was not able to add > "Driver=gnuio.RXTXCommDriver > to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not > have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 > installed in /usr/java/jre1.5.0_05. I added comm.jar > to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext > to the library paths. Is this OK ? > > Does it matter that I am receiving on /dev/ttyUSB0 ? > > Thanks. > -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Sun Feb 12 21:01:33 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:01:33 -0700 (MST) Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: <1139677612.3431.5.camel@zd7280> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> <1139631780.23882.10.camel@zd7280> <1139677612.3431.5.camel@zd7280> Message-ID: I suspect what is happening is the select() is breaking out in the native code but the driver does not have support for notifying there are X bytes available. On some traditional Unix based systems, the only way you know data is available is the fd status changes and do an FIORDCHK ioctl. Or perhaps the only thing you can know is the fd status changed. It would take reading through the kernel driver code to know for sure. So on USB, depending upon the driver, the same may need to be done or the driver improved a bit if possible to support. Polling reads will also work but don't use the event driven model of CommAPI which isnt acceptable in the long run. The 100% cpu usage can then be explained because select no longer blocks until the data is read; the eventLoop spins loose. You can put a well placed sleep but rxtx only expects those are needed when it knows data is available. This may not be a super simple thing to understand and fix. I do have ideas to get you started. I'm going to be short on time the next couple weeks. I expect to put some good time in and answer some other questions I saw around the 25th. For now, I'd look at the following and go from there with the hints I've given. JNIEXPORT jint JNICALL RXTXPort(nativeavailable)( JNIEnv *env, jobject jobj ) { int fd = get_java_var( env, jobj,"fd","I" ); int result; /* char message[80]; ENTER( "RXTXPort:nativeavailable" ); On SCO OpenServer FIONREAD always fails for serial devices, so try ioctl FIORDCHK instead; will only tell us whether bytes are available, not how many, but better than nothing. This turns out to be true on Solaris also. taj. */ #ifdef FIORDCHK /* __unixware__ __sun__ probably others */ result = ioctl(fd, FIORDCHK, 0); #else if( ioctl( fd, FIONREAD, &result ) < 0 ) { goto fail; } #endif /* FIORDCHK */ On Sat, 11 Feb 2006, Kim Lux wrote: > > More on this problem. I copied and pasted simpleRead into a console > based Eclipse project and I've got the same result, except that cpu > usage doesn't go to 100%. I'm beginning to think there is an issue in > rxtx. > > My imports for simpleRead are: > > ============================ > import gnu.io.*; > import java.util.*; > //import javax.comm.*; > import java.io.*; > =========================== > > Any ideas ? I am trying to read from /dev/ttyUSB0 using a serial to > USB adapter which has worked well with minicom and gtkterm. > > Thanks. > > > > On Fri, 2006-02-10 at 21:23 -0700, Kim Lux wrote: >> I've got a problem receiving chars with my version of serialRead, >> written in an SWT GUI. >> >> I had a Java pro have a good look at my code and he can't see anything >> wrong with it. >> >> I can send chars fine. When I receive a char the cpu usage for the app >> goes to 100% and the code in the serial event handler doesn't get >> executed. >> >> The instructions on the Java Comm Serial API How-To for Linux page state >> that I must install javacomm. Is that true ? Everything builds without >> it and I can send chars on rxtx just fine, but I can't receive them. >> Could this be the problem ? >> >> I downloaded and installed javacomm. I was not able to add >> "Driver=gnuio.RXTXCommDriver >> to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not >> have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 >> installed in /usr/java/jre1.5.0_05. I added comm.jar >> to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext >> to the library paths. Is this OK ? >> >> Does it matter that I am receiving on /dev/ttyUSB0 ? >> >> Thanks. >> > From tjarvi at qbang.org Sun Feb 12 21:03:30 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:03:30 -0700 (MST) Subject: [Rxtx] One serial port object for both sending and receiving ? In-Reply-To: <1139610545.18177.4.camel@zd7280> References: <1139610545.18177.4.camel@zd7280> Message-ID: On Fri, 10 Feb 2006, Kim Lux wrote: > > Is it OK to use one SerialPort ojbect (ex Serial Port serialPort;) and > use it for both sending and receiving ? > > For example: > > ======================================================================== > static SerialPort serialPort = null; > static OutputStream serialOut = null; > static InputStream serialIn = null; > > > > > // assign it to an outputStream for use > try{ > serialOut = serialPort.getOutputStream(); > System.out.println("Serial output stream has been assigned."); > }//try > catch(IOException e) > { > System.out.println("Error: Couldn't assign output stream to serial > port."); > }//catch > > > //assign it to an inputStream for use > try{ > serialIn = serialPort.getInputStream(); > System.out.println("Serial input stream has been assigned."); > }//try > catch(IOException e) > { > System.out.println("Error: Couldn't assign input stream to serial > port."); > }//catch This should be fine. In fact trying to do it another way will probably not work as you will run into lockfile issues. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun Feb 12 21:13:13 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:13:13 -0700 (MST) Subject: [Rxtx] Question about Serial I/O under Win32 In-Reply-To: <662084330@web.de> References: <662084330@web.de> Message-ID: On Sat, 11 Feb 2006 lunareclipse03 at web.de wrote: > Hello everybody, > > I have a strange problem with a piece of code I made for myself. No, > this is not really concerning rxtx, but nevertheless I post this to the > list, hoping that some of you can help me. I've written two libraries, > one for linux and one for win32. The linux port works quite well, I can > send / receive faxes and / or replay voice messages over the telephone > line using a voice modem. But the win32 port of the library causes some > trouble. If, for example, I send out a fax with a certain modem under > linux, it works well. The fax is complete when it comes out of the fax > machine. If I then use the same modem to send out a fax under win32, the > fax coming out of the fax machine gets "stuck" halfways, but the sending > modem thinks that transmission was ok and drops the connection. The > answering fax machine then gives me "error while receiving." The "upper > layer" java code MUST be right, because if I do the same thing under > linux (using the linux library), everything is alright. Now I have to > ask: Can somebody please help me out with this??!? Could it be the case > that some kind of flow control or COMMTIMEOUTS setting causes this > behaviour? I set flow control to RTS/CTS before sending out a fax. How > can I DISABLE flow control? Or what do you think? Can something else > cause this problems? Thank you all for your time and PLEASE write back > soon. > Hi Sven I'm not too willing to talk about flow control at the low level until I confirm some things with test equipment later. It is not clear if you are using rxtx or writing your own native code. So I'm not sure how to answer much of this :) If you are wondering how to change the flow control using rxtx from java, The BlackBox example from Sun flips this back and forth. SerialPort.java in rxtx 2.1 uses the following: SerialPort.java: public static final int FLOWCONTROL_NONE =0; SerialPort.java: public static final int FLOWCONTROL_RTSCTS_IN =1; SerialPort.java: public static final int FLOWCONTROL_RTSCTS_OUT =2; SerialPort.java: public static final int FLOWCONTROL_XONXOFF_IN =4; SerialPort.java: public static final int FLOWCONTROL_XONXOFF_OUT=8; So if you set flowcontrol to RTSCTS, you can set it to NONE to turn it off. If you are looking for how to do it in native code, the rxtx Source is SerialImp.c (unix/linux/mac os x/w32) and termios.c (w32 only with SerialImp.c) You can track the code: SerialImp.c:JNIEXPORT void JNICALL RXTXPort(setflowcontrol)( JNIEnv *env, jobject jobj, jint flowmode ) termios.c:int tcgetattr( int fd, struct termios *s_termios ) termios.c:int tcsetattr( int fd, int when, struct termios *s_termios ) There may be a problem in the rxtx flow control code though. Rather than guess, I want to test this with a gold standard. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Feb 6 00:00:16 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 00:00:16 -0700 (MST) Subject: [Rxtx] wiki delay until tomorrow night. In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: On Sun, 5 Feb 2006, Trent Jarvi wrote: > On Sun, 5 Feb 2006, Kim Lux wrote: > >> usb ? Tell me more... I need that too. > > usb is a very proper design. Thats all it is. > Maybe rxtx could help usb. But it would start with helping bring back the community that was already there. It's not something I'd love to do but maybe its the right thing to do. It would probably take 2 years to do right. But maybe thats better than what we have now. I honestly don't know what IBM is doing which could just run over everything. Just some thoughts after some fine german wine. -- Trent Jarvi tjarvi at qbang.org From gadelavega at yahoo.com.ar Mon Feb 6 02:17:05 2006 From: gadelavega at yahoo.com.ar (Gonzalo A. de la Vega) Date: Mon, 06 Feb 2006 10:17:05 +0100 Subject: [Rxtx] Serial port ownership question In-Reply-To: References: <20060205113618.30274.qmail@web53501.mail.yahoo.com> <1139157422.4553.9.camel@zd7280> <1139158698.4936.9.camel@zd7280> Message-ID: <43E71411.4050402@yahoo.com.ar> On my Fedora Core 4: ls -l /dev/ttyS* crw-rw---- 1 root uucp 4, 64 Feb 6 2006 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Feb 6 2006 /dev/ttyS1 ... and: grep "ttyUSB" /etc/udev/rules.d/50-udev.rules KERNEL=="ttyUSB*", GROUP="uucp", MODE="0660" So anyone in the "uucp" group can use serial ports. On Gentoo the group is "tty". Trent Jarvi escribi?: > > > On Sun, 5 Feb 2006, Dr. Douglas Lyon wrote: > >> I can confirm that this is the case (only root ownership of >> serial ports, under fedora 4). >> Wow, what were they thinking?! >> - DL >> >>> I've found that the newer kernels have the serial ports owned by root. >>> For example, >>> >>> $ls -al /dev/tty* >>> crw-rw-rw- 1 root root 5, 0 Feb 5 02:06 /dev/tty >>> crw-rw---- 1 root root 4, 0 Feb 5 02:06 /dev/tty0 >>> crw------- 1 root root 4, 1 Feb 5 09:07 /dev/tty1 >>> crw-rw---- 1 root tty 4, 10 Feb 5 02:06 /dev/tty10 >>> crw-rw---- 1 root tty 4, 11 Feb 5 02:06 /dev/tty11 >>> ... > > > This is just not a problem jcp or such are going to solve. Its a > platform spitwad fight. But do look at pam. In fact thats what Sun > is doing too. Maybe Linux followed their lead.. I'm not a pam guy. > I've spent 16 hours trying to understand it but your users wont :) > > Solution? I have no clue. Its two tangent mentalities from my > perspective. > > -- > Trent Jarvi > tjarvi at qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mtnvega at yahoo.com.br Mon Feb 6 05:35:43 2006 From: mtnvega at yahoo.com.br (Luiz Jr) Date: Mon, 6 Feb 2006 12:35:43 +0000 (GMT) Subject: [Rxtx] Documentation Wiki In-Reply-To: <1139157422.4553.9.camel@zd7280> Message-ID: <20060206123543.57256.qmail@web53515.mail.yahoo.com> Hello, Thank you for you answer, but so the usage of the API is pretty much like the Java Communications Api? If yes, what version of the Java Comm Api? Thank you, Luiz A. Brandao Jr Kim Lux escreveu: On Sun, 2006-02-05 at 08:36 -0300, Luiz Jr wrote: > Hello, > > I want to start using the RXTX libraries, but I would to know how, > since I can not access the documentation wiki page I just started using them yesterday. Below is how I installed the libraries, if that helps. I used snippets of code from the SimpleWrite application here to get me going. http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html Instead of "import javax.comm.*;", use "import gnu.io.*;" which is gotten from RXTXcomm.jar, which you will need to include in your project references. I am working in Eclipse. BTW: there is no way to open a port without going through the port list and finding it. Maybe sometime in the future someone (me ?) will write a method called openSerialPort that allows the user to give a port identifier, such as "/dev/tty1" and return a port ready to use. It wouldn't take much to write that and it would save users a lot of code. Hope this helps. ======================================================================= 1) Figure out which java you are running, incase there is more than one installed. $ java -version java version "1.5.0_05" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_05-b05) Java HotSpot(TM) Client VM (build 1.5.0_05-b05, mixed mode, sharing) 2) Find all the jre directories and the one from which you are currently running. kfind (jre) 3) cd to that directory plus /lib/i386 cd /usr/java/jre1.5.0_05/lib/i386 4) Copy the library files (*.so) to that directory. cp /home/krlux/Desktop/'Java Controls'/rxtx-linux/bin/* . 5) Check that the copy was successful ls librxtx* librxtxI2C.so librxtxRaw.so librxtxSerial.so librxtxParallel.so librxtxRS485.so 6) cd to the /lib/ext directory for your java. cd /usr/java/jre1.5.0_05/lib/ext 7) Copy the Jar files there cp /home/krlux/Desktop/'Java Controls'/rxtx-linux/lib/ext/* . 8) Check that it was successful ls RXTX* RXTXcomm.jar Rxtx is now installed on your machine ready to use. =================================================================== -- Kim Lux, Diesel Research Inc. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx --------------------------------- Yahoo! Acesso Gr?tis - Internet r?pida e gr?tis. Instale o discador agora! -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/544aa403/attachment-0060.html From lyon at docjava.com Mon Feb 6 05:49:34 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 06 Feb 2006 07:49:34 -0500 Subject: [Rxtx] wiki delay until tomorrow night. In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: Hi All, I have often thought about USB drivers being needed. For example, the ironman watch will not interface to a mac (windows only). It is USB. My dymo label writer has no Java driver (native only). Etc. Most cheap web cameras are USB (and Java drivers go through JAI, if it supports the camera at all). The JAI code shows how sun did the USB drivers. You have to be a member of the jai project to download the source code. https://jai.dev.java.net has the jai distro. And then you are not allowed to redistribute it. However, we can all learn from it (if so inclined). Basically: cvs -d :pserver:lyon at cvs.dev.java.net:/cvs login cvs -d :pserver:lyon at cvs.dev.java.net:/cvs checkout jai-core You will need to user your own uid and pw to get in. The ant build has over 100 warnings from sun deprecations of its own code. You might say that they were hoisted on their own Picard ;) One interesting thing is that they support several platforms: linux-amd64 64-bit Linux-AMD64 linux-i586 32-bit Linux-x86 solaris-amd64 64-bit Solaris-AMD64 solaris-i586 32-bit Solaris-x86 solaris-sparc 32-bit Solaris-SPARC solaris-sparcv9 64-bit Solaris-SPARC windows-i586 32-bit Windows-x86 Thus, ant is used to provide a multi-platform native method distro. Neat. How do they do it? check this out: And: The core download does not contain any C source code (it was all pre-built). Basically, they are just copying .so and .dll files into build directories. I would love to see the C code for this...but Sun does not post it on the https://jai.dev.java.net site. I don't know why...Perhaps I missed it. - Doug >On Sun, 5 Feb 2006, Trent Jarvi wrote: > >>On Sun, 5 Feb 2006, Kim Lux wrote: >> >>>usb ? Tell me more... I need that too. >> >>usb is a very proper design. Thats all it is. >> > >Maybe rxtx could help usb. But it would start with helping bring >back the community that was already there. > >It's not something I'd love to do but maybe its the right thing to do. > >It would probably take 2 years to do right. But maybe thats better >than what we have now. > >I honestly don't know what IBM is doing which could just run over everything. > >Just some thoughts after some fine german wine. > >-- >Trent Jarvi >tjarvi at qbang.org > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tdelenik at gmail.com Mon Feb 6 05:56:32 2006 From: tdelenik at gmail.com (Thanasis Delenikas) Date: Mon, 6 Feb 2006 14:56:32 +0200 Subject: Fwd: [Rxtx] Documentation Wiki In-Reply-To: <1139157422.4553.9.camel@zd7280> References: <20060205113618.30274.qmail@web53501.mail.yahoo.com> <1139157422.4553.9.camel@zd7280> Message-ID: <310a1a930602060456t129f1dc6p5f2b908f13ab5a0b@mail.gmail.com> Hello all, Kim, this is a snippet from the code I use. The closest to directly opening a specific port without enumeration. << ... portId = CommPortIdentifier.getPortIdentifier(getPort()); serialPort = (SerialPort) portId.open("jSMSEngine", 1971); ... >> where getPort() return the string identifier of the port, i.e. "/dev/ttyS0" or "COM1" or whatever. Thanasis. ---------- Forwarded message ---------- From: Kim Lux Date: Feb 5, 2006 6:37 PM Subject: Re: [Rxtx] Documentation Wiki To: RXTX Developers and Users BTW: there is no way to open a port without going through the port list and finding it. Maybe sometime in the future someone (me ?) will write a method called openSerialPort that allows the user to give a port identifier, such as "/dev/tty1" and return a port ready to use. It wouldn't take much to write that and it would save users a lot of code. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/182ab5b8/attachment-0060.html From tjarvi at qbang.org Mon Feb 6 11:53:57 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 11:53:57 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: On Mon, 6 Feb 2006, Dr. Douglas Lyon wrote: > Hi All, > I have often thought about USB drivers being needed. > For example, the ironman watch will not interface > to a mac (windows only). It is USB. > My dymo label writer has no Java driver (native only). > Etc. > Most cheap web cameras are USB (and Java drivers go > through JAI, if it supports the camera at all). > The JAI code shows how sun did the USB drivers. > You have to be a member of the jai project to download > the source code. > https://jai.dev.java.net has the jai distro. > And then you are not allowed to redistribute it. However, > we can all learn from it (if so inclined). Basically: > cvs -d :pserver:lyon at cvs.dev.java.net:/cvs login > cvs -d :pserver:lyon at cvs.dev.java.net:/cvs checkout jai-core > You will need to user your own uid and pw to get in. > The ant build has over 100 warnings from sun deprecations > of its own code. > > You might say that they were hoisted on their own Picard ;) > > One interesting thing is that they support several platforms: > linux-amd64 64-bit Linux-AMD64 > linux-i586 32-bit Linux-x86 > solaris-amd64 64-bit Solaris-AMD64 > solaris-i586 32-bit Solaris-x86 > solaris-sparc 32-bit Solaris-SPARC > solaris-sparcv9 64-bit Solaris-SPARC > windows-i586 32-bit Windows-x86 > Thus, ant is used to provide a multi-platform native method distro. > Neat. > How do they do it? > check this out: > > > > > > > > > > > > > And: > > > > > > > > > > The core download does not contain any C source code (it was all pre-built). > Basically, they are just copying .so and .dll files into build directories. > > I would love to see the C code for this...but Sun does not post it on the > https://jai.dev.java.net site. > > I don't know why...Perhaps I missed it. > > - Doug > > I've looked at moving rxtx to Ant builds. I think that would help IDEs a great deal. I requested a evalutation desk copy the O'Reilly Ant book for some j2ee material I was teaching. http://www.oreilly.com/catalog/anttdg/ It has a one sentence mention of JNI. So there was not luck there. I saw that there is another Ant book that does mention JNI more. I can't find it now. Ant must be able to support it with extensions. http://ant.apache.org/manual/OptionalTasks/javah.html What the auto(break :) tools do in the rxtx build is 4 things really. 1) gcc compile flags 2) ld compile flags 3) config.h 4) compile flags for customizing rxtx (lockfiles, ...) See 1 All of this information except 4 can be static once obtained. So I'm not attached to the auto tools. If I could find an example of Ant being used for JNI code, I'd be one of the first to start moving that direction. Maybe someone saw an example someplace. The other thing we have not completed discussing is the directory structure. There is interest in making rxtx more IDE friendly. I get more mail about that off the list than how to install rxtx. And I see we have Ken Thompson in da house :) He is our trusted CVS maintainer and the guy that purchased the rxtx.org domain. Old community. We will need Ken for changing the directory structure of source. I would like to open up discussion about both of these as it is more than time. The problem is I have little experience with Ant and even less with IDEs. It would be nice if we could work with Eclipse and NetBeans. http://www.netbeans.org/ (sun and some community) http://www.eclipes.org (ibm,rhat,... perhaps more community) http://maven.apache.org/what-is-maven.html (apache. It is community) borland should sortof be here too but I think thats covered in eclipse. >From what I understand so far, we should morph rxtx to support those three maybe trusting apaches lead with maven. But I use vi. I have little to no clues beyond what people have fed me. Can we agree that thats the right direction to go? -- Trent Jarvi tjarvi at qbang.org From brian at mbari.org Mon Feb 6 14:57:50 2006 From: brian at mbari.org (Brian Schlining) Date: Mon, 6 Feb 2006 13:57:50 -0800 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> > The other thing we have not completed discussing is the directory > structure. There is interest in making rxtx more IDE friendly. I > get more mail about that off the list than how to install rxtx. > > And I see we have Ken Thompson in da house :) He is our trusted > CVS maintainer and the guy that purchased the rxtx.org domain. Old > community. We will need Ken for changing the directory structure of > source. > > I would like to open up discussion about both of these as it is > more than time. The problem is I have little experience with Ant > and even less with IDEs. It would be nice if we could work with > Eclipse and NetBeans. > > http://www.netbeans.org/ (sun and some community) > http://www.eclipes.org (ibm,rhat,... perhaps more community) > http://maven.apache.org/what-is-maven.html (apache. It is community) > borland should sortof be here too but I think thats covered in > eclipse. > >> From what I understand so far, we should morph rxtx to support >> those three > maybe trusting apaches lead with maven. But I use vi. I have > little to no clues beyond what people have fed me. > Maven likes the directory structure below for Java code. (From http:// maven.apache.org/guides/getting-started/index.html) This structure works fine with ant, netbeans, and eclipse. rxtx_root_directory `-- src |-- main | `-- java | `-- gnu | `-- io `-- test `-- java `-- gnu `-- io Brian Schlining Software Engineer http://www.mbari.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/d9451eba/attachment-0060.html From tjarvi at qbang.org Mon Feb 6 15:11:45 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 15:11:45 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: > rxtx_root_directory > `-- src > |-- main > | `-- java > | `-- gnu > | `-- io > `-- test > `-- java > `-- gnu > `-- io > >From what I understand this will just be good. For me it makes no difference. So lets do the rxtx thing. Let if fester for two weeks and if nobody objects, we will do it. I'm not doing this because I care. I'm doing this to eliminate much of my inbox. But test... man is rxtx lacking there in the community aspect. It is covered but not right. _maybe_ I can change that this year. -- Trent Jarvi tjarvi at qbang.org (cat hurding since 1997) From lux at diesel-research.com Mon Feb 6 21:38:49 2006 From: lux at diesel-research.com (Kim Lux) Date: Mon, 06 Feb 2006 21:38:49 -0700 Subject: [Rxtx] How can I use Lock Files with rxtx (in FC4) ? Message-ID: <1139287129.17031.3.camel@zd7280> I am now running an rxtx application on FC4. I am getting: ========================================================= check_group_uucp(): error testing lock file creation Error details: Permission denied check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL ========================================================= $ ls -al /var/lock total 32 drwxrwxr-x 4 root lock 4096 Feb 6 16:04 . drwxr-xr-x 24 root root 4096 Nov 14 01:19 .. drwx------ 2 root root 4096 Apr 27 2005 lvm drwxr-xr-x 2 root root 4096 Feb 6 16:04 subsys How do I fix this for regulator users ? -- Kim Lux, Diesel Research Inc. From dmarkman at mac.com Mon Feb 6 22:24:44 2006 From: dmarkman at mac.com (Dmitry Markman) Date: Tue, 7 Feb 2006 00:24:44 -0500 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: if I understands the issue right in order to be able to use ant for c/c++ compilation you have to install ant's cc task http://ant-contrib.sourceforge.net/cc.html it looks like it should work on mac os x (authors claim, that it's platform independent) but I never tested so all you have to do it's providing right command line for the gcc compiler On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: >> rxtx_root_directory >> `-- src >> |-- main >> | `-- java >> | `-- gnu >> | `-- io >> `-- test >> `-- java >> `-- gnu >> `-- io >> > > >> From what I understand this will just be good. > > For me it makes no difference. So lets do the rxtx thing. Let if > fester for two weeks and if nobody objects, we will do it. > > I'm not doing this because I care. I'm doing this to eliminate > much of my inbox. > > But test... man is rxtx lacking there in the community aspect. It > is covered but not right. _maybe_ I can change that this year. > > -- > Trent Jarvi > tjarvi at qbang.org > (cat hurding since 1997) > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx Dmitry Markman From lux at diesel-research.com Mon Feb 6 23:20:15 2006 From: lux at diesel-research.com (Kim Lux) Date: Mon, 06 Feb 2006 23:20:15 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? Message-ID: <1139293215.3689.4.camel@zd7280> I'm running the code below. portlist.hasMoreElements() is false. /dev has ports in it as listed below. What am I doing wrong ? ========================================================== // Step through the list of ports until we find one that matches // the one we are looking for. portList = CommPortIdentifier.getPortIdentifiers(); while(portList.hasMoreElements()) { portID = (CommPortIdentifier) portList.nextElement(); // if (portID.getName().equals("/dev/ttyUSB0")) { myTA.append("Serial port ttyUSB0 has been found\n"); break; }// if portID equals... }// End of while... ========================================================== ls -al /dev/tty* crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 ... crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 -- Kim Lux, Diesel Research Inc. From david.garnier at trusted-logic.com Tue Feb 7 00:46:30 2006 From: david.garnier at trusted-logic.com (David Garnier) Date: Tue, 07 Feb 2006 08:46:30 +0100 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: <43E85056.2090608@trusted-logic.com> Hello, I think that the make-based build process is fine as it is, apart from the location of the Java source files. It is true that putting the Java source in a directory structure that map 1-to-1 to the Java package structure is the norm and should make it easier for everyone to modify the Java source, with or without an IDE. Ant is a good tool, but in the RXTX case I fail to see the advantage of using it compared to the current make-based process. As Trent said, they are more pressing issues, like testing. Regards, David Dmitry Markman wrote: > if I understands the issue right > in order to be able to use ant for c/c++ compilation > you have to install ant's cc task > http://ant-contrib.sourceforge.net/cc.html > > it looks like it should work on mac os x > (authors claim, that it's platform independent) > but I never tested > > so all you have to do it's providing right command line > for the gcc compiler > > > > > On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: > >>> rxtx_root_directory >>> `-- src >>> |-- main >>> | `-- java >>> | `-- gnu >>> | `-- io >>> `-- test >>> `-- java >>> `-- gnu >>> `-- io >>> >> >> >>> From what I understand this will just be good. >> >> For me it makes no difference. So lets do the rxtx thing. Let if >> fester for two weeks and if nobody objects, we will do it. >> >> I'm not doing this because I care. I'm doing this to eliminate much >> of my inbox. >> >> But test... man is rxtx lacking there in the community aspect. It is >> covered but not right. _maybe_ I can change that this year. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> (cat hurding since 1997) From tjarvi at qbang.org Tue Feb 7 01:11:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 01:11:31 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <43E85056.2090608@trusted-logic.com> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: On Tue, 7 Feb 2006, David Garnier wrote: > Hello, > > I think that the make-based build process is fine as it is, apart from the location of the Java > source files. It is true that putting the Java source in a directory structure that map 1-to-1 to > the Java package structure is the norm and should make it easier for everyone to modify the Java > source, with or without an IDE. > > Ant is a good tool, but in the RXTX case I fail to see the advantage of using it compared to the > current make-based process. As Trent said, they are more pressing issues, like testing. > Hi David I have more experience with testing rxtx than I can talk about. But let it be known, rxtx has gone trough 100's of hours of testing. We are hobby folks interested in toys but there is more. rxtx has had some of the best guidance in the industry there. This is not an easy thing. I may be able to come back in a month from the other side of the corperate fence and help. I suspect the tests could just be made public but they are in a very unusual environment that just wont work in a wider sense. This is something I'll be trying to change. At one point it was agreed we could just make the results public so this isnt just noise.. There is interest and I think its safe to mention that much. The big problem with testing in the past is most of it is done with a loopback connection. So we *still* have major questions regarding things like flow control. rxtx talks to itself over a loopback and it works. regardless of right or wrong. This requires more thought to be done right. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Feb 7 02:46:34 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 02:46:34 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: > The big problem with testing in the past is most of it is done with a > loopback connection. So we *still* have major questions regarding things > like flow control. rxtx talks to itself over a loopback and it works. > regardless of right or wrong. With serial communication there are gold standards. ckermit is probably a definitive 'standard.' Maybe its possible to do ping/pong tests with ckermit? Is it scriptable? There are known issues in rxtx. Probably the worst is some threading issues regarding some JREs with multiple JNI threads setting java variables. Man did I get schooled there. Just switch the c functions to returning variables and things go away. Sometimes they work fine, sometimes they blow up. Without understanding everything, somehow rhat got it right and debian (and especially gentoo) grabbed kernel patches causing all sort of harm. Its not hard to fix once you understand whats going on but nearly impossible to track with a debugger. So I have a good idea what 2.1-8 will have outside of the IDE modifications. rxtx 2.1-7 is a release for everyone to sync with. Its not even as stable as -pre17 as far as I know - I ran no test suites. I'll be chasing it too. We just had so many contributions that it was time. It seriously broke internal scheduals but thats a great thing :) The other thing I want to do in 2.1-8 is automagic baud rates. It turns out lots of shops are doing really funky baud rates for things like automobile test equipment. It is possible but it requires a fair amount of change in the native code. Is anyone looking at this? -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Feb 7 02:57:21 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 07 Feb 2006 04:57:21 -0500 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <43E85056.2090608@trusted-logic.com> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: Hi All, I agree, testing is very important. The problem I have been trying to address is related to cross-platform testing and the robust nature of the installs. Typically, I visit 3 platforms to deploy my product, windows, linux and mac. A build is performed on each platform. The idea that you can build for many platforms from one copy the source code seems attractive. This should enable synchronized deployments of identical code. The question of how to achieve this goal remains open. As Trent mentioned, this is hard. Perhaps Ant will help here (but perhaps not). Ant does seem to help with running unit tests. However, it does not help with multi-platform tests. For that you need many machines and different operating environments. Toward that end, I have created a multi-platform test that can be run from web start, located at: http://show.docjava.com:8086/book/cgij/code/jnlp/serialPort.PortTest.jnlp This is interesting because many people in the community can run the test and we can improve the test, as time permits. No, it is not a perfect solution, however, the idea does help with multi-platform tests using many machines and different operating environments. If the group has a good test for a general serial port set-ups, i would be happy to deploy it, for general evaluation using web start. And as for ANT, it is just an idea. Not all my ideas are good ones! - Doug >Hello, > >I think that the make-based build process is fine as it is, apart >from the location of the Java >source files. It is true that putting the Java source in a directory >structure that map 1-to-1 to >the Java package structure is the norm and should make it easier for >everyone to modify the Java >source, with or without an IDE. > >Ant is a good tool, but in the RXTX case I fail to see the advantage >of using it compared to the >current make-based process. As Trent said, they are more pressing >issues, like testing. > >Regards, >David > >Dmitry Markman wrote: >> if I understands the issue right >> in order to be able to use ant for c/c++ compilation >> you have to install ant's cc task >> http://ant-contrib.sourceforge.net/cc.html >> >> it looks like it should work on mac os x >> (authors claim, that it's platform independent) >> but I never tested >> >> so all you have to do it's providing right command line >> for the gcc compiler >> >> >> >> >> On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: >> >>>> rxtx_root_directory >>>> `-- src >>>> |-- main >>>> | `-- java >>>> | `-- gnu >>>> | `-- io >>>> `-- test >>>> `-- java >>>> `-- gnu >>>> `-- io >>>> >>> >>> >>>> From what I understand this will just be good. >>> >>> For me it makes no difference. So lets do the rxtx thing. Let if >>> fester for two weeks and if nobody objects, we will do it. >>> >>> I'm not doing this because I care. I'm doing this to eliminate much >>> of my inbox. >>> >>> But test... man is rxtx lacking there in the community aspect. It is >>> covered but not right. _maybe_ I can change that this year. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> (cat hurding since 1997) > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From matt.higgins at gmail.com Tue Feb 7 08:28:34 2006 From: matt.higgins at gmail.com (Matt Higgins) Date: Tue, 7 Feb 2006 10:28:34 -0500 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final Message-ID: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? import java.io.*; import java.util.*; import gnu.io.*; public class MySimpleRead implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; public static void main(String[] args) { boolean portFound = false; String defaultPort = "COM1"; if (args.length > 0) { defaultPort = args[0]; } portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; MySimpleRead reader = new MySimpleRead(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } } public MySimpleRead() { try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) { e.printStackTrace(); } try { inputStream = serialPort.getInputStream(); } catch (IOException e) { e.printStackTrace(); } try { serialPort.addEventListener(this); } catch (TooManyListenersException e) { e.printStackTrace(); } try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { e.printStackTrace(); } System.out.println("Baud is " + serialPort.getBaudRate()); System.out.println("Bits is " + serialPort.getDataBits()); System.out.println("Stop is " + serialPort.getStopBits()); System.out.println("Par is " + serialPort.getParity()); serialPort.notifyOnDataAvailable(true); readThread = new Thread(this); readThread.start(); } public void run() { // Thread.sleep(20000); //} catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { System.out.println("An event occurred " + event.getEventType()); switch (event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: byte[] readBuffer = new byte[20]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } System.out.print(new String(readBuffer)); } catch (IOException e) {} break; } } } --------------- Result on windows ------------------------------ Stable Library ============================================================== Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port:: COM1 Baud is 9600 Bits is 8 Stop is 1 Par is 0 ----------------- End Results ----------------------------------------- ------------------ Result on Linux ----------------------------------- Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 Found port: /dev/ttyS0 Baud is 9600 Bits is 8 Stop is 1 Par is 0 An event occurred 1 043100066224 ------------------ End Results --------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/a1431630/attachment-0060.html From brian at mbari.org Tue Feb 7 09:48:37 2006 From: brian at mbari.org (Brian Schlining) Date: Tue, 7 Feb 2006 08:48:37 -0800 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> Message-ID: <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> Hi Matt > The following code works fine on Linux but I never see any data > when run on Windows. This is a cut and paste from the SimpleRead > example. > I am attempting to read data from a bar code scanner. I can fire > up HyperTermianl on windows and see that the device is working > properly as I see the barcodes are scanned and echoed back to the > terminal. However when I run the app I don't see any data. It is > however associating with the com port as the informational bits > print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. Cheers Brian Schlining Software Engineer http://www.mbari.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/16d07f37/attachment-0060.html From lux at diesel-research.com Tue Feb 7 11:59:58 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 11:59:58 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139293215.3689.4.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> Message-ID: <1139338798.8145.4.camel@zd7280> Any ideas on this ? Any reason why portList.hasMoreElements() should be false even though there are devices in /dev ? On Mon, 2006-02-06 at 23:20 -0700, Kim Lux wrote: > I'm running the code below. > > portlist.hasMoreElements() is false. > > /dev has ports in it as listed below. > > What am I doing wrong ? > > > ========================================================== > // Step through the list of ports until we find one that matches > // the one we are looking for. > > portList = CommPortIdentifier.getPortIdentifiers(); > > while(portList.hasMoreElements()) > { > portID = (CommPortIdentifier) portList.nextElement(); // > if (portID.getName().equals("/dev/ttyUSB0")) > { > myTA.append("Serial port ttyUSB0 has been found\n"); > break; > }// if portID equals... > }// End of while... > ========================================================== > > ls -al /dev/tty* > crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty > crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 > crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 > crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 > crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 > ... > crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 > crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 > crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 > > > -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 12:20:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 12:20:25 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139338798.8145.4.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> Message-ID: On Tue, 7 Feb 2006, Kim Lux wrote: > > Any ideas on this ? Any reason why portList.hasMoreElements() should be > false even though there are devices in /dev ? > > > On Mon, 2006-02-06 at 23:20 -0700, Kim Lux wrote: >> I'm running the code below. >> >> portlist.hasMoreElements() is false. >> >> /dev has ports in it as listed below. >> >> What am I doing wrong ? >> >> >> ========================================================== >> // Step through the list of ports until we find one that matches >> // the one we are looking for. >> >> portList = CommPortIdentifier.getPortIdentifiers(); >> >> while(portList.hasMoreElements()) >> { >> portID = (CommPortIdentifier) portList.nextElement(); // >> if (portID.getName().equals("/dev/ttyUSB0")) >> { >> myTA.append("Serial port ttyUSB0 has been found\n"); >> break; >> }// if portID equals... >> }// End of while... >> ========================================================== >> >> ls -al /dev/tty* >> crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty >> crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 >> crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 >> crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 >> crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 >> ... >> crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 >> crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 >> crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 >> >> >> > Hi Kim What rxtx does is try to open the port and do a timed out read. If the kernel/... do not complain it's enumarted. I suspect you could do a crude test by doing something like cat /dev/ttyS0 > /dev/null If that barfs then rxtx wont enumerate the port. hmm looking at your question again, I suspect it's a lockfile problem. This is documented in INSTALL with the source. Its easy enough to test this too.. touch /var/lock/testingrxtxlockfiles && rm -f /var/lock/testingrxtxlockfiles If you are not in the right group it will bail. Root will work regardless. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 12:37:56 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 12:37:56 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> Message-ID: <1139341076.8145.11.camel@zd7280> Exactly which ports does rxtx attempt to put into the list ? /dev/* or /dev/tty* or /dev/tty[0-9[0-9] ? or /dev/ttyS* ? For the record, only /dev/ttyUSB0 is a valid port on the machine I am presently on. Will this be a problem ? On Tue, 2006-02-07 at 12:20 -0700, Trent Jarvi wrote: > This is documented in INSTALL with the source. > I was wondering where that file was. I will download source and dig it up. Thanks. -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 12:51:09 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 12:51:09 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139341076.8145.11.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: On Tue, 7 Feb 2006, Kim Lux wrote: > > Exactly which ports does rxtx attempt to put into the list ? /dev/* > or /dev/tty* or /dev/tty[0-9[0-9] ? or /dev/ttyS* ? > > For the record, only /dev/ttyUSB0 is a valid port on the machine I am > presently on. Will this be a problem ? > > > On Tue, 2006-02-07 at 12:20 -0700, Trent Jarvi wrote: >> This is documented in INSTALL with the source. >> > I was wondering where that file was. I will download source and dig it > up. > > Thanks. > Hmm I'm looking at pre17 so this may have changed. (its just what I have on this machine) if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA" // for the IPAQs }; CandidatePortPrefixes=Temp; } So you may need to add "ttyUSB" to that list. RXTX used to enumerate _everything_ see if(osName.equals("Linux-all-ports") But it became less than practical. This is all in RXTXCommDriver.java hmm I just did a cvs update. if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have to get your fingers into the code. We aim for sane defaults. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 13:06:45 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 13:06:45 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139342805.8145.22.camel@zd7280> On Tue, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > Hmm I'm looking at pre17 so this may have changed. (its just what I have > on this machine) > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA" // for the IPAQs > }; > CandidatePortPrefixes=Temp; > } > > > So you may need to add "ttyUSB" to that list. RXTX used to enumerate > _everything_ see if(osName.equals("Linux-all-ports") But it became less > than practical. > > This is all in RXTXCommDriver.java > > hmm I just did a cvs update. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have > to get your fingers into the code. We aim for sane defaults. Excellent. Thanks for taking the time. -- Kim Lux, Diesel Research Inc. From ideiglenes1 at freemail.hu Tue Feb 7 13:53:39 2006 From: ideiglenes1 at freemail.hu (--) Date: Tue, 07 Feb 2006 21:53:39 +0100 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139345619.22534.2.camel@localhost> Hi! I use this code to get all the extra Linux devices. :) if ("Linux".equals(System.getProperty("os.name"))) { System.setProperty("os.name","Linux-all-ports"); } driver = new RXTXCommDriver(); On k, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > On Tue, 7 Feb 2006, Kim Lux wrote: > > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have > to get your fingers into the code. We aim for sane defaults. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From matt.higgins at gmail.com Tue Feb 7 13:45:54 2006 From: matt.higgins at gmail.com (Matt Higgins) Date: Tue, 7 Feb 2006 15:45:54 -0500 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> Message-ID: <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> Sweet this is exactly what I needed. I was searching the archives through marc.theamisgroup they only have archives back to 1/3/05. Should have hit the mailman archive! Thanks a lot! On 2/7/06, Brian Schlining wrote: > > Hi Matt > > The following code works fine on Linux but I never see any data when run > on Windows. This is a cut and paste from the SimpleRead example. > I am attempting to read data from a bar code scanner. I can fire up > HyperTermianl on windows and see that the device is working properly as I > see the barcodes are scanned and echoed back to the terminal. However when I > run the app I don't see any data. It is however associating with the com > port as the informational bits print fine? > > > You're not the only one whose had this problem, I don't know if Trent has > addressed this is the latest release of RXTX but there is a workaround. > Here's the recent thread from the RXTX mailing list regarding this issues: > > Thanasis Delenikas tdelenik at gmail.com > Wed Jan 18 13:56:23 MST 2006 > > * Previous message: [Rxtx] Re: More close() performance fixes > * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] > > Hi all. > (I've subscribed again from my other email account). > > Trent, > > You are right. Linux *always* works, no matter what flow control you set. > Windows *works only* with hardware flow control (I haven't tested what > happens with software XON/XOFF flow control). > > I assume (but I am not certain) that even with no flow control at all, all > platforms should work. Without flow control, you have the risk of bumping > into overflow or framing errors, but that's your (the end programmer, I > mean) problem. > > >From my side, I shouldn't be working without flow control. That was a bug > too... It was some code forgotten from the old times, when I used to work > with phone emulation drivers which didn't support flow control. The > correct > way is to have some flow control enabled and that's why I suppose this is > a > low-severity bug for RxTx. > > I have no idea which platform shows the correct behaviour, since > my knowledge about Linux and the inner workings of these low-level i/o > operations is limited. > > Regards, > Thanasis Delenikas. > > > > > Message: 2 > > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > > From: Trent Jarvi > > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > > To: RXTX Developers and Users > > Message-ID: > > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > > > Hi all, > > > > > > Trent, I have found something. > > > I read your comment about flow control, so I experimented a bit. > > > > > > If you remember, in my sample program I've used no flow control at all > ( > > i.e. > > > Java constant FLOWCONTROL_NONE). > > > > > > Now, during testing, I've switch to hardware inbound flow control (i.e > . > > Java > > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > > beautifully! > > > > > > I think I will switch to H/W flow control and test things for a while, > > but > > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > > > > > Hi Thanasis, > > > > I'm fairly sure you have identified a bug. I would not worry too much > > about what Sun CommAPI w32 defaults are. I think they did more or less > > whatever the port opened with. Just a guess. Linux tries to stomp on > > ports so they are all the same. > > > > So this started out with Linux worked, Windows XP/.. did not as I > recall. > > Something is wrong in rxtx. Do I understand this right? > > > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > > > Perhaps there is something Wayne or I did not understand when we wrote > > that code. I wasnt programming back in the BBS days so modems are not > my > > thing. I have a few questions. > > > > Is the above matrix confirmed by observation? > > Linux just always worked? > > Which one _should_ work? I'm guessing modems work with hardware flow > > control. I'll have to dig around. > > > > The windows flow control changes a couple things with hardware flow > > control. Following the w32 API documentation is confusing sometimes. > > But it looks like Linux could have a bug too. > > Cheers > > Brian Schlining > Software Engineer > http://www.mbari.org > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/9c989144/attachment-0060.html From tjarvi at qbang.org Tue Feb 7 14:06:14 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 14:06:14 -0700 (MST) Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> Message-ID: >> >> You're not the only one whose had this problem, I don't know if Trent has >> addressed this is the latest release of RXTX but there is a workaround. >> Here's the recent thread from the RXTX mailing list regarding this issues: >> I have not. I expect to have access to some test equipment next month and I'll go through all of this. I really don't know whats going on and I need a gold standard. I thought maybe linux was autodetecting the flow control. Your observations would certainly be welcome. I need to talk to Russell King and see what he is doing. Until then I'd just be toying around over a loopback as usual. This is very high on the list though. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 17:25:05 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 17:25:05 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139358305.17994.2.camel@zd7280> My application now works. I installed the libraries and jar from 2.1-7 (Final). portlist.hasMoreElements is no longer false. The application finds the port for /dev/ttyUSB0. Thanks for your help, Trent (et al) Sorry I bothered you with this. Next time I will look in the source first. I didn't think it was an rxtx issue, I thought it was a Linux setup issue . On Tue, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > Hmm I'm looking at pre17 so this may have changed. (its just what I > have > on this machine) > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux > Serial Ports > "ttySA" // for the > IPAQs > }; > > CandidatePortPrefixes=Temp; > } > > > So you may need to add "ttyUSB" to that list. RXTX used to enumerate > _everything_ see if(osName.equals("Linux-all-ports") But it became > less > than practical. > > This is all in RXTXCommDriver.java > > hmm I just did a cvs update. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux > Serial Ports > "ttySA", // for the > IPAQs > "ttyUSB" // for USB > frobs > }; > > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you > have > to get your fingers into the code. We aim for sane defaults. -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 19:21:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 19:21:54 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139358305.17994.2.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> <1139358305.17994.2.camel@zd7280> Message-ID: >Sorry I bothered you with this. Next time I will look in the source >first. I didn't think it was an rxtx issue, I thought it was a Linux >setup issue . Why would you be sorry? I would have done the same. I'm glad it's working :) -- Trent Jarvi tjarvi at qbang.org From tma at mail.island.net Wed Feb 8 13:39:35 2006 From: tma at mail.island.net (Tom Alldread) Date: Wed, 08 Feb 2006 12:39:35 -0800 Subject: [Rxtx] Win32/Linux Serial Port Data Dropouts In-Reply-To: <200602060702.k167255O007882@www.qbang.org> References: <200602060702.k167255O007882@www.qbang.org> Message-ID: <43EA5707.4020200@mail.island.net> Greetings Folks at RXTX: During the last couple of months I have been alternately testing with javax.comm 2 and RXTX 2.1 under Windows XP and CommApi 3 and RXTX 2.1 under Suse 10.0 Linux. In the process I have learned a little about java multi-threading under NetBeans 5 with Profiler. My java (jdk 1.5_06) application is used for data acquisition and provides a graphical display of A-D conversion data received from a 56KBaud serial port. The actual data throughput is about 10KBaud thus it is well below the speed of the port. I use hardware RTS/CTS flow control which can stall the data acquisition sample rate if necessary. This ensures the display computer has the ability to slow the data acquisition rate should it become too busy to accept the regular data flow. Both the serial port buffer and the java read buffer are set at 16KB. Usually the data transfers into the java read buffer are less than 100 bytes unless the data acquisition is recovering from a stall. The data flow normally hesitates after each 5 KB block as a continue command is needed from the display computer to start the drawing of a new graphics display line. Separate threads have been provided for the serial port event monitoring and data processing. The serial port event thread has been given the maximum priority and data processing thread the minimum priority provided by java. Thread yield statements have been placed within all data processing while/for loops as an effort to ensure quick access to CPU cycles for the serial port event thread. I have found that short data transmissions are essentially error free but occasional dropouts occur with continuous data flow especially under Windows XP. ....................................................................................................................................................................................... Linux results: I am happy to report that RXTX 2.1 appears to work very well under Linux although I did notice some errors when the screen savers were running with my dual monitors. I believe this is a local problem associated with my dual graphics which needs further attention. The recent CommApi 3 Linux release from Sun did not work at all with my program. It seemed to send commands out OK but did not receive any data. Although the serial port event triggered the ISR, the input stream appeared filled with nulls and thus did not contain any data. As my understanding is that CommApi 3 was tested with a Red Hat distribution of Linux I wonder if this problem is distro dependent? Although somewhat off topic here I wonder if anyone reading this has had similar experience? .................................................................................................................................................................................. Windows XP results: There are problems with occasional data dropouts which become more frequent as the sampling rate is increased or if the computer becomes busy with other duties. The dropouts typically consist of a half dozen byte block of lost data. It appears the lost bytes never get added to the java input stream. There has not been any indication of garbled data, overruns or framing errors which suggests the UART communications remains solid. Using javax.comm 2 I found that the setting of SerialPort 'enableReceiveThreshold' to 40 and 'enableReceiveTimeout' of 100mS reduced the dropouts error rate significantly. I found that I could not get RXTX 2.1 to function with the aforementioned threshold and timeout settings. The javax.comm 2 interface is consequently performing better for me under Windows than RXTX 2.1. I wonder if anyone here has any suggestions as to what I might try to improve RXTX 2.1? Although my settings are the same as under Suse 10.0, RXTX 2.1 performs much better for me under Linux than any of the alternatives that I have tried under Windows XP . ............................................................................................................................................................................... I would like to establish, based on the experience of others, if I have reached the normally expected performance limit of java serial port communications? Should I expect to achieve virtually error free serial port data input from a continuous stream under Windows XP java software? I am considering changing my protocol to packets with error checking if necessary but would like to know if the dropout problems I am experiencing are typical or not before I take this rather work intensive plunge. Many thanks in advance for any help! Best Regards, Tom Alldread -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.375 / Virus Database: 267.15.2/253 - Release Date: 2006-02-07 From jlaxson at mac.com Wed Feb 8 23:56:48 2006 From: jlaxson at mac.com (John Laxson) Date: Thu, 9 Feb 2006 00:56:48 -0600 Subject: [Rxtx] PortInUseException: Unknown Application on OSX Message-ID: Hi, I've been trying to get RXTX 2.1.7 going on Mac OS X for a while here, and am running up into a wall here. I've tried with pre- compiled and the source version and get the same problem, a gnu.io.PortInUseException: Unknown Application. I have run the fixperms script included with the source distribution, and id shows me as a member of the uucp group, and permissions on /var/spool/uucp are 775 root:uucp. Running a test program (included at the bottom for clarity) lets me enumerate all the serial ports correctly, but trying to open any of them gives the PortInUseException. If it helps, when I try to open a port that's set to make an outgoing bluetooth connection, there is no delay and no connection attempt at all. Thanks, John Laxson PS: The documentation wiki on qbang.org shows 404, and has for a few days now. My test code: public static void main(String[] args) { SerialPort serialPort; try { Enumeration e = CommPortIdentifier.getPortIdentifiers(); CommPortIdentifier ident; while (e.hasMoreElements()) { ident = (CommPortIdentifier)e.nextElement(); System.out.println(ident.getName()); } ident = CommPortIdentifier.getPortIdentifier("/dev/cu.modem"); serialPort = (SerialPort) ident.open("Me", 5000); } catch (Exception e) { e.printStackTrace(); } } From rajesh.invincible at gmail.com Thu Feb 9 03:39:38 2006 From: rajesh.invincible at gmail.com (Rajesh N) Date: Thu, 9 Feb 2006 16:09:38 +0530 Subject: [Rxtx] Re: Move .java Files in gnu.io filesystem hierarchy - Maven (2) In-Reply-To: <43DF21D2.7090200@ngi.it> References: <43DF21D2.7090200@ngi.it> Message-ID: <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Can anybody tell me how to overcome these EXCEPTIONS I AM WORKING ON SERIAL COMMN IN JAVA ON LINUX. 1. " NOT ALL PARAMETERS SUPPORTED BY THE KERNEL" This i came across the following statement inmy prog. SerialP is A SerialPort object SerialP.setSerialPortParams(9600(BAUDRATE),DATABITS_8,STOPBITS_1,PARITY_NONE) 2. NullPointer Exception at Event Dispatch Now i have checked all my object references for a null reference but i found none i have put up my entire code in try catch blocks but still I AM UNABLE TO CATCH THIS EXCEPTION AND HENCE MY APPLICATION CLOSES HOW DOES THESE GO? PLEASE HELP ME IT IS URGENTTTTTTTTTTTTTTTT yours sincerely RAJESH On 1/31/06, Fabio Frumento wrote: > Hi Xavier, > > I don't know maven at all but the directory hierarchy listed buy Trent > is fine for me... > > I'll take a look to maven, it seems an interesting project > > Regards > > Fabio Frumento > > Trent Jarvi wrote: > > On Tue, 31 Jan 2006, Xavier Frisaye wrote: > > > >> Hi all, > >> > >> If you are going to rearrange the src folder, i will propose to use > >> maven 2 and follow its directory structure > >> > (http://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html). > >> > >> Maven 2 simplify java project and give a standard way to make projects > >> (http://maven.apache.org/). > >> We are using it for internal projects and we are very satisfied. > >> > >> Is anybody interested? > >> > >> I'm not an expert in maven 2 (yet) but i'm agree to help using it if > >> you choose to make so. > >> > > > > so this would be: > > > > rxtx-devel/src/main/java/gnu.io > > rxtx-devel/src/test/java/ManIwish.java > > > > I don't use IDEs very much so I'll let others comment. But I don't see > > a problem with that. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Thu Feb 9 09:50:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 9 Feb 2006 09:50:31 -0700 (MST) Subject: [Rxtx] Re: Move .java Files in gnu.io filesystem hierarchy - Maven (2) In-Reply-To: <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Message-ID: On Thu, 9 Feb 2006, Rajesh N wrote: > Can anybody tell me how to overcome these EXCEPTIONS > I AM WORKING ON SERIAL COMMN IN JAVA ON LINUX. > > 1. " NOT ALL PARAMETERS SUPPORTED BY THE KERNEL" > > This i came across the following statement inmy prog. > SerialP is A SerialPort object > SerialP.setSerialPortParams(9600(BAUDRATE),DATABITS_8,STOPBITS_1,PARITY_NONE) > Strange. The parameters you use are the same the port should open with by default. Could you paste the actual exception you are getting? I don't see that in the rxtx source. Also it would help to know the rxtx version. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Fri Feb 10 15:29:05 2006 From: lux at diesel-research.com (Kim Lux) Date: Fri, 10 Feb 2006 15:29:05 -0700 Subject: [Rxtx] One serial port object for both sending and receiving ? Message-ID: <1139610545.18177.4.camel@zd7280> Is it OK to use one SerialPort ojbect (ex Serial Port serialPort;) and use it for both sending and receiving ? For example: ======================================================================== static SerialPort serialPort = null; static OutputStream serialOut = null; static InputStream serialIn = null; // assign it to an outputStream for use try{ serialOut = serialPort.getOutputStream(); System.out.println("Serial output stream has been assigned."); }//try catch(IOException e) { System.out.println("Error: Couldn't assign output stream to serial port."); }//catch //assign it to an inputStream for use try{ serialIn = serialPort.getInputStream(); System.out.println("Serial input stream has been assigned."); }//try catch(IOException e) { System.out.println("Error: Couldn't assign input stream to serial port."); }//catch ======================================================================== -- Kim Lux, Diesel Research Inc. From lux at diesel-research.com Fri Feb 10 21:23:00 2006 From: lux at diesel-research.com (Kim Lux) Date: Fri, 10 Feb 2006 21:23:00 -0700 Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Message-ID: <1139631780.23882.10.camel@zd7280> I've got a problem receiving chars with my version of serialRead, written in an SWT GUI. I had a Java pro have a good look at my code and he can't see anything wrong with it. I can send chars fine. When I receive a char the cpu usage for the app goes to 100% and the code in the serial event handler doesn't get executed. The instructions on the Java Comm Serial API How-To for Linux page state that I must install javacomm. Is that true ? Everything builds without it and I can send chars on rxtx just fine, but I can't receive them. Could this be the problem ? I downloaded and installed javacomm. I was not able to add "Driver=gnuio.RXTXCommDriver to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 installed in /usr/java/jre1.5.0_05. I added comm.jar to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext to the library paths. Is this OK ? Does it matter that I am receiving on /dev/ttyUSB0 ? Thanks. -- Kim Lux, Diesel Research Inc. From lunareclipse03 at web.de Sat Feb 11 09:44:46 2006 From: lunareclipse03 at web.de (lunareclipse03@web.de) Date: Sat, 11 Feb 2006 17:44:46 +0100 Subject: [Rxtx] Question about Serial I/O under Win32 Message-ID: <662084330@web.de> Hello everybody, I have a strange problem with a piece of code I made for myself. No, this is not really concerning rxtx, but nevertheless I post this to the list, hoping that some of you can help me. I've written two libraries, one for linux and one for win32. The linux port works quite well, I can send / receive faxes and / or replay voice messages over the telephone line using a voice modem. But the win32 port of the library causes some trouble. If, for example, I send out a fax with a certain modem under linux, it works well. The fax is complete when it comes out of the fax machine. If I then use the same modem to send out a fax under win32, the fax coming out of the fax machine gets "stuck" halfways, but the sending modem thinks that transmission was ok and drops the connection. The answering fax machine then gives me "error while receiving." The "upper layer" java code MUST be right, because if I do the same thing under linux (using the linux library), everything is alright. Now I have to ask: Can somebody please help me out with this??!? Could it be the case that some kind of flow control or COMMTIMEOUTS setting causes this behaviour? I set flow control to RTS/CTS before sending out a fax. How can I DISABLE flow control? Or what do you think? Can something else cause this problems? Thank you all for your time and PLEASE write back soon. Regards, --Sven Ahlemann Am Waldrand 31 45721 Haltern am See Germany ______________________________________________________________ Verschicken Sie romantische, coole und witzige Bilder per SMS! Jetzt bei WEB.DE FreeMail: http://f.web.de/?mc=021193 From lux at diesel-research.com Sat Feb 11 10:06:52 2006 From: lux at diesel-research.com (Kim Lux) Date: Sat, 11 Feb 2006 10:06:52 -0700 Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: <1139631780.23882.10.camel@zd7280> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> <1139631780.23882.10.camel@zd7280> Message-ID: <1139677612.3431.5.camel@zd7280> More on this problem. I copied and pasted simpleRead into a console based Eclipse project and I've got the same result, except that cpu usage doesn't go to 100%. I'm beginning to think there is an issue in rxtx. My imports for simpleRead are: ============================ import gnu.io.*; import java.util.*; //import javax.comm.*; import java.io.*; =========================== Any ideas ? I am trying to read from /dev/ttyUSB0 using a serial to USB adapter which has worked well with minicom and gtkterm. Thanks. On Fri, 2006-02-10 at 21:23 -0700, Kim Lux wrote: > I've got a problem receiving chars with my version of serialRead, > written in an SWT GUI. > > I had a Java pro have a good look at my code and he can't see anything > wrong with it. > > I can send chars fine. When I receive a char the cpu usage for the app > goes to 100% and the code in the serial event handler doesn't get > executed. > > The instructions on the Java Comm Serial API How-To for Linux page state > that I must install javacomm. Is that true ? Everything builds without > it and I can send chars on rxtx just fine, but I can't receive them. > Could this be the problem ? > > I downloaded and installed javacomm. I was not able to add > "Driver=gnuio.RXTXCommDriver > to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not > have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 > installed in /usr/java/jre1.5.0_05. I added comm.jar > to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext > to the library paths. Is this OK ? > > Does it matter that I am receiving on /dev/ttyUSB0 ? > > Thanks. > -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Sun Feb 12 21:01:33 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:01:33 -0700 (MST) Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: <1139677612.3431.5.camel@zd7280> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> <1139631780.23882.10.camel@zd7280> <1139677612.3431.5.camel@zd7280> Message-ID: I suspect what is happening is the select() is breaking out in the native code but the driver does not have support for notifying there are X bytes available. On some traditional Unix based systems, the only way you know data is available is the fd status changes and do an FIORDCHK ioctl. Or perhaps the only thing you can know is the fd status changed. It would take reading through the kernel driver code to know for sure. So on USB, depending upon the driver, the same may need to be done or the driver improved a bit if possible to support. Polling reads will also work but don't use the event driven model of CommAPI which isnt acceptable in the long run. The 100% cpu usage can then be explained because select no longer blocks until the data is read; the eventLoop spins loose. You can put a well placed sleep but rxtx only expects those are needed when it knows data is available. This may not be a super simple thing to understand and fix. I do have ideas to get you started. I'm going to be short on time the next couple weeks. I expect to put some good time in and answer some other questions I saw around the 25th. For now, I'd look at the following and go from there with the hints I've given. JNIEXPORT jint JNICALL RXTXPort(nativeavailable)( JNIEnv *env, jobject jobj ) { int fd = get_java_var( env, jobj,"fd","I" ); int result; /* char message[80]; ENTER( "RXTXPort:nativeavailable" ); On SCO OpenServer FIONREAD always fails for serial devices, so try ioctl FIORDCHK instead; will only tell us whether bytes are available, not how many, but better than nothing. This turns out to be true on Solaris also. taj. */ #ifdef FIORDCHK /* __unixware__ __sun__ probably others */ result = ioctl(fd, FIORDCHK, 0); #else if( ioctl( fd, FIONREAD, &result ) < 0 ) { goto fail; } #endif /* FIORDCHK */ On Sat, 11 Feb 2006, Kim Lux wrote: > > More on this problem. I copied and pasted simpleRead into a console > based Eclipse project and I've got the same result, except that cpu > usage doesn't go to 100%. I'm beginning to think there is an issue in > rxtx. > > My imports for simpleRead are: > > ============================ > import gnu.io.*; > import java.util.*; > //import javax.comm.*; > import java.io.*; > =========================== > > Any ideas ? I am trying to read from /dev/ttyUSB0 using a serial to > USB adapter which has worked well with minicom and gtkterm. > > Thanks. > > > > On Fri, 2006-02-10 at 21:23 -0700, Kim Lux wrote: >> I've got a problem receiving chars with my version of serialRead, >> written in an SWT GUI. >> >> I had a Java pro have a good look at my code and he can't see anything >> wrong with it. >> >> I can send chars fine. When I receive a char the cpu usage for the app >> goes to 100% and the code in the serial event handler doesn't get >> executed. >> >> The instructions on the Java Comm Serial API How-To for Linux page state >> that I must install javacomm. Is that true ? Everything builds without >> it and I can send chars on rxtx just fine, but I can't receive them. >> Could this be the problem ? >> >> I downloaded and installed javacomm. I was not able to add >> "Driver=gnuio.RXTXCommDriver >> to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not >> have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 >> installed in /usr/java/jre1.5.0_05. I added comm.jar >> to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext >> to the library paths. Is this OK ? >> >> Does it matter that I am receiving on /dev/ttyUSB0 ? >> >> Thanks. >> > From tjarvi at qbang.org Sun Feb 12 21:03:30 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:03:30 -0700 (MST) Subject: [Rxtx] One serial port object for both sending and receiving ? In-Reply-To: <1139610545.18177.4.camel@zd7280> References: <1139610545.18177.4.camel@zd7280> Message-ID: On Fri, 10 Feb 2006, Kim Lux wrote: > > Is it OK to use one SerialPort ojbect (ex Serial Port serialPort;) and > use it for both sending and receiving ? > > For example: > > ======================================================================== > static SerialPort serialPort = null; > static OutputStream serialOut = null; > static InputStream serialIn = null; > > > > > // assign it to an outputStream for use > try{ > serialOut = serialPort.getOutputStream(); > System.out.println("Serial output stream has been assigned."); > }//try > catch(IOException e) > { > System.out.println("Error: Couldn't assign output stream to serial > port."); > }//catch > > > //assign it to an inputStream for use > try{ > serialIn = serialPort.getInputStream(); > System.out.println("Serial input stream has been assigned."); > }//try > catch(IOException e) > { > System.out.println("Error: Couldn't assign input stream to serial > port."); > }//catch This should be fine. In fact trying to do it another way will probably not work as you will run into lockfile issues. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun Feb 12 21:13:13 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:13:13 -0700 (MST) Subject: [Rxtx] Question about Serial I/O under Win32 In-Reply-To: <662084330@web.de> References: <662084330@web.de> Message-ID: On Sat, 11 Feb 2006 lunareclipse03 at web.de wrote: > Hello everybody, > > I have a strange problem with a piece of code I made for myself. No, > this is not really concerning rxtx, but nevertheless I post this to the > list, hoping that some of you can help me. I've written two libraries, > one for linux and one for win32. The linux port works quite well, I can > send / receive faxes and / or replay voice messages over the telephone > line using a voice modem. But the win32 port of the library causes some > trouble. If, for example, I send out a fax with a certain modem under > linux, it works well. The fax is complete when it comes out of the fax > machine. If I then use the same modem to send out a fax under win32, the > fax coming out of the fax machine gets "stuck" halfways, but the sending > modem thinks that transmission was ok and drops the connection. The > answering fax machine then gives me "error while receiving." The "upper > layer" java code MUST be right, because if I do the same thing under > linux (using the linux library), everything is alright. Now I have to > ask: Can somebody please help me out with this??!? Could it be the case > that some kind of flow control or COMMTIMEOUTS setting causes this > behaviour? I set flow control to RTS/CTS before sending out a fax. How > can I DISABLE flow control? Or what do you think? Can something else > cause this problems? Thank you all for your time and PLEASE write back > soon. > Hi Sven I'm not too willing to talk about flow control at the low level until I confirm some things with test equipment later. It is not clear if you are using rxtx or writing your own native code. So I'm not sure how to answer much of this :) If you are wondering how to change the flow control using rxtx from java, The BlackBox example from Sun flips this back and forth. SerialPort.java in rxtx 2.1 uses the following: SerialPort.java: public static final int FLOWCONTROL_NONE =0; SerialPort.java: public static final int FLOWCONTROL_RTSCTS_IN =1; SerialPort.java: public static final int FLOWCONTROL_RTSCTS_OUT =2; SerialPort.java: public static final int FLOWCONTROL_XONXOFF_IN =4; SerialPort.java: public static final int FLOWCONTROL_XONXOFF_OUT=8; So if you set flowcontrol to RTSCTS, you can set it to NONE to turn it off. If you are looking for how to do it in native code, the rxtx Source is SerialImp.c (unix/linux/mac os x/w32) and termios.c (w32 only with SerialImp.c) You can track the code: SerialImp.c:JNIEXPORT void JNICALL RXTXPort(setflowcontrol)( JNIEnv *env, jobject jobj, jint flowmode ) termios.c:int tcgetattr( int fd, struct termios *s_termios ) termios.c:int tcsetattr( int fd, int when, struct termios *s_termios ) There may be a problem in the rxtx flow control code though. Rather than guess, I want to test this with a gold standard. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Feb 6 00:00:16 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 00:00:16 -0700 (MST) Subject: [Rxtx] wiki delay until tomorrow night. In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: On Sun, 5 Feb 2006, Trent Jarvi wrote: > On Sun, 5 Feb 2006, Kim Lux wrote: > >> usb ? Tell me more... I need that too. > > usb is a very proper design. Thats all it is. > Maybe rxtx could help usb. But it would start with helping bring back the community that was already there. It's not something I'd love to do but maybe its the right thing to do. It would probably take 2 years to do right. But maybe thats better than what we have now. I honestly don't know what IBM is doing which could just run over everything. Just some thoughts after some fine german wine. -- Trent Jarvi tjarvi at qbang.org From gadelavega at yahoo.com.ar Mon Feb 6 02:17:05 2006 From: gadelavega at yahoo.com.ar (Gonzalo A. de la Vega) Date: Mon, 06 Feb 2006 10:17:05 +0100 Subject: [Rxtx] Serial port ownership question In-Reply-To: References: <20060205113618.30274.qmail@web53501.mail.yahoo.com> <1139157422.4553.9.camel@zd7280> <1139158698.4936.9.camel@zd7280> Message-ID: <43E71411.4050402@yahoo.com.ar> On my Fedora Core 4: ls -l /dev/ttyS* crw-rw---- 1 root uucp 4, 64 Feb 6 2006 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Feb 6 2006 /dev/ttyS1 ... and: grep "ttyUSB" /etc/udev/rules.d/50-udev.rules KERNEL=="ttyUSB*", GROUP="uucp", MODE="0660" So anyone in the "uucp" group can use serial ports. On Gentoo the group is "tty". Trent Jarvi escribi?: > > > On Sun, 5 Feb 2006, Dr. Douglas Lyon wrote: > >> I can confirm that this is the case (only root ownership of >> serial ports, under fedora 4). >> Wow, what were they thinking?! >> - DL >> >>> I've found that the newer kernels have the serial ports owned by root. >>> For example, >>> >>> $ls -al /dev/tty* >>> crw-rw-rw- 1 root root 5, 0 Feb 5 02:06 /dev/tty >>> crw-rw---- 1 root root 4, 0 Feb 5 02:06 /dev/tty0 >>> crw------- 1 root root 4, 1 Feb 5 09:07 /dev/tty1 >>> crw-rw---- 1 root tty 4, 10 Feb 5 02:06 /dev/tty10 >>> crw-rw---- 1 root tty 4, 11 Feb 5 02:06 /dev/tty11 >>> ... > > > This is just not a problem jcp or such are going to solve. Its a > platform spitwad fight. But do look at pam. In fact thats what Sun > is doing too. Maybe Linux followed their lead.. I'm not a pam guy. > I've spent 16 hours trying to understand it but your users wont :) > > Solution? I have no clue. Its two tangent mentalities from my > perspective. > > -- > Trent Jarvi > tjarvi at qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mtnvega at yahoo.com.br Mon Feb 6 05:35:43 2006 From: mtnvega at yahoo.com.br (Luiz Jr) Date: Mon, 6 Feb 2006 12:35:43 +0000 (GMT) Subject: [Rxtx] Documentation Wiki In-Reply-To: <1139157422.4553.9.camel@zd7280> Message-ID: <20060206123543.57256.qmail@web53515.mail.yahoo.com> Hello, Thank you for you answer, but so the usage of the API is pretty much like the Java Communications Api? If yes, what version of the Java Comm Api? Thank you, Luiz A. Brandao Jr Kim Lux escreveu: On Sun, 2006-02-05 at 08:36 -0300, Luiz Jr wrote: > Hello, > > I want to start using the RXTX libraries, but I would to know how, > since I can not access the documentation wiki page I just started using them yesterday. Below is how I installed the libraries, if that helps. I used snippets of code from the SimpleWrite application here to get me going. http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html Instead of "import javax.comm.*;", use "import gnu.io.*;" which is gotten from RXTXcomm.jar, which you will need to include in your project references. I am working in Eclipse. BTW: there is no way to open a port without going through the port list and finding it. Maybe sometime in the future someone (me ?) will write a method called openSerialPort that allows the user to give a port identifier, such as "/dev/tty1" and return a port ready to use. It wouldn't take much to write that and it would save users a lot of code. Hope this helps. ======================================================================= 1) Figure out which java you are running, incase there is more than one installed. $ java -version java version "1.5.0_05" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_05-b05) Java HotSpot(TM) Client VM (build 1.5.0_05-b05, mixed mode, sharing) 2) Find all the jre directories and the one from which you are currently running. kfind (jre) 3) cd to that directory plus /lib/i386 cd /usr/java/jre1.5.0_05/lib/i386 4) Copy the library files (*.so) to that directory. cp /home/krlux/Desktop/'Java Controls'/rxtx-linux/bin/* . 5) Check that the copy was successful ls librxtx* librxtxI2C.so librxtxRaw.so librxtxSerial.so librxtxParallel.so librxtxRS485.so 6) cd to the /lib/ext directory for your java. cd /usr/java/jre1.5.0_05/lib/ext 7) Copy the Jar files there cp /home/krlux/Desktop/'Java Controls'/rxtx-linux/lib/ext/* . 8) Check that it was successful ls RXTX* RXTXcomm.jar Rxtx is now installed on your machine ready to use. =================================================================== -- Kim Lux, Diesel Research Inc. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx --------------------------------- Yahoo! Acesso Gr?tis - Internet r?pida e gr?tis. Instale o discador agora! -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/544aa403/attachment-0061.html From lyon at docjava.com Mon Feb 6 05:49:34 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 06 Feb 2006 07:49:34 -0500 Subject: [Rxtx] wiki delay until tomorrow night. In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: Hi All, I have often thought about USB drivers being needed. For example, the ironman watch will not interface to a mac (windows only). It is USB. My dymo label writer has no Java driver (native only). Etc. Most cheap web cameras are USB (and Java drivers go through JAI, if it supports the camera at all). The JAI code shows how sun did the USB drivers. You have to be a member of the jai project to download the source code. https://jai.dev.java.net has the jai distro. And then you are not allowed to redistribute it. However, we can all learn from it (if so inclined). Basically: cvs -d :pserver:lyon at cvs.dev.java.net:/cvs login cvs -d :pserver:lyon at cvs.dev.java.net:/cvs checkout jai-core You will need to user your own uid and pw to get in. The ant build has over 100 warnings from sun deprecations of its own code. You might say that they were hoisted on their own Picard ;) One interesting thing is that they support several platforms: linux-amd64 64-bit Linux-AMD64 linux-i586 32-bit Linux-x86 solaris-amd64 64-bit Solaris-AMD64 solaris-i586 32-bit Solaris-x86 solaris-sparc 32-bit Solaris-SPARC solaris-sparcv9 64-bit Solaris-SPARC windows-i586 32-bit Windows-x86 Thus, ant is used to provide a multi-platform native method distro. Neat. How do they do it? check this out: And: The core download does not contain any C source code (it was all pre-built). Basically, they are just copying .so and .dll files into build directories. I would love to see the C code for this...but Sun does not post it on the https://jai.dev.java.net site. I don't know why...Perhaps I missed it. - Doug >On Sun, 5 Feb 2006, Trent Jarvi wrote: > >>On Sun, 5 Feb 2006, Kim Lux wrote: >> >>>usb ? Tell me more... I need that too. >> >>usb is a very proper design. Thats all it is. >> > >Maybe rxtx could help usb. But it would start with helping bring >back the community that was already there. > >It's not something I'd love to do but maybe its the right thing to do. > >It would probably take 2 years to do right. But maybe thats better >than what we have now. > >I honestly don't know what IBM is doing which could just run over everything. > >Just some thoughts after some fine german wine. > >-- >Trent Jarvi >tjarvi at qbang.org > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tdelenik at gmail.com Mon Feb 6 05:56:32 2006 From: tdelenik at gmail.com (Thanasis Delenikas) Date: Mon, 6 Feb 2006 14:56:32 +0200 Subject: Fwd: [Rxtx] Documentation Wiki In-Reply-To: <1139157422.4553.9.camel@zd7280> References: <20060205113618.30274.qmail@web53501.mail.yahoo.com> <1139157422.4553.9.camel@zd7280> Message-ID: <310a1a930602060456t129f1dc6p5f2b908f13ab5a0b@mail.gmail.com> Hello all, Kim, this is a snippet from the code I use. The closest to directly opening a specific port without enumeration. << ... portId = CommPortIdentifier.getPortIdentifier(getPort()); serialPort = (SerialPort) portId.open("jSMSEngine", 1971); ... >> where getPort() return the string identifier of the port, i.e. "/dev/ttyS0" or "COM1" or whatever. Thanasis. ---------- Forwarded message ---------- From: Kim Lux Date: Feb 5, 2006 6:37 PM Subject: Re: [Rxtx] Documentation Wiki To: RXTX Developers and Users BTW: there is no way to open a port without going through the port list and finding it. Maybe sometime in the future someone (me ?) will write a method called openSerialPort that allows the user to give a port identifier, such as "/dev/tty1" and return a port ready to use. It wouldn't take much to write that and it would save users a lot of code. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/182ab5b8/attachment-0061.html From tjarvi at qbang.org Mon Feb 6 11:53:57 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 11:53:57 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: On Mon, 6 Feb 2006, Dr. Douglas Lyon wrote: > Hi All, > I have often thought about USB drivers being needed. > For example, the ironman watch will not interface > to a mac (windows only). It is USB. > My dymo label writer has no Java driver (native only). > Etc. > Most cheap web cameras are USB (and Java drivers go > through JAI, if it supports the camera at all). > The JAI code shows how sun did the USB drivers. > You have to be a member of the jai project to download > the source code. > https://jai.dev.java.net has the jai distro. > And then you are not allowed to redistribute it. However, > we can all learn from it (if so inclined). Basically: > cvs -d :pserver:lyon at cvs.dev.java.net:/cvs login > cvs -d :pserver:lyon at cvs.dev.java.net:/cvs checkout jai-core > You will need to user your own uid and pw to get in. > The ant build has over 100 warnings from sun deprecations > of its own code. > > You might say that they were hoisted on their own Picard ;) > > One interesting thing is that they support several platforms: > linux-amd64 64-bit Linux-AMD64 > linux-i586 32-bit Linux-x86 > solaris-amd64 64-bit Solaris-AMD64 > solaris-i586 32-bit Solaris-x86 > solaris-sparc 32-bit Solaris-SPARC > solaris-sparcv9 64-bit Solaris-SPARC > windows-i586 32-bit Windows-x86 > Thus, ant is used to provide a multi-platform native method distro. > Neat. > How do they do it? > check this out: > > > > > > > > > > > > > And: > > > > > > > > > > The core download does not contain any C source code (it was all pre-built). > Basically, they are just copying .so and .dll files into build directories. > > I would love to see the C code for this...but Sun does not post it on the > https://jai.dev.java.net site. > > I don't know why...Perhaps I missed it. > > - Doug > > I've looked at moving rxtx to Ant builds. I think that would help IDEs a great deal. I requested a evalutation desk copy the O'Reilly Ant book for some j2ee material I was teaching. http://www.oreilly.com/catalog/anttdg/ It has a one sentence mention of JNI. So there was not luck there. I saw that there is another Ant book that does mention JNI more. I can't find it now. Ant must be able to support it with extensions. http://ant.apache.org/manual/OptionalTasks/javah.html What the auto(break :) tools do in the rxtx build is 4 things really. 1) gcc compile flags 2) ld compile flags 3) config.h 4) compile flags for customizing rxtx (lockfiles, ...) See 1 All of this information except 4 can be static once obtained. So I'm not attached to the auto tools. If I could find an example of Ant being used for JNI code, I'd be one of the first to start moving that direction. Maybe someone saw an example someplace. The other thing we have not completed discussing is the directory structure. There is interest in making rxtx more IDE friendly. I get more mail about that off the list than how to install rxtx. And I see we have Ken Thompson in da house :) He is our trusted CVS maintainer and the guy that purchased the rxtx.org domain. Old community. We will need Ken for changing the directory structure of source. I would like to open up discussion about both of these as it is more than time. The problem is I have little experience with Ant and even less with IDEs. It would be nice if we could work with Eclipse and NetBeans. http://www.netbeans.org/ (sun and some community) http://www.eclipes.org (ibm,rhat,... perhaps more community) http://maven.apache.org/what-is-maven.html (apache. It is community) borland should sortof be here too but I think thats covered in eclipse. >From what I understand so far, we should morph rxtx to support those three maybe trusting apaches lead with maven. But I use vi. I have little to no clues beyond what people have fed me. Can we agree that thats the right direction to go? -- Trent Jarvi tjarvi at qbang.org From brian at mbari.org Mon Feb 6 14:57:50 2006 From: brian at mbari.org (Brian Schlining) Date: Mon, 6 Feb 2006 13:57:50 -0800 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> > The other thing we have not completed discussing is the directory > structure. There is interest in making rxtx more IDE friendly. I > get more mail about that off the list than how to install rxtx. > > And I see we have Ken Thompson in da house :) He is our trusted > CVS maintainer and the guy that purchased the rxtx.org domain. Old > community. We will need Ken for changing the directory structure of > source. > > I would like to open up discussion about both of these as it is > more than time. The problem is I have little experience with Ant > and even less with IDEs. It would be nice if we could work with > Eclipse and NetBeans. > > http://www.netbeans.org/ (sun and some community) > http://www.eclipes.org (ibm,rhat,... perhaps more community) > http://maven.apache.org/what-is-maven.html (apache. It is community) > borland should sortof be here too but I think thats covered in > eclipse. > >> From what I understand so far, we should morph rxtx to support >> those three > maybe trusting apaches lead with maven. But I use vi. I have > little to no clues beyond what people have fed me. > Maven likes the directory structure below for Java code. (From http:// maven.apache.org/guides/getting-started/index.html) This structure works fine with ant, netbeans, and eclipse. rxtx_root_directory `-- src |-- main | `-- java | `-- gnu | `-- io `-- test `-- java `-- gnu `-- io Brian Schlining Software Engineer http://www.mbari.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/d9451eba/attachment-0061.html From tjarvi at qbang.org Mon Feb 6 15:11:45 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 15:11:45 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: > rxtx_root_directory > `-- src > |-- main > | `-- java > | `-- gnu > | `-- io > `-- test > `-- java > `-- gnu > `-- io > >From what I understand this will just be good. For me it makes no difference. So lets do the rxtx thing. Let if fester for two weeks and if nobody objects, we will do it. I'm not doing this because I care. I'm doing this to eliminate much of my inbox. But test... man is rxtx lacking there in the community aspect. It is covered but not right. _maybe_ I can change that this year. -- Trent Jarvi tjarvi at qbang.org (cat hurding since 1997) From lux at diesel-research.com Mon Feb 6 21:38:49 2006 From: lux at diesel-research.com (Kim Lux) Date: Mon, 06 Feb 2006 21:38:49 -0700 Subject: [Rxtx] How can I use Lock Files with rxtx (in FC4) ? Message-ID: <1139287129.17031.3.camel@zd7280> I am now running an rxtx application on FC4. I am getting: ========================================================= check_group_uucp(): error testing lock file creation Error details: Permission denied check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL ========================================================= $ ls -al /var/lock total 32 drwxrwxr-x 4 root lock 4096 Feb 6 16:04 . drwxr-xr-x 24 root root 4096 Nov 14 01:19 .. drwx------ 2 root root 4096 Apr 27 2005 lvm drwxr-xr-x 2 root root 4096 Feb 6 16:04 subsys How do I fix this for regulator users ? -- Kim Lux, Diesel Research Inc. From dmarkman at mac.com Mon Feb 6 22:24:44 2006 From: dmarkman at mac.com (Dmitry Markman) Date: Tue, 7 Feb 2006 00:24:44 -0500 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: if I understands the issue right in order to be able to use ant for c/c++ compilation you have to install ant's cc task http://ant-contrib.sourceforge.net/cc.html it looks like it should work on mac os x (authors claim, that it's platform independent) but I never tested so all you have to do it's providing right command line for the gcc compiler On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: >> rxtx_root_directory >> `-- src >> |-- main >> | `-- java >> | `-- gnu >> | `-- io >> `-- test >> `-- java >> `-- gnu >> `-- io >> > > >> From what I understand this will just be good. > > For me it makes no difference. So lets do the rxtx thing. Let if > fester for two weeks and if nobody objects, we will do it. > > I'm not doing this because I care. I'm doing this to eliminate > much of my inbox. > > But test... man is rxtx lacking there in the community aspect. It > is covered but not right. _maybe_ I can change that this year. > > -- > Trent Jarvi > tjarvi at qbang.org > (cat hurding since 1997) > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx Dmitry Markman From lux at diesel-research.com Mon Feb 6 23:20:15 2006 From: lux at diesel-research.com (Kim Lux) Date: Mon, 06 Feb 2006 23:20:15 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? Message-ID: <1139293215.3689.4.camel@zd7280> I'm running the code below. portlist.hasMoreElements() is false. /dev has ports in it as listed below. What am I doing wrong ? ========================================================== // Step through the list of ports until we find one that matches // the one we are looking for. portList = CommPortIdentifier.getPortIdentifiers(); while(portList.hasMoreElements()) { portID = (CommPortIdentifier) portList.nextElement(); // if (portID.getName().equals("/dev/ttyUSB0")) { myTA.append("Serial port ttyUSB0 has been found\n"); break; }// if portID equals... }// End of while... ========================================================== ls -al /dev/tty* crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 ... crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 -- Kim Lux, Diesel Research Inc. From david.garnier at trusted-logic.com Tue Feb 7 00:46:30 2006 From: david.garnier at trusted-logic.com (David Garnier) Date: Tue, 07 Feb 2006 08:46:30 +0100 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: <43E85056.2090608@trusted-logic.com> Hello, I think that the make-based build process is fine as it is, apart from the location of the Java source files. It is true that putting the Java source in a directory structure that map 1-to-1 to the Java package structure is the norm and should make it easier for everyone to modify the Java source, with or without an IDE. Ant is a good tool, but in the RXTX case I fail to see the advantage of using it compared to the current make-based process. As Trent said, they are more pressing issues, like testing. Regards, David Dmitry Markman wrote: > if I understands the issue right > in order to be able to use ant for c/c++ compilation > you have to install ant's cc task > http://ant-contrib.sourceforge.net/cc.html > > it looks like it should work on mac os x > (authors claim, that it's platform independent) > but I never tested > > so all you have to do it's providing right command line > for the gcc compiler > > > > > On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: > >>> rxtx_root_directory >>> `-- src >>> |-- main >>> | `-- java >>> | `-- gnu >>> | `-- io >>> `-- test >>> `-- java >>> `-- gnu >>> `-- io >>> >> >> >>> From what I understand this will just be good. >> >> For me it makes no difference. So lets do the rxtx thing. Let if >> fester for two weeks and if nobody objects, we will do it. >> >> I'm not doing this because I care. I'm doing this to eliminate much >> of my inbox. >> >> But test... man is rxtx lacking there in the community aspect. It is >> covered but not right. _maybe_ I can change that this year. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> (cat hurding since 1997) From tjarvi at qbang.org Tue Feb 7 01:11:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 01:11:31 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <43E85056.2090608@trusted-logic.com> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: On Tue, 7 Feb 2006, David Garnier wrote: > Hello, > > I think that the make-based build process is fine as it is, apart from the location of the Java > source files. It is true that putting the Java source in a directory structure that map 1-to-1 to > the Java package structure is the norm and should make it easier for everyone to modify the Java > source, with or without an IDE. > > Ant is a good tool, but in the RXTX case I fail to see the advantage of using it compared to the > current make-based process. As Trent said, they are more pressing issues, like testing. > Hi David I have more experience with testing rxtx than I can talk about. But let it be known, rxtx has gone trough 100's of hours of testing. We are hobby folks interested in toys but there is more. rxtx has had some of the best guidance in the industry there. This is not an easy thing. I may be able to come back in a month from the other side of the corperate fence and help. I suspect the tests could just be made public but they are in a very unusual environment that just wont work in a wider sense. This is something I'll be trying to change. At one point it was agreed we could just make the results public so this isnt just noise.. There is interest and I think its safe to mention that much. The big problem with testing in the past is most of it is done with a loopback connection. So we *still* have major questions regarding things like flow control. rxtx talks to itself over a loopback and it works. regardless of right or wrong. This requires more thought to be done right. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Feb 7 02:46:34 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 02:46:34 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: > The big problem with testing in the past is most of it is done with a > loopback connection. So we *still* have major questions regarding things > like flow control. rxtx talks to itself over a loopback and it works. > regardless of right or wrong. With serial communication there are gold standards. ckermit is probably a definitive 'standard.' Maybe its possible to do ping/pong tests with ckermit? Is it scriptable? There are known issues in rxtx. Probably the worst is some threading issues regarding some JREs with multiple JNI threads setting java variables. Man did I get schooled there. Just switch the c functions to returning variables and things go away. Sometimes they work fine, sometimes they blow up. Without understanding everything, somehow rhat got it right and debian (and especially gentoo) grabbed kernel patches causing all sort of harm. Its not hard to fix once you understand whats going on but nearly impossible to track with a debugger. So I have a good idea what 2.1-8 will have outside of the IDE modifications. rxtx 2.1-7 is a release for everyone to sync with. Its not even as stable as -pre17 as far as I know - I ran no test suites. I'll be chasing it too. We just had so many contributions that it was time. It seriously broke internal scheduals but thats a great thing :) The other thing I want to do in 2.1-8 is automagic baud rates. It turns out lots of shops are doing really funky baud rates for things like automobile test equipment. It is possible but it requires a fair amount of change in the native code. Is anyone looking at this? -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Feb 7 02:57:21 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 07 Feb 2006 04:57:21 -0500 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <43E85056.2090608@trusted-logic.com> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: Hi All, I agree, testing is very important. The problem I have been trying to address is related to cross-platform testing and the robust nature of the installs. Typically, I visit 3 platforms to deploy my product, windows, linux and mac. A build is performed on each platform. The idea that you can build for many platforms from one copy the source code seems attractive. This should enable synchronized deployments of identical code. The question of how to achieve this goal remains open. As Trent mentioned, this is hard. Perhaps Ant will help here (but perhaps not). Ant does seem to help with running unit tests. However, it does not help with multi-platform tests. For that you need many machines and different operating environments. Toward that end, I have created a multi-platform test that can be run from web start, located at: http://show.docjava.com:8086/book/cgij/code/jnlp/serialPort.PortTest.jnlp This is interesting because many people in the community can run the test and we can improve the test, as time permits. No, it is not a perfect solution, however, the idea does help with multi-platform tests using many machines and different operating environments. If the group has a good test for a general serial port set-ups, i would be happy to deploy it, for general evaluation using web start. And as for ANT, it is just an idea. Not all my ideas are good ones! - Doug >Hello, > >I think that the make-based build process is fine as it is, apart >from the location of the Java >source files. It is true that putting the Java source in a directory >structure that map 1-to-1 to >the Java package structure is the norm and should make it easier for >everyone to modify the Java >source, with or without an IDE. > >Ant is a good tool, but in the RXTX case I fail to see the advantage >of using it compared to the >current make-based process. As Trent said, they are more pressing >issues, like testing. > >Regards, >David > >Dmitry Markman wrote: >> if I understands the issue right >> in order to be able to use ant for c/c++ compilation >> you have to install ant's cc task >> http://ant-contrib.sourceforge.net/cc.html >> >> it looks like it should work on mac os x >> (authors claim, that it's platform independent) >> but I never tested >> >> so all you have to do it's providing right command line >> for the gcc compiler >> >> >> >> >> On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: >> >>>> rxtx_root_directory >>>> `-- src >>>> |-- main >>>> | `-- java >>>> | `-- gnu >>>> | `-- io >>>> `-- test >>>> `-- java >>>> `-- gnu >>>> `-- io >>>> >>> >>> >>>> From what I understand this will just be good. >>> >>> For me it makes no difference. So lets do the rxtx thing. Let if >>> fester for two weeks and if nobody objects, we will do it. >>> >>> I'm not doing this because I care. I'm doing this to eliminate much >>> of my inbox. >>> >>> But test... man is rxtx lacking there in the community aspect. It is >>> covered but not right. _maybe_ I can change that this year. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> (cat hurding since 1997) > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From matt.higgins at gmail.com Tue Feb 7 08:28:34 2006 From: matt.higgins at gmail.com (Matt Higgins) Date: Tue, 7 Feb 2006 10:28:34 -0500 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final Message-ID: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? import java.io.*; import java.util.*; import gnu.io.*; public class MySimpleRead implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; public static void main(String[] args) { boolean portFound = false; String defaultPort = "COM1"; if (args.length > 0) { defaultPort = args[0]; } portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; MySimpleRead reader = new MySimpleRead(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } } public MySimpleRead() { try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) { e.printStackTrace(); } try { inputStream = serialPort.getInputStream(); } catch (IOException e) { e.printStackTrace(); } try { serialPort.addEventListener(this); } catch (TooManyListenersException e) { e.printStackTrace(); } try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { e.printStackTrace(); } System.out.println("Baud is " + serialPort.getBaudRate()); System.out.println("Bits is " + serialPort.getDataBits()); System.out.println("Stop is " + serialPort.getStopBits()); System.out.println("Par is " + serialPort.getParity()); serialPort.notifyOnDataAvailable(true); readThread = new Thread(this); readThread.start(); } public void run() { // Thread.sleep(20000); //} catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { System.out.println("An event occurred " + event.getEventType()); switch (event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: byte[] readBuffer = new byte[20]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } System.out.print(new String(readBuffer)); } catch (IOException e) {} break; } } } --------------- Result on windows ------------------------------ Stable Library ============================================================== Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port:: COM1 Baud is 9600 Bits is 8 Stop is 1 Par is 0 ----------------- End Results ----------------------------------------- ------------------ Result on Linux ----------------------------------- Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 Found port: /dev/ttyS0 Baud is 9600 Bits is 8 Stop is 1 Par is 0 An event occurred 1 043100066224 ------------------ End Results --------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/a1431630/attachment-0061.html From brian at mbari.org Tue Feb 7 09:48:37 2006 From: brian at mbari.org (Brian Schlining) Date: Tue, 7 Feb 2006 08:48:37 -0800 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> Message-ID: <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> Hi Matt > The following code works fine on Linux but I never see any data > when run on Windows. This is a cut and paste from the SimpleRead > example. > I am attempting to read data from a bar code scanner. I can fire > up HyperTermianl on windows and see that the device is working > properly as I see the barcodes are scanned and echoed back to the > terminal. However when I run the app I don't see any data. It is > however associating with the com port as the informational bits > print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. Cheers Brian Schlining Software Engineer http://www.mbari.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/16d07f37/attachment-0061.html From lux at diesel-research.com Tue Feb 7 11:59:58 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 11:59:58 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139293215.3689.4.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> Message-ID: <1139338798.8145.4.camel@zd7280> Any ideas on this ? Any reason why portList.hasMoreElements() should be false even though there are devices in /dev ? On Mon, 2006-02-06 at 23:20 -0700, Kim Lux wrote: > I'm running the code below. > > portlist.hasMoreElements() is false. > > /dev has ports in it as listed below. > > What am I doing wrong ? > > > ========================================================== > // Step through the list of ports until we find one that matches > // the one we are looking for. > > portList = CommPortIdentifier.getPortIdentifiers(); > > while(portList.hasMoreElements()) > { > portID = (CommPortIdentifier) portList.nextElement(); // > if (portID.getName().equals("/dev/ttyUSB0")) > { > myTA.append("Serial port ttyUSB0 has been found\n"); > break; > }// if portID equals... > }// End of while... > ========================================================== > > ls -al /dev/tty* > crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty > crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 > crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 > crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 > crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 > ... > crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 > crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 > crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 > > > -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 12:20:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 12:20:25 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139338798.8145.4.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> Message-ID: On Tue, 7 Feb 2006, Kim Lux wrote: > > Any ideas on this ? Any reason why portList.hasMoreElements() should be > false even though there are devices in /dev ? > > > On Mon, 2006-02-06 at 23:20 -0700, Kim Lux wrote: >> I'm running the code below. >> >> portlist.hasMoreElements() is false. >> >> /dev has ports in it as listed below. >> >> What am I doing wrong ? >> >> >> ========================================================== >> // Step through the list of ports until we find one that matches >> // the one we are looking for. >> >> portList = CommPortIdentifier.getPortIdentifiers(); >> >> while(portList.hasMoreElements()) >> { >> portID = (CommPortIdentifier) portList.nextElement(); // >> if (portID.getName().equals("/dev/ttyUSB0")) >> { >> myTA.append("Serial port ttyUSB0 has been found\n"); >> break; >> }// if portID equals... >> }// End of while... >> ========================================================== >> >> ls -al /dev/tty* >> crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty >> crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 >> crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 >> crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 >> crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 >> ... >> crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 >> crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 >> crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 >> >> >> > Hi Kim What rxtx does is try to open the port and do a timed out read. If the kernel/... do not complain it's enumarted. I suspect you could do a crude test by doing something like cat /dev/ttyS0 > /dev/null If that barfs then rxtx wont enumerate the port. hmm looking at your question again, I suspect it's a lockfile problem. This is documented in INSTALL with the source. Its easy enough to test this too.. touch /var/lock/testingrxtxlockfiles && rm -f /var/lock/testingrxtxlockfiles If you are not in the right group it will bail. Root will work regardless. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 12:37:56 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 12:37:56 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> Message-ID: <1139341076.8145.11.camel@zd7280> Exactly which ports does rxtx attempt to put into the list ? /dev/* or /dev/tty* or /dev/tty[0-9[0-9] ? or /dev/ttyS* ? For the record, only /dev/ttyUSB0 is a valid port on the machine I am presently on. Will this be a problem ? On Tue, 2006-02-07 at 12:20 -0700, Trent Jarvi wrote: > This is documented in INSTALL with the source. > I was wondering where that file was. I will download source and dig it up. Thanks. -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 12:51:09 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 12:51:09 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139341076.8145.11.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: On Tue, 7 Feb 2006, Kim Lux wrote: > > Exactly which ports does rxtx attempt to put into the list ? /dev/* > or /dev/tty* or /dev/tty[0-9[0-9] ? or /dev/ttyS* ? > > For the record, only /dev/ttyUSB0 is a valid port on the machine I am > presently on. Will this be a problem ? > > > On Tue, 2006-02-07 at 12:20 -0700, Trent Jarvi wrote: >> This is documented in INSTALL with the source. >> > I was wondering where that file was. I will download source and dig it > up. > > Thanks. > Hmm I'm looking at pre17 so this may have changed. (its just what I have on this machine) if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA" // for the IPAQs }; CandidatePortPrefixes=Temp; } So you may need to add "ttyUSB" to that list. RXTX used to enumerate _everything_ see if(osName.equals("Linux-all-ports") But it became less than practical. This is all in RXTXCommDriver.java hmm I just did a cvs update. if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have to get your fingers into the code. We aim for sane defaults. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 13:06:45 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 13:06:45 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139342805.8145.22.camel@zd7280> On Tue, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > Hmm I'm looking at pre17 so this may have changed. (its just what I have > on this machine) > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA" // for the IPAQs > }; > CandidatePortPrefixes=Temp; > } > > > So you may need to add "ttyUSB" to that list. RXTX used to enumerate > _everything_ see if(osName.equals("Linux-all-ports") But it became less > than practical. > > This is all in RXTXCommDriver.java > > hmm I just did a cvs update. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have > to get your fingers into the code. We aim for sane defaults. Excellent. Thanks for taking the time. -- Kim Lux, Diesel Research Inc. From ideiglenes1 at freemail.hu Tue Feb 7 13:53:39 2006 From: ideiglenes1 at freemail.hu (--) Date: Tue, 07 Feb 2006 21:53:39 +0100 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139345619.22534.2.camel@localhost> Hi! I use this code to get all the extra Linux devices. :) if ("Linux".equals(System.getProperty("os.name"))) { System.setProperty("os.name","Linux-all-ports"); } driver = new RXTXCommDriver(); On k, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > On Tue, 7 Feb 2006, Kim Lux wrote: > > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have > to get your fingers into the code. We aim for sane defaults. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From matt.higgins at gmail.com Tue Feb 7 13:45:54 2006 From: matt.higgins at gmail.com (Matt Higgins) Date: Tue, 7 Feb 2006 15:45:54 -0500 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> Message-ID: <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> Sweet this is exactly what I needed. I was searching the archives through marc.theamisgroup they only have archives back to 1/3/05. Should have hit the mailman archive! Thanks a lot! On 2/7/06, Brian Schlining wrote: > > Hi Matt > > The following code works fine on Linux but I never see any data when run > on Windows. This is a cut and paste from the SimpleRead example. > I am attempting to read data from a bar code scanner. I can fire up > HyperTermianl on windows and see that the device is working properly as I > see the barcodes are scanned and echoed back to the terminal. However when I > run the app I don't see any data. It is however associating with the com > port as the informational bits print fine? > > > You're not the only one whose had this problem, I don't know if Trent has > addressed this is the latest release of RXTX but there is a workaround. > Here's the recent thread from the RXTX mailing list regarding this issues: > > Thanasis Delenikas tdelenik at gmail.com > Wed Jan 18 13:56:23 MST 2006 > > * Previous message: [Rxtx] Re: More close() performance fixes > * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] > > Hi all. > (I've subscribed again from my other email account). > > Trent, > > You are right. Linux *always* works, no matter what flow control you set. > Windows *works only* with hardware flow control (I haven't tested what > happens with software XON/XOFF flow control). > > I assume (but I am not certain) that even with no flow control at all, all > platforms should work. Without flow control, you have the risk of bumping > into overflow or framing errors, but that's your (the end programmer, I > mean) problem. > > >From my side, I shouldn't be working without flow control. That was a bug > too... It was some code forgotten from the old times, when I used to work > with phone emulation drivers which didn't support flow control. The > correct > way is to have some flow control enabled and that's why I suppose this is > a > low-severity bug for RxTx. > > I have no idea which platform shows the correct behaviour, since > my knowledge about Linux and the inner workings of these low-level i/o > operations is limited. > > Regards, > Thanasis Delenikas. > > > > > Message: 2 > > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > > From: Trent Jarvi > > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > > To: RXTX Developers and Users > > Message-ID: > > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > > > Hi all, > > > > > > Trent, I have found something. > > > I read your comment about flow control, so I experimented a bit. > > > > > > If you remember, in my sample program I've used no flow control at all > ( > > i.e. > > > Java constant FLOWCONTROL_NONE). > > > > > > Now, during testing, I've switch to hardware inbound flow control (i.e > . > > Java > > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > > beautifully! > > > > > > I think I will switch to H/W flow control and test things for a while, > > but > > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > > > > > Hi Thanasis, > > > > I'm fairly sure you have identified a bug. I would not worry too much > > about what Sun CommAPI w32 defaults are. I think they did more or less > > whatever the port opened with. Just a guess. Linux tries to stomp on > > ports so they are all the same. > > > > So this started out with Linux worked, Windows XP/.. did not as I > recall. > > Something is wrong in rxtx. Do I understand this right? > > > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > > > Perhaps there is something Wayne or I did not understand when we wrote > > that code. I wasnt programming back in the BBS days so modems are not > my > > thing. I have a few questions. > > > > Is the above matrix confirmed by observation? > > Linux just always worked? > > Which one _should_ work? I'm guessing modems work with hardware flow > > control. I'll have to dig around. > > > > The windows flow control changes a couple things with hardware flow > > control. Following the w32 API documentation is confusing sometimes. > > But it looks like Linux could have a bug too. > > Cheers > > Brian Schlining > Software Engineer > http://www.mbari.org > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/9c989144/attachment-0061.html From tjarvi at qbang.org Tue Feb 7 14:06:14 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 14:06:14 -0700 (MST) Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> Message-ID: >> >> You're not the only one whose had this problem, I don't know if Trent has >> addressed this is the latest release of RXTX but there is a workaround. >> Here's the recent thread from the RXTX mailing list regarding this issues: >> I have not. I expect to have access to some test equipment next month and I'll go through all of this. I really don't know whats going on and I need a gold standard. I thought maybe linux was autodetecting the flow control. Your observations would certainly be welcome. I need to talk to Russell King and see what he is doing. Until then I'd just be toying around over a loopback as usual. This is very high on the list though. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 17:25:05 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 17:25:05 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139358305.17994.2.camel@zd7280> My application now works. I installed the libraries and jar from 2.1-7 (Final). portlist.hasMoreElements is no longer false. The application finds the port for /dev/ttyUSB0. Thanks for your help, Trent (et al) Sorry I bothered you with this. Next time I will look in the source first. I didn't think it was an rxtx issue, I thought it was a Linux setup issue . On Tue, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > Hmm I'm looking at pre17 so this may have changed. (its just what I > have > on this machine) > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux > Serial Ports > "ttySA" // for the > IPAQs > }; > > CandidatePortPrefixes=Temp; > } > > > So you may need to add "ttyUSB" to that list. RXTX used to enumerate > _everything_ see if(osName.equals("Linux-all-ports") But it became > less > than practical. > > This is all in RXTXCommDriver.java > > hmm I just did a cvs update. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux > Serial Ports > "ttySA", // for the > IPAQs > "ttyUSB" // for USB > frobs > }; > > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you > have > to get your fingers into the code. We aim for sane defaults. -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 19:21:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 19:21:54 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139358305.17994.2.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> <1139358305.17994.2.camel@zd7280> Message-ID: >Sorry I bothered you with this. Next time I will look in the source >first. I didn't think it was an rxtx issue, I thought it was a Linux >setup issue . Why would you be sorry? I would have done the same. I'm glad it's working :) -- Trent Jarvi tjarvi at qbang.org From tma at mail.island.net Wed Feb 8 13:39:35 2006 From: tma at mail.island.net (Tom Alldread) Date: Wed, 08 Feb 2006 12:39:35 -0800 Subject: [Rxtx] Win32/Linux Serial Port Data Dropouts In-Reply-To: <200602060702.k167255O007882@www.qbang.org> References: <200602060702.k167255O007882@www.qbang.org> Message-ID: <43EA5707.4020200@mail.island.net> Greetings Folks at RXTX: During the last couple of months I have been alternately testing with javax.comm 2 and RXTX 2.1 under Windows XP and CommApi 3 and RXTX 2.1 under Suse 10.0 Linux. In the process I have learned a little about java multi-threading under NetBeans 5 with Profiler. My java (jdk 1.5_06) application is used for data acquisition and provides a graphical display of A-D conversion data received from a 56KBaud serial port. The actual data throughput is about 10KBaud thus it is well below the speed of the port. I use hardware RTS/CTS flow control which can stall the data acquisition sample rate if necessary. This ensures the display computer has the ability to slow the data acquisition rate should it become too busy to accept the regular data flow. Both the serial port buffer and the java read buffer are set at 16KB. Usually the data transfers into the java read buffer are less than 100 bytes unless the data acquisition is recovering from a stall. The data flow normally hesitates after each 5 KB block as a continue command is needed from the display computer to start the drawing of a new graphics display line. Separate threads have been provided for the serial port event monitoring and data processing. The serial port event thread has been given the maximum priority and data processing thread the minimum priority provided by java. Thread yield statements have been placed within all data processing while/for loops as an effort to ensure quick access to CPU cycles for the serial port event thread. I have found that short data transmissions are essentially error free but occasional dropouts occur with continuous data flow especially under Windows XP. ....................................................................................................................................................................................... Linux results: I am happy to report that RXTX 2.1 appears to work very well under Linux although I did notice some errors when the screen savers were running with my dual monitors. I believe this is a local problem associated with my dual graphics which needs further attention. The recent CommApi 3 Linux release from Sun did not work at all with my program. It seemed to send commands out OK but did not receive any data. Although the serial port event triggered the ISR, the input stream appeared filled with nulls and thus did not contain any data. As my understanding is that CommApi 3 was tested with a Red Hat distribution of Linux I wonder if this problem is distro dependent? Although somewhat off topic here I wonder if anyone reading this has had similar experience? .................................................................................................................................................................................. Windows XP results: There are problems with occasional data dropouts which become more frequent as the sampling rate is increased or if the computer becomes busy with other duties. The dropouts typically consist of a half dozen byte block of lost data. It appears the lost bytes never get added to the java input stream. There has not been any indication of garbled data, overruns or framing errors which suggests the UART communications remains solid. Using javax.comm 2 I found that the setting of SerialPort 'enableReceiveThreshold' to 40 and 'enableReceiveTimeout' of 100mS reduced the dropouts error rate significantly. I found that I could not get RXTX 2.1 to function with the aforementioned threshold and timeout settings. The javax.comm 2 interface is consequently performing better for me under Windows than RXTX 2.1. I wonder if anyone here has any suggestions as to what I might try to improve RXTX 2.1? Although my settings are the same as under Suse 10.0, RXTX 2.1 performs much better for me under Linux than any of the alternatives that I have tried under Windows XP . ............................................................................................................................................................................... I would like to establish, based on the experience of others, if I have reached the normally expected performance limit of java serial port communications? Should I expect to achieve virtually error free serial port data input from a continuous stream under Windows XP java software? I am considering changing my protocol to packets with error checking if necessary but would like to know if the dropout problems I am experiencing are typical or not before I take this rather work intensive plunge. Many thanks in advance for any help! Best Regards, Tom Alldread -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.375 / Virus Database: 267.15.2/253 - Release Date: 2006-02-07 From jlaxson at mac.com Wed Feb 8 23:56:48 2006 From: jlaxson at mac.com (John Laxson) Date: Thu, 9 Feb 2006 00:56:48 -0600 Subject: [Rxtx] PortInUseException: Unknown Application on OSX Message-ID: Hi, I've been trying to get RXTX 2.1.7 going on Mac OS X for a while here, and am running up into a wall here. I've tried with pre- compiled and the source version and get the same problem, a gnu.io.PortInUseException: Unknown Application. I have run the fixperms script included with the source distribution, and id shows me as a member of the uucp group, and permissions on /var/spool/uucp are 775 root:uucp. Running a test program (included at the bottom for clarity) lets me enumerate all the serial ports correctly, but trying to open any of them gives the PortInUseException. If it helps, when I try to open a port that's set to make an outgoing bluetooth connection, there is no delay and no connection attempt at all. Thanks, John Laxson PS: The documentation wiki on qbang.org shows 404, and has for a few days now. My test code: public static void main(String[] args) { SerialPort serialPort; try { Enumeration e = CommPortIdentifier.getPortIdentifiers(); CommPortIdentifier ident; while (e.hasMoreElements()) { ident = (CommPortIdentifier)e.nextElement(); System.out.println(ident.getName()); } ident = CommPortIdentifier.getPortIdentifier("/dev/cu.modem"); serialPort = (SerialPort) ident.open("Me", 5000); } catch (Exception e) { e.printStackTrace(); } } From rajesh.invincible at gmail.com Thu Feb 9 03:39:38 2006 From: rajesh.invincible at gmail.com (Rajesh N) Date: Thu, 9 Feb 2006 16:09:38 +0530 Subject: [Rxtx] Re: Move .java Files in gnu.io filesystem hierarchy - Maven (2) In-Reply-To: <43DF21D2.7090200@ngi.it> References: <43DF21D2.7090200@ngi.it> Message-ID: <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Can anybody tell me how to overcome these EXCEPTIONS I AM WORKING ON SERIAL COMMN IN JAVA ON LINUX. 1. " NOT ALL PARAMETERS SUPPORTED BY THE KERNEL" This i came across the following statement inmy prog. SerialP is A SerialPort object SerialP.setSerialPortParams(9600(BAUDRATE),DATABITS_8,STOPBITS_1,PARITY_NONE) 2. NullPointer Exception at Event Dispatch Now i have checked all my object references for a null reference but i found none i have put up my entire code in try catch blocks but still I AM UNABLE TO CATCH THIS EXCEPTION AND HENCE MY APPLICATION CLOSES HOW DOES THESE GO? PLEASE HELP ME IT IS URGENTTTTTTTTTTTTTTTT yours sincerely RAJESH On 1/31/06, Fabio Frumento wrote: > Hi Xavier, > > I don't know maven at all but the directory hierarchy listed buy Trent > is fine for me... > > I'll take a look to maven, it seems an interesting project > > Regards > > Fabio Frumento > > Trent Jarvi wrote: > > On Tue, 31 Jan 2006, Xavier Frisaye wrote: > > > >> Hi all, > >> > >> If you are going to rearrange the src folder, i will propose to use > >> maven 2 and follow its directory structure > >> > (http://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html). > >> > >> Maven 2 simplify java project and give a standard way to make projects > >> (http://maven.apache.org/). > >> We are using it for internal projects and we are very satisfied. > >> > >> Is anybody interested? > >> > >> I'm not an expert in maven 2 (yet) but i'm agree to help using it if > >> you choose to make so. > >> > > > > so this would be: > > > > rxtx-devel/src/main/java/gnu.io > > rxtx-devel/src/test/java/ManIwish.java > > > > I don't use IDEs very much so I'll let others comment. But I don't see > > a problem with that. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Thu Feb 9 09:50:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 9 Feb 2006 09:50:31 -0700 (MST) Subject: [Rxtx] Re: Move .java Files in gnu.io filesystem hierarchy - Maven (2) In-Reply-To: <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Message-ID: On Thu, 9 Feb 2006, Rajesh N wrote: > Can anybody tell me how to overcome these EXCEPTIONS > I AM WORKING ON SERIAL COMMN IN JAVA ON LINUX. > > 1. " NOT ALL PARAMETERS SUPPORTED BY THE KERNEL" > > This i came across the following statement inmy prog. > SerialP is A SerialPort object > SerialP.setSerialPortParams(9600(BAUDRATE),DATABITS_8,STOPBITS_1,PARITY_NONE) > Strange. The parameters you use are the same the port should open with by default. Could you paste the actual exception you are getting? I don't see that in the rxtx source. Also it would help to know the rxtx version. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Fri Feb 10 15:29:05 2006 From: lux at diesel-research.com (Kim Lux) Date: Fri, 10 Feb 2006 15:29:05 -0700 Subject: [Rxtx] One serial port object for both sending and receiving ? Message-ID: <1139610545.18177.4.camel@zd7280> Is it OK to use one SerialPort ojbect (ex Serial Port serialPort;) and use it for both sending and receiving ? For example: ======================================================================== static SerialPort serialPort = null; static OutputStream serialOut = null; static InputStream serialIn = null; // assign it to an outputStream for use try{ serialOut = serialPort.getOutputStream(); System.out.println("Serial output stream has been assigned."); }//try catch(IOException e) { System.out.println("Error: Couldn't assign output stream to serial port."); }//catch //assign it to an inputStream for use try{ serialIn = serialPort.getInputStream(); System.out.println("Serial input stream has been assigned."); }//try catch(IOException e) { System.out.println("Error: Couldn't assign input stream to serial port."); }//catch ======================================================================== -- Kim Lux, Diesel Research Inc. From lux at diesel-research.com Fri Feb 10 21:23:00 2006 From: lux at diesel-research.com (Kim Lux) Date: Fri, 10 Feb 2006 21:23:00 -0700 Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Message-ID: <1139631780.23882.10.camel@zd7280> I've got a problem receiving chars with my version of serialRead, written in an SWT GUI. I had a Java pro have a good look at my code and he can't see anything wrong with it. I can send chars fine. When I receive a char the cpu usage for the app goes to 100% and the code in the serial event handler doesn't get executed. The instructions on the Java Comm Serial API How-To for Linux page state that I must install javacomm. Is that true ? Everything builds without it and I can send chars on rxtx just fine, but I can't receive them. Could this be the problem ? I downloaded and installed javacomm. I was not able to add "Driver=gnuio.RXTXCommDriver to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 installed in /usr/java/jre1.5.0_05. I added comm.jar to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext to the library paths. Is this OK ? Does it matter that I am receiving on /dev/ttyUSB0 ? Thanks. -- Kim Lux, Diesel Research Inc. From lunareclipse03 at web.de Sat Feb 11 09:44:46 2006 From: lunareclipse03 at web.de (lunareclipse03@web.de) Date: Sat, 11 Feb 2006 17:44:46 +0100 Subject: [Rxtx] Question about Serial I/O under Win32 Message-ID: <662084330@web.de> Hello everybody, I have a strange problem with a piece of code I made for myself. No, this is not really concerning rxtx, but nevertheless I post this to the list, hoping that some of you can help me. I've written two libraries, one for linux and one for win32. The linux port works quite well, I can send / receive faxes and / or replay voice messages over the telephone line using a voice modem. But the win32 port of the library causes some trouble. If, for example, I send out a fax with a certain modem under linux, it works well. The fax is complete when it comes out of the fax machine. If I then use the same modem to send out a fax under win32, the fax coming out of the fax machine gets "stuck" halfways, but the sending modem thinks that transmission was ok and drops the connection. The answering fax machine then gives me "error while receiving." The "upper layer" java code MUST be right, because if I do the same thing under linux (using the linux library), everything is alright. Now I have to ask: Can somebody please help me out with this??!? Could it be the case that some kind of flow control or COMMTIMEOUTS setting causes this behaviour? I set flow control to RTS/CTS before sending out a fax. How can I DISABLE flow control? Or what do you think? Can something else cause this problems? Thank you all for your time and PLEASE write back soon. Regards, --Sven Ahlemann Am Waldrand 31 45721 Haltern am See Germany ______________________________________________________________ Verschicken Sie romantische, coole und witzige Bilder per SMS! Jetzt bei WEB.DE FreeMail: http://f.web.de/?mc=021193 From lux at diesel-research.com Sat Feb 11 10:06:52 2006 From: lux at diesel-research.com (Kim Lux) Date: Sat, 11 Feb 2006 10:06:52 -0700 Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: <1139631780.23882.10.camel@zd7280> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> <1139631780.23882.10.camel@zd7280> Message-ID: <1139677612.3431.5.camel@zd7280> More on this problem. I copied and pasted simpleRead into a console based Eclipse project and I've got the same result, except that cpu usage doesn't go to 100%. I'm beginning to think there is an issue in rxtx. My imports for simpleRead are: ============================ import gnu.io.*; import java.util.*; //import javax.comm.*; import java.io.*; =========================== Any ideas ? I am trying to read from /dev/ttyUSB0 using a serial to USB adapter which has worked well with minicom and gtkterm. Thanks. On Fri, 2006-02-10 at 21:23 -0700, Kim Lux wrote: > I've got a problem receiving chars with my version of serialRead, > written in an SWT GUI. > > I had a Java pro have a good look at my code and he can't see anything > wrong with it. > > I can send chars fine. When I receive a char the cpu usage for the app > goes to 100% and the code in the serial event handler doesn't get > executed. > > The instructions on the Java Comm Serial API How-To for Linux page state > that I must install javacomm. Is that true ? Everything builds without > it and I can send chars on rxtx just fine, but I can't receive them. > Could this be the problem ? > > I downloaded and installed javacomm. I was not able to add > "Driver=gnuio.RXTXCommDriver > to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not > have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 > installed in /usr/java/jre1.5.0_05. I added comm.jar > to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext > to the library paths. Is this OK ? > > Does it matter that I am receiving on /dev/ttyUSB0 ? > > Thanks. > -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Sun Feb 12 21:01:33 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:01:33 -0700 (MST) Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: <1139677612.3431.5.camel@zd7280> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> <1139631780.23882.10.camel@zd7280> <1139677612.3431.5.camel@zd7280> Message-ID: I suspect what is happening is the select() is breaking out in the native code but the driver does not have support for notifying there are X bytes available. On some traditional Unix based systems, the only way you know data is available is the fd status changes and do an FIORDCHK ioctl. Or perhaps the only thing you can know is the fd status changed. It would take reading through the kernel driver code to know for sure. So on USB, depending upon the driver, the same may need to be done or the driver improved a bit if possible to support. Polling reads will also work but don't use the event driven model of CommAPI which isnt acceptable in the long run. The 100% cpu usage can then be explained because select no longer blocks until the data is read; the eventLoop spins loose. You can put a well placed sleep but rxtx only expects those are needed when it knows data is available. This may not be a super simple thing to understand and fix. I do have ideas to get you started. I'm going to be short on time the next couple weeks. I expect to put some good time in and answer some other questions I saw around the 25th. For now, I'd look at the following and go from there with the hints I've given. JNIEXPORT jint JNICALL RXTXPort(nativeavailable)( JNIEnv *env, jobject jobj ) { int fd = get_java_var( env, jobj,"fd","I" ); int result; /* char message[80]; ENTER( "RXTXPort:nativeavailable" ); On SCO OpenServer FIONREAD always fails for serial devices, so try ioctl FIORDCHK instead; will only tell us whether bytes are available, not how many, but better than nothing. This turns out to be true on Solaris also. taj. */ #ifdef FIORDCHK /* __unixware__ __sun__ probably others */ result = ioctl(fd, FIORDCHK, 0); #else if( ioctl( fd, FIONREAD, &result ) < 0 ) { goto fail; } #endif /* FIORDCHK */ On Sat, 11 Feb 2006, Kim Lux wrote: > > More on this problem. I copied and pasted simpleRead into a console > based Eclipse project and I've got the same result, except that cpu > usage doesn't go to 100%. I'm beginning to think there is an issue in > rxtx. > > My imports for simpleRead are: > > ============================ > import gnu.io.*; > import java.util.*; > //import javax.comm.*; > import java.io.*; > =========================== > > Any ideas ? I am trying to read from /dev/ttyUSB0 using a serial to > USB adapter which has worked well with minicom and gtkterm. > > Thanks. > > > > On Fri, 2006-02-10 at 21:23 -0700, Kim Lux wrote: >> I've got a problem receiving chars with my version of serialRead, >> written in an SWT GUI. >> >> I had a Java pro have a good look at my code and he can't see anything >> wrong with it. >> >> I can send chars fine. When I receive a char the cpu usage for the app >> goes to 100% and the code in the serial event handler doesn't get >> executed. >> >> The instructions on the Java Comm Serial API How-To for Linux page state >> that I must install javacomm. Is that true ? Everything builds without >> it and I can send chars on rxtx just fine, but I can't receive them. >> Could this be the problem ? >> >> I downloaded and installed javacomm. I was not able to add >> "Driver=gnuio.RXTXCommDriver >> to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not >> have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 >> installed in /usr/java/jre1.5.0_05. I added comm.jar >> to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext >> to the library paths. Is this OK ? >> >> Does it matter that I am receiving on /dev/ttyUSB0 ? >> >> Thanks. >> > From tjarvi at qbang.org Sun Feb 12 21:03:30 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:03:30 -0700 (MST) Subject: [Rxtx] One serial port object for both sending and receiving ? In-Reply-To: <1139610545.18177.4.camel@zd7280> References: <1139610545.18177.4.camel@zd7280> Message-ID: On Fri, 10 Feb 2006, Kim Lux wrote: > > Is it OK to use one SerialPort ojbect (ex Serial Port serialPort;) and > use it for both sending and receiving ? > > For example: > > ======================================================================== > static SerialPort serialPort = null; > static OutputStream serialOut = null; > static InputStream serialIn = null; > > > > > // assign it to an outputStream for use > try{ > serialOut = serialPort.getOutputStream(); > System.out.println("Serial output stream has been assigned."); > }//try > catch(IOException e) > { > System.out.println("Error: Couldn't assign output stream to serial > port."); > }//catch > > > //assign it to an inputStream for use > try{ > serialIn = serialPort.getInputStream(); > System.out.println("Serial input stream has been assigned."); > }//try > catch(IOException e) > { > System.out.println("Error: Couldn't assign input stream to serial > port."); > }//catch This should be fine. In fact trying to do it another way will probably not work as you will run into lockfile issues. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun Feb 12 21:13:13 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:13:13 -0700 (MST) Subject: [Rxtx] Question about Serial I/O under Win32 In-Reply-To: <662084330@web.de> References: <662084330@web.de> Message-ID: On Sat, 11 Feb 2006 lunareclipse03 at web.de wrote: > Hello everybody, > > I have a strange problem with a piece of code I made for myself. No, > this is not really concerning rxtx, but nevertheless I post this to the > list, hoping that some of you can help me. I've written two libraries, > one for linux and one for win32. The linux port works quite well, I can > send / receive faxes and / or replay voice messages over the telephone > line using a voice modem. But the win32 port of the library causes some > trouble. If, for example, I send out a fax with a certain modem under > linux, it works well. The fax is complete when it comes out of the fax > machine. If I then use the same modem to send out a fax under win32, the > fax coming out of the fax machine gets "stuck" halfways, but the sending > modem thinks that transmission was ok and drops the connection. The > answering fax machine then gives me "error while receiving." The "upper > layer" java code MUST be right, because if I do the same thing under > linux (using the linux library), everything is alright. Now I have to > ask: Can somebody please help me out with this??!? Could it be the case > that some kind of flow control or COMMTIMEOUTS setting causes this > behaviour? I set flow control to RTS/CTS before sending out a fax. How > can I DISABLE flow control? Or what do you think? Can something else > cause this problems? Thank you all for your time and PLEASE write back > soon. > Hi Sven I'm not too willing to talk about flow control at the low level until I confirm some things with test equipment later. It is not clear if you are using rxtx or writing your own native code. So I'm not sure how to answer much of this :) If you are wondering how to change the flow control using rxtx from java, The BlackBox example from Sun flips this back and forth. SerialPort.java in rxtx 2.1 uses the following: SerialPort.java: public static final int FLOWCONTROL_NONE =0; SerialPort.java: public static final int FLOWCONTROL_RTSCTS_IN =1; SerialPort.java: public static final int FLOWCONTROL_RTSCTS_OUT =2; SerialPort.java: public static final int FLOWCONTROL_XONXOFF_IN =4; SerialPort.java: public static final int FLOWCONTROL_XONXOFF_OUT=8; So if you set flowcontrol to RTSCTS, you can set it to NONE to turn it off. If you are looking for how to do it in native code, the rxtx Source is SerialImp.c (unix/linux/mac os x/w32) and termios.c (w32 only with SerialImp.c) You can track the code: SerialImp.c:JNIEXPORT void JNICALL RXTXPort(setflowcontrol)( JNIEnv *env, jobject jobj, jint flowmode ) termios.c:int tcgetattr( int fd, struct termios *s_termios ) termios.c:int tcsetattr( int fd, int when, struct termios *s_termios ) There may be a problem in the rxtx flow control code though. Rather than guess, I want to test this with a gold standard. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Feb 6 00:00:16 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 00:00:16 -0700 (MST) Subject: [Rxtx] wiki delay until tomorrow night. In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: On Sun, 5 Feb 2006, Trent Jarvi wrote: > On Sun, 5 Feb 2006, Kim Lux wrote: > >> usb ? Tell me more... I need that too. > > usb is a very proper design. Thats all it is. > Maybe rxtx could help usb. But it would start with helping bring back the community that was already there. It's not something I'd love to do but maybe its the right thing to do. It would probably take 2 years to do right. But maybe thats better than what we have now. I honestly don't know what IBM is doing which could just run over everything. Just some thoughts after some fine german wine. -- Trent Jarvi tjarvi at qbang.org From gadelavega at yahoo.com.ar Mon Feb 6 02:17:05 2006 From: gadelavega at yahoo.com.ar (Gonzalo A. de la Vega) Date: Mon, 06 Feb 2006 10:17:05 +0100 Subject: [Rxtx] Serial port ownership question In-Reply-To: References: <20060205113618.30274.qmail@web53501.mail.yahoo.com> <1139157422.4553.9.camel@zd7280> <1139158698.4936.9.camel@zd7280> Message-ID: <43E71411.4050402@yahoo.com.ar> On my Fedora Core 4: ls -l /dev/ttyS* crw-rw---- 1 root uucp 4, 64 Feb 6 2006 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Feb 6 2006 /dev/ttyS1 ... and: grep "ttyUSB" /etc/udev/rules.d/50-udev.rules KERNEL=="ttyUSB*", GROUP="uucp", MODE="0660" So anyone in the "uucp" group can use serial ports. On Gentoo the group is "tty". Trent Jarvi escribi?: > > > On Sun, 5 Feb 2006, Dr. Douglas Lyon wrote: > >> I can confirm that this is the case (only root ownership of >> serial ports, under fedora 4). >> Wow, what were they thinking?! >> - DL >> >>> I've found that the newer kernels have the serial ports owned by root. >>> For example, >>> >>> $ls -al /dev/tty* >>> crw-rw-rw- 1 root root 5, 0 Feb 5 02:06 /dev/tty >>> crw-rw---- 1 root root 4, 0 Feb 5 02:06 /dev/tty0 >>> crw------- 1 root root 4, 1 Feb 5 09:07 /dev/tty1 >>> crw-rw---- 1 root tty 4, 10 Feb 5 02:06 /dev/tty10 >>> crw-rw---- 1 root tty 4, 11 Feb 5 02:06 /dev/tty11 >>> ... > > > This is just not a problem jcp or such are going to solve. Its a > platform spitwad fight. But do look at pam. In fact thats what Sun > is doing too. Maybe Linux followed their lead.. I'm not a pam guy. > I've spent 16 hours trying to understand it but your users wont :) > > Solution? I have no clue. Its two tangent mentalities from my > perspective. > > -- > Trent Jarvi > tjarvi at qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mtnvega at yahoo.com.br Mon Feb 6 05:35:43 2006 From: mtnvega at yahoo.com.br (Luiz Jr) Date: Mon, 6 Feb 2006 12:35:43 +0000 (GMT) Subject: [Rxtx] Documentation Wiki In-Reply-To: <1139157422.4553.9.camel@zd7280> Message-ID: <20060206123543.57256.qmail@web53515.mail.yahoo.com> Hello, Thank you for you answer, but so the usage of the API is pretty much like the Java Communications Api? If yes, what version of the Java Comm Api? Thank you, Luiz A. Brandao Jr Kim Lux escreveu: On Sun, 2006-02-05 at 08:36 -0300, Luiz Jr wrote: > Hello, > > I want to start using the RXTX libraries, but I would to know how, > since I can not access the documentation wiki page I just started using them yesterday. Below is how I installed the libraries, if that helps. I used snippets of code from the SimpleWrite application here to get me going. http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html Instead of "import javax.comm.*;", use "import gnu.io.*;" which is gotten from RXTXcomm.jar, which you will need to include in your project references. I am working in Eclipse. BTW: there is no way to open a port without going through the port list and finding it. Maybe sometime in the future someone (me ?) will write a method called openSerialPort that allows the user to give a port identifier, such as "/dev/tty1" and return a port ready to use. It wouldn't take much to write that and it would save users a lot of code. Hope this helps. ======================================================================= 1) Figure out which java you are running, incase there is more than one installed. $ java -version java version "1.5.0_05" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_05-b05) Java HotSpot(TM) Client VM (build 1.5.0_05-b05, mixed mode, sharing) 2) Find all the jre directories and the one from which you are currently running. kfind (jre) 3) cd to that directory plus /lib/i386 cd /usr/java/jre1.5.0_05/lib/i386 4) Copy the library files (*.so) to that directory. cp /home/krlux/Desktop/'Java Controls'/rxtx-linux/bin/* . 5) Check that the copy was successful ls librxtx* librxtxI2C.so librxtxRaw.so librxtxSerial.so librxtxParallel.so librxtxRS485.so 6) cd to the /lib/ext directory for your java. cd /usr/java/jre1.5.0_05/lib/ext 7) Copy the Jar files there cp /home/krlux/Desktop/'Java Controls'/rxtx-linux/lib/ext/* . 8) Check that it was successful ls RXTX* RXTXcomm.jar Rxtx is now installed on your machine ready to use. =================================================================== -- Kim Lux, Diesel Research Inc. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx --------------------------------- Yahoo! Acesso Gr?tis - Internet r?pida e gr?tis. Instale o discador agora! -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/544aa403/attachment-0062.html From lyon at docjava.com Mon Feb 6 05:49:34 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 06 Feb 2006 07:49:34 -0500 Subject: [Rxtx] wiki delay until tomorrow night. In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: Hi All, I have often thought about USB drivers being needed. For example, the ironman watch will not interface to a mac (windows only). It is USB. My dymo label writer has no Java driver (native only). Etc. Most cheap web cameras are USB (and Java drivers go through JAI, if it supports the camera at all). The JAI code shows how sun did the USB drivers. You have to be a member of the jai project to download the source code. https://jai.dev.java.net has the jai distro. And then you are not allowed to redistribute it. However, we can all learn from it (if so inclined). Basically: cvs -d :pserver:lyon at cvs.dev.java.net:/cvs login cvs -d :pserver:lyon at cvs.dev.java.net:/cvs checkout jai-core You will need to user your own uid and pw to get in. The ant build has over 100 warnings from sun deprecations of its own code. You might say that they were hoisted on their own Picard ;) One interesting thing is that they support several platforms: linux-amd64 64-bit Linux-AMD64 linux-i586 32-bit Linux-x86 solaris-amd64 64-bit Solaris-AMD64 solaris-i586 32-bit Solaris-x86 solaris-sparc 32-bit Solaris-SPARC solaris-sparcv9 64-bit Solaris-SPARC windows-i586 32-bit Windows-x86 Thus, ant is used to provide a multi-platform native method distro. Neat. How do they do it? check this out: And: The core download does not contain any C source code (it was all pre-built). Basically, they are just copying .so and .dll files into build directories. I would love to see the C code for this...but Sun does not post it on the https://jai.dev.java.net site. I don't know why...Perhaps I missed it. - Doug >On Sun, 5 Feb 2006, Trent Jarvi wrote: > >>On Sun, 5 Feb 2006, Kim Lux wrote: >> >>>usb ? Tell me more... I need that too. >> >>usb is a very proper design. Thats all it is. >> > >Maybe rxtx could help usb. But it would start with helping bring >back the community that was already there. > >It's not something I'd love to do but maybe its the right thing to do. > >It would probably take 2 years to do right. But maybe thats better >than what we have now. > >I honestly don't know what IBM is doing which could just run over everything. > >Just some thoughts after some fine german wine. > >-- >Trent Jarvi >tjarvi at qbang.org > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tdelenik at gmail.com Mon Feb 6 05:56:32 2006 From: tdelenik at gmail.com (Thanasis Delenikas) Date: Mon, 6 Feb 2006 14:56:32 +0200 Subject: Fwd: [Rxtx] Documentation Wiki In-Reply-To: <1139157422.4553.9.camel@zd7280> References: <20060205113618.30274.qmail@web53501.mail.yahoo.com> <1139157422.4553.9.camel@zd7280> Message-ID: <310a1a930602060456t129f1dc6p5f2b908f13ab5a0b@mail.gmail.com> Hello all, Kim, this is a snippet from the code I use. The closest to directly opening a specific port without enumeration. << ... portId = CommPortIdentifier.getPortIdentifier(getPort()); serialPort = (SerialPort) portId.open("jSMSEngine", 1971); ... >> where getPort() return the string identifier of the port, i.e. "/dev/ttyS0" or "COM1" or whatever. Thanasis. ---------- Forwarded message ---------- From: Kim Lux Date: Feb 5, 2006 6:37 PM Subject: Re: [Rxtx] Documentation Wiki To: RXTX Developers and Users BTW: there is no way to open a port without going through the port list and finding it. Maybe sometime in the future someone (me ?) will write a method called openSerialPort that allows the user to give a port identifier, such as "/dev/tty1" and return a port ready to use. It wouldn't take much to write that and it would save users a lot of code. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/182ab5b8/attachment-0062.html From tjarvi at qbang.org Mon Feb 6 11:53:57 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 11:53:57 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: On Mon, 6 Feb 2006, Dr. Douglas Lyon wrote: > Hi All, > I have often thought about USB drivers being needed. > For example, the ironman watch will not interface > to a mac (windows only). It is USB. > My dymo label writer has no Java driver (native only). > Etc. > Most cheap web cameras are USB (and Java drivers go > through JAI, if it supports the camera at all). > The JAI code shows how sun did the USB drivers. > You have to be a member of the jai project to download > the source code. > https://jai.dev.java.net has the jai distro. > And then you are not allowed to redistribute it. However, > we can all learn from it (if so inclined). Basically: > cvs -d :pserver:lyon at cvs.dev.java.net:/cvs login > cvs -d :pserver:lyon at cvs.dev.java.net:/cvs checkout jai-core > You will need to user your own uid and pw to get in. > The ant build has over 100 warnings from sun deprecations > of its own code. > > You might say that they were hoisted on their own Picard ;) > > One interesting thing is that they support several platforms: > linux-amd64 64-bit Linux-AMD64 > linux-i586 32-bit Linux-x86 > solaris-amd64 64-bit Solaris-AMD64 > solaris-i586 32-bit Solaris-x86 > solaris-sparc 32-bit Solaris-SPARC > solaris-sparcv9 64-bit Solaris-SPARC > windows-i586 32-bit Windows-x86 > Thus, ant is used to provide a multi-platform native method distro. > Neat. > How do they do it? > check this out: > > > > > > > > > > > > > And: > > > > > > > > > > The core download does not contain any C source code (it was all pre-built). > Basically, they are just copying .so and .dll files into build directories. > > I would love to see the C code for this...but Sun does not post it on the > https://jai.dev.java.net site. > > I don't know why...Perhaps I missed it. > > - Doug > > I've looked at moving rxtx to Ant builds. I think that would help IDEs a great deal. I requested a evalutation desk copy the O'Reilly Ant book for some j2ee material I was teaching. http://www.oreilly.com/catalog/anttdg/ It has a one sentence mention of JNI. So there was not luck there. I saw that there is another Ant book that does mention JNI more. I can't find it now. Ant must be able to support it with extensions. http://ant.apache.org/manual/OptionalTasks/javah.html What the auto(break :) tools do in the rxtx build is 4 things really. 1) gcc compile flags 2) ld compile flags 3) config.h 4) compile flags for customizing rxtx (lockfiles, ...) See 1 All of this information except 4 can be static once obtained. So I'm not attached to the auto tools. If I could find an example of Ant being used for JNI code, I'd be one of the first to start moving that direction. Maybe someone saw an example someplace. The other thing we have not completed discussing is the directory structure. There is interest in making rxtx more IDE friendly. I get more mail about that off the list than how to install rxtx. And I see we have Ken Thompson in da house :) He is our trusted CVS maintainer and the guy that purchased the rxtx.org domain. Old community. We will need Ken for changing the directory structure of source. I would like to open up discussion about both of these as it is more than time. The problem is I have little experience with Ant and even less with IDEs. It would be nice if we could work with Eclipse and NetBeans. http://www.netbeans.org/ (sun and some community) http://www.eclipes.org (ibm,rhat,... perhaps more community) http://maven.apache.org/what-is-maven.html (apache. It is community) borland should sortof be here too but I think thats covered in eclipse. >From what I understand so far, we should morph rxtx to support those three maybe trusting apaches lead with maven. But I use vi. I have little to no clues beyond what people have fed me. Can we agree that thats the right direction to go? -- Trent Jarvi tjarvi at qbang.org From brian at mbari.org Mon Feb 6 14:57:50 2006 From: brian at mbari.org (Brian Schlining) Date: Mon, 6 Feb 2006 13:57:50 -0800 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> > The other thing we have not completed discussing is the directory > structure. There is interest in making rxtx more IDE friendly. I > get more mail about that off the list than how to install rxtx. > > And I see we have Ken Thompson in da house :) He is our trusted > CVS maintainer and the guy that purchased the rxtx.org domain. Old > community. We will need Ken for changing the directory structure of > source. > > I would like to open up discussion about both of these as it is > more than time. The problem is I have little experience with Ant > and even less with IDEs. It would be nice if we could work with > Eclipse and NetBeans. > > http://www.netbeans.org/ (sun and some community) > http://www.eclipes.org (ibm,rhat,... perhaps more community) > http://maven.apache.org/what-is-maven.html (apache. It is community) > borland should sortof be here too but I think thats covered in > eclipse. > >> From what I understand so far, we should morph rxtx to support >> those three > maybe trusting apaches lead with maven. But I use vi. I have > little to no clues beyond what people have fed me. > Maven likes the directory structure below for Java code. (From http:// maven.apache.org/guides/getting-started/index.html) This structure works fine with ant, netbeans, and eclipse. rxtx_root_directory `-- src |-- main | `-- java | `-- gnu | `-- io `-- test `-- java `-- gnu `-- io Brian Schlining Software Engineer http://www.mbari.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/d9451eba/attachment-0062.html From tjarvi at qbang.org Mon Feb 6 15:11:45 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 15:11:45 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: > rxtx_root_directory > `-- src > |-- main > | `-- java > | `-- gnu > | `-- io > `-- test > `-- java > `-- gnu > `-- io > >From what I understand this will just be good. For me it makes no difference. So lets do the rxtx thing. Let if fester for two weeks and if nobody objects, we will do it. I'm not doing this because I care. I'm doing this to eliminate much of my inbox. But test... man is rxtx lacking there in the community aspect. It is covered but not right. _maybe_ I can change that this year. -- Trent Jarvi tjarvi at qbang.org (cat hurding since 1997) From lux at diesel-research.com Mon Feb 6 21:38:49 2006 From: lux at diesel-research.com (Kim Lux) Date: Mon, 06 Feb 2006 21:38:49 -0700 Subject: [Rxtx] How can I use Lock Files with rxtx (in FC4) ? Message-ID: <1139287129.17031.3.camel@zd7280> I am now running an rxtx application on FC4. I am getting: ========================================================= check_group_uucp(): error testing lock file creation Error details: Permission denied check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL ========================================================= $ ls -al /var/lock total 32 drwxrwxr-x 4 root lock 4096 Feb 6 16:04 . drwxr-xr-x 24 root root 4096 Nov 14 01:19 .. drwx------ 2 root root 4096 Apr 27 2005 lvm drwxr-xr-x 2 root root 4096 Feb 6 16:04 subsys How do I fix this for regulator users ? -- Kim Lux, Diesel Research Inc. From dmarkman at mac.com Mon Feb 6 22:24:44 2006 From: dmarkman at mac.com (Dmitry Markman) Date: Tue, 7 Feb 2006 00:24:44 -0500 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: if I understands the issue right in order to be able to use ant for c/c++ compilation you have to install ant's cc task http://ant-contrib.sourceforge.net/cc.html it looks like it should work on mac os x (authors claim, that it's platform independent) but I never tested so all you have to do it's providing right command line for the gcc compiler On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: >> rxtx_root_directory >> `-- src >> |-- main >> | `-- java >> | `-- gnu >> | `-- io >> `-- test >> `-- java >> `-- gnu >> `-- io >> > > >> From what I understand this will just be good. > > For me it makes no difference. So lets do the rxtx thing. Let if > fester for two weeks and if nobody objects, we will do it. > > I'm not doing this because I care. I'm doing this to eliminate > much of my inbox. > > But test... man is rxtx lacking there in the community aspect. It > is covered but not right. _maybe_ I can change that this year. > > -- > Trent Jarvi > tjarvi at qbang.org > (cat hurding since 1997) > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx Dmitry Markman From lux at diesel-research.com Mon Feb 6 23:20:15 2006 From: lux at diesel-research.com (Kim Lux) Date: Mon, 06 Feb 2006 23:20:15 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? Message-ID: <1139293215.3689.4.camel@zd7280> I'm running the code below. portlist.hasMoreElements() is false. /dev has ports in it as listed below. What am I doing wrong ? ========================================================== // Step through the list of ports until we find one that matches // the one we are looking for. portList = CommPortIdentifier.getPortIdentifiers(); while(portList.hasMoreElements()) { portID = (CommPortIdentifier) portList.nextElement(); // if (portID.getName().equals("/dev/ttyUSB0")) { myTA.append("Serial port ttyUSB0 has been found\n"); break; }// if portID equals... }// End of while... ========================================================== ls -al /dev/tty* crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 ... crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 -- Kim Lux, Diesel Research Inc. From david.garnier at trusted-logic.com Tue Feb 7 00:46:30 2006 From: david.garnier at trusted-logic.com (David Garnier) Date: Tue, 07 Feb 2006 08:46:30 +0100 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: <43E85056.2090608@trusted-logic.com> Hello, I think that the make-based build process is fine as it is, apart from the location of the Java source files. It is true that putting the Java source in a directory structure that map 1-to-1 to the Java package structure is the norm and should make it easier for everyone to modify the Java source, with or without an IDE. Ant is a good tool, but in the RXTX case I fail to see the advantage of using it compared to the current make-based process. As Trent said, they are more pressing issues, like testing. Regards, David Dmitry Markman wrote: > if I understands the issue right > in order to be able to use ant for c/c++ compilation > you have to install ant's cc task > http://ant-contrib.sourceforge.net/cc.html > > it looks like it should work on mac os x > (authors claim, that it's platform independent) > but I never tested > > so all you have to do it's providing right command line > for the gcc compiler > > > > > On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: > >>> rxtx_root_directory >>> `-- src >>> |-- main >>> | `-- java >>> | `-- gnu >>> | `-- io >>> `-- test >>> `-- java >>> `-- gnu >>> `-- io >>> >> >> >>> From what I understand this will just be good. >> >> For me it makes no difference. So lets do the rxtx thing. Let if >> fester for two weeks and if nobody objects, we will do it. >> >> I'm not doing this because I care. I'm doing this to eliminate much >> of my inbox. >> >> But test... man is rxtx lacking there in the community aspect. It is >> covered but not right. _maybe_ I can change that this year. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> (cat hurding since 1997) From tjarvi at qbang.org Tue Feb 7 01:11:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 01:11:31 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <43E85056.2090608@trusted-logic.com> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: On Tue, 7 Feb 2006, David Garnier wrote: > Hello, > > I think that the make-based build process is fine as it is, apart from the location of the Java > source files. It is true that putting the Java source in a directory structure that map 1-to-1 to > the Java package structure is the norm and should make it easier for everyone to modify the Java > source, with or without an IDE. > > Ant is a good tool, but in the RXTX case I fail to see the advantage of using it compared to the > current make-based process. As Trent said, they are more pressing issues, like testing. > Hi David I have more experience with testing rxtx than I can talk about. But let it be known, rxtx has gone trough 100's of hours of testing. We are hobby folks interested in toys but there is more. rxtx has had some of the best guidance in the industry there. This is not an easy thing. I may be able to come back in a month from the other side of the corperate fence and help. I suspect the tests could just be made public but they are in a very unusual environment that just wont work in a wider sense. This is something I'll be trying to change. At one point it was agreed we could just make the results public so this isnt just noise.. There is interest and I think its safe to mention that much. The big problem with testing in the past is most of it is done with a loopback connection. So we *still* have major questions regarding things like flow control. rxtx talks to itself over a loopback and it works. regardless of right or wrong. This requires more thought to be done right. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Feb 7 02:46:34 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 02:46:34 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: > The big problem with testing in the past is most of it is done with a > loopback connection. So we *still* have major questions regarding things > like flow control. rxtx talks to itself over a loopback and it works. > regardless of right or wrong. With serial communication there are gold standards. ckermit is probably a definitive 'standard.' Maybe its possible to do ping/pong tests with ckermit? Is it scriptable? There are known issues in rxtx. Probably the worst is some threading issues regarding some JREs with multiple JNI threads setting java variables. Man did I get schooled there. Just switch the c functions to returning variables and things go away. Sometimes they work fine, sometimes they blow up. Without understanding everything, somehow rhat got it right and debian (and especially gentoo) grabbed kernel patches causing all sort of harm. Its not hard to fix once you understand whats going on but nearly impossible to track with a debugger. So I have a good idea what 2.1-8 will have outside of the IDE modifications. rxtx 2.1-7 is a release for everyone to sync with. Its not even as stable as -pre17 as far as I know - I ran no test suites. I'll be chasing it too. We just had so many contributions that it was time. It seriously broke internal scheduals but thats a great thing :) The other thing I want to do in 2.1-8 is automagic baud rates. It turns out lots of shops are doing really funky baud rates for things like automobile test equipment. It is possible but it requires a fair amount of change in the native code. Is anyone looking at this? -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Feb 7 02:57:21 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 07 Feb 2006 04:57:21 -0500 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <43E85056.2090608@trusted-logic.com> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: Hi All, I agree, testing is very important. The problem I have been trying to address is related to cross-platform testing and the robust nature of the installs. Typically, I visit 3 platforms to deploy my product, windows, linux and mac. A build is performed on each platform. The idea that you can build for many platforms from one copy the source code seems attractive. This should enable synchronized deployments of identical code. The question of how to achieve this goal remains open. As Trent mentioned, this is hard. Perhaps Ant will help here (but perhaps not). Ant does seem to help with running unit tests. However, it does not help with multi-platform tests. For that you need many machines and different operating environments. Toward that end, I have created a multi-platform test that can be run from web start, located at: http://show.docjava.com:8086/book/cgij/code/jnlp/serialPort.PortTest.jnlp This is interesting because many people in the community can run the test and we can improve the test, as time permits. No, it is not a perfect solution, however, the idea does help with multi-platform tests using many machines and different operating environments. If the group has a good test for a general serial port set-ups, i would be happy to deploy it, for general evaluation using web start. And as for ANT, it is just an idea. Not all my ideas are good ones! - Doug >Hello, > >I think that the make-based build process is fine as it is, apart >from the location of the Java >source files. It is true that putting the Java source in a directory >structure that map 1-to-1 to >the Java package structure is the norm and should make it easier for >everyone to modify the Java >source, with or without an IDE. > >Ant is a good tool, but in the RXTX case I fail to see the advantage >of using it compared to the >current make-based process. As Trent said, they are more pressing >issues, like testing. > >Regards, >David > >Dmitry Markman wrote: >> if I understands the issue right >> in order to be able to use ant for c/c++ compilation >> you have to install ant's cc task >> http://ant-contrib.sourceforge.net/cc.html >> >> it looks like it should work on mac os x >> (authors claim, that it's platform independent) >> but I never tested >> >> so all you have to do it's providing right command line >> for the gcc compiler >> >> >> >> >> On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: >> >>>> rxtx_root_directory >>>> `-- src >>>> |-- main >>>> | `-- java >>>> | `-- gnu >>>> | `-- io >>>> `-- test >>>> `-- java >>>> `-- gnu >>>> `-- io >>>> >>> >>> >>>> From what I understand this will just be good. >>> >>> For me it makes no difference. So lets do the rxtx thing. Let if >>> fester for two weeks and if nobody objects, we will do it. >>> >>> I'm not doing this because I care. I'm doing this to eliminate much >>> of my inbox. >>> >>> But test... man is rxtx lacking there in the community aspect. It is >>> covered but not right. _maybe_ I can change that this year. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> (cat hurding since 1997) > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From matt.higgins at gmail.com Tue Feb 7 08:28:34 2006 From: matt.higgins at gmail.com (Matt Higgins) Date: Tue, 7 Feb 2006 10:28:34 -0500 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final Message-ID: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? import java.io.*; import java.util.*; import gnu.io.*; public class MySimpleRead implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; public static void main(String[] args) { boolean portFound = false; String defaultPort = "COM1"; if (args.length > 0) { defaultPort = args[0]; } portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; MySimpleRead reader = new MySimpleRead(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } } public MySimpleRead() { try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) { e.printStackTrace(); } try { inputStream = serialPort.getInputStream(); } catch (IOException e) { e.printStackTrace(); } try { serialPort.addEventListener(this); } catch (TooManyListenersException e) { e.printStackTrace(); } try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { e.printStackTrace(); } System.out.println("Baud is " + serialPort.getBaudRate()); System.out.println("Bits is " + serialPort.getDataBits()); System.out.println("Stop is " + serialPort.getStopBits()); System.out.println("Par is " + serialPort.getParity()); serialPort.notifyOnDataAvailable(true); readThread = new Thread(this); readThread.start(); } public void run() { // Thread.sleep(20000); //} catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { System.out.println("An event occurred " + event.getEventType()); switch (event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: byte[] readBuffer = new byte[20]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } System.out.print(new String(readBuffer)); } catch (IOException e) {} break; } } } --------------- Result on windows ------------------------------ Stable Library ============================================================== Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port:: COM1 Baud is 9600 Bits is 8 Stop is 1 Par is 0 ----------------- End Results ----------------------------------------- ------------------ Result on Linux ----------------------------------- Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 Found port: /dev/ttyS0 Baud is 9600 Bits is 8 Stop is 1 Par is 0 An event occurred 1 043100066224 ------------------ End Results --------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/a1431630/attachment-0062.html From brian at mbari.org Tue Feb 7 09:48:37 2006 From: brian at mbari.org (Brian Schlining) Date: Tue, 7 Feb 2006 08:48:37 -0800 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> Message-ID: <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> Hi Matt > The following code works fine on Linux but I never see any data > when run on Windows. This is a cut and paste from the SimpleRead > example. > I am attempting to read data from a bar code scanner. I can fire > up HyperTermianl on windows and see that the device is working > properly as I see the barcodes are scanned and echoed back to the > terminal. However when I run the app I don't see any data. It is > however associating with the com port as the informational bits > print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. Cheers Brian Schlining Software Engineer http://www.mbari.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/16d07f37/attachment-0062.html From lux at diesel-research.com Tue Feb 7 11:59:58 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 11:59:58 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139293215.3689.4.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> Message-ID: <1139338798.8145.4.camel@zd7280> Any ideas on this ? Any reason why portList.hasMoreElements() should be false even though there are devices in /dev ? On Mon, 2006-02-06 at 23:20 -0700, Kim Lux wrote: > I'm running the code below. > > portlist.hasMoreElements() is false. > > /dev has ports in it as listed below. > > What am I doing wrong ? > > > ========================================================== > // Step through the list of ports until we find one that matches > // the one we are looking for. > > portList = CommPortIdentifier.getPortIdentifiers(); > > while(portList.hasMoreElements()) > { > portID = (CommPortIdentifier) portList.nextElement(); // > if (portID.getName().equals("/dev/ttyUSB0")) > { > myTA.append("Serial port ttyUSB0 has been found\n"); > break; > }// if portID equals... > }// End of while... > ========================================================== > > ls -al /dev/tty* > crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty > crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 > crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 > crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 > crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 > ... > crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 > crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 > crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 > > > -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 12:20:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 12:20:25 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139338798.8145.4.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> Message-ID: On Tue, 7 Feb 2006, Kim Lux wrote: > > Any ideas on this ? Any reason why portList.hasMoreElements() should be > false even though there are devices in /dev ? > > > On Mon, 2006-02-06 at 23:20 -0700, Kim Lux wrote: >> I'm running the code below. >> >> portlist.hasMoreElements() is false. >> >> /dev has ports in it as listed below. >> >> What am I doing wrong ? >> >> >> ========================================================== >> // Step through the list of ports until we find one that matches >> // the one we are looking for. >> >> portList = CommPortIdentifier.getPortIdentifiers(); >> >> while(portList.hasMoreElements()) >> { >> portID = (CommPortIdentifier) portList.nextElement(); // >> if (portID.getName().equals("/dev/ttyUSB0")) >> { >> myTA.append("Serial port ttyUSB0 has been found\n"); >> break; >> }// if portID equals... >> }// End of while... >> ========================================================== >> >> ls -al /dev/tty* >> crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty >> crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 >> crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 >> crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 >> crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 >> ... >> crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 >> crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 >> crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 >> >> >> > Hi Kim What rxtx does is try to open the port and do a timed out read. If the kernel/... do not complain it's enumarted. I suspect you could do a crude test by doing something like cat /dev/ttyS0 > /dev/null If that barfs then rxtx wont enumerate the port. hmm looking at your question again, I suspect it's a lockfile problem. This is documented in INSTALL with the source. Its easy enough to test this too.. touch /var/lock/testingrxtxlockfiles && rm -f /var/lock/testingrxtxlockfiles If you are not in the right group it will bail. Root will work regardless. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 12:37:56 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 12:37:56 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> Message-ID: <1139341076.8145.11.camel@zd7280> Exactly which ports does rxtx attempt to put into the list ? /dev/* or /dev/tty* or /dev/tty[0-9[0-9] ? or /dev/ttyS* ? For the record, only /dev/ttyUSB0 is a valid port on the machine I am presently on. Will this be a problem ? On Tue, 2006-02-07 at 12:20 -0700, Trent Jarvi wrote: > This is documented in INSTALL with the source. > I was wondering where that file was. I will download source and dig it up. Thanks. -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 12:51:09 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 12:51:09 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139341076.8145.11.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: On Tue, 7 Feb 2006, Kim Lux wrote: > > Exactly which ports does rxtx attempt to put into the list ? /dev/* > or /dev/tty* or /dev/tty[0-9[0-9] ? or /dev/ttyS* ? > > For the record, only /dev/ttyUSB0 is a valid port on the machine I am > presently on. Will this be a problem ? > > > On Tue, 2006-02-07 at 12:20 -0700, Trent Jarvi wrote: >> This is documented in INSTALL with the source. >> > I was wondering where that file was. I will download source and dig it > up. > > Thanks. > Hmm I'm looking at pre17 so this may have changed. (its just what I have on this machine) if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA" // for the IPAQs }; CandidatePortPrefixes=Temp; } So you may need to add "ttyUSB" to that list. RXTX used to enumerate _everything_ see if(osName.equals("Linux-all-ports") But it became less than practical. This is all in RXTXCommDriver.java hmm I just did a cvs update. if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have to get your fingers into the code. We aim for sane defaults. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 13:06:45 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 13:06:45 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139342805.8145.22.camel@zd7280> On Tue, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > Hmm I'm looking at pre17 so this may have changed. (its just what I have > on this machine) > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA" // for the IPAQs > }; > CandidatePortPrefixes=Temp; > } > > > So you may need to add "ttyUSB" to that list. RXTX used to enumerate > _everything_ see if(osName.equals("Linux-all-ports") But it became less > than practical. > > This is all in RXTXCommDriver.java > > hmm I just did a cvs update. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have > to get your fingers into the code. We aim for sane defaults. Excellent. Thanks for taking the time. -- Kim Lux, Diesel Research Inc. From ideiglenes1 at freemail.hu Tue Feb 7 13:53:39 2006 From: ideiglenes1 at freemail.hu (--) Date: Tue, 07 Feb 2006 21:53:39 +0100 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139345619.22534.2.camel@localhost> Hi! I use this code to get all the extra Linux devices. :) if ("Linux".equals(System.getProperty("os.name"))) { System.setProperty("os.name","Linux-all-ports"); } driver = new RXTXCommDriver(); On k, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > On Tue, 7 Feb 2006, Kim Lux wrote: > > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have > to get your fingers into the code. We aim for sane defaults. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From matt.higgins at gmail.com Tue Feb 7 13:45:54 2006 From: matt.higgins at gmail.com (Matt Higgins) Date: Tue, 7 Feb 2006 15:45:54 -0500 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> Message-ID: <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> Sweet this is exactly what I needed. I was searching the archives through marc.theamisgroup they only have archives back to 1/3/05. Should have hit the mailman archive! Thanks a lot! On 2/7/06, Brian Schlining wrote: > > Hi Matt > > The following code works fine on Linux but I never see any data when run > on Windows. This is a cut and paste from the SimpleRead example. > I am attempting to read data from a bar code scanner. I can fire up > HyperTermianl on windows and see that the device is working properly as I > see the barcodes are scanned and echoed back to the terminal. However when I > run the app I don't see any data. It is however associating with the com > port as the informational bits print fine? > > > You're not the only one whose had this problem, I don't know if Trent has > addressed this is the latest release of RXTX but there is a workaround. > Here's the recent thread from the RXTX mailing list regarding this issues: > > Thanasis Delenikas tdelenik at gmail.com > Wed Jan 18 13:56:23 MST 2006 > > * Previous message: [Rxtx] Re: More close() performance fixes > * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] > > Hi all. > (I've subscribed again from my other email account). > > Trent, > > You are right. Linux *always* works, no matter what flow control you set. > Windows *works only* with hardware flow control (I haven't tested what > happens with software XON/XOFF flow control). > > I assume (but I am not certain) that even with no flow control at all, all > platforms should work. Without flow control, you have the risk of bumping > into overflow or framing errors, but that's your (the end programmer, I > mean) problem. > > >From my side, I shouldn't be working without flow control. That was a bug > too... It was some code forgotten from the old times, when I used to work > with phone emulation drivers which didn't support flow control. The > correct > way is to have some flow control enabled and that's why I suppose this is > a > low-severity bug for RxTx. > > I have no idea which platform shows the correct behaviour, since > my knowledge about Linux and the inner workings of these low-level i/o > operations is limited. > > Regards, > Thanasis Delenikas. > > > > > Message: 2 > > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > > From: Trent Jarvi > > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > > To: RXTX Developers and Users > > Message-ID: > > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > > > Hi all, > > > > > > Trent, I have found something. > > > I read your comment about flow control, so I experimented a bit. > > > > > > If you remember, in my sample program I've used no flow control at all > ( > > i.e. > > > Java constant FLOWCONTROL_NONE). > > > > > > Now, during testing, I've switch to hardware inbound flow control (i.e > . > > Java > > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > > beautifully! > > > > > > I think I will switch to H/W flow control and test things for a while, > > but > > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > > > > > Hi Thanasis, > > > > I'm fairly sure you have identified a bug. I would not worry too much > > about what Sun CommAPI w32 defaults are. I think they did more or less > > whatever the port opened with. Just a guess. Linux tries to stomp on > > ports so they are all the same. > > > > So this started out with Linux worked, Windows XP/.. did not as I > recall. > > Something is wrong in rxtx. Do I understand this right? > > > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > > > Perhaps there is something Wayne or I did not understand when we wrote > > that code. I wasnt programming back in the BBS days so modems are not > my > > thing. I have a few questions. > > > > Is the above matrix confirmed by observation? > > Linux just always worked? > > Which one _should_ work? I'm guessing modems work with hardware flow > > control. I'll have to dig around. > > > > The windows flow control changes a couple things with hardware flow > > control. Following the w32 API documentation is confusing sometimes. > > But it looks like Linux could have a bug too. > > Cheers > > Brian Schlining > Software Engineer > http://www.mbari.org > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/9c989144/attachment-0062.html From tjarvi at qbang.org Tue Feb 7 14:06:14 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 14:06:14 -0700 (MST) Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> Message-ID: >> >> You're not the only one whose had this problem, I don't know if Trent has >> addressed this is the latest release of RXTX but there is a workaround. >> Here's the recent thread from the RXTX mailing list regarding this issues: >> I have not. I expect to have access to some test equipment next month and I'll go through all of this. I really don't know whats going on and I need a gold standard. I thought maybe linux was autodetecting the flow control. Your observations would certainly be welcome. I need to talk to Russell King and see what he is doing. Until then I'd just be toying around over a loopback as usual. This is very high on the list though. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 17:25:05 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 17:25:05 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139358305.17994.2.camel@zd7280> My application now works. I installed the libraries and jar from 2.1-7 (Final). portlist.hasMoreElements is no longer false. The application finds the port for /dev/ttyUSB0. Thanks for your help, Trent (et al) Sorry I bothered you with this. Next time I will look in the source first. I didn't think it was an rxtx issue, I thought it was a Linux setup issue . On Tue, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > Hmm I'm looking at pre17 so this may have changed. (its just what I > have > on this machine) > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux > Serial Ports > "ttySA" // for the > IPAQs > }; > > CandidatePortPrefixes=Temp; > } > > > So you may need to add "ttyUSB" to that list. RXTX used to enumerate > _everything_ see if(osName.equals("Linux-all-ports") But it became > less > than practical. > > This is all in RXTXCommDriver.java > > hmm I just did a cvs update. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux > Serial Ports > "ttySA", // for the > IPAQs > "ttyUSB" // for USB > frobs > }; > > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you > have > to get your fingers into the code. We aim for sane defaults. -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 19:21:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 19:21:54 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139358305.17994.2.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> <1139358305.17994.2.camel@zd7280> Message-ID: >Sorry I bothered you with this. Next time I will look in the source >first. I didn't think it was an rxtx issue, I thought it was a Linux >setup issue . Why would you be sorry? I would have done the same. I'm glad it's working :) -- Trent Jarvi tjarvi at qbang.org From tma at mail.island.net Wed Feb 8 13:39:35 2006 From: tma at mail.island.net (Tom Alldread) Date: Wed, 08 Feb 2006 12:39:35 -0800 Subject: [Rxtx] Win32/Linux Serial Port Data Dropouts In-Reply-To: <200602060702.k167255O007882@www.qbang.org> References: <200602060702.k167255O007882@www.qbang.org> Message-ID: <43EA5707.4020200@mail.island.net> Greetings Folks at RXTX: During the last couple of months I have been alternately testing with javax.comm 2 and RXTX 2.1 under Windows XP and CommApi 3 and RXTX 2.1 under Suse 10.0 Linux. In the process I have learned a little about java multi-threading under NetBeans 5 with Profiler. My java (jdk 1.5_06) application is used for data acquisition and provides a graphical display of A-D conversion data received from a 56KBaud serial port. The actual data throughput is about 10KBaud thus it is well below the speed of the port. I use hardware RTS/CTS flow control which can stall the data acquisition sample rate if necessary. This ensures the display computer has the ability to slow the data acquisition rate should it become too busy to accept the regular data flow. Both the serial port buffer and the java read buffer are set at 16KB. Usually the data transfers into the java read buffer are less than 100 bytes unless the data acquisition is recovering from a stall. The data flow normally hesitates after each 5 KB block as a continue command is needed from the display computer to start the drawing of a new graphics display line. Separate threads have been provided for the serial port event monitoring and data processing. The serial port event thread has been given the maximum priority and data processing thread the minimum priority provided by java. Thread yield statements have been placed within all data processing while/for loops as an effort to ensure quick access to CPU cycles for the serial port event thread. I have found that short data transmissions are essentially error free but occasional dropouts occur with continuous data flow especially under Windows XP. ....................................................................................................................................................................................... Linux results: I am happy to report that RXTX 2.1 appears to work very well under Linux although I did notice some errors when the screen savers were running with my dual monitors. I believe this is a local problem associated with my dual graphics which needs further attention. The recent CommApi 3 Linux release from Sun did not work at all with my program. It seemed to send commands out OK but did not receive any data. Although the serial port event triggered the ISR, the input stream appeared filled with nulls and thus did not contain any data. As my understanding is that CommApi 3 was tested with a Red Hat distribution of Linux I wonder if this problem is distro dependent? Although somewhat off topic here I wonder if anyone reading this has had similar experience? .................................................................................................................................................................................. Windows XP results: There are problems with occasional data dropouts which become more frequent as the sampling rate is increased or if the computer becomes busy with other duties. The dropouts typically consist of a half dozen byte block of lost data. It appears the lost bytes never get added to the java input stream. There has not been any indication of garbled data, overruns or framing errors which suggests the UART communications remains solid. Using javax.comm 2 I found that the setting of SerialPort 'enableReceiveThreshold' to 40 and 'enableReceiveTimeout' of 100mS reduced the dropouts error rate significantly. I found that I could not get RXTX 2.1 to function with the aforementioned threshold and timeout settings. The javax.comm 2 interface is consequently performing better for me under Windows than RXTX 2.1. I wonder if anyone here has any suggestions as to what I might try to improve RXTX 2.1? Although my settings are the same as under Suse 10.0, RXTX 2.1 performs much better for me under Linux than any of the alternatives that I have tried under Windows XP . ............................................................................................................................................................................... I would like to establish, based on the experience of others, if I have reached the normally expected performance limit of java serial port communications? Should I expect to achieve virtually error free serial port data input from a continuous stream under Windows XP java software? I am considering changing my protocol to packets with error checking if necessary but would like to know if the dropout problems I am experiencing are typical or not before I take this rather work intensive plunge. Many thanks in advance for any help! Best Regards, Tom Alldread -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.375 / Virus Database: 267.15.2/253 - Release Date: 2006-02-07 From jlaxson at mac.com Wed Feb 8 23:56:48 2006 From: jlaxson at mac.com (John Laxson) Date: Thu, 9 Feb 2006 00:56:48 -0600 Subject: [Rxtx] PortInUseException: Unknown Application on OSX Message-ID: Hi, I've been trying to get RXTX 2.1.7 going on Mac OS X for a while here, and am running up into a wall here. I've tried with pre- compiled and the source version and get the same problem, a gnu.io.PortInUseException: Unknown Application. I have run the fixperms script included with the source distribution, and id shows me as a member of the uucp group, and permissions on /var/spool/uucp are 775 root:uucp. Running a test program (included at the bottom for clarity) lets me enumerate all the serial ports correctly, but trying to open any of them gives the PortInUseException. If it helps, when I try to open a port that's set to make an outgoing bluetooth connection, there is no delay and no connection attempt at all. Thanks, John Laxson PS: The documentation wiki on qbang.org shows 404, and has for a few days now. My test code: public static void main(String[] args) { SerialPort serialPort; try { Enumeration e = CommPortIdentifier.getPortIdentifiers(); CommPortIdentifier ident; while (e.hasMoreElements()) { ident = (CommPortIdentifier)e.nextElement(); System.out.println(ident.getName()); } ident = CommPortIdentifier.getPortIdentifier("/dev/cu.modem"); serialPort = (SerialPort) ident.open("Me", 5000); } catch (Exception e) { e.printStackTrace(); } } From rajesh.invincible at gmail.com Thu Feb 9 03:39:38 2006 From: rajesh.invincible at gmail.com (Rajesh N) Date: Thu, 9 Feb 2006 16:09:38 +0530 Subject: [Rxtx] Re: Move .java Files in gnu.io filesystem hierarchy - Maven (2) In-Reply-To: <43DF21D2.7090200@ngi.it> References: <43DF21D2.7090200@ngi.it> Message-ID: <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Can anybody tell me how to overcome these EXCEPTIONS I AM WORKING ON SERIAL COMMN IN JAVA ON LINUX. 1. " NOT ALL PARAMETERS SUPPORTED BY THE KERNEL" This i came across the following statement inmy prog. SerialP is A SerialPort object SerialP.setSerialPortParams(9600(BAUDRATE),DATABITS_8,STOPBITS_1,PARITY_NONE) 2. NullPointer Exception at Event Dispatch Now i have checked all my object references for a null reference but i found none i have put up my entire code in try catch blocks but still I AM UNABLE TO CATCH THIS EXCEPTION AND HENCE MY APPLICATION CLOSES HOW DOES THESE GO? PLEASE HELP ME IT IS URGENTTTTTTTTTTTTTTTT yours sincerely RAJESH On 1/31/06, Fabio Frumento wrote: > Hi Xavier, > > I don't know maven at all but the directory hierarchy listed buy Trent > is fine for me... > > I'll take a look to maven, it seems an interesting project > > Regards > > Fabio Frumento > > Trent Jarvi wrote: > > On Tue, 31 Jan 2006, Xavier Frisaye wrote: > > > >> Hi all, > >> > >> If you are going to rearrange the src folder, i will propose to use > >> maven 2 and follow its directory structure > >> > (http://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html). > >> > >> Maven 2 simplify java project and give a standard way to make projects > >> (http://maven.apache.org/). > >> We are using it for internal projects and we are very satisfied. > >> > >> Is anybody interested? > >> > >> I'm not an expert in maven 2 (yet) but i'm agree to help using it if > >> you choose to make so. > >> > > > > so this would be: > > > > rxtx-devel/src/main/java/gnu.io > > rxtx-devel/src/test/java/ManIwish.java > > > > I don't use IDEs very much so I'll let others comment. But I don't see > > a problem with that. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Thu Feb 9 09:50:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 9 Feb 2006 09:50:31 -0700 (MST) Subject: [Rxtx] Re: Move .java Files in gnu.io filesystem hierarchy - Maven (2) In-Reply-To: <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Message-ID: On Thu, 9 Feb 2006, Rajesh N wrote: > Can anybody tell me how to overcome these EXCEPTIONS > I AM WORKING ON SERIAL COMMN IN JAVA ON LINUX. > > 1. " NOT ALL PARAMETERS SUPPORTED BY THE KERNEL" > > This i came across the following statement inmy prog. > SerialP is A SerialPort object > SerialP.setSerialPortParams(9600(BAUDRATE),DATABITS_8,STOPBITS_1,PARITY_NONE) > Strange. The parameters you use are the same the port should open with by default. Could you paste the actual exception you are getting? I don't see that in the rxtx source. Also it would help to know the rxtx version. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Fri Feb 10 15:29:05 2006 From: lux at diesel-research.com (Kim Lux) Date: Fri, 10 Feb 2006 15:29:05 -0700 Subject: [Rxtx] One serial port object for both sending and receiving ? Message-ID: <1139610545.18177.4.camel@zd7280> Is it OK to use one SerialPort ojbect (ex Serial Port serialPort;) and use it for both sending and receiving ? For example: ======================================================================== static SerialPort serialPort = null; static OutputStream serialOut = null; static InputStream serialIn = null; // assign it to an outputStream for use try{ serialOut = serialPort.getOutputStream(); System.out.println("Serial output stream has been assigned."); }//try catch(IOException e) { System.out.println("Error: Couldn't assign output stream to serial port."); }//catch //assign it to an inputStream for use try{ serialIn = serialPort.getInputStream(); System.out.println("Serial input stream has been assigned."); }//try catch(IOException e) { System.out.println("Error: Couldn't assign input stream to serial port."); }//catch ======================================================================== -- Kim Lux, Diesel Research Inc. From lux at diesel-research.com Fri Feb 10 21:23:00 2006 From: lux at diesel-research.com (Kim Lux) Date: Fri, 10 Feb 2006 21:23:00 -0700 Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Message-ID: <1139631780.23882.10.camel@zd7280> I've got a problem receiving chars with my version of serialRead, written in an SWT GUI. I had a Java pro have a good look at my code and he can't see anything wrong with it. I can send chars fine. When I receive a char the cpu usage for the app goes to 100% and the code in the serial event handler doesn't get executed. The instructions on the Java Comm Serial API How-To for Linux page state that I must install javacomm. Is that true ? Everything builds without it and I can send chars on rxtx just fine, but I can't receive them. Could this be the problem ? I downloaded and installed javacomm. I was not able to add "Driver=gnuio.RXTXCommDriver to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 installed in /usr/java/jre1.5.0_05. I added comm.jar to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext to the library paths. Is this OK ? Does it matter that I am receiving on /dev/ttyUSB0 ? Thanks. -- Kim Lux, Diesel Research Inc. From lunareclipse03 at web.de Sat Feb 11 09:44:46 2006 From: lunareclipse03 at web.de (lunareclipse03@web.de) Date: Sat, 11 Feb 2006 17:44:46 +0100 Subject: [Rxtx] Question about Serial I/O under Win32 Message-ID: <662084330@web.de> Hello everybody, I have a strange problem with a piece of code I made for myself. No, this is not really concerning rxtx, but nevertheless I post this to the list, hoping that some of you can help me. I've written two libraries, one for linux and one for win32. The linux port works quite well, I can send / receive faxes and / or replay voice messages over the telephone line using a voice modem. But the win32 port of the library causes some trouble. If, for example, I send out a fax with a certain modem under linux, it works well. The fax is complete when it comes out of the fax machine. If I then use the same modem to send out a fax under win32, the fax coming out of the fax machine gets "stuck" halfways, but the sending modem thinks that transmission was ok and drops the connection. The answering fax machine then gives me "error while receiving." The "upper layer" java code MUST be right, because if I do the same thing under linux (using the linux library), everything is alright. Now I have to ask: Can somebody please help me out with this??!? Could it be the case that some kind of flow control or COMMTIMEOUTS setting causes this behaviour? I set flow control to RTS/CTS before sending out a fax. How can I DISABLE flow control? Or what do you think? Can something else cause this problems? Thank you all for your time and PLEASE write back soon. Regards, --Sven Ahlemann Am Waldrand 31 45721 Haltern am See Germany ______________________________________________________________ Verschicken Sie romantische, coole und witzige Bilder per SMS! Jetzt bei WEB.DE FreeMail: http://f.web.de/?mc=021193 From lux at diesel-research.com Sat Feb 11 10:06:52 2006 From: lux at diesel-research.com (Kim Lux) Date: Sat, 11 Feb 2006 10:06:52 -0700 Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: <1139631780.23882.10.camel@zd7280> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> <1139631780.23882.10.camel@zd7280> Message-ID: <1139677612.3431.5.camel@zd7280> More on this problem. I copied and pasted simpleRead into a console based Eclipse project and I've got the same result, except that cpu usage doesn't go to 100%. I'm beginning to think there is an issue in rxtx. My imports for simpleRead are: ============================ import gnu.io.*; import java.util.*; //import javax.comm.*; import java.io.*; =========================== Any ideas ? I am trying to read from /dev/ttyUSB0 using a serial to USB adapter which has worked well with minicom and gtkterm. Thanks. On Fri, 2006-02-10 at 21:23 -0700, Kim Lux wrote: > I've got a problem receiving chars with my version of serialRead, > written in an SWT GUI. > > I had a Java pro have a good look at my code and he can't see anything > wrong with it. > > I can send chars fine. When I receive a char the cpu usage for the app > goes to 100% and the code in the serial event handler doesn't get > executed. > > The instructions on the Java Comm Serial API How-To for Linux page state > that I must install javacomm. Is that true ? Everything builds without > it and I can send chars on rxtx just fine, but I can't receive them. > Could this be the problem ? > > I downloaded and installed javacomm. I was not able to add > "Driver=gnuio.RXTXCommDriver > to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not > have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 > installed in /usr/java/jre1.5.0_05. I added comm.jar > to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext > to the library paths. Is this OK ? > > Does it matter that I am receiving on /dev/ttyUSB0 ? > > Thanks. > -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Sun Feb 12 21:01:33 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:01:33 -0700 (MST) Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: <1139677612.3431.5.camel@zd7280> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> <1139631780.23882.10.camel@zd7280> <1139677612.3431.5.camel@zd7280> Message-ID: I suspect what is happening is the select() is breaking out in the native code but the driver does not have support for notifying there are X bytes available. On some traditional Unix based systems, the only way you know data is available is the fd status changes and do an FIORDCHK ioctl. Or perhaps the only thing you can know is the fd status changed. It would take reading through the kernel driver code to know for sure. So on USB, depending upon the driver, the same may need to be done or the driver improved a bit if possible to support. Polling reads will also work but don't use the event driven model of CommAPI which isnt acceptable in the long run. The 100% cpu usage can then be explained because select no longer blocks until the data is read; the eventLoop spins loose. You can put a well placed sleep but rxtx only expects those are needed when it knows data is available. This may not be a super simple thing to understand and fix. I do have ideas to get you started. I'm going to be short on time the next couple weeks. I expect to put some good time in and answer some other questions I saw around the 25th. For now, I'd look at the following and go from there with the hints I've given. JNIEXPORT jint JNICALL RXTXPort(nativeavailable)( JNIEnv *env, jobject jobj ) { int fd = get_java_var( env, jobj,"fd","I" ); int result; /* char message[80]; ENTER( "RXTXPort:nativeavailable" ); On SCO OpenServer FIONREAD always fails for serial devices, so try ioctl FIORDCHK instead; will only tell us whether bytes are available, not how many, but better than nothing. This turns out to be true on Solaris also. taj. */ #ifdef FIORDCHK /* __unixware__ __sun__ probably others */ result = ioctl(fd, FIORDCHK, 0); #else if( ioctl( fd, FIONREAD, &result ) < 0 ) { goto fail; } #endif /* FIORDCHK */ On Sat, 11 Feb 2006, Kim Lux wrote: > > More on this problem. I copied and pasted simpleRead into a console > based Eclipse project and I've got the same result, except that cpu > usage doesn't go to 100%. I'm beginning to think there is an issue in > rxtx. > > My imports for simpleRead are: > > ============================ > import gnu.io.*; > import java.util.*; > //import javax.comm.*; > import java.io.*; > =========================== > > Any ideas ? I am trying to read from /dev/ttyUSB0 using a serial to > USB adapter which has worked well with minicom and gtkterm. > > Thanks. > > > > On Fri, 2006-02-10 at 21:23 -0700, Kim Lux wrote: >> I've got a problem receiving chars with my version of serialRead, >> written in an SWT GUI. >> >> I had a Java pro have a good look at my code and he can't see anything >> wrong with it. >> >> I can send chars fine. When I receive a char the cpu usage for the app >> goes to 100% and the code in the serial event handler doesn't get >> executed. >> >> The instructions on the Java Comm Serial API How-To for Linux page state >> that I must install javacomm. Is that true ? Everything builds without >> it and I can send chars on rxtx just fine, but I can't receive them. >> Could this be the problem ? >> >> I downloaded and installed javacomm. I was not able to add >> "Driver=gnuio.RXTXCommDriver >> to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not >> have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 >> installed in /usr/java/jre1.5.0_05. I added comm.jar >> to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext >> to the library paths. Is this OK ? >> >> Does it matter that I am receiving on /dev/ttyUSB0 ? >> >> Thanks. >> > From tjarvi at qbang.org Sun Feb 12 21:03:30 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:03:30 -0700 (MST) Subject: [Rxtx] One serial port object for both sending and receiving ? In-Reply-To: <1139610545.18177.4.camel@zd7280> References: <1139610545.18177.4.camel@zd7280> Message-ID: On Fri, 10 Feb 2006, Kim Lux wrote: > > Is it OK to use one SerialPort ojbect (ex Serial Port serialPort;) and > use it for both sending and receiving ? > > For example: > > ======================================================================== > static SerialPort serialPort = null; > static OutputStream serialOut = null; > static InputStream serialIn = null; > > > > > // assign it to an outputStream for use > try{ > serialOut = serialPort.getOutputStream(); > System.out.println("Serial output stream has been assigned."); > }//try > catch(IOException e) > { > System.out.println("Error: Couldn't assign output stream to serial > port."); > }//catch > > > //assign it to an inputStream for use > try{ > serialIn = serialPort.getInputStream(); > System.out.println("Serial input stream has been assigned."); > }//try > catch(IOException e) > { > System.out.println("Error: Couldn't assign input stream to serial > port."); > }//catch This should be fine. In fact trying to do it another way will probably not work as you will run into lockfile issues. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun Feb 12 21:13:13 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:13:13 -0700 (MST) Subject: [Rxtx] Question about Serial I/O under Win32 In-Reply-To: <662084330@web.de> References: <662084330@web.de> Message-ID: On Sat, 11 Feb 2006 lunareclipse03 at web.de wrote: > Hello everybody, > > I have a strange problem with a piece of code I made for myself. No, > this is not really concerning rxtx, but nevertheless I post this to the > list, hoping that some of you can help me. I've written two libraries, > one for linux and one for win32. The linux port works quite well, I can > send / receive faxes and / or replay voice messages over the telephone > line using a voice modem. But the win32 port of the library causes some > trouble. If, for example, I send out a fax with a certain modem under > linux, it works well. The fax is complete when it comes out of the fax > machine. If I then use the same modem to send out a fax under win32, the > fax coming out of the fax machine gets "stuck" halfways, but the sending > modem thinks that transmission was ok and drops the connection. The > answering fax machine then gives me "error while receiving." The "upper > layer" java code MUST be right, because if I do the same thing under > linux (using the linux library), everything is alright. Now I have to > ask: Can somebody please help me out with this??!? Could it be the case > that some kind of flow control or COMMTIMEOUTS setting causes this > behaviour? I set flow control to RTS/CTS before sending out a fax. How > can I DISABLE flow control? Or what do you think? Can something else > cause this problems? Thank you all for your time and PLEASE write back > soon. > Hi Sven I'm not too willing to talk about flow control at the low level until I confirm some things with test equipment later. It is not clear if you are using rxtx or writing your own native code. So I'm not sure how to answer much of this :) If you are wondering how to change the flow control using rxtx from java, The BlackBox example from Sun flips this back and forth. SerialPort.java in rxtx 2.1 uses the following: SerialPort.java: public static final int FLOWCONTROL_NONE =0; SerialPort.java: public static final int FLOWCONTROL_RTSCTS_IN =1; SerialPort.java: public static final int FLOWCONTROL_RTSCTS_OUT =2; SerialPort.java: public static final int FLOWCONTROL_XONXOFF_IN =4; SerialPort.java: public static final int FLOWCONTROL_XONXOFF_OUT=8; So if you set flowcontrol to RTSCTS, you can set it to NONE to turn it off. If you are looking for how to do it in native code, the rxtx Source is SerialImp.c (unix/linux/mac os x/w32) and termios.c (w32 only with SerialImp.c) You can track the code: SerialImp.c:JNIEXPORT void JNICALL RXTXPort(setflowcontrol)( JNIEnv *env, jobject jobj, jint flowmode ) termios.c:int tcgetattr( int fd, struct termios *s_termios ) termios.c:int tcsetattr( int fd, int when, struct termios *s_termios ) There may be a problem in the rxtx flow control code though. Rather than guess, I want to test this with a gold standard. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Feb 6 00:00:16 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 00:00:16 -0700 (MST) Subject: [Rxtx] wiki delay until tomorrow night. In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: On Sun, 5 Feb 2006, Trent Jarvi wrote: > On Sun, 5 Feb 2006, Kim Lux wrote: > >> usb ? Tell me more... I need that too. > > usb is a very proper design. Thats all it is. > Maybe rxtx could help usb. But it would start with helping bring back the community that was already there. It's not something I'd love to do but maybe its the right thing to do. It would probably take 2 years to do right. But maybe thats better than what we have now. I honestly don't know what IBM is doing which could just run over everything. Just some thoughts after some fine german wine. -- Trent Jarvi tjarvi at qbang.org From gadelavega at yahoo.com.ar Mon Feb 6 02:17:05 2006 From: gadelavega at yahoo.com.ar (Gonzalo A. de la Vega) Date: Mon, 06 Feb 2006 10:17:05 +0100 Subject: [Rxtx] Serial port ownership question In-Reply-To: References: <20060205113618.30274.qmail@web53501.mail.yahoo.com> <1139157422.4553.9.camel@zd7280> <1139158698.4936.9.camel@zd7280> Message-ID: <43E71411.4050402@yahoo.com.ar> On my Fedora Core 4: ls -l /dev/ttyS* crw-rw---- 1 root uucp 4, 64 Feb 6 2006 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Feb 6 2006 /dev/ttyS1 ... and: grep "ttyUSB" /etc/udev/rules.d/50-udev.rules KERNEL=="ttyUSB*", GROUP="uucp", MODE="0660" So anyone in the "uucp" group can use serial ports. On Gentoo the group is "tty". Trent Jarvi escribi?: > > > On Sun, 5 Feb 2006, Dr. Douglas Lyon wrote: > >> I can confirm that this is the case (only root ownership of >> serial ports, under fedora 4). >> Wow, what were they thinking?! >> - DL >> >>> I've found that the newer kernels have the serial ports owned by root. >>> For example, >>> >>> $ls -al /dev/tty* >>> crw-rw-rw- 1 root root 5, 0 Feb 5 02:06 /dev/tty >>> crw-rw---- 1 root root 4, 0 Feb 5 02:06 /dev/tty0 >>> crw------- 1 root root 4, 1 Feb 5 09:07 /dev/tty1 >>> crw-rw---- 1 root tty 4, 10 Feb 5 02:06 /dev/tty10 >>> crw-rw---- 1 root tty 4, 11 Feb 5 02:06 /dev/tty11 >>> ... > > > This is just not a problem jcp or such are going to solve. Its a > platform spitwad fight. But do look at pam. In fact thats what Sun > is doing too. Maybe Linux followed their lead.. I'm not a pam guy. > I've spent 16 hours trying to understand it but your users wont :) > > Solution? I have no clue. Its two tangent mentalities from my > perspective. > > -- > Trent Jarvi > tjarvi at qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mtnvega at yahoo.com.br Mon Feb 6 05:35:43 2006 From: mtnvega at yahoo.com.br (Luiz Jr) Date: Mon, 6 Feb 2006 12:35:43 +0000 (GMT) Subject: [Rxtx] Documentation Wiki In-Reply-To: <1139157422.4553.9.camel@zd7280> Message-ID: <20060206123543.57256.qmail@web53515.mail.yahoo.com> Hello, Thank you for you answer, but so the usage of the API is pretty much like the Java Communications Api? If yes, what version of the Java Comm Api? Thank you, Luiz A. Brandao Jr Kim Lux escreveu: On Sun, 2006-02-05 at 08:36 -0300, Luiz Jr wrote: > Hello, > > I want to start using the RXTX libraries, but I would to know how, > since I can not access the documentation wiki page I just started using them yesterday. Below is how I installed the libraries, if that helps. I used snippets of code from the SimpleWrite application here to get me going. http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html Instead of "import javax.comm.*;", use "import gnu.io.*;" which is gotten from RXTXcomm.jar, which you will need to include in your project references. I am working in Eclipse. BTW: there is no way to open a port without going through the port list and finding it. Maybe sometime in the future someone (me ?) will write a method called openSerialPort that allows the user to give a port identifier, such as "/dev/tty1" and return a port ready to use. It wouldn't take much to write that and it would save users a lot of code. Hope this helps. ======================================================================= 1) Figure out which java you are running, incase there is more than one installed. $ java -version java version "1.5.0_05" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_05-b05) Java HotSpot(TM) Client VM (build 1.5.0_05-b05, mixed mode, sharing) 2) Find all the jre directories and the one from which you are currently running. kfind (jre) 3) cd to that directory plus /lib/i386 cd /usr/java/jre1.5.0_05/lib/i386 4) Copy the library files (*.so) to that directory. cp /home/krlux/Desktop/'Java Controls'/rxtx-linux/bin/* . 5) Check that the copy was successful ls librxtx* librxtxI2C.so librxtxRaw.so librxtxSerial.so librxtxParallel.so librxtxRS485.so 6) cd to the /lib/ext directory for your java. cd /usr/java/jre1.5.0_05/lib/ext 7) Copy the Jar files there cp /home/krlux/Desktop/'Java Controls'/rxtx-linux/lib/ext/* . 8) Check that it was successful ls RXTX* RXTXcomm.jar Rxtx is now installed on your machine ready to use. =================================================================== -- Kim Lux, Diesel Research Inc. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx --------------------------------- Yahoo! Acesso Gr?tis - Internet r?pida e gr?tis. Instale o discador agora! -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/544aa403/attachment-0063.html From lyon at docjava.com Mon Feb 6 05:49:34 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 06 Feb 2006 07:49:34 -0500 Subject: [Rxtx] wiki delay until tomorrow night. In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: Hi All, I have often thought about USB drivers being needed. For example, the ironman watch will not interface to a mac (windows only). It is USB. My dymo label writer has no Java driver (native only). Etc. Most cheap web cameras are USB (and Java drivers go through JAI, if it supports the camera at all). The JAI code shows how sun did the USB drivers. You have to be a member of the jai project to download the source code. https://jai.dev.java.net has the jai distro. And then you are not allowed to redistribute it. However, we can all learn from it (if so inclined). Basically: cvs -d :pserver:lyon at cvs.dev.java.net:/cvs login cvs -d :pserver:lyon at cvs.dev.java.net:/cvs checkout jai-core You will need to user your own uid and pw to get in. The ant build has over 100 warnings from sun deprecations of its own code. You might say that they were hoisted on their own Picard ;) One interesting thing is that they support several platforms: linux-amd64 64-bit Linux-AMD64 linux-i586 32-bit Linux-x86 solaris-amd64 64-bit Solaris-AMD64 solaris-i586 32-bit Solaris-x86 solaris-sparc 32-bit Solaris-SPARC solaris-sparcv9 64-bit Solaris-SPARC windows-i586 32-bit Windows-x86 Thus, ant is used to provide a multi-platform native method distro. Neat. How do they do it? check this out: And: The core download does not contain any C source code (it was all pre-built). Basically, they are just copying .so and .dll files into build directories. I would love to see the C code for this...but Sun does not post it on the https://jai.dev.java.net site. I don't know why...Perhaps I missed it. - Doug >On Sun, 5 Feb 2006, Trent Jarvi wrote: > >>On Sun, 5 Feb 2006, Kim Lux wrote: >> >>>usb ? Tell me more... I need that too. >> >>usb is a very proper design. Thats all it is. >> > >Maybe rxtx could help usb. But it would start with helping bring >back the community that was already there. > >It's not something I'd love to do but maybe its the right thing to do. > >It would probably take 2 years to do right. But maybe thats better >than what we have now. > >I honestly don't know what IBM is doing which could just run over everything. > >Just some thoughts after some fine german wine. > >-- >Trent Jarvi >tjarvi at qbang.org > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tdelenik at gmail.com Mon Feb 6 05:56:32 2006 From: tdelenik at gmail.com (Thanasis Delenikas) Date: Mon, 6 Feb 2006 14:56:32 +0200 Subject: Fwd: [Rxtx] Documentation Wiki In-Reply-To: <1139157422.4553.9.camel@zd7280> References: <20060205113618.30274.qmail@web53501.mail.yahoo.com> <1139157422.4553.9.camel@zd7280> Message-ID: <310a1a930602060456t129f1dc6p5f2b908f13ab5a0b@mail.gmail.com> Hello all, Kim, this is a snippet from the code I use. The closest to directly opening a specific port without enumeration. << ... portId = CommPortIdentifier.getPortIdentifier(getPort()); serialPort = (SerialPort) portId.open("jSMSEngine", 1971); ... >> where getPort() return the string identifier of the port, i.e. "/dev/ttyS0" or "COM1" or whatever. Thanasis. ---------- Forwarded message ---------- From: Kim Lux Date: Feb 5, 2006 6:37 PM Subject: Re: [Rxtx] Documentation Wiki To: RXTX Developers and Users BTW: there is no way to open a port without going through the port list and finding it. Maybe sometime in the future someone (me ?) will write a method called openSerialPort that allows the user to give a port identifier, such as "/dev/tty1" and return a port ready to use. It wouldn't take much to write that and it would save users a lot of code. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/182ab5b8/attachment-0063.html From tjarvi at qbang.org Mon Feb 6 11:53:57 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 11:53:57 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: On Mon, 6 Feb 2006, Dr. Douglas Lyon wrote: > Hi All, > I have often thought about USB drivers being needed. > For example, the ironman watch will not interface > to a mac (windows only). It is USB. > My dymo label writer has no Java driver (native only). > Etc. > Most cheap web cameras are USB (and Java drivers go > through JAI, if it supports the camera at all). > The JAI code shows how sun did the USB drivers. > You have to be a member of the jai project to download > the source code. > https://jai.dev.java.net has the jai distro. > And then you are not allowed to redistribute it. However, > we can all learn from it (if so inclined). Basically: > cvs -d :pserver:lyon at cvs.dev.java.net:/cvs login > cvs -d :pserver:lyon at cvs.dev.java.net:/cvs checkout jai-core > You will need to user your own uid and pw to get in. > The ant build has over 100 warnings from sun deprecations > of its own code. > > You might say that they were hoisted on their own Picard ;) > > One interesting thing is that they support several platforms: > linux-amd64 64-bit Linux-AMD64 > linux-i586 32-bit Linux-x86 > solaris-amd64 64-bit Solaris-AMD64 > solaris-i586 32-bit Solaris-x86 > solaris-sparc 32-bit Solaris-SPARC > solaris-sparcv9 64-bit Solaris-SPARC > windows-i586 32-bit Windows-x86 > Thus, ant is used to provide a multi-platform native method distro. > Neat. > How do they do it? > check this out: > > > > > > > > > > > > > And: > > > > > > > > > > The core download does not contain any C source code (it was all pre-built). > Basically, they are just copying .so and .dll files into build directories. > > I would love to see the C code for this...but Sun does not post it on the > https://jai.dev.java.net site. > > I don't know why...Perhaps I missed it. > > - Doug > > I've looked at moving rxtx to Ant builds. I think that would help IDEs a great deal. I requested a evalutation desk copy the O'Reilly Ant book for some j2ee material I was teaching. http://www.oreilly.com/catalog/anttdg/ It has a one sentence mention of JNI. So there was not luck there. I saw that there is another Ant book that does mention JNI more. I can't find it now. Ant must be able to support it with extensions. http://ant.apache.org/manual/OptionalTasks/javah.html What the auto(break :) tools do in the rxtx build is 4 things really. 1) gcc compile flags 2) ld compile flags 3) config.h 4) compile flags for customizing rxtx (lockfiles, ...) See 1 All of this information except 4 can be static once obtained. So I'm not attached to the auto tools. If I could find an example of Ant being used for JNI code, I'd be one of the first to start moving that direction. Maybe someone saw an example someplace. The other thing we have not completed discussing is the directory structure. There is interest in making rxtx more IDE friendly. I get more mail about that off the list than how to install rxtx. And I see we have Ken Thompson in da house :) He is our trusted CVS maintainer and the guy that purchased the rxtx.org domain. Old community. We will need Ken for changing the directory structure of source. I would like to open up discussion about both of these as it is more than time. The problem is I have little experience with Ant and even less with IDEs. It would be nice if we could work with Eclipse and NetBeans. http://www.netbeans.org/ (sun and some community) http://www.eclipes.org (ibm,rhat,... perhaps more community) http://maven.apache.org/what-is-maven.html (apache. It is community) borland should sortof be here too but I think thats covered in eclipse. >From what I understand so far, we should morph rxtx to support those three maybe trusting apaches lead with maven. But I use vi. I have little to no clues beyond what people have fed me. Can we agree that thats the right direction to go? -- Trent Jarvi tjarvi at qbang.org From brian at mbari.org Mon Feb 6 14:57:50 2006 From: brian at mbari.org (Brian Schlining) Date: Mon, 6 Feb 2006 13:57:50 -0800 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> > The other thing we have not completed discussing is the directory > structure. There is interest in making rxtx more IDE friendly. I > get more mail about that off the list than how to install rxtx. > > And I see we have Ken Thompson in da house :) He is our trusted > CVS maintainer and the guy that purchased the rxtx.org domain. Old > community. We will need Ken for changing the directory structure of > source. > > I would like to open up discussion about both of these as it is > more than time. The problem is I have little experience with Ant > and even less with IDEs. It would be nice if we could work with > Eclipse and NetBeans. > > http://www.netbeans.org/ (sun and some community) > http://www.eclipes.org (ibm,rhat,... perhaps more community) > http://maven.apache.org/what-is-maven.html (apache. It is community) > borland should sortof be here too but I think thats covered in > eclipse. > >> From what I understand so far, we should morph rxtx to support >> those three > maybe trusting apaches lead with maven. But I use vi. I have > little to no clues beyond what people have fed me. > Maven likes the directory structure below for Java code. (From http:// maven.apache.org/guides/getting-started/index.html) This structure works fine with ant, netbeans, and eclipse. rxtx_root_directory `-- src |-- main | `-- java | `-- gnu | `-- io `-- test `-- java `-- gnu `-- io Brian Schlining Software Engineer http://www.mbari.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/d9451eba/attachment-0063.html From tjarvi at qbang.org Mon Feb 6 15:11:45 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 15:11:45 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: > rxtx_root_directory > `-- src > |-- main > | `-- java > | `-- gnu > | `-- io > `-- test > `-- java > `-- gnu > `-- io > >From what I understand this will just be good. For me it makes no difference. So lets do the rxtx thing. Let if fester for two weeks and if nobody objects, we will do it. I'm not doing this because I care. I'm doing this to eliminate much of my inbox. But test... man is rxtx lacking there in the community aspect. It is covered but not right. _maybe_ I can change that this year. -- Trent Jarvi tjarvi at qbang.org (cat hurding since 1997) From lux at diesel-research.com Mon Feb 6 21:38:49 2006 From: lux at diesel-research.com (Kim Lux) Date: Mon, 06 Feb 2006 21:38:49 -0700 Subject: [Rxtx] How can I use Lock Files with rxtx (in FC4) ? Message-ID: <1139287129.17031.3.camel@zd7280> I am now running an rxtx application on FC4. I am getting: ========================================================= check_group_uucp(): error testing lock file creation Error details: Permission denied check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL ========================================================= $ ls -al /var/lock total 32 drwxrwxr-x 4 root lock 4096 Feb 6 16:04 . drwxr-xr-x 24 root root 4096 Nov 14 01:19 .. drwx------ 2 root root 4096 Apr 27 2005 lvm drwxr-xr-x 2 root root 4096 Feb 6 16:04 subsys How do I fix this for regulator users ? -- Kim Lux, Diesel Research Inc. From dmarkman at mac.com Mon Feb 6 22:24:44 2006 From: dmarkman at mac.com (Dmitry Markman) Date: Tue, 7 Feb 2006 00:24:44 -0500 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: if I understands the issue right in order to be able to use ant for c/c++ compilation you have to install ant's cc task http://ant-contrib.sourceforge.net/cc.html it looks like it should work on mac os x (authors claim, that it's platform independent) but I never tested so all you have to do it's providing right command line for the gcc compiler On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: >> rxtx_root_directory >> `-- src >> |-- main >> | `-- java >> | `-- gnu >> | `-- io >> `-- test >> `-- java >> `-- gnu >> `-- io >> > > >> From what I understand this will just be good. > > For me it makes no difference. So lets do the rxtx thing. Let if > fester for two weeks and if nobody objects, we will do it. > > I'm not doing this because I care. I'm doing this to eliminate > much of my inbox. > > But test... man is rxtx lacking there in the community aspect. It > is covered but not right. _maybe_ I can change that this year. > > -- > Trent Jarvi > tjarvi at qbang.org > (cat hurding since 1997) > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx Dmitry Markman From lux at diesel-research.com Mon Feb 6 23:20:15 2006 From: lux at diesel-research.com (Kim Lux) Date: Mon, 06 Feb 2006 23:20:15 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? Message-ID: <1139293215.3689.4.camel@zd7280> I'm running the code below. portlist.hasMoreElements() is false. /dev has ports in it as listed below. What am I doing wrong ? ========================================================== // Step through the list of ports until we find one that matches // the one we are looking for. portList = CommPortIdentifier.getPortIdentifiers(); while(portList.hasMoreElements()) { portID = (CommPortIdentifier) portList.nextElement(); // if (portID.getName().equals("/dev/ttyUSB0")) { myTA.append("Serial port ttyUSB0 has been found\n"); break; }// if portID equals... }// End of while... ========================================================== ls -al /dev/tty* crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 ... crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 -- Kim Lux, Diesel Research Inc. From david.garnier at trusted-logic.com Tue Feb 7 00:46:30 2006 From: david.garnier at trusted-logic.com (David Garnier) Date: Tue, 07 Feb 2006 08:46:30 +0100 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: <43E85056.2090608@trusted-logic.com> Hello, I think that the make-based build process is fine as it is, apart from the location of the Java source files. It is true that putting the Java source in a directory structure that map 1-to-1 to the Java package structure is the norm and should make it easier for everyone to modify the Java source, with or without an IDE. Ant is a good tool, but in the RXTX case I fail to see the advantage of using it compared to the current make-based process. As Trent said, they are more pressing issues, like testing. Regards, David Dmitry Markman wrote: > if I understands the issue right > in order to be able to use ant for c/c++ compilation > you have to install ant's cc task > http://ant-contrib.sourceforge.net/cc.html > > it looks like it should work on mac os x > (authors claim, that it's platform independent) > but I never tested > > so all you have to do it's providing right command line > for the gcc compiler > > > > > On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: > >>> rxtx_root_directory >>> `-- src >>> |-- main >>> | `-- java >>> | `-- gnu >>> | `-- io >>> `-- test >>> `-- java >>> `-- gnu >>> `-- io >>> >> >> >>> From what I understand this will just be good. >> >> For me it makes no difference. So lets do the rxtx thing. Let if >> fester for two weeks and if nobody objects, we will do it. >> >> I'm not doing this because I care. I'm doing this to eliminate much >> of my inbox. >> >> But test... man is rxtx lacking there in the community aspect. It is >> covered but not right. _maybe_ I can change that this year. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> (cat hurding since 1997) From tjarvi at qbang.org Tue Feb 7 01:11:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 01:11:31 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <43E85056.2090608@trusted-logic.com> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: On Tue, 7 Feb 2006, David Garnier wrote: > Hello, > > I think that the make-based build process is fine as it is, apart from the location of the Java > source files. It is true that putting the Java source in a directory structure that map 1-to-1 to > the Java package structure is the norm and should make it easier for everyone to modify the Java > source, with or without an IDE. > > Ant is a good tool, but in the RXTX case I fail to see the advantage of using it compared to the > current make-based process. As Trent said, they are more pressing issues, like testing. > Hi David I have more experience with testing rxtx than I can talk about. But let it be known, rxtx has gone trough 100's of hours of testing. We are hobby folks interested in toys but there is more. rxtx has had some of the best guidance in the industry there. This is not an easy thing. I may be able to come back in a month from the other side of the corperate fence and help. I suspect the tests could just be made public but they are in a very unusual environment that just wont work in a wider sense. This is something I'll be trying to change. At one point it was agreed we could just make the results public so this isnt just noise.. There is interest and I think its safe to mention that much. The big problem with testing in the past is most of it is done with a loopback connection. So we *still* have major questions regarding things like flow control. rxtx talks to itself over a loopback and it works. regardless of right or wrong. This requires more thought to be done right. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Feb 7 02:46:34 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 02:46:34 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: > The big problem with testing in the past is most of it is done with a > loopback connection. So we *still* have major questions regarding things > like flow control. rxtx talks to itself over a loopback and it works. > regardless of right or wrong. With serial communication there are gold standards. ckermit is probably a definitive 'standard.' Maybe its possible to do ping/pong tests with ckermit? Is it scriptable? There are known issues in rxtx. Probably the worst is some threading issues regarding some JREs with multiple JNI threads setting java variables. Man did I get schooled there. Just switch the c functions to returning variables and things go away. Sometimes they work fine, sometimes they blow up. Without understanding everything, somehow rhat got it right and debian (and especially gentoo) grabbed kernel patches causing all sort of harm. Its not hard to fix once you understand whats going on but nearly impossible to track with a debugger. So I have a good idea what 2.1-8 will have outside of the IDE modifications. rxtx 2.1-7 is a release for everyone to sync with. Its not even as stable as -pre17 as far as I know - I ran no test suites. I'll be chasing it too. We just had so many contributions that it was time. It seriously broke internal scheduals but thats a great thing :) The other thing I want to do in 2.1-8 is automagic baud rates. It turns out lots of shops are doing really funky baud rates for things like automobile test equipment. It is possible but it requires a fair amount of change in the native code. Is anyone looking at this? -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Feb 7 02:57:21 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 07 Feb 2006 04:57:21 -0500 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <43E85056.2090608@trusted-logic.com> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: Hi All, I agree, testing is very important. The problem I have been trying to address is related to cross-platform testing and the robust nature of the installs. Typically, I visit 3 platforms to deploy my product, windows, linux and mac. A build is performed on each platform. The idea that you can build for many platforms from one copy the source code seems attractive. This should enable synchronized deployments of identical code. The question of how to achieve this goal remains open. As Trent mentioned, this is hard. Perhaps Ant will help here (but perhaps not). Ant does seem to help with running unit tests. However, it does not help with multi-platform tests. For that you need many machines and different operating environments. Toward that end, I have created a multi-platform test that can be run from web start, located at: http://show.docjava.com:8086/book/cgij/code/jnlp/serialPort.PortTest.jnlp This is interesting because many people in the community can run the test and we can improve the test, as time permits. No, it is not a perfect solution, however, the idea does help with multi-platform tests using many machines and different operating environments. If the group has a good test for a general serial port set-ups, i would be happy to deploy it, for general evaluation using web start. And as for ANT, it is just an idea. Not all my ideas are good ones! - Doug >Hello, > >I think that the make-based build process is fine as it is, apart >from the location of the Java >source files. It is true that putting the Java source in a directory >structure that map 1-to-1 to >the Java package structure is the norm and should make it easier for >everyone to modify the Java >source, with or without an IDE. > >Ant is a good tool, but in the RXTX case I fail to see the advantage >of using it compared to the >current make-based process. As Trent said, they are more pressing >issues, like testing. > >Regards, >David > >Dmitry Markman wrote: >> if I understands the issue right >> in order to be able to use ant for c/c++ compilation >> you have to install ant's cc task >> http://ant-contrib.sourceforge.net/cc.html >> >> it looks like it should work on mac os x >> (authors claim, that it's platform independent) >> but I never tested >> >> so all you have to do it's providing right command line >> for the gcc compiler >> >> >> >> >> On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: >> >>>> rxtx_root_directory >>>> `-- src >>>> |-- main >>>> | `-- java >>>> | `-- gnu >>>> | `-- io >>>> `-- test >>>> `-- java >>>> `-- gnu >>>> `-- io >>>> >>> >>> >>>> From what I understand this will just be good. >>> >>> For me it makes no difference. So lets do the rxtx thing. Let if >>> fester for two weeks and if nobody objects, we will do it. >>> >>> I'm not doing this because I care. I'm doing this to eliminate much >>> of my inbox. >>> >>> But test... man is rxtx lacking there in the community aspect. It is >>> covered but not right. _maybe_ I can change that this year. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> (cat hurding since 1997) > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From matt.higgins at gmail.com Tue Feb 7 08:28:34 2006 From: matt.higgins at gmail.com (Matt Higgins) Date: Tue, 7 Feb 2006 10:28:34 -0500 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final Message-ID: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? import java.io.*; import java.util.*; import gnu.io.*; public class MySimpleRead implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; public static void main(String[] args) { boolean portFound = false; String defaultPort = "COM1"; if (args.length > 0) { defaultPort = args[0]; } portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; MySimpleRead reader = new MySimpleRead(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } } public MySimpleRead() { try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) { e.printStackTrace(); } try { inputStream = serialPort.getInputStream(); } catch (IOException e) { e.printStackTrace(); } try { serialPort.addEventListener(this); } catch (TooManyListenersException e) { e.printStackTrace(); } try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { e.printStackTrace(); } System.out.println("Baud is " + serialPort.getBaudRate()); System.out.println("Bits is " + serialPort.getDataBits()); System.out.println("Stop is " + serialPort.getStopBits()); System.out.println("Par is " + serialPort.getParity()); serialPort.notifyOnDataAvailable(true); readThread = new Thread(this); readThread.start(); } public void run() { // Thread.sleep(20000); //} catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { System.out.println("An event occurred " + event.getEventType()); switch (event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: byte[] readBuffer = new byte[20]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } System.out.print(new String(readBuffer)); } catch (IOException e) {} break; } } } --------------- Result on windows ------------------------------ Stable Library ============================================================== Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port:: COM1 Baud is 9600 Bits is 8 Stop is 1 Par is 0 ----------------- End Results ----------------------------------------- ------------------ Result on Linux ----------------------------------- Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 Found port: /dev/ttyS0 Baud is 9600 Bits is 8 Stop is 1 Par is 0 An event occurred 1 043100066224 ------------------ End Results --------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/a1431630/attachment-0063.html From brian at mbari.org Tue Feb 7 09:48:37 2006 From: brian at mbari.org (Brian Schlining) Date: Tue, 7 Feb 2006 08:48:37 -0800 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> Message-ID: <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> Hi Matt > The following code works fine on Linux but I never see any data > when run on Windows. This is a cut and paste from the SimpleRead > example. > I am attempting to read data from a bar code scanner. I can fire > up HyperTermianl on windows and see that the device is working > properly as I see the barcodes are scanned and echoed back to the > terminal. However when I run the app I don't see any data. It is > however associating with the com port as the informational bits > print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. Cheers Brian Schlining Software Engineer http://www.mbari.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/16d07f37/attachment-0063.html From lux at diesel-research.com Tue Feb 7 11:59:58 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 11:59:58 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139293215.3689.4.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> Message-ID: <1139338798.8145.4.camel@zd7280> Any ideas on this ? Any reason why portList.hasMoreElements() should be false even though there are devices in /dev ? On Mon, 2006-02-06 at 23:20 -0700, Kim Lux wrote: > I'm running the code below. > > portlist.hasMoreElements() is false. > > /dev has ports in it as listed below. > > What am I doing wrong ? > > > ========================================================== > // Step through the list of ports until we find one that matches > // the one we are looking for. > > portList = CommPortIdentifier.getPortIdentifiers(); > > while(portList.hasMoreElements()) > { > portID = (CommPortIdentifier) portList.nextElement(); // > if (portID.getName().equals("/dev/ttyUSB0")) > { > myTA.append("Serial port ttyUSB0 has been found\n"); > break; > }// if portID equals... > }// End of while... > ========================================================== > > ls -al /dev/tty* > crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty > crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 > crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 > crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 > crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 > ... > crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 > crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 > crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 > > > -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 12:20:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 12:20:25 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139338798.8145.4.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> Message-ID: On Tue, 7 Feb 2006, Kim Lux wrote: > > Any ideas on this ? Any reason why portList.hasMoreElements() should be > false even though there are devices in /dev ? > > > On Mon, 2006-02-06 at 23:20 -0700, Kim Lux wrote: >> I'm running the code below. >> >> portlist.hasMoreElements() is false. >> >> /dev has ports in it as listed below. >> >> What am I doing wrong ? >> >> >> ========================================================== >> // Step through the list of ports until we find one that matches >> // the one we are looking for. >> >> portList = CommPortIdentifier.getPortIdentifiers(); >> >> while(portList.hasMoreElements()) >> { >> portID = (CommPortIdentifier) portList.nextElement(); // >> if (portID.getName().equals("/dev/ttyUSB0")) >> { >> myTA.append("Serial port ttyUSB0 has been found\n"); >> break; >> }// if portID equals... >> }// End of while... >> ========================================================== >> >> ls -al /dev/tty* >> crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty >> crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 >> crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 >> crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 >> crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 >> ... >> crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 >> crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 >> crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 >> >> >> > Hi Kim What rxtx does is try to open the port and do a timed out read. If the kernel/... do not complain it's enumarted. I suspect you could do a crude test by doing something like cat /dev/ttyS0 > /dev/null If that barfs then rxtx wont enumerate the port. hmm looking at your question again, I suspect it's a lockfile problem. This is documented in INSTALL with the source. Its easy enough to test this too.. touch /var/lock/testingrxtxlockfiles && rm -f /var/lock/testingrxtxlockfiles If you are not in the right group it will bail. Root will work regardless. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 12:37:56 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 12:37:56 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> Message-ID: <1139341076.8145.11.camel@zd7280> Exactly which ports does rxtx attempt to put into the list ? /dev/* or /dev/tty* or /dev/tty[0-9[0-9] ? or /dev/ttyS* ? For the record, only /dev/ttyUSB0 is a valid port on the machine I am presently on. Will this be a problem ? On Tue, 2006-02-07 at 12:20 -0700, Trent Jarvi wrote: > This is documented in INSTALL with the source. > I was wondering where that file was. I will download source and dig it up. Thanks. -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 12:51:09 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 12:51:09 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139341076.8145.11.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: On Tue, 7 Feb 2006, Kim Lux wrote: > > Exactly which ports does rxtx attempt to put into the list ? /dev/* > or /dev/tty* or /dev/tty[0-9[0-9] ? or /dev/ttyS* ? > > For the record, only /dev/ttyUSB0 is a valid port on the machine I am > presently on. Will this be a problem ? > > > On Tue, 2006-02-07 at 12:20 -0700, Trent Jarvi wrote: >> This is documented in INSTALL with the source. >> > I was wondering where that file was. I will download source and dig it > up. > > Thanks. > Hmm I'm looking at pre17 so this may have changed. (its just what I have on this machine) if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA" // for the IPAQs }; CandidatePortPrefixes=Temp; } So you may need to add "ttyUSB" to that list. RXTX used to enumerate _everything_ see if(osName.equals("Linux-all-ports") But it became less than practical. This is all in RXTXCommDriver.java hmm I just did a cvs update. if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have to get your fingers into the code. We aim for sane defaults. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 13:06:45 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 13:06:45 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139342805.8145.22.camel@zd7280> On Tue, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > Hmm I'm looking at pre17 so this may have changed. (its just what I have > on this machine) > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA" // for the IPAQs > }; > CandidatePortPrefixes=Temp; > } > > > So you may need to add "ttyUSB" to that list. RXTX used to enumerate > _everything_ see if(osName.equals("Linux-all-ports") But it became less > than practical. > > This is all in RXTXCommDriver.java > > hmm I just did a cvs update. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have > to get your fingers into the code. We aim for sane defaults. Excellent. Thanks for taking the time. -- Kim Lux, Diesel Research Inc. From ideiglenes1 at freemail.hu Tue Feb 7 13:53:39 2006 From: ideiglenes1 at freemail.hu (--) Date: Tue, 07 Feb 2006 21:53:39 +0100 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139345619.22534.2.camel@localhost> Hi! I use this code to get all the extra Linux devices. :) if ("Linux".equals(System.getProperty("os.name"))) { System.setProperty("os.name","Linux-all-ports"); } driver = new RXTXCommDriver(); On k, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > On Tue, 7 Feb 2006, Kim Lux wrote: > > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have > to get your fingers into the code. We aim for sane defaults. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From matt.higgins at gmail.com Tue Feb 7 13:45:54 2006 From: matt.higgins at gmail.com (Matt Higgins) Date: Tue, 7 Feb 2006 15:45:54 -0500 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> Message-ID: <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> Sweet this is exactly what I needed. I was searching the archives through marc.theamisgroup they only have archives back to 1/3/05. Should have hit the mailman archive! Thanks a lot! On 2/7/06, Brian Schlining wrote: > > Hi Matt > > The following code works fine on Linux but I never see any data when run > on Windows. This is a cut and paste from the SimpleRead example. > I am attempting to read data from a bar code scanner. I can fire up > HyperTermianl on windows and see that the device is working properly as I > see the barcodes are scanned and echoed back to the terminal. However when I > run the app I don't see any data. It is however associating with the com > port as the informational bits print fine? > > > You're not the only one whose had this problem, I don't know if Trent has > addressed this is the latest release of RXTX but there is a workaround. > Here's the recent thread from the RXTX mailing list regarding this issues: > > Thanasis Delenikas tdelenik at gmail.com > Wed Jan 18 13:56:23 MST 2006 > > * Previous message: [Rxtx] Re: More close() performance fixes > * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] > > Hi all. > (I've subscribed again from my other email account). > > Trent, > > You are right. Linux *always* works, no matter what flow control you set. > Windows *works only* with hardware flow control (I haven't tested what > happens with software XON/XOFF flow control). > > I assume (but I am not certain) that even with no flow control at all, all > platforms should work. Without flow control, you have the risk of bumping > into overflow or framing errors, but that's your (the end programmer, I > mean) problem. > > >From my side, I shouldn't be working without flow control. That was a bug > too... It was some code forgotten from the old times, when I used to work > with phone emulation drivers which didn't support flow control. The > correct > way is to have some flow control enabled and that's why I suppose this is > a > low-severity bug for RxTx. > > I have no idea which platform shows the correct behaviour, since > my knowledge about Linux and the inner workings of these low-level i/o > operations is limited. > > Regards, > Thanasis Delenikas. > > > > > Message: 2 > > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > > From: Trent Jarvi > > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > > To: RXTX Developers and Users > > Message-ID: > > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > > > Hi all, > > > > > > Trent, I have found something. > > > I read your comment about flow control, so I experimented a bit. > > > > > > If you remember, in my sample program I've used no flow control at all > ( > > i.e. > > > Java constant FLOWCONTROL_NONE). > > > > > > Now, during testing, I've switch to hardware inbound flow control (i.e > . > > Java > > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > > beautifully! > > > > > > I think I will switch to H/W flow control and test things for a while, > > but > > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > > > > > Hi Thanasis, > > > > I'm fairly sure you have identified a bug. I would not worry too much > > about what Sun CommAPI w32 defaults are. I think they did more or less > > whatever the port opened with. Just a guess. Linux tries to stomp on > > ports so they are all the same. > > > > So this started out with Linux worked, Windows XP/.. did not as I > recall. > > Something is wrong in rxtx. Do I understand this right? > > > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > > > Perhaps there is something Wayne or I did not understand when we wrote > > that code. I wasnt programming back in the BBS days so modems are not > my > > thing. I have a few questions. > > > > Is the above matrix confirmed by observation? > > Linux just always worked? > > Which one _should_ work? I'm guessing modems work with hardware flow > > control. I'll have to dig around. > > > > The windows flow control changes a couple things with hardware flow > > control. Following the w32 API documentation is confusing sometimes. > > But it looks like Linux could have a bug too. > > Cheers > > Brian Schlining > Software Engineer > http://www.mbari.org > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/9c989144/attachment-0063.html From tjarvi at qbang.org Tue Feb 7 14:06:14 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 14:06:14 -0700 (MST) Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> Message-ID: >> >> You're not the only one whose had this problem, I don't know if Trent has >> addressed this is the latest release of RXTX but there is a workaround. >> Here's the recent thread from the RXTX mailing list regarding this issues: >> I have not. I expect to have access to some test equipment next month and I'll go through all of this. I really don't know whats going on and I need a gold standard. I thought maybe linux was autodetecting the flow control. Your observations would certainly be welcome. I need to talk to Russell King and see what he is doing. Until then I'd just be toying around over a loopback as usual. This is very high on the list though. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 17:25:05 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 17:25:05 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139358305.17994.2.camel@zd7280> My application now works. I installed the libraries and jar from 2.1-7 (Final). portlist.hasMoreElements is no longer false. The application finds the port for /dev/ttyUSB0. Thanks for your help, Trent (et al) Sorry I bothered you with this. Next time I will look in the source first. I didn't think it was an rxtx issue, I thought it was a Linux setup issue . On Tue, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > Hmm I'm looking at pre17 so this may have changed. (its just what I > have > on this machine) > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux > Serial Ports > "ttySA" // for the > IPAQs > }; > > CandidatePortPrefixes=Temp; > } > > > So you may need to add "ttyUSB" to that list. RXTX used to enumerate > _everything_ see if(osName.equals("Linux-all-ports") But it became > less > than practical. > > This is all in RXTXCommDriver.java > > hmm I just did a cvs update. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux > Serial Ports > "ttySA", // for the > IPAQs > "ttyUSB" // for USB > frobs > }; > > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you > have > to get your fingers into the code. We aim for sane defaults. -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 19:21:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 19:21:54 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139358305.17994.2.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> <1139358305.17994.2.camel@zd7280> Message-ID: >Sorry I bothered you with this. Next time I will look in the source >first. I didn't think it was an rxtx issue, I thought it was a Linux >setup issue . Why would you be sorry? I would have done the same. I'm glad it's working :) -- Trent Jarvi tjarvi at qbang.org From tma at mail.island.net Wed Feb 8 13:39:35 2006 From: tma at mail.island.net (Tom Alldread) Date: Wed, 08 Feb 2006 12:39:35 -0800 Subject: [Rxtx] Win32/Linux Serial Port Data Dropouts In-Reply-To: <200602060702.k167255O007882@www.qbang.org> References: <200602060702.k167255O007882@www.qbang.org> Message-ID: <43EA5707.4020200@mail.island.net> Greetings Folks at RXTX: During the last couple of months I have been alternately testing with javax.comm 2 and RXTX 2.1 under Windows XP and CommApi 3 and RXTX 2.1 under Suse 10.0 Linux. In the process I have learned a little about java multi-threading under NetBeans 5 with Profiler. My java (jdk 1.5_06) application is used for data acquisition and provides a graphical display of A-D conversion data received from a 56KBaud serial port. The actual data throughput is about 10KBaud thus it is well below the speed of the port. I use hardware RTS/CTS flow control which can stall the data acquisition sample rate if necessary. This ensures the display computer has the ability to slow the data acquisition rate should it become too busy to accept the regular data flow. Both the serial port buffer and the java read buffer are set at 16KB. Usually the data transfers into the java read buffer are less than 100 bytes unless the data acquisition is recovering from a stall. The data flow normally hesitates after each 5 KB block as a continue command is needed from the display computer to start the drawing of a new graphics display line. Separate threads have been provided for the serial port event monitoring and data processing. The serial port event thread has been given the maximum priority and data processing thread the minimum priority provided by java. Thread yield statements have been placed within all data processing while/for loops as an effort to ensure quick access to CPU cycles for the serial port event thread. I have found that short data transmissions are essentially error free but occasional dropouts occur with continuous data flow especially under Windows XP. ....................................................................................................................................................................................... Linux results: I am happy to report that RXTX 2.1 appears to work very well under Linux although I did notice some errors when the screen savers were running with my dual monitors. I believe this is a local problem associated with my dual graphics which needs further attention. The recent CommApi 3 Linux release from Sun did not work at all with my program. It seemed to send commands out OK but did not receive any data. Although the serial port event triggered the ISR, the input stream appeared filled with nulls and thus did not contain any data. As my understanding is that CommApi 3 was tested with a Red Hat distribution of Linux I wonder if this problem is distro dependent? Although somewhat off topic here I wonder if anyone reading this has had similar experience? .................................................................................................................................................................................. Windows XP results: There are problems with occasional data dropouts which become more frequent as the sampling rate is increased or if the computer becomes busy with other duties. The dropouts typically consist of a half dozen byte block of lost data. It appears the lost bytes never get added to the java input stream. There has not been any indication of garbled data, overruns or framing errors which suggests the UART communications remains solid. Using javax.comm 2 I found that the setting of SerialPort 'enableReceiveThreshold' to 40 and 'enableReceiveTimeout' of 100mS reduced the dropouts error rate significantly. I found that I could not get RXTX 2.1 to function with the aforementioned threshold and timeout settings. The javax.comm 2 interface is consequently performing better for me under Windows than RXTX 2.1. I wonder if anyone here has any suggestions as to what I might try to improve RXTX 2.1? Although my settings are the same as under Suse 10.0, RXTX 2.1 performs much better for me under Linux than any of the alternatives that I have tried under Windows XP . ............................................................................................................................................................................... I would like to establish, based on the experience of others, if I have reached the normally expected performance limit of java serial port communications? Should I expect to achieve virtually error free serial port data input from a continuous stream under Windows XP java software? I am considering changing my protocol to packets with error checking if necessary but would like to know if the dropout problems I am experiencing are typical or not before I take this rather work intensive plunge. Many thanks in advance for any help! Best Regards, Tom Alldread -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.375 / Virus Database: 267.15.2/253 - Release Date: 2006-02-07 From jlaxson at mac.com Wed Feb 8 23:56:48 2006 From: jlaxson at mac.com (John Laxson) Date: Thu, 9 Feb 2006 00:56:48 -0600 Subject: [Rxtx] PortInUseException: Unknown Application on OSX Message-ID: Hi, I've been trying to get RXTX 2.1.7 going on Mac OS X for a while here, and am running up into a wall here. I've tried with pre- compiled and the source version and get the same problem, a gnu.io.PortInUseException: Unknown Application. I have run the fixperms script included with the source distribution, and id shows me as a member of the uucp group, and permissions on /var/spool/uucp are 775 root:uucp. Running a test program (included at the bottom for clarity) lets me enumerate all the serial ports correctly, but trying to open any of them gives the PortInUseException. If it helps, when I try to open a port that's set to make an outgoing bluetooth connection, there is no delay and no connection attempt at all. Thanks, John Laxson PS: The documentation wiki on qbang.org shows 404, and has for a few days now. My test code: public static void main(String[] args) { SerialPort serialPort; try { Enumeration e = CommPortIdentifier.getPortIdentifiers(); CommPortIdentifier ident; while (e.hasMoreElements()) { ident = (CommPortIdentifier)e.nextElement(); System.out.println(ident.getName()); } ident = CommPortIdentifier.getPortIdentifier("/dev/cu.modem"); serialPort = (SerialPort) ident.open("Me", 5000); } catch (Exception e) { e.printStackTrace(); } } From rajesh.invincible at gmail.com Thu Feb 9 03:39:38 2006 From: rajesh.invincible at gmail.com (Rajesh N) Date: Thu, 9 Feb 2006 16:09:38 +0530 Subject: [Rxtx] Re: Move .java Files in gnu.io filesystem hierarchy - Maven (2) In-Reply-To: <43DF21D2.7090200@ngi.it> References: <43DF21D2.7090200@ngi.it> Message-ID: <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Can anybody tell me how to overcome these EXCEPTIONS I AM WORKING ON SERIAL COMMN IN JAVA ON LINUX. 1. " NOT ALL PARAMETERS SUPPORTED BY THE KERNEL" This i came across the following statement inmy prog. SerialP is A SerialPort object SerialP.setSerialPortParams(9600(BAUDRATE),DATABITS_8,STOPBITS_1,PARITY_NONE) 2. NullPointer Exception at Event Dispatch Now i have checked all my object references for a null reference but i found none i have put up my entire code in try catch blocks but still I AM UNABLE TO CATCH THIS EXCEPTION AND HENCE MY APPLICATION CLOSES HOW DOES THESE GO? PLEASE HELP ME IT IS URGENTTTTTTTTTTTTTTTT yours sincerely RAJESH On 1/31/06, Fabio Frumento wrote: > Hi Xavier, > > I don't know maven at all but the directory hierarchy listed buy Trent > is fine for me... > > I'll take a look to maven, it seems an interesting project > > Regards > > Fabio Frumento > > Trent Jarvi wrote: > > On Tue, 31 Jan 2006, Xavier Frisaye wrote: > > > >> Hi all, > >> > >> If you are going to rearrange the src folder, i will propose to use > >> maven 2 and follow its directory structure > >> > (http://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html). > >> > >> Maven 2 simplify java project and give a standard way to make projects > >> (http://maven.apache.org/). > >> We are using it for internal projects and we are very satisfied. > >> > >> Is anybody interested? > >> > >> I'm not an expert in maven 2 (yet) but i'm agree to help using it if > >> you choose to make so. > >> > > > > so this would be: > > > > rxtx-devel/src/main/java/gnu.io > > rxtx-devel/src/test/java/ManIwish.java > > > > I don't use IDEs very much so I'll let others comment. But I don't see > > a problem with that. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Thu Feb 9 09:50:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 9 Feb 2006 09:50:31 -0700 (MST) Subject: [Rxtx] Re: Move .java Files in gnu.io filesystem hierarchy - Maven (2) In-Reply-To: <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Message-ID: On Thu, 9 Feb 2006, Rajesh N wrote: > Can anybody tell me how to overcome these EXCEPTIONS > I AM WORKING ON SERIAL COMMN IN JAVA ON LINUX. > > 1. " NOT ALL PARAMETERS SUPPORTED BY THE KERNEL" > > This i came across the following statement inmy prog. > SerialP is A SerialPort object > SerialP.setSerialPortParams(9600(BAUDRATE),DATABITS_8,STOPBITS_1,PARITY_NONE) > Strange. The parameters you use are the same the port should open with by default. Could you paste the actual exception you are getting? I don't see that in the rxtx source. Also it would help to know the rxtx version. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Fri Feb 10 15:29:05 2006 From: lux at diesel-research.com (Kim Lux) Date: Fri, 10 Feb 2006 15:29:05 -0700 Subject: [Rxtx] One serial port object for both sending and receiving ? Message-ID: <1139610545.18177.4.camel@zd7280> Is it OK to use one SerialPort ojbect (ex Serial Port serialPort;) and use it for both sending and receiving ? For example: ======================================================================== static SerialPort serialPort = null; static OutputStream serialOut = null; static InputStream serialIn = null; // assign it to an outputStream for use try{ serialOut = serialPort.getOutputStream(); System.out.println("Serial output stream has been assigned."); }//try catch(IOException e) { System.out.println("Error: Couldn't assign output stream to serial port."); }//catch //assign it to an inputStream for use try{ serialIn = serialPort.getInputStream(); System.out.println("Serial input stream has been assigned."); }//try catch(IOException e) { System.out.println("Error: Couldn't assign input stream to serial port."); }//catch ======================================================================== -- Kim Lux, Diesel Research Inc. From lux at diesel-research.com Fri Feb 10 21:23:00 2006 From: lux at diesel-research.com (Kim Lux) Date: Fri, 10 Feb 2006 21:23:00 -0700 Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Message-ID: <1139631780.23882.10.camel@zd7280> I've got a problem receiving chars with my version of serialRead, written in an SWT GUI. I had a Java pro have a good look at my code and he can't see anything wrong with it. I can send chars fine. When I receive a char the cpu usage for the app goes to 100% and the code in the serial event handler doesn't get executed. The instructions on the Java Comm Serial API How-To for Linux page state that I must install javacomm. Is that true ? Everything builds without it and I can send chars on rxtx just fine, but I can't receive them. Could this be the problem ? I downloaded and installed javacomm. I was not able to add "Driver=gnuio.RXTXCommDriver to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 installed in /usr/java/jre1.5.0_05. I added comm.jar to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext to the library paths. Is this OK ? Does it matter that I am receiving on /dev/ttyUSB0 ? Thanks. -- Kim Lux, Diesel Research Inc. From lunareclipse03 at web.de Sat Feb 11 09:44:46 2006 From: lunareclipse03 at web.de (lunareclipse03@web.de) Date: Sat, 11 Feb 2006 17:44:46 +0100 Subject: [Rxtx] Question about Serial I/O under Win32 Message-ID: <662084330@web.de> Hello everybody, I have a strange problem with a piece of code I made for myself. No, this is not really concerning rxtx, but nevertheless I post this to the list, hoping that some of you can help me. I've written two libraries, one for linux and one for win32. The linux port works quite well, I can send / receive faxes and / or replay voice messages over the telephone line using a voice modem. But the win32 port of the library causes some trouble. If, for example, I send out a fax with a certain modem under linux, it works well. The fax is complete when it comes out of the fax machine. If I then use the same modem to send out a fax under win32, the fax coming out of the fax machine gets "stuck" halfways, but the sending modem thinks that transmission was ok and drops the connection. The answering fax machine then gives me "error while receiving." The "upper layer" java code MUST be right, because if I do the same thing under linux (using the linux library), everything is alright. Now I have to ask: Can somebody please help me out with this??!? Could it be the case that some kind of flow control or COMMTIMEOUTS setting causes this behaviour? I set flow control to RTS/CTS before sending out a fax. How can I DISABLE flow control? Or what do you think? Can something else cause this problems? Thank you all for your time and PLEASE write back soon. Regards, --Sven Ahlemann Am Waldrand 31 45721 Haltern am See Germany ______________________________________________________________ Verschicken Sie romantische, coole und witzige Bilder per SMS! Jetzt bei WEB.DE FreeMail: http://f.web.de/?mc=021193 From lux at diesel-research.com Sat Feb 11 10:06:52 2006 From: lux at diesel-research.com (Kim Lux) Date: Sat, 11 Feb 2006 10:06:52 -0700 Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: <1139631780.23882.10.camel@zd7280> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> <1139631780.23882.10.camel@zd7280> Message-ID: <1139677612.3431.5.camel@zd7280> More on this problem. I copied and pasted simpleRead into a console based Eclipse project and I've got the same result, except that cpu usage doesn't go to 100%. I'm beginning to think there is an issue in rxtx. My imports for simpleRead are: ============================ import gnu.io.*; import java.util.*; //import javax.comm.*; import java.io.*; =========================== Any ideas ? I am trying to read from /dev/ttyUSB0 using a serial to USB adapter which has worked well with minicom and gtkterm. Thanks. On Fri, 2006-02-10 at 21:23 -0700, Kim Lux wrote: > I've got a problem receiving chars with my version of serialRead, > written in an SWT GUI. > > I had a Java pro have a good look at my code and he can't see anything > wrong with it. > > I can send chars fine. When I receive a char the cpu usage for the app > goes to 100% and the code in the serial event handler doesn't get > executed. > > The instructions on the Java Comm Serial API How-To for Linux page state > that I must install javacomm. Is that true ? Everything builds without > it and I can send chars on rxtx just fine, but I can't receive them. > Could this be the problem ? > > I downloaded and installed javacomm. I was not able to add > "Driver=gnuio.RXTXCommDriver > to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not > have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 > installed in /usr/java/jre1.5.0_05. I added comm.jar > to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext > to the library paths. Is this OK ? > > Does it matter that I am receiving on /dev/ttyUSB0 ? > > Thanks. > -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Sun Feb 12 21:01:33 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:01:33 -0700 (MST) Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: <1139677612.3431.5.camel@zd7280> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> <1139631780.23882.10.camel@zd7280> <1139677612.3431.5.camel@zd7280> Message-ID: I suspect what is happening is the select() is breaking out in the native code but the driver does not have support for notifying there are X bytes available. On some traditional Unix based systems, the only way you know data is available is the fd status changes and do an FIORDCHK ioctl. Or perhaps the only thing you can know is the fd status changed. It would take reading through the kernel driver code to know for sure. So on USB, depending upon the driver, the same may need to be done or the driver improved a bit if possible to support. Polling reads will also work but don't use the event driven model of CommAPI which isnt acceptable in the long run. The 100% cpu usage can then be explained because select no longer blocks until the data is read; the eventLoop spins loose. You can put a well placed sleep but rxtx only expects those are needed when it knows data is available. This may not be a super simple thing to understand and fix. I do have ideas to get you started. I'm going to be short on time the next couple weeks. I expect to put some good time in and answer some other questions I saw around the 25th. For now, I'd look at the following and go from there with the hints I've given. JNIEXPORT jint JNICALL RXTXPort(nativeavailable)( JNIEnv *env, jobject jobj ) { int fd = get_java_var( env, jobj,"fd","I" ); int result; /* char message[80]; ENTER( "RXTXPort:nativeavailable" ); On SCO OpenServer FIONREAD always fails for serial devices, so try ioctl FIORDCHK instead; will only tell us whether bytes are available, not how many, but better than nothing. This turns out to be true on Solaris also. taj. */ #ifdef FIORDCHK /* __unixware__ __sun__ probably others */ result = ioctl(fd, FIORDCHK, 0); #else if( ioctl( fd, FIONREAD, &result ) < 0 ) { goto fail; } #endif /* FIORDCHK */ On Sat, 11 Feb 2006, Kim Lux wrote: > > More on this problem. I copied and pasted simpleRead into a console > based Eclipse project and I've got the same result, except that cpu > usage doesn't go to 100%. I'm beginning to think there is an issue in > rxtx. > > My imports for simpleRead are: > > ============================ > import gnu.io.*; > import java.util.*; > //import javax.comm.*; > import java.io.*; > =========================== > > Any ideas ? I am trying to read from /dev/ttyUSB0 using a serial to > USB adapter which has worked well with minicom and gtkterm. > > Thanks. > > > > On Fri, 2006-02-10 at 21:23 -0700, Kim Lux wrote: >> I've got a problem receiving chars with my version of serialRead, >> written in an SWT GUI. >> >> I had a Java pro have a good look at my code and he can't see anything >> wrong with it. >> >> I can send chars fine. When I receive a char the cpu usage for the app >> goes to 100% and the code in the serial event handler doesn't get >> executed. >> >> The instructions on the Java Comm Serial API How-To for Linux page state >> that I must install javacomm. Is that true ? Everything builds without >> it and I can send chars on rxtx just fine, but I can't receive them. >> Could this be the problem ? >> >> I downloaded and installed javacomm. I was not able to add >> "Driver=gnuio.RXTXCommDriver >> to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not >> have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 >> installed in /usr/java/jre1.5.0_05. I added comm.jar >> to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext >> to the library paths. Is this OK ? >> >> Does it matter that I am receiving on /dev/ttyUSB0 ? >> >> Thanks. >> > From tjarvi at qbang.org Sun Feb 12 21:03:30 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:03:30 -0700 (MST) Subject: [Rxtx] One serial port object for both sending and receiving ? In-Reply-To: <1139610545.18177.4.camel@zd7280> References: <1139610545.18177.4.camel@zd7280> Message-ID: On Fri, 10 Feb 2006, Kim Lux wrote: > > Is it OK to use one SerialPort ojbect (ex Serial Port serialPort;) and > use it for both sending and receiving ? > > For example: > > ======================================================================== > static SerialPort serialPort = null; > static OutputStream serialOut = null; > static InputStream serialIn = null; > > > > > // assign it to an outputStream for use > try{ > serialOut = serialPort.getOutputStream(); > System.out.println("Serial output stream has been assigned."); > }//try > catch(IOException e) > { > System.out.println("Error: Couldn't assign output stream to serial > port."); > }//catch > > > //assign it to an inputStream for use > try{ > serialIn = serialPort.getInputStream(); > System.out.println("Serial input stream has been assigned."); > }//try > catch(IOException e) > { > System.out.println("Error: Couldn't assign input stream to serial > port."); > }//catch This should be fine. In fact trying to do it another way will probably not work as you will run into lockfile issues. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun Feb 12 21:13:13 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:13:13 -0700 (MST) Subject: [Rxtx] Question about Serial I/O under Win32 In-Reply-To: <662084330@web.de> References: <662084330@web.de> Message-ID: On Sat, 11 Feb 2006 lunareclipse03 at web.de wrote: > Hello everybody, > > I have a strange problem with a piece of code I made for myself. No, > this is not really concerning rxtx, but nevertheless I post this to the > list, hoping that some of you can help me. I've written two libraries, > one for linux and one for win32. The linux port works quite well, I can > send / receive faxes and / or replay voice messages over the telephone > line using a voice modem. But the win32 port of the library causes some > trouble. If, for example, I send out a fax with a certain modem under > linux, it works well. The fax is complete when it comes out of the fax > machine. If I then use the same modem to send out a fax under win32, the > fax coming out of the fax machine gets "stuck" halfways, but the sending > modem thinks that transmission was ok and drops the connection. The > answering fax machine then gives me "error while receiving." The "upper > layer" java code MUST be right, because if I do the same thing under > linux (using the linux library), everything is alright. Now I have to > ask: Can somebody please help me out with this??!? Could it be the case > that some kind of flow control or COMMTIMEOUTS setting causes this > behaviour? I set flow control to RTS/CTS before sending out a fax. How > can I DISABLE flow control? Or what do you think? Can something else > cause this problems? Thank you all for your time and PLEASE write back > soon. > Hi Sven I'm not too willing to talk about flow control at the low level until I confirm some things with test equipment later. It is not clear if you are using rxtx or writing your own native code. So I'm not sure how to answer much of this :) If you are wondering how to change the flow control using rxtx from java, The BlackBox example from Sun flips this back and forth. SerialPort.java in rxtx 2.1 uses the following: SerialPort.java: public static final int FLOWCONTROL_NONE =0; SerialPort.java: public static final int FLOWCONTROL_RTSCTS_IN =1; SerialPort.java: public static final int FLOWCONTROL_RTSCTS_OUT =2; SerialPort.java: public static final int FLOWCONTROL_XONXOFF_IN =4; SerialPort.java: public static final int FLOWCONTROL_XONXOFF_OUT=8; So if you set flowcontrol to RTSCTS, you can set it to NONE to turn it off. If you are looking for how to do it in native code, the rxtx Source is SerialImp.c (unix/linux/mac os x/w32) and termios.c (w32 only with SerialImp.c) You can track the code: SerialImp.c:JNIEXPORT void JNICALL RXTXPort(setflowcontrol)( JNIEnv *env, jobject jobj, jint flowmode ) termios.c:int tcgetattr( int fd, struct termios *s_termios ) termios.c:int tcsetattr( int fd, int when, struct termios *s_termios ) There may be a problem in the rxtx flow control code though. Rather than guess, I want to test this with a gold standard. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Feb 6 00:00:16 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 00:00:16 -0700 (MST) Subject: [Rxtx] wiki delay until tomorrow night. In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: On Sun, 5 Feb 2006, Trent Jarvi wrote: > On Sun, 5 Feb 2006, Kim Lux wrote: > >> usb ? Tell me more... I need that too. > > usb is a very proper design. Thats all it is. > Maybe rxtx could help usb. But it would start with helping bring back the community that was already there. It's not something I'd love to do but maybe its the right thing to do. It would probably take 2 years to do right. But maybe thats better than what we have now. I honestly don't know what IBM is doing which could just run over everything. Just some thoughts after some fine german wine. -- Trent Jarvi tjarvi at qbang.org From gadelavega at yahoo.com.ar Mon Feb 6 02:17:05 2006 From: gadelavega at yahoo.com.ar (Gonzalo A. de la Vega) Date: Mon, 06 Feb 2006 10:17:05 +0100 Subject: [Rxtx] Serial port ownership question In-Reply-To: References: <20060205113618.30274.qmail@web53501.mail.yahoo.com> <1139157422.4553.9.camel@zd7280> <1139158698.4936.9.camel@zd7280> Message-ID: <43E71411.4050402@yahoo.com.ar> On my Fedora Core 4: ls -l /dev/ttyS* crw-rw---- 1 root uucp 4, 64 Feb 6 2006 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Feb 6 2006 /dev/ttyS1 ... and: grep "ttyUSB" /etc/udev/rules.d/50-udev.rules KERNEL=="ttyUSB*", GROUP="uucp", MODE="0660" So anyone in the "uucp" group can use serial ports. On Gentoo the group is "tty". Trent Jarvi escribi?: > > > On Sun, 5 Feb 2006, Dr. Douglas Lyon wrote: > >> I can confirm that this is the case (only root ownership of >> serial ports, under fedora 4). >> Wow, what were they thinking?! >> - DL >> >>> I've found that the newer kernels have the serial ports owned by root. >>> For example, >>> >>> $ls -al /dev/tty* >>> crw-rw-rw- 1 root root 5, 0 Feb 5 02:06 /dev/tty >>> crw-rw---- 1 root root 4, 0 Feb 5 02:06 /dev/tty0 >>> crw------- 1 root root 4, 1 Feb 5 09:07 /dev/tty1 >>> crw-rw---- 1 root tty 4, 10 Feb 5 02:06 /dev/tty10 >>> crw-rw---- 1 root tty 4, 11 Feb 5 02:06 /dev/tty11 >>> ... > > > This is just not a problem jcp or such are going to solve. Its a > platform spitwad fight. But do look at pam. In fact thats what Sun > is doing too. Maybe Linux followed their lead.. I'm not a pam guy. > I've spent 16 hours trying to understand it but your users wont :) > > Solution? I have no clue. Its two tangent mentalities from my > perspective. > > -- > Trent Jarvi > tjarvi at qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mtnvega at yahoo.com.br Mon Feb 6 05:35:43 2006 From: mtnvega at yahoo.com.br (Luiz Jr) Date: Mon, 6 Feb 2006 12:35:43 +0000 (GMT) Subject: [Rxtx] Documentation Wiki In-Reply-To: <1139157422.4553.9.camel@zd7280> Message-ID: <20060206123543.57256.qmail@web53515.mail.yahoo.com> Hello, Thank you for you answer, but so the usage of the API is pretty much like the Java Communications Api? If yes, what version of the Java Comm Api? Thank you, Luiz A. Brandao Jr Kim Lux escreveu: On Sun, 2006-02-05 at 08:36 -0300, Luiz Jr wrote: > Hello, > > I want to start using the RXTX libraries, but I would to know how, > since I can not access the documentation wiki page I just started using them yesterday. Below is how I installed the libraries, if that helps. I used snippets of code from the SimpleWrite application here to get me going. http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html Instead of "import javax.comm.*;", use "import gnu.io.*;" which is gotten from RXTXcomm.jar, which you will need to include in your project references. I am working in Eclipse. BTW: there is no way to open a port without going through the port list and finding it. Maybe sometime in the future someone (me ?) will write a method called openSerialPort that allows the user to give a port identifier, such as "/dev/tty1" and return a port ready to use. It wouldn't take much to write that and it would save users a lot of code. Hope this helps. ======================================================================= 1) Figure out which java you are running, incase there is more than one installed. $ java -version java version "1.5.0_05" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_05-b05) Java HotSpot(TM) Client VM (build 1.5.0_05-b05, mixed mode, sharing) 2) Find all the jre directories and the one from which you are currently running. kfind (jre) 3) cd to that directory plus /lib/i386 cd /usr/java/jre1.5.0_05/lib/i386 4) Copy the library files (*.so) to that directory. cp /home/krlux/Desktop/'Java Controls'/rxtx-linux/bin/* . 5) Check that the copy was successful ls librxtx* librxtxI2C.so librxtxRaw.so librxtxSerial.so librxtxParallel.so librxtxRS485.so 6) cd to the /lib/ext directory for your java. cd /usr/java/jre1.5.0_05/lib/ext 7) Copy the Jar files there cp /home/krlux/Desktop/'Java Controls'/rxtx-linux/lib/ext/* . 8) Check that it was successful ls RXTX* RXTXcomm.jar Rxtx is now installed on your machine ready to use. =================================================================== -- Kim Lux, Diesel Research Inc. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx --------------------------------- Yahoo! Acesso Gr?tis - Internet r?pida e gr?tis. Instale o discador agora! -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/544aa403/attachment-0064.html From lyon at docjava.com Mon Feb 6 05:49:34 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 06 Feb 2006 07:49:34 -0500 Subject: [Rxtx] wiki delay until tomorrow night. In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: Hi All, I have often thought about USB drivers being needed. For example, the ironman watch will not interface to a mac (windows only). It is USB. My dymo label writer has no Java driver (native only). Etc. Most cheap web cameras are USB (and Java drivers go through JAI, if it supports the camera at all). The JAI code shows how sun did the USB drivers. You have to be a member of the jai project to download the source code. https://jai.dev.java.net has the jai distro. And then you are not allowed to redistribute it. However, we can all learn from it (if so inclined). Basically: cvs -d :pserver:lyon at cvs.dev.java.net:/cvs login cvs -d :pserver:lyon at cvs.dev.java.net:/cvs checkout jai-core You will need to user your own uid and pw to get in. The ant build has over 100 warnings from sun deprecations of its own code. You might say that they were hoisted on their own Picard ;) One interesting thing is that they support several platforms: linux-amd64 64-bit Linux-AMD64 linux-i586 32-bit Linux-x86 solaris-amd64 64-bit Solaris-AMD64 solaris-i586 32-bit Solaris-x86 solaris-sparc 32-bit Solaris-SPARC solaris-sparcv9 64-bit Solaris-SPARC windows-i586 32-bit Windows-x86 Thus, ant is used to provide a multi-platform native method distro. Neat. How do they do it? check this out: And: The core download does not contain any C source code (it was all pre-built). Basically, they are just copying .so and .dll files into build directories. I would love to see the C code for this...but Sun does not post it on the https://jai.dev.java.net site. I don't know why...Perhaps I missed it. - Doug >On Sun, 5 Feb 2006, Trent Jarvi wrote: > >>On Sun, 5 Feb 2006, Kim Lux wrote: >> >>>usb ? Tell me more... I need that too. >> >>usb is a very proper design. Thats all it is. >> > >Maybe rxtx could help usb. But it would start with helping bring >back the community that was already there. > >It's not something I'd love to do but maybe its the right thing to do. > >It would probably take 2 years to do right. But maybe thats better >than what we have now. > >I honestly don't know what IBM is doing which could just run over everything. > >Just some thoughts after some fine german wine. > >-- >Trent Jarvi >tjarvi at qbang.org > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tdelenik at gmail.com Mon Feb 6 05:56:32 2006 From: tdelenik at gmail.com (Thanasis Delenikas) Date: Mon, 6 Feb 2006 14:56:32 +0200 Subject: Fwd: [Rxtx] Documentation Wiki In-Reply-To: <1139157422.4553.9.camel@zd7280> References: <20060205113618.30274.qmail@web53501.mail.yahoo.com> <1139157422.4553.9.camel@zd7280> Message-ID: <310a1a930602060456t129f1dc6p5f2b908f13ab5a0b@mail.gmail.com> Hello all, Kim, this is a snippet from the code I use. The closest to directly opening a specific port without enumeration. << ... portId = CommPortIdentifier.getPortIdentifier(getPort()); serialPort = (SerialPort) portId.open("jSMSEngine", 1971); ... >> where getPort() return the string identifier of the port, i.e. "/dev/ttyS0" or "COM1" or whatever. Thanasis. ---------- Forwarded message ---------- From: Kim Lux Date: Feb 5, 2006 6:37 PM Subject: Re: [Rxtx] Documentation Wiki To: RXTX Developers and Users BTW: there is no way to open a port without going through the port list and finding it. Maybe sometime in the future someone (me ?) will write a method called openSerialPort that allows the user to give a port identifier, such as "/dev/tty1" and return a port ready to use. It wouldn't take much to write that and it would save users a lot of code. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/182ab5b8/attachment-0064.html From tjarvi at qbang.org Mon Feb 6 11:53:57 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 11:53:57 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: On Mon, 6 Feb 2006, Dr. Douglas Lyon wrote: > Hi All, > I have often thought about USB drivers being needed. > For example, the ironman watch will not interface > to a mac (windows only). It is USB. > My dymo label writer has no Java driver (native only). > Etc. > Most cheap web cameras are USB (and Java drivers go > through JAI, if it supports the camera at all). > The JAI code shows how sun did the USB drivers. > You have to be a member of the jai project to download > the source code. > https://jai.dev.java.net has the jai distro. > And then you are not allowed to redistribute it. However, > we can all learn from it (if so inclined). Basically: > cvs -d :pserver:lyon at cvs.dev.java.net:/cvs login > cvs -d :pserver:lyon at cvs.dev.java.net:/cvs checkout jai-core > You will need to user your own uid and pw to get in. > The ant build has over 100 warnings from sun deprecations > of its own code. > > You might say that they were hoisted on their own Picard ;) > > One interesting thing is that they support several platforms: > linux-amd64 64-bit Linux-AMD64 > linux-i586 32-bit Linux-x86 > solaris-amd64 64-bit Solaris-AMD64 > solaris-i586 32-bit Solaris-x86 > solaris-sparc 32-bit Solaris-SPARC > solaris-sparcv9 64-bit Solaris-SPARC > windows-i586 32-bit Windows-x86 > Thus, ant is used to provide a multi-platform native method distro. > Neat. > How do they do it? > check this out: > > > > > > > > > > > > > And: > > > > > > > > > > The core download does not contain any C source code (it was all pre-built). > Basically, they are just copying .so and .dll files into build directories. > > I would love to see the C code for this...but Sun does not post it on the > https://jai.dev.java.net site. > > I don't know why...Perhaps I missed it. > > - Doug > > I've looked at moving rxtx to Ant builds. I think that would help IDEs a great deal. I requested a evalutation desk copy the O'Reilly Ant book for some j2ee material I was teaching. http://www.oreilly.com/catalog/anttdg/ It has a one sentence mention of JNI. So there was not luck there. I saw that there is another Ant book that does mention JNI more. I can't find it now. Ant must be able to support it with extensions. http://ant.apache.org/manual/OptionalTasks/javah.html What the auto(break :) tools do in the rxtx build is 4 things really. 1) gcc compile flags 2) ld compile flags 3) config.h 4) compile flags for customizing rxtx (lockfiles, ...) See 1 All of this information except 4 can be static once obtained. So I'm not attached to the auto tools. If I could find an example of Ant being used for JNI code, I'd be one of the first to start moving that direction. Maybe someone saw an example someplace. The other thing we have not completed discussing is the directory structure. There is interest in making rxtx more IDE friendly. I get more mail about that off the list than how to install rxtx. And I see we have Ken Thompson in da house :) He is our trusted CVS maintainer and the guy that purchased the rxtx.org domain. Old community. We will need Ken for changing the directory structure of source. I would like to open up discussion about both of these as it is more than time. The problem is I have little experience with Ant and even less with IDEs. It would be nice if we could work with Eclipse and NetBeans. http://www.netbeans.org/ (sun and some community) http://www.eclipes.org (ibm,rhat,... perhaps more community) http://maven.apache.org/what-is-maven.html (apache. It is community) borland should sortof be here too but I think thats covered in eclipse. >From what I understand so far, we should morph rxtx to support those three maybe trusting apaches lead with maven. But I use vi. I have little to no clues beyond what people have fed me. Can we agree that thats the right direction to go? -- Trent Jarvi tjarvi at qbang.org From brian at mbari.org Mon Feb 6 14:57:50 2006 From: brian at mbari.org (Brian Schlining) Date: Mon, 6 Feb 2006 13:57:50 -0800 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> > The other thing we have not completed discussing is the directory > structure. There is interest in making rxtx more IDE friendly. I > get more mail about that off the list than how to install rxtx. > > And I see we have Ken Thompson in da house :) He is our trusted > CVS maintainer and the guy that purchased the rxtx.org domain. Old > community. We will need Ken for changing the directory structure of > source. > > I would like to open up discussion about both of these as it is > more than time. The problem is I have little experience with Ant > and even less with IDEs. It would be nice if we could work with > Eclipse and NetBeans. > > http://www.netbeans.org/ (sun and some community) > http://www.eclipes.org (ibm,rhat,... perhaps more community) > http://maven.apache.org/what-is-maven.html (apache. It is community) > borland should sortof be here too but I think thats covered in > eclipse. > >> From what I understand so far, we should morph rxtx to support >> those three > maybe trusting apaches lead with maven. But I use vi. I have > little to no clues beyond what people have fed me. > Maven likes the directory structure below for Java code. (From http:// maven.apache.org/guides/getting-started/index.html) This structure works fine with ant, netbeans, and eclipse. rxtx_root_directory `-- src |-- main | `-- java | `-- gnu | `-- io `-- test `-- java `-- gnu `-- io Brian Schlining Software Engineer http://www.mbari.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/d9451eba/attachment-0064.html From tjarvi at qbang.org Mon Feb 6 15:11:45 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 15:11:45 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: > rxtx_root_directory > `-- src > |-- main > | `-- java > | `-- gnu > | `-- io > `-- test > `-- java > `-- gnu > `-- io > >From what I understand this will just be good. For me it makes no difference. So lets do the rxtx thing. Let if fester for two weeks and if nobody objects, we will do it. I'm not doing this because I care. I'm doing this to eliminate much of my inbox. But test... man is rxtx lacking there in the community aspect. It is covered but not right. _maybe_ I can change that this year. -- Trent Jarvi tjarvi at qbang.org (cat hurding since 1997) From lux at diesel-research.com Mon Feb 6 21:38:49 2006 From: lux at diesel-research.com (Kim Lux) Date: Mon, 06 Feb 2006 21:38:49 -0700 Subject: [Rxtx] How can I use Lock Files with rxtx (in FC4) ? Message-ID: <1139287129.17031.3.camel@zd7280> I am now running an rxtx application on FC4. I am getting: ========================================================= check_group_uucp(): error testing lock file creation Error details: Permission denied check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL ========================================================= $ ls -al /var/lock total 32 drwxrwxr-x 4 root lock 4096 Feb 6 16:04 . drwxr-xr-x 24 root root 4096 Nov 14 01:19 .. drwx------ 2 root root 4096 Apr 27 2005 lvm drwxr-xr-x 2 root root 4096 Feb 6 16:04 subsys How do I fix this for regulator users ? -- Kim Lux, Diesel Research Inc. From dmarkman at mac.com Mon Feb 6 22:24:44 2006 From: dmarkman at mac.com (Dmitry Markman) Date: Tue, 7 Feb 2006 00:24:44 -0500 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: if I understands the issue right in order to be able to use ant for c/c++ compilation you have to install ant's cc task http://ant-contrib.sourceforge.net/cc.html it looks like it should work on mac os x (authors claim, that it's platform independent) but I never tested so all you have to do it's providing right command line for the gcc compiler On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: >> rxtx_root_directory >> `-- src >> |-- main >> | `-- java >> | `-- gnu >> | `-- io >> `-- test >> `-- java >> `-- gnu >> `-- io >> > > >> From what I understand this will just be good. > > For me it makes no difference. So lets do the rxtx thing. Let if > fester for two weeks and if nobody objects, we will do it. > > I'm not doing this because I care. I'm doing this to eliminate > much of my inbox. > > But test... man is rxtx lacking there in the community aspect. It > is covered but not right. _maybe_ I can change that this year. > > -- > Trent Jarvi > tjarvi at qbang.org > (cat hurding since 1997) > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx Dmitry Markman From lux at diesel-research.com Mon Feb 6 23:20:15 2006 From: lux at diesel-research.com (Kim Lux) Date: Mon, 06 Feb 2006 23:20:15 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? Message-ID: <1139293215.3689.4.camel@zd7280> I'm running the code below. portlist.hasMoreElements() is false. /dev has ports in it as listed below. What am I doing wrong ? ========================================================== // Step through the list of ports until we find one that matches // the one we are looking for. portList = CommPortIdentifier.getPortIdentifiers(); while(portList.hasMoreElements()) { portID = (CommPortIdentifier) portList.nextElement(); // if (portID.getName().equals("/dev/ttyUSB0")) { myTA.append("Serial port ttyUSB0 has been found\n"); break; }// if portID equals... }// End of while... ========================================================== ls -al /dev/tty* crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 ... crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 -- Kim Lux, Diesel Research Inc. From david.garnier at trusted-logic.com Tue Feb 7 00:46:30 2006 From: david.garnier at trusted-logic.com (David Garnier) Date: Tue, 07 Feb 2006 08:46:30 +0100 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: <43E85056.2090608@trusted-logic.com> Hello, I think that the make-based build process is fine as it is, apart from the location of the Java source files. It is true that putting the Java source in a directory structure that map 1-to-1 to the Java package structure is the norm and should make it easier for everyone to modify the Java source, with or without an IDE. Ant is a good tool, but in the RXTX case I fail to see the advantage of using it compared to the current make-based process. As Trent said, they are more pressing issues, like testing. Regards, David Dmitry Markman wrote: > if I understands the issue right > in order to be able to use ant for c/c++ compilation > you have to install ant's cc task > http://ant-contrib.sourceforge.net/cc.html > > it looks like it should work on mac os x > (authors claim, that it's platform independent) > but I never tested > > so all you have to do it's providing right command line > for the gcc compiler > > > > > On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: > >>> rxtx_root_directory >>> `-- src >>> |-- main >>> | `-- java >>> | `-- gnu >>> | `-- io >>> `-- test >>> `-- java >>> `-- gnu >>> `-- io >>> >> >> >>> From what I understand this will just be good. >> >> For me it makes no difference. So lets do the rxtx thing. Let if >> fester for two weeks and if nobody objects, we will do it. >> >> I'm not doing this because I care. I'm doing this to eliminate much >> of my inbox. >> >> But test... man is rxtx lacking there in the community aspect. It is >> covered but not right. _maybe_ I can change that this year. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> (cat hurding since 1997) From tjarvi at qbang.org Tue Feb 7 01:11:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 01:11:31 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <43E85056.2090608@trusted-logic.com> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: On Tue, 7 Feb 2006, David Garnier wrote: > Hello, > > I think that the make-based build process is fine as it is, apart from the location of the Java > source files. It is true that putting the Java source in a directory structure that map 1-to-1 to > the Java package structure is the norm and should make it easier for everyone to modify the Java > source, with or without an IDE. > > Ant is a good tool, but in the RXTX case I fail to see the advantage of using it compared to the > current make-based process. As Trent said, they are more pressing issues, like testing. > Hi David I have more experience with testing rxtx than I can talk about. But let it be known, rxtx has gone trough 100's of hours of testing. We are hobby folks interested in toys but there is more. rxtx has had some of the best guidance in the industry there. This is not an easy thing. I may be able to come back in a month from the other side of the corperate fence and help. I suspect the tests could just be made public but they are in a very unusual environment that just wont work in a wider sense. This is something I'll be trying to change. At one point it was agreed we could just make the results public so this isnt just noise.. There is interest and I think its safe to mention that much. The big problem with testing in the past is most of it is done with a loopback connection. So we *still* have major questions regarding things like flow control. rxtx talks to itself over a loopback and it works. regardless of right or wrong. This requires more thought to be done right. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Feb 7 02:46:34 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 02:46:34 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: > The big problem with testing in the past is most of it is done with a > loopback connection. So we *still* have major questions regarding things > like flow control. rxtx talks to itself over a loopback and it works. > regardless of right or wrong. With serial communication there are gold standards. ckermit is probably a definitive 'standard.' Maybe its possible to do ping/pong tests with ckermit? Is it scriptable? There are known issues in rxtx. Probably the worst is some threading issues regarding some JREs with multiple JNI threads setting java variables. Man did I get schooled there. Just switch the c functions to returning variables and things go away. Sometimes they work fine, sometimes they blow up. Without understanding everything, somehow rhat got it right and debian (and especially gentoo) grabbed kernel patches causing all sort of harm. Its not hard to fix once you understand whats going on but nearly impossible to track with a debugger. So I have a good idea what 2.1-8 will have outside of the IDE modifications. rxtx 2.1-7 is a release for everyone to sync with. Its not even as stable as -pre17 as far as I know - I ran no test suites. I'll be chasing it too. We just had so many contributions that it was time. It seriously broke internal scheduals but thats a great thing :) The other thing I want to do in 2.1-8 is automagic baud rates. It turns out lots of shops are doing really funky baud rates for things like automobile test equipment. It is possible but it requires a fair amount of change in the native code. Is anyone looking at this? -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Feb 7 02:57:21 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 07 Feb 2006 04:57:21 -0500 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <43E85056.2090608@trusted-logic.com> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: Hi All, I agree, testing is very important. The problem I have been trying to address is related to cross-platform testing and the robust nature of the installs. Typically, I visit 3 platforms to deploy my product, windows, linux and mac. A build is performed on each platform. The idea that you can build for many platforms from one copy the source code seems attractive. This should enable synchronized deployments of identical code. The question of how to achieve this goal remains open. As Trent mentioned, this is hard. Perhaps Ant will help here (but perhaps not). Ant does seem to help with running unit tests. However, it does not help with multi-platform tests. For that you need many machines and different operating environments. Toward that end, I have created a multi-platform test that can be run from web start, located at: http://show.docjava.com:8086/book/cgij/code/jnlp/serialPort.PortTest.jnlp This is interesting because many people in the community can run the test and we can improve the test, as time permits. No, it is not a perfect solution, however, the idea does help with multi-platform tests using many machines and different operating environments. If the group has a good test for a general serial port set-ups, i would be happy to deploy it, for general evaluation using web start. And as for ANT, it is just an idea. Not all my ideas are good ones! - Doug >Hello, > >I think that the make-based build process is fine as it is, apart >from the location of the Java >source files. It is true that putting the Java source in a directory >structure that map 1-to-1 to >the Java package structure is the norm and should make it easier for >everyone to modify the Java >source, with or without an IDE. > >Ant is a good tool, but in the RXTX case I fail to see the advantage >of using it compared to the >current make-based process. As Trent said, they are more pressing >issues, like testing. > >Regards, >David > >Dmitry Markman wrote: >> if I understands the issue right >> in order to be able to use ant for c/c++ compilation >> you have to install ant's cc task >> http://ant-contrib.sourceforge.net/cc.html >> >> it looks like it should work on mac os x >> (authors claim, that it's platform independent) >> but I never tested >> >> so all you have to do it's providing right command line >> for the gcc compiler >> >> >> >> >> On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: >> >>>> rxtx_root_directory >>>> `-- src >>>> |-- main >>>> | `-- java >>>> | `-- gnu >>>> | `-- io >>>> `-- test >>>> `-- java >>>> `-- gnu >>>> `-- io >>>> >>> >>> >>>> From what I understand this will just be good. >>> >>> For me it makes no difference. So lets do the rxtx thing. Let if >>> fester for two weeks and if nobody objects, we will do it. >>> >>> I'm not doing this because I care. I'm doing this to eliminate much >>> of my inbox. >>> >>> But test... man is rxtx lacking there in the community aspect. It is >>> covered but not right. _maybe_ I can change that this year. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> (cat hurding since 1997) > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From matt.higgins at gmail.com Tue Feb 7 08:28:34 2006 From: matt.higgins at gmail.com (Matt Higgins) Date: Tue, 7 Feb 2006 10:28:34 -0500 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final Message-ID: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? import java.io.*; import java.util.*; import gnu.io.*; public class MySimpleRead implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; public static void main(String[] args) { boolean portFound = false; String defaultPort = "COM1"; if (args.length > 0) { defaultPort = args[0]; } portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; MySimpleRead reader = new MySimpleRead(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } } public MySimpleRead() { try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) { e.printStackTrace(); } try { inputStream = serialPort.getInputStream(); } catch (IOException e) { e.printStackTrace(); } try { serialPort.addEventListener(this); } catch (TooManyListenersException e) { e.printStackTrace(); } try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { e.printStackTrace(); } System.out.println("Baud is " + serialPort.getBaudRate()); System.out.println("Bits is " + serialPort.getDataBits()); System.out.println("Stop is " + serialPort.getStopBits()); System.out.println("Par is " + serialPort.getParity()); serialPort.notifyOnDataAvailable(true); readThread = new Thread(this); readThread.start(); } public void run() { // Thread.sleep(20000); //} catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { System.out.println("An event occurred " + event.getEventType()); switch (event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: byte[] readBuffer = new byte[20]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } System.out.print(new String(readBuffer)); } catch (IOException e) {} break; } } } --------------- Result on windows ------------------------------ Stable Library ============================================================== Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port:: COM1 Baud is 9600 Bits is 8 Stop is 1 Par is 0 ----------------- End Results ----------------------------------------- ------------------ Result on Linux ----------------------------------- Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 Found port: /dev/ttyS0 Baud is 9600 Bits is 8 Stop is 1 Par is 0 An event occurred 1 043100066224 ------------------ End Results --------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/a1431630/attachment-0064.html From brian at mbari.org Tue Feb 7 09:48:37 2006 From: brian at mbari.org (Brian Schlining) Date: Tue, 7 Feb 2006 08:48:37 -0800 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> Message-ID: <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> Hi Matt > The following code works fine on Linux but I never see any data > when run on Windows. This is a cut and paste from the SimpleRead > example. > I am attempting to read data from a bar code scanner. I can fire > up HyperTermianl on windows and see that the device is working > properly as I see the barcodes are scanned and echoed back to the > terminal. However when I run the app I don't see any data. It is > however associating with the com port as the informational bits > print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. Cheers Brian Schlining Software Engineer http://www.mbari.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/16d07f37/attachment-0064.html From lux at diesel-research.com Tue Feb 7 11:59:58 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 11:59:58 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139293215.3689.4.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> Message-ID: <1139338798.8145.4.camel@zd7280> Any ideas on this ? Any reason why portList.hasMoreElements() should be false even though there are devices in /dev ? On Mon, 2006-02-06 at 23:20 -0700, Kim Lux wrote: > I'm running the code below. > > portlist.hasMoreElements() is false. > > /dev has ports in it as listed below. > > What am I doing wrong ? > > > ========================================================== > // Step through the list of ports until we find one that matches > // the one we are looking for. > > portList = CommPortIdentifier.getPortIdentifiers(); > > while(portList.hasMoreElements()) > { > portID = (CommPortIdentifier) portList.nextElement(); // > if (portID.getName().equals("/dev/ttyUSB0")) > { > myTA.append("Serial port ttyUSB0 has been found\n"); > break; > }// if portID equals... > }// End of while... > ========================================================== > > ls -al /dev/tty* > crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty > crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 > crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 > crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 > crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 > ... > crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 > crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 > crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 > > > -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 12:20:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 12:20:25 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139338798.8145.4.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> Message-ID: On Tue, 7 Feb 2006, Kim Lux wrote: > > Any ideas on this ? Any reason why portList.hasMoreElements() should be > false even though there are devices in /dev ? > > > On Mon, 2006-02-06 at 23:20 -0700, Kim Lux wrote: >> I'm running the code below. >> >> portlist.hasMoreElements() is false. >> >> /dev has ports in it as listed below. >> >> What am I doing wrong ? >> >> >> ========================================================== >> // Step through the list of ports until we find one that matches >> // the one we are looking for. >> >> portList = CommPortIdentifier.getPortIdentifiers(); >> >> while(portList.hasMoreElements()) >> { >> portID = (CommPortIdentifier) portList.nextElement(); // >> if (portID.getName().equals("/dev/ttyUSB0")) >> { >> myTA.append("Serial port ttyUSB0 has been found\n"); >> break; >> }// if portID equals... >> }// End of while... >> ========================================================== >> >> ls -al /dev/tty* >> crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty >> crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 >> crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 >> crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 >> crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 >> ... >> crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 >> crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 >> crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 >> >> >> > Hi Kim What rxtx does is try to open the port and do a timed out read. If the kernel/... do not complain it's enumarted. I suspect you could do a crude test by doing something like cat /dev/ttyS0 > /dev/null If that barfs then rxtx wont enumerate the port. hmm looking at your question again, I suspect it's a lockfile problem. This is documented in INSTALL with the source. Its easy enough to test this too.. touch /var/lock/testingrxtxlockfiles && rm -f /var/lock/testingrxtxlockfiles If you are not in the right group it will bail. Root will work regardless. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 12:37:56 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 12:37:56 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> Message-ID: <1139341076.8145.11.camel@zd7280> Exactly which ports does rxtx attempt to put into the list ? /dev/* or /dev/tty* or /dev/tty[0-9[0-9] ? or /dev/ttyS* ? For the record, only /dev/ttyUSB0 is a valid port on the machine I am presently on. Will this be a problem ? On Tue, 2006-02-07 at 12:20 -0700, Trent Jarvi wrote: > This is documented in INSTALL with the source. > I was wondering where that file was. I will download source and dig it up. Thanks. -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 12:51:09 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 12:51:09 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139341076.8145.11.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: On Tue, 7 Feb 2006, Kim Lux wrote: > > Exactly which ports does rxtx attempt to put into the list ? /dev/* > or /dev/tty* or /dev/tty[0-9[0-9] ? or /dev/ttyS* ? > > For the record, only /dev/ttyUSB0 is a valid port on the machine I am > presently on. Will this be a problem ? > > > On Tue, 2006-02-07 at 12:20 -0700, Trent Jarvi wrote: >> This is documented in INSTALL with the source. >> > I was wondering where that file was. I will download source and dig it > up. > > Thanks. > Hmm I'm looking at pre17 so this may have changed. (its just what I have on this machine) if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA" // for the IPAQs }; CandidatePortPrefixes=Temp; } So you may need to add "ttyUSB" to that list. RXTX used to enumerate _everything_ see if(osName.equals("Linux-all-ports") But it became less than practical. This is all in RXTXCommDriver.java hmm I just did a cvs update. if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have to get your fingers into the code. We aim for sane defaults. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 13:06:45 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 13:06:45 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139342805.8145.22.camel@zd7280> On Tue, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > Hmm I'm looking at pre17 so this may have changed. (its just what I have > on this machine) > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA" // for the IPAQs > }; > CandidatePortPrefixes=Temp; > } > > > So you may need to add "ttyUSB" to that list. RXTX used to enumerate > _everything_ see if(osName.equals("Linux-all-ports") But it became less > than practical. > > This is all in RXTXCommDriver.java > > hmm I just did a cvs update. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have > to get your fingers into the code. We aim for sane defaults. Excellent. Thanks for taking the time. -- Kim Lux, Diesel Research Inc. From ideiglenes1 at freemail.hu Tue Feb 7 13:53:39 2006 From: ideiglenes1 at freemail.hu (--) Date: Tue, 07 Feb 2006 21:53:39 +0100 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139345619.22534.2.camel@localhost> Hi! I use this code to get all the extra Linux devices. :) if ("Linux".equals(System.getProperty("os.name"))) { System.setProperty("os.name","Linux-all-ports"); } driver = new RXTXCommDriver(); On k, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > On Tue, 7 Feb 2006, Kim Lux wrote: > > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have > to get your fingers into the code. We aim for sane defaults. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From matt.higgins at gmail.com Tue Feb 7 13:45:54 2006 From: matt.higgins at gmail.com (Matt Higgins) Date: Tue, 7 Feb 2006 15:45:54 -0500 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> Message-ID: <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> Sweet this is exactly what I needed. I was searching the archives through marc.theamisgroup they only have archives back to 1/3/05. Should have hit the mailman archive! Thanks a lot! On 2/7/06, Brian Schlining wrote: > > Hi Matt > > The following code works fine on Linux but I never see any data when run > on Windows. This is a cut and paste from the SimpleRead example. > I am attempting to read data from a bar code scanner. I can fire up > HyperTermianl on windows and see that the device is working properly as I > see the barcodes are scanned and echoed back to the terminal. However when I > run the app I don't see any data. It is however associating with the com > port as the informational bits print fine? > > > You're not the only one whose had this problem, I don't know if Trent has > addressed this is the latest release of RXTX but there is a workaround. > Here's the recent thread from the RXTX mailing list regarding this issues: > > Thanasis Delenikas tdelenik at gmail.com > Wed Jan 18 13:56:23 MST 2006 > > * Previous message: [Rxtx] Re: More close() performance fixes > * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] > > Hi all. > (I've subscribed again from my other email account). > > Trent, > > You are right. Linux *always* works, no matter what flow control you set. > Windows *works only* with hardware flow control (I haven't tested what > happens with software XON/XOFF flow control). > > I assume (but I am not certain) that even with no flow control at all, all > platforms should work. Without flow control, you have the risk of bumping > into overflow or framing errors, but that's your (the end programmer, I > mean) problem. > > >From my side, I shouldn't be working without flow control. That was a bug > too... It was some code forgotten from the old times, when I used to work > with phone emulation drivers which didn't support flow control. The > correct > way is to have some flow control enabled and that's why I suppose this is > a > low-severity bug for RxTx. > > I have no idea which platform shows the correct behaviour, since > my knowledge about Linux and the inner workings of these low-level i/o > operations is limited. > > Regards, > Thanasis Delenikas. > > > > > Message: 2 > > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > > From: Trent Jarvi > > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > > To: RXTX Developers and Users > > Message-ID: > > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > > > Hi all, > > > > > > Trent, I have found something. > > > I read your comment about flow control, so I experimented a bit. > > > > > > If you remember, in my sample program I've used no flow control at all > ( > > i.e. > > > Java constant FLOWCONTROL_NONE). > > > > > > Now, during testing, I've switch to hardware inbound flow control (i.e > . > > Java > > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > > beautifully! > > > > > > I think I will switch to H/W flow control and test things for a while, > > but > > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > > > > > Hi Thanasis, > > > > I'm fairly sure you have identified a bug. I would not worry too much > > about what Sun CommAPI w32 defaults are. I think they did more or less > > whatever the port opened with. Just a guess. Linux tries to stomp on > > ports so they are all the same. > > > > So this started out with Linux worked, Windows XP/.. did not as I > recall. > > Something is wrong in rxtx. Do I understand this right? > > > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > > > Perhaps there is something Wayne or I did not understand when we wrote > > that code. I wasnt programming back in the BBS days so modems are not > my > > thing. I have a few questions. > > > > Is the above matrix confirmed by observation? > > Linux just always worked? > > Which one _should_ work? I'm guessing modems work with hardware flow > > control. I'll have to dig around. > > > > The windows flow control changes a couple things with hardware flow > > control. Following the w32 API documentation is confusing sometimes. > > But it looks like Linux could have a bug too. > > Cheers > > Brian Schlining > Software Engineer > http://www.mbari.org > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/9c989144/attachment-0064.html From tjarvi at qbang.org Tue Feb 7 14:06:14 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 14:06:14 -0700 (MST) Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> Message-ID: >> >> You're not the only one whose had this problem, I don't know if Trent has >> addressed this is the latest release of RXTX but there is a workaround. >> Here's the recent thread from the RXTX mailing list regarding this issues: >> I have not. I expect to have access to some test equipment next month and I'll go through all of this. I really don't know whats going on and I need a gold standard. I thought maybe linux was autodetecting the flow control. Your observations would certainly be welcome. I need to talk to Russell King and see what he is doing. Until then I'd just be toying around over a loopback as usual. This is very high on the list though. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 17:25:05 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 17:25:05 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139358305.17994.2.camel@zd7280> My application now works. I installed the libraries and jar from 2.1-7 (Final). portlist.hasMoreElements is no longer false. The application finds the port for /dev/ttyUSB0. Thanks for your help, Trent (et al) Sorry I bothered you with this. Next time I will look in the source first. I didn't think it was an rxtx issue, I thought it was a Linux setup issue . On Tue, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > Hmm I'm looking at pre17 so this may have changed. (its just what I > have > on this machine) > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux > Serial Ports > "ttySA" // for the > IPAQs > }; > > CandidatePortPrefixes=Temp; > } > > > So you may need to add "ttyUSB" to that list. RXTX used to enumerate > _everything_ see if(osName.equals("Linux-all-ports") But it became > less > than practical. > > This is all in RXTXCommDriver.java > > hmm I just did a cvs update. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux > Serial Ports > "ttySA", // for the > IPAQs > "ttyUSB" // for USB > frobs > }; > > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you > have > to get your fingers into the code. We aim for sane defaults. -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 19:21:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 19:21:54 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139358305.17994.2.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> <1139358305.17994.2.camel@zd7280> Message-ID: >Sorry I bothered you with this. Next time I will look in the source >first. I didn't think it was an rxtx issue, I thought it was a Linux >setup issue . Why would you be sorry? I would have done the same. I'm glad it's working :) -- Trent Jarvi tjarvi at qbang.org From tma at mail.island.net Wed Feb 8 13:39:35 2006 From: tma at mail.island.net (Tom Alldread) Date: Wed, 08 Feb 2006 12:39:35 -0800 Subject: [Rxtx] Win32/Linux Serial Port Data Dropouts In-Reply-To: <200602060702.k167255O007882@www.qbang.org> References: <200602060702.k167255O007882@www.qbang.org> Message-ID: <43EA5707.4020200@mail.island.net> Greetings Folks at RXTX: During the last couple of months I have been alternately testing with javax.comm 2 and RXTX 2.1 under Windows XP and CommApi 3 and RXTX 2.1 under Suse 10.0 Linux. In the process I have learned a little about java multi-threading under NetBeans 5 with Profiler. My java (jdk 1.5_06) application is used for data acquisition and provides a graphical display of A-D conversion data received from a 56KBaud serial port. The actual data throughput is about 10KBaud thus it is well below the speed of the port. I use hardware RTS/CTS flow control which can stall the data acquisition sample rate if necessary. This ensures the display computer has the ability to slow the data acquisition rate should it become too busy to accept the regular data flow. Both the serial port buffer and the java read buffer are set at 16KB. Usually the data transfers into the java read buffer are less than 100 bytes unless the data acquisition is recovering from a stall. The data flow normally hesitates after each 5 KB block as a continue command is needed from the display computer to start the drawing of a new graphics display line. Separate threads have been provided for the serial port event monitoring and data processing. The serial port event thread has been given the maximum priority and data processing thread the minimum priority provided by java. Thread yield statements have been placed within all data processing while/for loops as an effort to ensure quick access to CPU cycles for the serial port event thread. I have found that short data transmissions are essentially error free but occasional dropouts occur with continuous data flow especially under Windows XP. ....................................................................................................................................................................................... Linux results: I am happy to report that RXTX 2.1 appears to work very well under Linux although I did notice some errors when the screen savers were running with my dual monitors. I believe this is a local problem associated with my dual graphics which needs further attention. The recent CommApi 3 Linux release from Sun did not work at all with my program. It seemed to send commands out OK but did not receive any data. Although the serial port event triggered the ISR, the input stream appeared filled with nulls and thus did not contain any data. As my understanding is that CommApi 3 was tested with a Red Hat distribution of Linux I wonder if this problem is distro dependent? Although somewhat off topic here I wonder if anyone reading this has had similar experience? .................................................................................................................................................................................. Windows XP results: There are problems with occasional data dropouts which become more frequent as the sampling rate is increased or if the computer becomes busy with other duties. The dropouts typically consist of a half dozen byte block of lost data. It appears the lost bytes never get added to the java input stream. There has not been any indication of garbled data, overruns or framing errors which suggests the UART communications remains solid. Using javax.comm 2 I found that the setting of SerialPort 'enableReceiveThreshold' to 40 and 'enableReceiveTimeout' of 100mS reduced the dropouts error rate significantly. I found that I could not get RXTX 2.1 to function with the aforementioned threshold and timeout settings. The javax.comm 2 interface is consequently performing better for me under Windows than RXTX 2.1. I wonder if anyone here has any suggestions as to what I might try to improve RXTX 2.1? Although my settings are the same as under Suse 10.0, RXTX 2.1 performs much better for me under Linux than any of the alternatives that I have tried under Windows XP . ............................................................................................................................................................................... I would like to establish, based on the experience of others, if I have reached the normally expected performance limit of java serial port communications? Should I expect to achieve virtually error free serial port data input from a continuous stream under Windows XP java software? I am considering changing my protocol to packets with error checking if necessary but would like to know if the dropout problems I am experiencing are typical or not before I take this rather work intensive plunge. Many thanks in advance for any help! Best Regards, Tom Alldread -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.375 / Virus Database: 267.15.2/253 - Release Date: 2006-02-07 From jlaxson at mac.com Wed Feb 8 23:56:48 2006 From: jlaxson at mac.com (John Laxson) Date: Thu, 9 Feb 2006 00:56:48 -0600 Subject: [Rxtx] PortInUseException: Unknown Application on OSX Message-ID: Hi, I've been trying to get RXTX 2.1.7 going on Mac OS X for a while here, and am running up into a wall here. I've tried with pre- compiled and the source version and get the same problem, a gnu.io.PortInUseException: Unknown Application. I have run the fixperms script included with the source distribution, and id shows me as a member of the uucp group, and permissions on /var/spool/uucp are 775 root:uucp. Running a test program (included at the bottom for clarity) lets me enumerate all the serial ports correctly, but trying to open any of them gives the PortInUseException. If it helps, when I try to open a port that's set to make an outgoing bluetooth connection, there is no delay and no connection attempt at all. Thanks, John Laxson PS: The documentation wiki on qbang.org shows 404, and has for a few days now. My test code: public static void main(String[] args) { SerialPort serialPort; try { Enumeration e = CommPortIdentifier.getPortIdentifiers(); CommPortIdentifier ident; while (e.hasMoreElements()) { ident = (CommPortIdentifier)e.nextElement(); System.out.println(ident.getName()); } ident = CommPortIdentifier.getPortIdentifier("/dev/cu.modem"); serialPort = (SerialPort) ident.open("Me", 5000); } catch (Exception e) { e.printStackTrace(); } } From rajesh.invincible at gmail.com Thu Feb 9 03:39:38 2006 From: rajesh.invincible at gmail.com (Rajesh N) Date: Thu, 9 Feb 2006 16:09:38 +0530 Subject: [Rxtx] Re: Move .java Files in gnu.io filesystem hierarchy - Maven (2) In-Reply-To: <43DF21D2.7090200@ngi.it> References: <43DF21D2.7090200@ngi.it> Message-ID: <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Can anybody tell me how to overcome these EXCEPTIONS I AM WORKING ON SERIAL COMMN IN JAVA ON LINUX. 1. " NOT ALL PARAMETERS SUPPORTED BY THE KERNEL" This i came across the following statement inmy prog. SerialP is A SerialPort object SerialP.setSerialPortParams(9600(BAUDRATE),DATABITS_8,STOPBITS_1,PARITY_NONE) 2. NullPointer Exception at Event Dispatch Now i have checked all my object references for a null reference but i found none i have put up my entire code in try catch blocks but still I AM UNABLE TO CATCH THIS EXCEPTION AND HENCE MY APPLICATION CLOSES HOW DOES THESE GO? PLEASE HELP ME IT IS URGENTTTTTTTTTTTTTTTT yours sincerely RAJESH On 1/31/06, Fabio Frumento wrote: > Hi Xavier, > > I don't know maven at all but the directory hierarchy listed buy Trent > is fine for me... > > I'll take a look to maven, it seems an interesting project > > Regards > > Fabio Frumento > > Trent Jarvi wrote: > > On Tue, 31 Jan 2006, Xavier Frisaye wrote: > > > >> Hi all, > >> > >> If you are going to rearrange the src folder, i will propose to use > >> maven 2 and follow its directory structure > >> > (http://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html). > >> > >> Maven 2 simplify java project and give a standard way to make projects > >> (http://maven.apache.org/). > >> We are using it for internal projects and we are very satisfied. > >> > >> Is anybody interested? > >> > >> I'm not an expert in maven 2 (yet) but i'm agree to help using it if > >> you choose to make so. > >> > > > > so this would be: > > > > rxtx-devel/src/main/java/gnu.io > > rxtx-devel/src/test/java/ManIwish.java > > > > I don't use IDEs very much so I'll let others comment. But I don't see > > a problem with that. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Thu Feb 9 09:50:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 9 Feb 2006 09:50:31 -0700 (MST) Subject: [Rxtx] Re: Move .java Files in gnu.io filesystem hierarchy - Maven (2) In-Reply-To: <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Message-ID: On Thu, 9 Feb 2006, Rajesh N wrote: > Can anybody tell me how to overcome these EXCEPTIONS > I AM WORKING ON SERIAL COMMN IN JAVA ON LINUX. > > 1. " NOT ALL PARAMETERS SUPPORTED BY THE KERNEL" > > This i came across the following statement inmy prog. > SerialP is A SerialPort object > SerialP.setSerialPortParams(9600(BAUDRATE),DATABITS_8,STOPBITS_1,PARITY_NONE) > Strange. The parameters you use are the same the port should open with by default. Could you paste the actual exception you are getting? I don't see that in the rxtx source. Also it would help to know the rxtx version. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Fri Feb 10 15:29:05 2006 From: lux at diesel-research.com (Kim Lux) Date: Fri, 10 Feb 2006 15:29:05 -0700 Subject: [Rxtx] One serial port object for both sending and receiving ? Message-ID: <1139610545.18177.4.camel@zd7280> Is it OK to use one SerialPort ojbect (ex Serial Port serialPort;) and use it for both sending and receiving ? For example: ======================================================================== static SerialPort serialPort = null; static OutputStream serialOut = null; static InputStream serialIn = null; // assign it to an outputStream for use try{ serialOut = serialPort.getOutputStream(); System.out.println("Serial output stream has been assigned."); }//try catch(IOException e) { System.out.println("Error: Couldn't assign output stream to serial port."); }//catch //assign it to an inputStream for use try{ serialIn = serialPort.getInputStream(); System.out.println("Serial input stream has been assigned."); }//try catch(IOException e) { System.out.println("Error: Couldn't assign input stream to serial port."); }//catch ======================================================================== -- Kim Lux, Diesel Research Inc. From lux at diesel-research.com Fri Feb 10 21:23:00 2006 From: lux at diesel-research.com (Kim Lux) Date: Fri, 10 Feb 2006 21:23:00 -0700 Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Message-ID: <1139631780.23882.10.camel@zd7280> I've got a problem receiving chars with my version of serialRead, written in an SWT GUI. I had a Java pro have a good look at my code and he can't see anything wrong with it. I can send chars fine. When I receive a char the cpu usage for the app goes to 100% and the code in the serial event handler doesn't get executed. The instructions on the Java Comm Serial API How-To for Linux page state that I must install javacomm. Is that true ? Everything builds without it and I can send chars on rxtx just fine, but I can't receive them. Could this be the problem ? I downloaded and installed javacomm. I was not able to add "Driver=gnuio.RXTXCommDriver to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 installed in /usr/java/jre1.5.0_05. I added comm.jar to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext to the library paths. Is this OK ? Does it matter that I am receiving on /dev/ttyUSB0 ? Thanks. -- Kim Lux, Diesel Research Inc. From lunareclipse03 at web.de Sat Feb 11 09:44:46 2006 From: lunareclipse03 at web.de (lunareclipse03@web.de) Date: Sat, 11 Feb 2006 17:44:46 +0100 Subject: [Rxtx] Question about Serial I/O under Win32 Message-ID: <662084330@web.de> Hello everybody, I have a strange problem with a piece of code I made for myself. No, this is not really concerning rxtx, but nevertheless I post this to the list, hoping that some of you can help me. I've written two libraries, one for linux and one for win32. The linux port works quite well, I can send / receive faxes and / or replay voice messages over the telephone line using a voice modem. But the win32 port of the library causes some trouble. If, for example, I send out a fax with a certain modem under linux, it works well. The fax is complete when it comes out of the fax machine. If I then use the same modem to send out a fax under win32, the fax coming out of the fax machine gets "stuck" halfways, but the sending modem thinks that transmission was ok and drops the connection. The answering fax machine then gives me "error while receiving." The "upper layer" java code MUST be right, because if I do the same thing under linux (using the linux library), everything is alright. Now I have to ask: Can somebody please help me out with this??!? Could it be the case that some kind of flow control or COMMTIMEOUTS setting causes this behaviour? I set flow control to RTS/CTS before sending out a fax. How can I DISABLE flow control? Or what do you think? Can something else cause this problems? Thank you all for your time and PLEASE write back soon. Regards, --Sven Ahlemann Am Waldrand 31 45721 Haltern am See Germany ______________________________________________________________ Verschicken Sie romantische, coole und witzige Bilder per SMS! Jetzt bei WEB.DE FreeMail: http://f.web.de/?mc=021193 From lux at diesel-research.com Sat Feb 11 10:06:52 2006 From: lux at diesel-research.com (Kim Lux) Date: Sat, 11 Feb 2006 10:06:52 -0700 Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: <1139631780.23882.10.camel@zd7280> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> <1139631780.23882.10.camel@zd7280> Message-ID: <1139677612.3431.5.camel@zd7280> More on this problem. I copied and pasted simpleRead into a console based Eclipse project and I've got the same result, except that cpu usage doesn't go to 100%. I'm beginning to think there is an issue in rxtx. My imports for simpleRead are: ============================ import gnu.io.*; import java.util.*; //import javax.comm.*; import java.io.*; =========================== Any ideas ? I am trying to read from /dev/ttyUSB0 using a serial to USB adapter which has worked well with minicom and gtkterm. Thanks. On Fri, 2006-02-10 at 21:23 -0700, Kim Lux wrote: > I've got a problem receiving chars with my version of serialRead, > written in an SWT GUI. > > I had a Java pro have a good look at my code and he can't see anything > wrong with it. > > I can send chars fine. When I receive a char the cpu usage for the app > goes to 100% and the code in the serial event handler doesn't get > executed. > > The instructions on the Java Comm Serial API How-To for Linux page state > that I must install javacomm. Is that true ? Everything builds without > it and I can send chars on rxtx just fine, but I can't receive them. > Could this be the problem ? > > I downloaded and installed javacomm. I was not able to add > "Driver=gnuio.RXTXCommDriver > to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not > have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 > installed in /usr/java/jre1.5.0_05. I added comm.jar > to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext > to the library paths. Is this OK ? > > Does it matter that I am receiving on /dev/ttyUSB0 ? > > Thanks. > -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Sun Feb 12 21:01:33 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:01:33 -0700 (MST) Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: <1139677612.3431.5.camel@zd7280> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> <1139631780.23882.10.camel@zd7280> <1139677612.3431.5.camel@zd7280> Message-ID: I suspect what is happening is the select() is breaking out in the native code but the driver does not have support for notifying there are X bytes available. On some traditional Unix based systems, the only way you know data is available is the fd status changes and do an FIORDCHK ioctl. Or perhaps the only thing you can know is the fd status changed. It would take reading through the kernel driver code to know for sure. So on USB, depending upon the driver, the same may need to be done or the driver improved a bit if possible to support. Polling reads will also work but don't use the event driven model of CommAPI which isnt acceptable in the long run. The 100% cpu usage can then be explained because select no longer blocks until the data is read; the eventLoop spins loose. You can put a well placed sleep but rxtx only expects those are needed when it knows data is available. This may not be a super simple thing to understand and fix. I do have ideas to get you started. I'm going to be short on time the next couple weeks. I expect to put some good time in and answer some other questions I saw around the 25th. For now, I'd look at the following and go from there with the hints I've given. JNIEXPORT jint JNICALL RXTXPort(nativeavailable)( JNIEnv *env, jobject jobj ) { int fd = get_java_var( env, jobj,"fd","I" ); int result; /* char message[80]; ENTER( "RXTXPort:nativeavailable" ); On SCO OpenServer FIONREAD always fails for serial devices, so try ioctl FIORDCHK instead; will only tell us whether bytes are available, not how many, but better than nothing. This turns out to be true on Solaris also. taj. */ #ifdef FIORDCHK /* __unixware__ __sun__ probably others */ result = ioctl(fd, FIORDCHK, 0); #else if( ioctl( fd, FIONREAD, &result ) < 0 ) { goto fail; } #endif /* FIORDCHK */ On Sat, 11 Feb 2006, Kim Lux wrote: > > More on this problem. I copied and pasted simpleRead into a console > based Eclipse project and I've got the same result, except that cpu > usage doesn't go to 100%. I'm beginning to think there is an issue in > rxtx. > > My imports for simpleRead are: > > ============================ > import gnu.io.*; > import java.util.*; > //import javax.comm.*; > import java.io.*; > =========================== > > Any ideas ? I am trying to read from /dev/ttyUSB0 using a serial to > USB adapter which has worked well with minicom and gtkterm. > > Thanks. > > > > On Fri, 2006-02-10 at 21:23 -0700, Kim Lux wrote: >> I've got a problem receiving chars with my version of serialRead, >> written in an SWT GUI. >> >> I had a Java pro have a good look at my code and he can't see anything >> wrong with it. >> >> I can send chars fine. When I receive a char the cpu usage for the app >> goes to 100% and the code in the serial event handler doesn't get >> executed. >> >> The instructions on the Java Comm Serial API How-To for Linux page state >> that I must install javacomm. Is that true ? Everything builds without >> it and I can send chars on rxtx just fine, but I can't receive them. >> Could this be the problem ? >> >> I downloaded and installed javacomm. I was not able to add >> "Driver=gnuio.RXTXCommDriver >> to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not >> have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 >> installed in /usr/java/jre1.5.0_05. I added comm.jar >> to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext >> to the library paths. Is this OK ? >> >> Does it matter that I am receiving on /dev/ttyUSB0 ? >> >> Thanks. >> > From tjarvi at qbang.org Sun Feb 12 21:03:30 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:03:30 -0700 (MST) Subject: [Rxtx] One serial port object for both sending and receiving ? In-Reply-To: <1139610545.18177.4.camel@zd7280> References: <1139610545.18177.4.camel@zd7280> Message-ID: On Fri, 10 Feb 2006, Kim Lux wrote: > > Is it OK to use one SerialPort ojbect (ex Serial Port serialPort;) and > use it for both sending and receiving ? > > For example: > > ======================================================================== > static SerialPort serialPort = null; > static OutputStream serialOut = null; > static InputStream serialIn = null; > > > > > // assign it to an outputStream for use > try{ > serialOut = serialPort.getOutputStream(); > System.out.println("Serial output stream has been assigned."); > }//try > catch(IOException e) > { > System.out.println("Error: Couldn't assign output stream to serial > port."); > }//catch > > > //assign it to an inputStream for use > try{ > serialIn = serialPort.getInputStream(); > System.out.println("Serial input stream has been assigned."); > }//try > catch(IOException e) > { > System.out.println("Error: Couldn't assign input stream to serial > port."); > }//catch This should be fine. In fact trying to do it another way will probably not work as you will run into lockfile issues. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun Feb 12 21:13:13 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:13:13 -0700 (MST) Subject: [Rxtx] Question about Serial I/O under Win32 In-Reply-To: <662084330@web.de> References: <662084330@web.de> Message-ID: On Sat, 11 Feb 2006 lunareclipse03 at web.de wrote: > Hello everybody, > > I have a strange problem with a piece of code I made for myself. No, > this is not really concerning rxtx, but nevertheless I post this to the > list, hoping that some of you can help me. I've written two libraries, > one for linux and one for win32. The linux port works quite well, I can > send / receive faxes and / or replay voice messages over the telephone > line using a voice modem. But the win32 port of the library causes some > trouble. If, for example, I send out a fax with a certain modem under > linux, it works well. The fax is complete when it comes out of the fax > machine. If I then use the same modem to send out a fax under win32, the > fax coming out of the fax machine gets "stuck" halfways, but the sending > modem thinks that transmission was ok and drops the connection. The > answering fax machine then gives me "error while receiving." The "upper > layer" java code MUST be right, because if I do the same thing under > linux (using the linux library), everything is alright. Now I have to > ask: Can somebody please help me out with this??!? Could it be the case > that some kind of flow control or COMMTIMEOUTS setting causes this > behaviour? I set flow control to RTS/CTS before sending out a fax. How > can I DISABLE flow control? Or what do you think? Can something else > cause this problems? Thank you all for your time and PLEASE write back > soon. > Hi Sven I'm not too willing to talk about flow control at the low level until I confirm some things with test equipment later. It is not clear if you are using rxtx or writing your own native code. So I'm not sure how to answer much of this :) If you are wondering how to change the flow control using rxtx from java, The BlackBox example from Sun flips this back and forth. SerialPort.java in rxtx 2.1 uses the following: SerialPort.java: public static final int FLOWCONTROL_NONE =0; SerialPort.java: public static final int FLOWCONTROL_RTSCTS_IN =1; SerialPort.java: public static final int FLOWCONTROL_RTSCTS_OUT =2; SerialPort.java: public static final int FLOWCONTROL_XONXOFF_IN =4; SerialPort.java: public static final int FLOWCONTROL_XONXOFF_OUT=8; So if you set flowcontrol to RTSCTS, you can set it to NONE to turn it off. If you are looking for how to do it in native code, the rxtx Source is SerialImp.c (unix/linux/mac os x/w32) and termios.c (w32 only with SerialImp.c) You can track the code: SerialImp.c:JNIEXPORT void JNICALL RXTXPort(setflowcontrol)( JNIEnv *env, jobject jobj, jint flowmode ) termios.c:int tcgetattr( int fd, struct termios *s_termios ) termios.c:int tcsetattr( int fd, int when, struct termios *s_termios ) There may be a problem in the rxtx flow control code though. Rather than guess, I want to test this with a gold standard. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Feb 6 00:00:16 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 00:00:16 -0700 (MST) Subject: [Rxtx] wiki delay until tomorrow night. In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: On Sun, 5 Feb 2006, Trent Jarvi wrote: > On Sun, 5 Feb 2006, Kim Lux wrote: > >> usb ? Tell me more... I need that too. > > usb is a very proper design. Thats all it is. > Maybe rxtx could help usb. But it would start with helping bring back the community that was already there. It's not something I'd love to do but maybe its the right thing to do. It would probably take 2 years to do right. But maybe thats better than what we have now. I honestly don't know what IBM is doing which could just run over everything. Just some thoughts after some fine german wine. -- Trent Jarvi tjarvi at qbang.org From gadelavega at yahoo.com.ar Mon Feb 6 02:17:05 2006 From: gadelavega at yahoo.com.ar (Gonzalo A. de la Vega) Date: Mon, 06 Feb 2006 10:17:05 +0100 Subject: [Rxtx] Serial port ownership question In-Reply-To: References: <20060205113618.30274.qmail@web53501.mail.yahoo.com> <1139157422.4553.9.camel@zd7280> <1139158698.4936.9.camel@zd7280> Message-ID: <43E71411.4050402@yahoo.com.ar> On my Fedora Core 4: ls -l /dev/ttyS* crw-rw---- 1 root uucp 4, 64 Feb 6 2006 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Feb 6 2006 /dev/ttyS1 ... and: grep "ttyUSB" /etc/udev/rules.d/50-udev.rules KERNEL=="ttyUSB*", GROUP="uucp", MODE="0660" So anyone in the "uucp" group can use serial ports. On Gentoo the group is "tty". Trent Jarvi escribi?: > > > On Sun, 5 Feb 2006, Dr. Douglas Lyon wrote: > >> I can confirm that this is the case (only root ownership of >> serial ports, under fedora 4). >> Wow, what were they thinking?! >> - DL >> >>> I've found that the newer kernels have the serial ports owned by root. >>> For example, >>> >>> $ls -al /dev/tty* >>> crw-rw-rw- 1 root root 5, 0 Feb 5 02:06 /dev/tty >>> crw-rw---- 1 root root 4, 0 Feb 5 02:06 /dev/tty0 >>> crw------- 1 root root 4, 1 Feb 5 09:07 /dev/tty1 >>> crw-rw---- 1 root tty 4, 10 Feb 5 02:06 /dev/tty10 >>> crw-rw---- 1 root tty 4, 11 Feb 5 02:06 /dev/tty11 >>> ... > > > This is just not a problem jcp or such are going to solve. Its a > platform spitwad fight. But do look at pam. In fact thats what Sun > is doing too. Maybe Linux followed their lead.. I'm not a pam guy. > I've spent 16 hours trying to understand it but your users wont :) > > Solution? I have no clue. Its two tangent mentalities from my > perspective. > > -- > Trent Jarvi > tjarvi at qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mtnvega at yahoo.com.br Mon Feb 6 05:35:43 2006 From: mtnvega at yahoo.com.br (Luiz Jr) Date: Mon, 6 Feb 2006 12:35:43 +0000 (GMT) Subject: [Rxtx] Documentation Wiki In-Reply-To: <1139157422.4553.9.camel@zd7280> Message-ID: <20060206123543.57256.qmail@web53515.mail.yahoo.com> Hello, Thank you for you answer, but so the usage of the API is pretty much like the Java Communications Api? If yes, what version of the Java Comm Api? Thank you, Luiz A. Brandao Jr Kim Lux escreveu: On Sun, 2006-02-05 at 08:36 -0300, Luiz Jr wrote: > Hello, > > I want to start using the RXTX libraries, but I would to know how, > since I can not access the documentation wiki page I just started using them yesterday. Below is how I installed the libraries, if that helps. I used snippets of code from the SimpleWrite application here to get me going. http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html Instead of "import javax.comm.*;", use "import gnu.io.*;" which is gotten from RXTXcomm.jar, which you will need to include in your project references. I am working in Eclipse. BTW: there is no way to open a port without going through the port list and finding it. Maybe sometime in the future someone (me ?) will write a method called openSerialPort that allows the user to give a port identifier, such as "/dev/tty1" and return a port ready to use. It wouldn't take much to write that and it would save users a lot of code. Hope this helps. ======================================================================= 1) Figure out which java you are running, incase there is more than one installed. $ java -version java version "1.5.0_05" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_05-b05) Java HotSpot(TM) Client VM (build 1.5.0_05-b05, mixed mode, sharing) 2) Find all the jre directories and the one from which you are currently running. kfind (jre) 3) cd to that directory plus /lib/i386 cd /usr/java/jre1.5.0_05/lib/i386 4) Copy the library files (*.so) to that directory. cp /home/krlux/Desktop/'Java Controls'/rxtx-linux/bin/* . 5) Check that the copy was successful ls librxtx* librxtxI2C.so librxtxRaw.so librxtxSerial.so librxtxParallel.so librxtxRS485.so 6) cd to the /lib/ext directory for your java. cd /usr/java/jre1.5.0_05/lib/ext 7) Copy the Jar files there cp /home/krlux/Desktop/'Java Controls'/rxtx-linux/lib/ext/* . 8) Check that it was successful ls RXTX* RXTXcomm.jar Rxtx is now installed on your machine ready to use. =================================================================== -- Kim Lux, Diesel Research Inc. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx --------------------------------- Yahoo! Acesso Gr?tis - Internet r?pida e gr?tis. Instale o discador agora! -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/544aa403/attachment-0065.html From lyon at docjava.com Mon Feb 6 05:49:34 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 06 Feb 2006 07:49:34 -0500 Subject: [Rxtx] wiki delay until tomorrow night. In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: Hi All, I have often thought about USB drivers being needed. For example, the ironman watch will not interface to a mac (windows only). It is USB. My dymo label writer has no Java driver (native only). Etc. Most cheap web cameras are USB (and Java drivers go through JAI, if it supports the camera at all). The JAI code shows how sun did the USB drivers. You have to be a member of the jai project to download the source code. https://jai.dev.java.net has the jai distro. And then you are not allowed to redistribute it. However, we can all learn from it (if so inclined). Basically: cvs -d :pserver:lyon at cvs.dev.java.net:/cvs login cvs -d :pserver:lyon at cvs.dev.java.net:/cvs checkout jai-core You will need to user your own uid and pw to get in. The ant build has over 100 warnings from sun deprecations of its own code. You might say that they were hoisted on their own Picard ;) One interesting thing is that they support several platforms: linux-amd64 64-bit Linux-AMD64 linux-i586 32-bit Linux-x86 solaris-amd64 64-bit Solaris-AMD64 solaris-i586 32-bit Solaris-x86 solaris-sparc 32-bit Solaris-SPARC solaris-sparcv9 64-bit Solaris-SPARC windows-i586 32-bit Windows-x86 Thus, ant is used to provide a multi-platform native method distro. Neat. How do they do it? check this out: And: The core download does not contain any C source code (it was all pre-built). Basically, they are just copying .so and .dll files into build directories. I would love to see the C code for this...but Sun does not post it on the https://jai.dev.java.net site. I don't know why...Perhaps I missed it. - Doug >On Sun, 5 Feb 2006, Trent Jarvi wrote: > >>On Sun, 5 Feb 2006, Kim Lux wrote: >> >>>usb ? Tell me more... I need that too. >> >>usb is a very proper design. Thats all it is. >> > >Maybe rxtx could help usb. But it would start with helping bring >back the community that was already there. > >It's not something I'd love to do but maybe its the right thing to do. > >It would probably take 2 years to do right. But maybe thats better >than what we have now. > >I honestly don't know what IBM is doing which could just run over everything. > >Just some thoughts after some fine german wine. > >-- >Trent Jarvi >tjarvi at qbang.org > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tdelenik at gmail.com Mon Feb 6 05:56:32 2006 From: tdelenik at gmail.com (Thanasis Delenikas) Date: Mon, 6 Feb 2006 14:56:32 +0200 Subject: Fwd: [Rxtx] Documentation Wiki In-Reply-To: <1139157422.4553.9.camel@zd7280> References: <20060205113618.30274.qmail@web53501.mail.yahoo.com> <1139157422.4553.9.camel@zd7280> Message-ID: <310a1a930602060456t129f1dc6p5f2b908f13ab5a0b@mail.gmail.com> Hello all, Kim, this is a snippet from the code I use. The closest to directly opening a specific port without enumeration. << ... portId = CommPortIdentifier.getPortIdentifier(getPort()); serialPort = (SerialPort) portId.open("jSMSEngine", 1971); ... >> where getPort() return the string identifier of the port, i.e. "/dev/ttyS0" or "COM1" or whatever. Thanasis. ---------- Forwarded message ---------- From: Kim Lux Date: Feb 5, 2006 6:37 PM Subject: Re: [Rxtx] Documentation Wiki To: RXTX Developers and Users BTW: there is no way to open a port without going through the port list and finding it. Maybe sometime in the future someone (me ?) will write a method called openSerialPort that allows the user to give a port identifier, such as "/dev/tty1" and return a port ready to use. It wouldn't take much to write that and it would save users a lot of code. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/182ab5b8/attachment-0065.html From tjarvi at qbang.org Mon Feb 6 11:53:57 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 11:53:57 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: On Mon, 6 Feb 2006, Dr. Douglas Lyon wrote: > Hi All, > I have often thought about USB drivers being needed. > For example, the ironman watch will not interface > to a mac (windows only). It is USB. > My dymo label writer has no Java driver (native only). > Etc. > Most cheap web cameras are USB (and Java drivers go > through JAI, if it supports the camera at all). > The JAI code shows how sun did the USB drivers. > You have to be a member of the jai project to download > the source code. > https://jai.dev.java.net has the jai distro. > And then you are not allowed to redistribute it. However, > we can all learn from it (if so inclined). Basically: > cvs -d :pserver:lyon at cvs.dev.java.net:/cvs login > cvs -d :pserver:lyon at cvs.dev.java.net:/cvs checkout jai-core > You will need to user your own uid and pw to get in. > The ant build has over 100 warnings from sun deprecations > of its own code. > > You might say that they were hoisted on their own Picard ;) > > One interesting thing is that they support several platforms: > linux-amd64 64-bit Linux-AMD64 > linux-i586 32-bit Linux-x86 > solaris-amd64 64-bit Solaris-AMD64 > solaris-i586 32-bit Solaris-x86 > solaris-sparc 32-bit Solaris-SPARC > solaris-sparcv9 64-bit Solaris-SPARC > windows-i586 32-bit Windows-x86 > Thus, ant is used to provide a multi-platform native method distro. > Neat. > How do they do it? > check this out: > > > > > > > > > > > > > And: > > > > > > > > > > The core download does not contain any C source code (it was all pre-built). > Basically, they are just copying .so and .dll files into build directories. > > I would love to see the C code for this...but Sun does not post it on the > https://jai.dev.java.net site. > > I don't know why...Perhaps I missed it. > > - Doug > > I've looked at moving rxtx to Ant builds. I think that would help IDEs a great deal. I requested a evalutation desk copy the O'Reilly Ant book for some j2ee material I was teaching. http://www.oreilly.com/catalog/anttdg/ It has a one sentence mention of JNI. So there was not luck there. I saw that there is another Ant book that does mention JNI more. I can't find it now. Ant must be able to support it with extensions. http://ant.apache.org/manual/OptionalTasks/javah.html What the auto(break :) tools do in the rxtx build is 4 things really. 1) gcc compile flags 2) ld compile flags 3) config.h 4) compile flags for customizing rxtx (lockfiles, ...) See 1 All of this information except 4 can be static once obtained. So I'm not attached to the auto tools. If I could find an example of Ant being used for JNI code, I'd be one of the first to start moving that direction. Maybe someone saw an example someplace. The other thing we have not completed discussing is the directory structure. There is interest in making rxtx more IDE friendly. I get more mail about that off the list than how to install rxtx. And I see we have Ken Thompson in da house :) He is our trusted CVS maintainer and the guy that purchased the rxtx.org domain. Old community. We will need Ken for changing the directory structure of source. I would like to open up discussion about both of these as it is more than time. The problem is I have little experience with Ant and even less with IDEs. It would be nice if we could work with Eclipse and NetBeans. http://www.netbeans.org/ (sun and some community) http://www.eclipes.org (ibm,rhat,... perhaps more community) http://maven.apache.org/what-is-maven.html (apache. It is community) borland should sortof be here too but I think thats covered in eclipse. >From what I understand so far, we should morph rxtx to support those three maybe trusting apaches lead with maven. But I use vi. I have little to no clues beyond what people have fed me. Can we agree that thats the right direction to go? -- Trent Jarvi tjarvi at qbang.org From brian at mbari.org Mon Feb 6 14:57:50 2006 From: brian at mbari.org (Brian Schlining) Date: Mon, 6 Feb 2006 13:57:50 -0800 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> > The other thing we have not completed discussing is the directory > structure. There is interest in making rxtx more IDE friendly. I > get more mail about that off the list than how to install rxtx. > > And I see we have Ken Thompson in da house :) He is our trusted > CVS maintainer and the guy that purchased the rxtx.org domain. Old > community. We will need Ken for changing the directory structure of > source. > > I would like to open up discussion about both of these as it is > more than time. The problem is I have little experience with Ant > and even less with IDEs. It would be nice if we could work with > Eclipse and NetBeans. > > http://www.netbeans.org/ (sun and some community) > http://www.eclipes.org (ibm,rhat,... perhaps more community) > http://maven.apache.org/what-is-maven.html (apache. It is community) > borland should sortof be here too but I think thats covered in > eclipse. > >> From what I understand so far, we should morph rxtx to support >> those three > maybe trusting apaches lead with maven. But I use vi. I have > little to no clues beyond what people have fed me. > Maven likes the directory structure below for Java code. (From http:// maven.apache.org/guides/getting-started/index.html) This structure works fine with ant, netbeans, and eclipse. rxtx_root_directory `-- src |-- main | `-- java | `-- gnu | `-- io `-- test `-- java `-- gnu `-- io Brian Schlining Software Engineer http://www.mbari.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/d9451eba/attachment-0065.html From tjarvi at qbang.org Mon Feb 6 15:11:45 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 15:11:45 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: > rxtx_root_directory > `-- src > |-- main > | `-- java > | `-- gnu > | `-- io > `-- test > `-- java > `-- gnu > `-- io > >From what I understand this will just be good. For me it makes no difference. So lets do the rxtx thing. Let if fester for two weeks and if nobody objects, we will do it. I'm not doing this because I care. I'm doing this to eliminate much of my inbox. But test... man is rxtx lacking there in the community aspect. It is covered but not right. _maybe_ I can change that this year. -- Trent Jarvi tjarvi at qbang.org (cat hurding since 1997) From lux at diesel-research.com Mon Feb 6 21:38:49 2006 From: lux at diesel-research.com (Kim Lux) Date: Mon, 06 Feb 2006 21:38:49 -0700 Subject: [Rxtx] How can I use Lock Files with rxtx (in FC4) ? Message-ID: <1139287129.17031.3.camel@zd7280> I am now running an rxtx application on FC4. I am getting: ========================================================= check_group_uucp(): error testing lock file creation Error details: Permission denied check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL ========================================================= $ ls -al /var/lock total 32 drwxrwxr-x 4 root lock 4096 Feb 6 16:04 . drwxr-xr-x 24 root root 4096 Nov 14 01:19 .. drwx------ 2 root root 4096 Apr 27 2005 lvm drwxr-xr-x 2 root root 4096 Feb 6 16:04 subsys How do I fix this for regulator users ? -- Kim Lux, Diesel Research Inc. From dmarkman at mac.com Mon Feb 6 22:24:44 2006 From: dmarkman at mac.com (Dmitry Markman) Date: Tue, 7 Feb 2006 00:24:44 -0500 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: if I understands the issue right in order to be able to use ant for c/c++ compilation you have to install ant's cc task http://ant-contrib.sourceforge.net/cc.html it looks like it should work on mac os x (authors claim, that it's platform independent) but I never tested so all you have to do it's providing right command line for the gcc compiler On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: >> rxtx_root_directory >> `-- src >> |-- main >> | `-- java >> | `-- gnu >> | `-- io >> `-- test >> `-- java >> `-- gnu >> `-- io >> > > >> From what I understand this will just be good. > > For me it makes no difference. So lets do the rxtx thing. Let if > fester for two weeks and if nobody objects, we will do it. > > I'm not doing this because I care. I'm doing this to eliminate > much of my inbox. > > But test... man is rxtx lacking there in the community aspect. It > is covered but not right. _maybe_ I can change that this year. > > -- > Trent Jarvi > tjarvi at qbang.org > (cat hurding since 1997) > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx Dmitry Markman From lux at diesel-research.com Mon Feb 6 23:20:15 2006 From: lux at diesel-research.com (Kim Lux) Date: Mon, 06 Feb 2006 23:20:15 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? Message-ID: <1139293215.3689.4.camel@zd7280> I'm running the code below. portlist.hasMoreElements() is false. /dev has ports in it as listed below. What am I doing wrong ? ========================================================== // Step through the list of ports until we find one that matches // the one we are looking for. portList = CommPortIdentifier.getPortIdentifiers(); while(portList.hasMoreElements()) { portID = (CommPortIdentifier) portList.nextElement(); // if (portID.getName().equals("/dev/ttyUSB0")) { myTA.append("Serial port ttyUSB0 has been found\n"); break; }// if portID equals... }// End of while... ========================================================== ls -al /dev/tty* crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 ... crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 -- Kim Lux, Diesel Research Inc. From david.garnier at trusted-logic.com Tue Feb 7 00:46:30 2006 From: david.garnier at trusted-logic.com (David Garnier) Date: Tue, 07 Feb 2006 08:46:30 +0100 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: <43E85056.2090608@trusted-logic.com> Hello, I think that the make-based build process is fine as it is, apart from the location of the Java source files. It is true that putting the Java source in a directory structure that map 1-to-1 to the Java package structure is the norm and should make it easier for everyone to modify the Java source, with or without an IDE. Ant is a good tool, but in the RXTX case I fail to see the advantage of using it compared to the current make-based process. As Trent said, they are more pressing issues, like testing. Regards, David Dmitry Markman wrote: > if I understands the issue right > in order to be able to use ant for c/c++ compilation > you have to install ant's cc task > http://ant-contrib.sourceforge.net/cc.html > > it looks like it should work on mac os x > (authors claim, that it's platform independent) > but I never tested > > so all you have to do it's providing right command line > for the gcc compiler > > > > > On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: > >>> rxtx_root_directory >>> `-- src >>> |-- main >>> | `-- java >>> | `-- gnu >>> | `-- io >>> `-- test >>> `-- java >>> `-- gnu >>> `-- io >>> >> >> >>> From what I understand this will just be good. >> >> For me it makes no difference. So lets do the rxtx thing. Let if >> fester for two weeks and if nobody objects, we will do it. >> >> I'm not doing this because I care. I'm doing this to eliminate much >> of my inbox. >> >> But test... man is rxtx lacking there in the community aspect. It is >> covered but not right. _maybe_ I can change that this year. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> (cat hurding since 1997) From tjarvi at qbang.org Tue Feb 7 01:11:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 01:11:31 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <43E85056.2090608@trusted-logic.com> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: On Tue, 7 Feb 2006, David Garnier wrote: > Hello, > > I think that the make-based build process is fine as it is, apart from the location of the Java > source files. It is true that putting the Java source in a directory structure that map 1-to-1 to > the Java package structure is the norm and should make it easier for everyone to modify the Java > source, with or without an IDE. > > Ant is a good tool, but in the RXTX case I fail to see the advantage of using it compared to the > current make-based process. As Trent said, they are more pressing issues, like testing. > Hi David I have more experience with testing rxtx than I can talk about. But let it be known, rxtx has gone trough 100's of hours of testing. We are hobby folks interested in toys but there is more. rxtx has had some of the best guidance in the industry there. This is not an easy thing. I may be able to come back in a month from the other side of the corperate fence and help. I suspect the tests could just be made public but they are in a very unusual environment that just wont work in a wider sense. This is something I'll be trying to change. At one point it was agreed we could just make the results public so this isnt just noise.. There is interest and I think its safe to mention that much. The big problem with testing in the past is most of it is done with a loopback connection. So we *still* have major questions regarding things like flow control. rxtx talks to itself over a loopback and it works. regardless of right or wrong. This requires more thought to be done right. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Feb 7 02:46:34 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 02:46:34 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: > The big problem with testing in the past is most of it is done with a > loopback connection. So we *still* have major questions regarding things > like flow control. rxtx talks to itself over a loopback and it works. > regardless of right or wrong. With serial communication there are gold standards. ckermit is probably a definitive 'standard.' Maybe its possible to do ping/pong tests with ckermit? Is it scriptable? There are known issues in rxtx. Probably the worst is some threading issues regarding some JREs with multiple JNI threads setting java variables. Man did I get schooled there. Just switch the c functions to returning variables and things go away. Sometimes they work fine, sometimes they blow up. Without understanding everything, somehow rhat got it right and debian (and especially gentoo) grabbed kernel patches causing all sort of harm. Its not hard to fix once you understand whats going on but nearly impossible to track with a debugger. So I have a good idea what 2.1-8 will have outside of the IDE modifications. rxtx 2.1-7 is a release for everyone to sync with. Its not even as stable as -pre17 as far as I know - I ran no test suites. I'll be chasing it too. We just had so many contributions that it was time. It seriously broke internal scheduals but thats a great thing :) The other thing I want to do in 2.1-8 is automagic baud rates. It turns out lots of shops are doing really funky baud rates for things like automobile test equipment. It is possible but it requires a fair amount of change in the native code. Is anyone looking at this? -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Feb 7 02:57:21 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 07 Feb 2006 04:57:21 -0500 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <43E85056.2090608@trusted-logic.com> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: Hi All, I agree, testing is very important. The problem I have been trying to address is related to cross-platform testing and the robust nature of the installs. Typically, I visit 3 platforms to deploy my product, windows, linux and mac. A build is performed on each platform. The idea that you can build for many platforms from one copy the source code seems attractive. This should enable synchronized deployments of identical code. The question of how to achieve this goal remains open. As Trent mentioned, this is hard. Perhaps Ant will help here (but perhaps not). Ant does seem to help with running unit tests. However, it does not help with multi-platform tests. For that you need many machines and different operating environments. Toward that end, I have created a multi-platform test that can be run from web start, located at: http://show.docjava.com:8086/book/cgij/code/jnlp/serialPort.PortTest.jnlp This is interesting because many people in the community can run the test and we can improve the test, as time permits. No, it is not a perfect solution, however, the idea does help with multi-platform tests using many machines and different operating environments. If the group has a good test for a general serial port set-ups, i would be happy to deploy it, for general evaluation using web start. And as for ANT, it is just an idea. Not all my ideas are good ones! - Doug >Hello, > >I think that the make-based build process is fine as it is, apart >from the location of the Java >source files. It is true that putting the Java source in a directory >structure that map 1-to-1 to >the Java package structure is the norm and should make it easier for >everyone to modify the Java >source, with or without an IDE. > >Ant is a good tool, but in the RXTX case I fail to see the advantage >of using it compared to the >current make-based process. As Trent said, they are more pressing >issues, like testing. > >Regards, >David > >Dmitry Markman wrote: >> if I understands the issue right >> in order to be able to use ant for c/c++ compilation >> you have to install ant's cc task >> http://ant-contrib.sourceforge.net/cc.html >> >> it looks like it should work on mac os x >> (authors claim, that it's platform independent) >> but I never tested >> >> so all you have to do it's providing right command line >> for the gcc compiler >> >> >> >> >> On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: >> >>>> rxtx_root_directory >>>> `-- src >>>> |-- main >>>> | `-- java >>>> | `-- gnu >>>> | `-- io >>>> `-- test >>>> `-- java >>>> `-- gnu >>>> `-- io >>>> >>> >>> >>>> From what I understand this will just be good. >>> >>> For me it makes no difference. So lets do the rxtx thing. Let if >>> fester for two weeks and if nobody objects, we will do it. >>> >>> I'm not doing this because I care. I'm doing this to eliminate much >>> of my inbox. >>> >>> But test... man is rxtx lacking there in the community aspect. It is >>> covered but not right. _maybe_ I can change that this year. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> (cat hurding since 1997) > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From matt.higgins at gmail.com Tue Feb 7 08:28:34 2006 From: matt.higgins at gmail.com (Matt Higgins) Date: Tue, 7 Feb 2006 10:28:34 -0500 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final Message-ID: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? import java.io.*; import java.util.*; import gnu.io.*; public class MySimpleRead implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; public static void main(String[] args) { boolean portFound = false; String defaultPort = "COM1"; if (args.length > 0) { defaultPort = args[0]; } portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; MySimpleRead reader = new MySimpleRead(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } } public MySimpleRead() { try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) { e.printStackTrace(); } try { inputStream = serialPort.getInputStream(); } catch (IOException e) { e.printStackTrace(); } try { serialPort.addEventListener(this); } catch (TooManyListenersException e) { e.printStackTrace(); } try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { e.printStackTrace(); } System.out.println("Baud is " + serialPort.getBaudRate()); System.out.println("Bits is " + serialPort.getDataBits()); System.out.println("Stop is " + serialPort.getStopBits()); System.out.println("Par is " + serialPort.getParity()); serialPort.notifyOnDataAvailable(true); readThread = new Thread(this); readThread.start(); } public void run() { // Thread.sleep(20000); //} catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { System.out.println("An event occurred " + event.getEventType()); switch (event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: byte[] readBuffer = new byte[20]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } System.out.print(new String(readBuffer)); } catch (IOException e) {} break; } } } --------------- Result on windows ------------------------------ Stable Library ============================================================== Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port:: COM1 Baud is 9600 Bits is 8 Stop is 1 Par is 0 ----------------- End Results ----------------------------------------- ------------------ Result on Linux ----------------------------------- Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 Found port: /dev/ttyS0 Baud is 9600 Bits is 8 Stop is 1 Par is 0 An event occurred 1 043100066224 ------------------ End Results --------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/a1431630/attachment-0065.html From brian at mbari.org Tue Feb 7 09:48:37 2006 From: brian at mbari.org (Brian Schlining) Date: Tue, 7 Feb 2006 08:48:37 -0800 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> Message-ID: <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> Hi Matt > The following code works fine on Linux but I never see any data > when run on Windows. This is a cut and paste from the SimpleRead > example. > I am attempting to read data from a bar code scanner. I can fire > up HyperTermianl on windows and see that the device is working > properly as I see the barcodes are scanned and echoed back to the > terminal. However when I run the app I don't see any data. It is > however associating with the com port as the informational bits > print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. Cheers Brian Schlining Software Engineer http://www.mbari.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/16d07f37/attachment-0065.html From lux at diesel-research.com Tue Feb 7 11:59:58 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 11:59:58 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139293215.3689.4.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> Message-ID: <1139338798.8145.4.camel@zd7280> Any ideas on this ? Any reason why portList.hasMoreElements() should be false even though there are devices in /dev ? On Mon, 2006-02-06 at 23:20 -0700, Kim Lux wrote: > I'm running the code below. > > portlist.hasMoreElements() is false. > > /dev has ports in it as listed below. > > What am I doing wrong ? > > > ========================================================== > // Step through the list of ports until we find one that matches > // the one we are looking for. > > portList = CommPortIdentifier.getPortIdentifiers(); > > while(portList.hasMoreElements()) > { > portID = (CommPortIdentifier) portList.nextElement(); // > if (portID.getName().equals("/dev/ttyUSB0")) > { > myTA.append("Serial port ttyUSB0 has been found\n"); > break; > }// if portID equals... > }// End of while... > ========================================================== > > ls -al /dev/tty* > crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty > crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 > crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 > crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 > crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 > ... > crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 > crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 > crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 > > > -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 12:20:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 12:20:25 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139338798.8145.4.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> Message-ID: On Tue, 7 Feb 2006, Kim Lux wrote: > > Any ideas on this ? Any reason why portList.hasMoreElements() should be > false even though there are devices in /dev ? > > > On Mon, 2006-02-06 at 23:20 -0700, Kim Lux wrote: >> I'm running the code below. >> >> portlist.hasMoreElements() is false. >> >> /dev has ports in it as listed below. >> >> What am I doing wrong ? >> >> >> ========================================================== >> // Step through the list of ports until we find one that matches >> // the one we are looking for. >> >> portList = CommPortIdentifier.getPortIdentifiers(); >> >> while(portList.hasMoreElements()) >> { >> portID = (CommPortIdentifier) portList.nextElement(); // >> if (portID.getName().equals("/dev/ttyUSB0")) >> { >> myTA.append("Serial port ttyUSB0 has been found\n"); >> break; >> }// if portID equals... >> }// End of while... >> ========================================================== >> >> ls -al /dev/tty* >> crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty >> crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 >> crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 >> crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 >> crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 >> ... >> crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 >> crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 >> crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 >> >> >> > Hi Kim What rxtx does is try to open the port and do a timed out read. If the kernel/... do not complain it's enumarted. I suspect you could do a crude test by doing something like cat /dev/ttyS0 > /dev/null If that barfs then rxtx wont enumerate the port. hmm looking at your question again, I suspect it's a lockfile problem. This is documented in INSTALL with the source. Its easy enough to test this too.. touch /var/lock/testingrxtxlockfiles && rm -f /var/lock/testingrxtxlockfiles If you are not in the right group it will bail. Root will work regardless. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 12:37:56 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 12:37:56 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> Message-ID: <1139341076.8145.11.camel@zd7280> Exactly which ports does rxtx attempt to put into the list ? /dev/* or /dev/tty* or /dev/tty[0-9[0-9] ? or /dev/ttyS* ? For the record, only /dev/ttyUSB0 is a valid port on the machine I am presently on. Will this be a problem ? On Tue, 2006-02-07 at 12:20 -0700, Trent Jarvi wrote: > This is documented in INSTALL with the source. > I was wondering where that file was. I will download source and dig it up. Thanks. -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 12:51:09 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 12:51:09 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139341076.8145.11.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: On Tue, 7 Feb 2006, Kim Lux wrote: > > Exactly which ports does rxtx attempt to put into the list ? /dev/* > or /dev/tty* or /dev/tty[0-9[0-9] ? or /dev/ttyS* ? > > For the record, only /dev/ttyUSB0 is a valid port on the machine I am > presently on. Will this be a problem ? > > > On Tue, 2006-02-07 at 12:20 -0700, Trent Jarvi wrote: >> This is documented in INSTALL with the source. >> > I was wondering where that file was. I will download source and dig it > up. > > Thanks. > Hmm I'm looking at pre17 so this may have changed. (its just what I have on this machine) if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA" // for the IPAQs }; CandidatePortPrefixes=Temp; } So you may need to add "ttyUSB" to that list. RXTX used to enumerate _everything_ see if(osName.equals("Linux-all-ports") But it became less than practical. This is all in RXTXCommDriver.java hmm I just did a cvs update. if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have to get your fingers into the code. We aim for sane defaults. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 13:06:45 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 13:06:45 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139342805.8145.22.camel@zd7280> On Tue, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > Hmm I'm looking at pre17 so this may have changed. (its just what I have > on this machine) > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA" // for the IPAQs > }; > CandidatePortPrefixes=Temp; > } > > > So you may need to add "ttyUSB" to that list. RXTX used to enumerate > _everything_ see if(osName.equals("Linux-all-ports") But it became less > than practical. > > This is all in RXTXCommDriver.java > > hmm I just did a cvs update. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have > to get your fingers into the code. We aim for sane defaults. Excellent. Thanks for taking the time. -- Kim Lux, Diesel Research Inc. From ideiglenes1 at freemail.hu Tue Feb 7 13:53:39 2006 From: ideiglenes1 at freemail.hu (--) Date: Tue, 07 Feb 2006 21:53:39 +0100 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139345619.22534.2.camel@localhost> Hi! I use this code to get all the extra Linux devices. :) if ("Linux".equals(System.getProperty("os.name"))) { System.setProperty("os.name","Linux-all-ports"); } driver = new RXTXCommDriver(); On k, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > On Tue, 7 Feb 2006, Kim Lux wrote: > > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have > to get your fingers into the code. We aim for sane defaults. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From matt.higgins at gmail.com Tue Feb 7 13:45:54 2006 From: matt.higgins at gmail.com (Matt Higgins) Date: Tue, 7 Feb 2006 15:45:54 -0500 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> Message-ID: <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> Sweet this is exactly what I needed. I was searching the archives through marc.theamisgroup they only have archives back to 1/3/05. Should have hit the mailman archive! Thanks a lot! On 2/7/06, Brian Schlining wrote: > > Hi Matt > > The following code works fine on Linux but I never see any data when run > on Windows. This is a cut and paste from the SimpleRead example. > I am attempting to read data from a bar code scanner. I can fire up > HyperTermianl on windows and see that the device is working properly as I > see the barcodes are scanned and echoed back to the terminal. However when I > run the app I don't see any data. It is however associating with the com > port as the informational bits print fine? > > > You're not the only one whose had this problem, I don't know if Trent has > addressed this is the latest release of RXTX but there is a workaround. > Here's the recent thread from the RXTX mailing list regarding this issues: > > Thanasis Delenikas tdelenik at gmail.com > Wed Jan 18 13:56:23 MST 2006 > > * Previous message: [Rxtx] Re: More close() performance fixes > * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] > > Hi all. > (I've subscribed again from my other email account). > > Trent, > > You are right. Linux *always* works, no matter what flow control you set. > Windows *works only* with hardware flow control (I haven't tested what > happens with software XON/XOFF flow control). > > I assume (but I am not certain) that even with no flow control at all, all > platforms should work. Without flow control, you have the risk of bumping > into overflow or framing errors, but that's your (the end programmer, I > mean) problem. > > >From my side, I shouldn't be working without flow control. That was a bug > too... It was some code forgotten from the old times, when I used to work > with phone emulation drivers which didn't support flow control. The > correct > way is to have some flow control enabled and that's why I suppose this is > a > low-severity bug for RxTx. > > I have no idea which platform shows the correct behaviour, since > my knowledge about Linux and the inner workings of these low-level i/o > operations is limited. > > Regards, > Thanasis Delenikas. > > > > > Message: 2 > > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > > From: Trent Jarvi > > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > > To: RXTX Developers and Users > > Message-ID: > > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > > > Hi all, > > > > > > Trent, I have found something. > > > I read your comment about flow control, so I experimented a bit. > > > > > > If you remember, in my sample program I've used no flow control at all > ( > > i.e. > > > Java constant FLOWCONTROL_NONE). > > > > > > Now, during testing, I've switch to hardware inbound flow control (i.e > . > > Java > > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > > beautifully! > > > > > > I think I will switch to H/W flow control and test things for a while, > > but > > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > > > > > Hi Thanasis, > > > > I'm fairly sure you have identified a bug. I would not worry too much > > about what Sun CommAPI w32 defaults are. I think they did more or less > > whatever the port opened with. Just a guess. Linux tries to stomp on > > ports so they are all the same. > > > > So this started out with Linux worked, Windows XP/.. did not as I > recall. > > Something is wrong in rxtx. Do I understand this right? > > > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > > > Perhaps there is something Wayne or I did not understand when we wrote > > that code. I wasnt programming back in the BBS days so modems are not > my > > thing. I have a few questions. > > > > Is the above matrix confirmed by observation? > > Linux just always worked? > > Which one _should_ work? I'm guessing modems work with hardware flow > > control. I'll have to dig around. > > > > The windows flow control changes a couple things with hardware flow > > control. Following the w32 API documentation is confusing sometimes. > > But it looks like Linux could have a bug too. > > Cheers > > Brian Schlining > Software Engineer > http://www.mbari.org > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/9c989144/attachment-0065.html From tjarvi at qbang.org Tue Feb 7 14:06:14 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 14:06:14 -0700 (MST) Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> Message-ID: >> >> You're not the only one whose had this problem, I don't know if Trent has >> addressed this is the latest release of RXTX but there is a workaround. >> Here's the recent thread from the RXTX mailing list regarding this issues: >> I have not. I expect to have access to some test equipment next month and I'll go through all of this. I really don't know whats going on and I need a gold standard. I thought maybe linux was autodetecting the flow control. Your observations would certainly be welcome. I need to talk to Russell King and see what he is doing. Until then I'd just be toying around over a loopback as usual. This is very high on the list though. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 17:25:05 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 17:25:05 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139358305.17994.2.camel@zd7280> My application now works. I installed the libraries and jar from 2.1-7 (Final). portlist.hasMoreElements is no longer false. The application finds the port for /dev/ttyUSB0. Thanks for your help, Trent (et al) Sorry I bothered you with this. Next time I will look in the source first. I didn't think it was an rxtx issue, I thought it was a Linux setup issue . On Tue, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > Hmm I'm looking at pre17 so this may have changed. (its just what I > have > on this machine) > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux > Serial Ports > "ttySA" // for the > IPAQs > }; > > CandidatePortPrefixes=Temp; > } > > > So you may need to add "ttyUSB" to that list. RXTX used to enumerate > _everything_ see if(osName.equals("Linux-all-ports") But it became > less > than practical. > > This is all in RXTXCommDriver.java > > hmm I just did a cvs update. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux > Serial Ports > "ttySA", // for the > IPAQs > "ttyUSB" // for USB > frobs > }; > > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you > have > to get your fingers into the code. We aim for sane defaults. -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 19:21:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 19:21:54 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139358305.17994.2.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> <1139358305.17994.2.camel@zd7280> Message-ID: >Sorry I bothered you with this. Next time I will look in the source >first. I didn't think it was an rxtx issue, I thought it was a Linux >setup issue . Why would you be sorry? I would have done the same. I'm glad it's working :) -- Trent Jarvi tjarvi at qbang.org From tma at mail.island.net Wed Feb 8 13:39:35 2006 From: tma at mail.island.net (Tom Alldread) Date: Wed, 08 Feb 2006 12:39:35 -0800 Subject: [Rxtx] Win32/Linux Serial Port Data Dropouts In-Reply-To: <200602060702.k167255O007882@www.qbang.org> References: <200602060702.k167255O007882@www.qbang.org> Message-ID: <43EA5707.4020200@mail.island.net> Greetings Folks at RXTX: During the last couple of months I have been alternately testing with javax.comm 2 and RXTX 2.1 under Windows XP and CommApi 3 and RXTX 2.1 under Suse 10.0 Linux. In the process I have learned a little about java multi-threading under NetBeans 5 with Profiler. My java (jdk 1.5_06) application is used for data acquisition and provides a graphical display of A-D conversion data received from a 56KBaud serial port. The actual data throughput is about 10KBaud thus it is well below the speed of the port. I use hardware RTS/CTS flow control which can stall the data acquisition sample rate if necessary. This ensures the display computer has the ability to slow the data acquisition rate should it become too busy to accept the regular data flow. Both the serial port buffer and the java read buffer are set at 16KB. Usually the data transfers into the java read buffer are less than 100 bytes unless the data acquisition is recovering from a stall. The data flow normally hesitates after each 5 KB block as a continue command is needed from the display computer to start the drawing of a new graphics display line. Separate threads have been provided for the serial port event monitoring and data processing. The serial port event thread has been given the maximum priority and data processing thread the minimum priority provided by java. Thread yield statements have been placed within all data processing while/for loops as an effort to ensure quick access to CPU cycles for the serial port event thread. I have found that short data transmissions are essentially error free but occasional dropouts occur with continuous data flow especially under Windows XP. ....................................................................................................................................................................................... Linux results: I am happy to report that RXTX 2.1 appears to work very well under Linux although I did notice some errors when the screen savers were running with my dual monitors. I believe this is a local problem associated with my dual graphics which needs further attention. The recent CommApi 3 Linux release from Sun did not work at all with my program. It seemed to send commands out OK but did not receive any data. Although the serial port event triggered the ISR, the input stream appeared filled with nulls and thus did not contain any data. As my understanding is that CommApi 3 was tested with a Red Hat distribution of Linux I wonder if this problem is distro dependent? Although somewhat off topic here I wonder if anyone reading this has had similar experience? .................................................................................................................................................................................. Windows XP results: There are problems with occasional data dropouts which become more frequent as the sampling rate is increased or if the computer becomes busy with other duties. The dropouts typically consist of a half dozen byte block of lost data. It appears the lost bytes never get added to the java input stream. There has not been any indication of garbled data, overruns or framing errors which suggests the UART communications remains solid. Using javax.comm 2 I found that the setting of SerialPort 'enableReceiveThreshold' to 40 and 'enableReceiveTimeout' of 100mS reduced the dropouts error rate significantly. I found that I could not get RXTX 2.1 to function with the aforementioned threshold and timeout settings. The javax.comm 2 interface is consequently performing better for me under Windows than RXTX 2.1. I wonder if anyone here has any suggestions as to what I might try to improve RXTX 2.1? Although my settings are the same as under Suse 10.0, RXTX 2.1 performs much better for me under Linux than any of the alternatives that I have tried under Windows XP . ............................................................................................................................................................................... I would like to establish, based on the experience of others, if I have reached the normally expected performance limit of java serial port communications? Should I expect to achieve virtually error free serial port data input from a continuous stream under Windows XP java software? I am considering changing my protocol to packets with error checking if necessary but would like to know if the dropout problems I am experiencing are typical or not before I take this rather work intensive plunge. Many thanks in advance for any help! Best Regards, Tom Alldread -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.375 / Virus Database: 267.15.2/253 - Release Date: 2006-02-07 From jlaxson at mac.com Wed Feb 8 23:56:48 2006 From: jlaxson at mac.com (John Laxson) Date: Thu, 9 Feb 2006 00:56:48 -0600 Subject: [Rxtx] PortInUseException: Unknown Application on OSX Message-ID: Hi, I've been trying to get RXTX 2.1.7 going on Mac OS X for a while here, and am running up into a wall here. I've tried with pre- compiled and the source version and get the same problem, a gnu.io.PortInUseException: Unknown Application. I have run the fixperms script included with the source distribution, and id shows me as a member of the uucp group, and permissions on /var/spool/uucp are 775 root:uucp. Running a test program (included at the bottom for clarity) lets me enumerate all the serial ports correctly, but trying to open any of them gives the PortInUseException. If it helps, when I try to open a port that's set to make an outgoing bluetooth connection, there is no delay and no connection attempt at all. Thanks, John Laxson PS: The documentation wiki on qbang.org shows 404, and has for a few days now. My test code: public static void main(String[] args) { SerialPort serialPort; try { Enumeration e = CommPortIdentifier.getPortIdentifiers(); CommPortIdentifier ident; while (e.hasMoreElements()) { ident = (CommPortIdentifier)e.nextElement(); System.out.println(ident.getName()); } ident = CommPortIdentifier.getPortIdentifier("/dev/cu.modem"); serialPort = (SerialPort) ident.open("Me", 5000); } catch (Exception e) { e.printStackTrace(); } } From rajesh.invincible at gmail.com Thu Feb 9 03:39:38 2006 From: rajesh.invincible at gmail.com (Rajesh N) Date: Thu, 9 Feb 2006 16:09:38 +0530 Subject: [Rxtx] Re: Move .java Files in gnu.io filesystem hierarchy - Maven (2) In-Reply-To: <43DF21D2.7090200@ngi.it> References: <43DF21D2.7090200@ngi.it> Message-ID: <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Can anybody tell me how to overcome these EXCEPTIONS I AM WORKING ON SERIAL COMMN IN JAVA ON LINUX. 1. " NOT ALL PARAMETERS SUPPORTED BY THE KERNEL" This i came across the following statement inmy prog. SerialP is A SerialPort object SerialP.setSerialPortParams(9600(BAUDRATE),DATABITS_8,STOPBITS_1,PARITY_NONE) 2. NullPointer Exception at Event Dispatch Now i have checked all my object references for a null reference but i found none i have put up my entire code in try catch blocks but still I AM UNABLE TO CATCH THIS EXCEPTION AND HENCE MY APPLICATION CLOSES HOW DOES THESE GO? PLEASE HELP ME IT IS URGENTTTTTTTTTTTTTTTT yours sincerely RAJESH On 1/31/06, Fabio Frumento wrote: > Hi Xavier, > > I don't know maven at all but the directory hierarchy listed buy Trent > is fine for me... > > I'll take a look to maven, it seems an interesting project > > Regards > > Fabio Frumento > > Trent Jarvi wrote: > > On Tue, 31 Jan 2006, Xavier Frisaye wrote: > > > >> Hi all, > >> > >> If you are going to rearrange the src folder, i will propose to use > >> maven 2 and follow its directory structure > >> > (http://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html). > >> > >> Maven 2 simplify java project and give a standard way to make projects > >> (http://maven.apache.org/). > >> We are using it for internal projects and we are very satisfied. > >> > >> Is anybody interested? > >> > >> I'm not an expert in maven 2 (yet) but i'm agree to help using it if > >> you choose to make so. > >> > > > > so this would be: > > > > rxtx-devel/src/main/java/gnu.io > > rxtx-devel/src/test/java/ManIwish.java > > > > I don't use IDEs very much so I'll let others comment. But I don't see > > a problem with that. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Thu Feb 9 09:50:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 9 Feb 2006 09:50:31 -0700 (MST) Subject: [Rxtx] Re: Move .java Files in gnu.io filesystem hierarchy - Maven (2) In-Reply-To: <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Message-ID: On Thu, 9 Feb 2006, Rajesh N wrote: > Can anybody tell me how to overcome these EXCEPTIONS > I AM WORKING ON SERIAL COMMN IN JAVA ON LINUX. > > 1. " NOT ALL PARAMETERS SUPPORTED BY THE KERNEL" > > This i came across the following statement inmy prog. > SerialP is A SerialPort object > SerialP.setSerialPortParams(9600(BAUDRATE),DATABITS_8,STOPBITS_1,PARITY_NONE) > Strange. The parameters you use are the same the port should open with by default. Could you paste the actual exception you are getting? I don't see that in the rxtx source. Also it would help to know the rxtx version. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Fri Feb 10 15:29:05 2006 From: lux at diesel-research.com (Kim Lux) Date: Fri, 10 Feb 2006 15:29:05 -0700 Subject: [Rxtx] One serial port object for both sending and receiving ? Message-ID: <1139610545.18177.4.camel@zd7280> Is it OK to use one SerialPort ojbect (ex Serial Port serialPort;) and use it for both sending and receiving ? For example: ======================================================================== static SerialPort serialPort = null; static OutputStream serialOut = null; static InputStream serialIn = null; // assign it to an outputStream for use try{ serialOut = serialPort.getOutputStream(); System.out.println("Serial output stream has been assigned."); }//try catch(IOException e) { System.out.println("Error: Couldn't assign output stream to serial port."); }//catch //assign it to an inputStream for use try{ serialIn = serialPort.getInputStream(); System.out.println("Serial input stream has been assigned."); }//try catch(IOException e) { System.out.println("Error: Couldn't assign input stream to serial port."); }//catch ======================================================================== -- Kim Lux, Diesel Research Inc. From lux at diesel-research.com Fri Feb 10 21:23:00 2006 From: lux at diesel-research.com (Kim Lux) Date: Fri, 10 Feb 2006 21:23:00 -0700 Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Message-ID: <1139631780.23882.10.camel@zd7280> I've got a problem receiving chars with my version of serialRead, written in an SWT GUI. I had a Java pro have a good look at my code and he can't see anything wrong with it. I can send chars fine. When I receive a char the cpu usage for the app goes to 100% and the code in the serial event handler doesn't get executed. The instructions on the Java Comm Serial API How-To for Linux page state that I must install javacomm. Is that true ? Everything builds without it and I can send chars on rxtx just fine, but I can't receive them. Could this be the problem ? I downloaded and installed javacomm. I was not able to add "Driver=gnuio.RXTXCommDriver to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 installed in /usr/java/jre1.5.0_05. I added comm.jar to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext to the library paths. Is this OK ? Does it matter that I am receiving on /dev/ttyUSB0 ? Thanks. -- Kim Lux, Diesel Research Inc. From lunareclipse03 at web.de Sat Feb 11 09:44:46 2006 From: lunareclipse03 at web.de (lunareclipse03@web.de) Date: Sat, 11 Feb 2006 17:44:46 +0100 Subject: [Rxtx] Question about Serial I/O under Win32 Message-ID: <662084330@web.de> Hello everybody, I have a strange problem with a piece of code I made for myself. No, this is not really concerning rxtx, but nevertheless I post this to the list, hoping that some of you can help me. I've written two libraries, one for linux and one for win32. The linux port works quite well, I can send / receive faxes and / or replay voice messages over the telephone line using a voice modem. But the win32 port of the library causes some trouble. If, for example, I send out a fax with a certain modem under linux, it works well. The fax is complete when it comes out of the fax machine. If I then use the same modem to send out a fax under win32, the fax coming out of the fax machine gets "stuck" halfways, but the sending modem thinks that transmission was ok and drops the connection. The answering fax machine then gives me "error while receiving." The "upper layer" java code MUST be right, because if I do the same thing under linux (using the linux library), everything is alright. Now I have to ask: Can somebody please help me out with this??!? Could it be the case that some kind of flow control or COMMTIMEOUTS setting causes this behaviour? I set flow control to RTS/CTS before sending out a fax. How can I DISABLE flow control? Or what do you think? Can something else cause this problems? Thank you all for your time and PLEASE write back soon. Regards, --Sven Ahlemann Am Waldrand 31 45721 Haltern am See Germany ______________________________________________________________ Verschicken Sie romantische, coole und witzige Bilder per SMS! Jetzt bei WEB.DE FreeMail: http://f.web.de/?mc=021193 From lux at diesel-research.com Sat Feb 11 10:06:52 2006 From: lux at diesel-research.com (Kim Lux) Date: Sat, 11 Feb 2006 10:06:52 -0700 Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: <1139631780.23882.10.camel@zd7280> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> <1139631780.23882.10.camel@zd7280> Message-ID: <1139677612.3431.5.camel@zd7280> More on this problem. I copied and pasted simpleRead into a console based Eclipse project and I've got the same result, except that cpu usage doesn't go to 100%. I'm beginning to think there is an issue in rxtx. My imports for simpleRead are: ============================ import gnu.io.*; import java.util.*; //import javax.comm.*; import java.io.*; =========================== Any ideas ? I am trying to read from /dev/ttyUSB0 using a serial to USB adapter which has worked well with minicom and gtkterm. Thanks. On Fri, 2006-02-10 at 21:23 -0700, Kim Lux wrote: > I've got a problem receiving chars with my version of serialRead, > written in an SWT GUI. > > I had a Java pro have a good look at my code and he can't see anything > wrong with it. > > I can send chars fine. When I receive a char the cpu usage for the app > goes to 100% and the code in the serial event handler doesn't get > executed. > > The instructions on the Java Comm Serial API How-To for Linux page state > that I must install javacomm. Is that true ? Everything builds without > it and I can send chars on rxtx just fine, but I can't receive them. > Could this be the problem ? > > I downloaded and installed javacomm. I was not able to add > "Driver=gnuio.RXTXCommDriver > to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not > have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 > installed in /usr/java/jre1.5.0_05. I added comm.jar > to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext > to the library paths. Is this OK ? > > Does it matter that I am receiving on /dev/ttyUSB0 ? > > Thanks. > -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Sun Feb 12 21:01:33 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:01:33 -0700 (MST) Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: <1139677612.3431.5.camel@zd7280> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> <1139631780.23882.10.camel@zd7280> <1139677612.3431.5.camel@zd7280> Message-ID: I suspect what is happening is the select() is breaking out in the native code but the driver does not have support for notifying there are X bytes available. On some traditional Unix based systems, the only way you know data is available is the fd status changes and do an FIORDCHK ioctl. Or perhaps the only thing you can know is the fd status changed. It would take reading through the kernel driver code to know for sure. So on USB, depending upon the driver, the same may need to be done or the driver improved a bit if possible to support. Polling reads will also work but don't use the event driven model of CommAPI which isnt acceptable in the long run. The 100% cpu usage can then be explained because select no longer blocks until the data is read; the eventLoop spins loose. You can put a well placed sleep but rxtx only expects those are needed when it knows data is available. This may not be a super simple thing to understand and fix. I do have ideas to get you started. I'm going to be short on time the next couple weeks. I expect to put some good time in and answer some other questions I saw around the 25th. For now, I'd look at the following and go from there with the hints I've given. JNIEXPORT jint JNICALL RXTXPort(nativeavailable)( JNIEnv *env, jobject jobj ) { int fd = get_java_var( env, jobj,"fd","I" ); int result; /* char message[80]; ENTER( "RXTXPort:nativeavailable" ); On SCO OpenServer FIONREAD always fails for serial devices, so try ioctl FIORDCHK instead; will only tell us whether bytes are available, not how many, but better than nothing. This turns out to be true on Solaris also. taj. */ #ifdef FIORDCHK /* __unixware__ __sun__ probably others */ result = ioctl(fd, FIORDCHK, 0); #else if( ioctl( fd, FIONREAD, &result ) < 0 ) { goto fail; } #endif /* FIORDCHK */ On Sat, 11 Feb 2006, Kim Lux wrote: > > More on this problem. I copied and pasted simpleRead into a console > based Eclipse project and I've got the same result, except that cpu > usage doesn't go to 100%. I'm beginning to think there is an issue in > rxtx. > > My imports for simpleRead are: > > ============================ > import gnu.io.*; > import java.util.*; > //import javax.comm.*; > import java.io.*; > =========================== > > Any ideas ? I am trying to read from /dev/ttyUSB0 using a serial to > USB adapter which has worked well with minicom and gtkterm. > > Thanks. > > > > On Fri, 2006-02-10 at 21:23 -0700, Kim Lux wrote: >> I've got a problem receiving chars with my version of serialRead, >> written in an SWT GUI. >> >> I had a Java pro have a good look at my code and he can't see anything >> wrong with it. >> >> I can send chars fine. When I receive a char the cpu usage for the app >> goes to 100% and the code in the serial event handler doesn't get >> executed. >> >> The instructions on the Java Comm Serial API How-To for Linux page state >> that I must install javacomm. Is that true ? Everything builds without >> it and I can send chars on rxtx just fine, but I can't receive them. >> Could this be the problem ? >> >> I downloaded and installed javacomm. I was not able to add >> "Driver=gnuio.RXTXCommDriver >> to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not >> have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 >> installed in /usr/java/jre1.5.0_05. I added comm.jar >> to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext >> to the library paths. Is this OK ? >> >> Does it matter that I am receiving on /dev/ttyUSB0 ? >> >> Thanks. >> > From tjarvi at qbang.org Sun Feb 12 21:03:30 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:03:30 -0700 (MST) Subject: [Rxtx] One serial port object for both sending and receiving ? In-Reply-To: <1139610545.18177.4.camel@zd7280> References: <1139610545.18177.4.camel@zd7280> Message-ID: On Fri, 10 Feb 2006, Kim Lux wrote: > > Is it OK to use one SerialPort ojbect (ex Serial Port serialPort;) and > use it for both sending and receiving ? > > For example: > > ======================================================================== > static SerialPort serialPort = null; > static OutputStream serialOut = null; > static InputStream serialIn = null; > > > > > // assign it to an outputStream for use > try{ > serialOut = serialPort.getOutputStream(); > System.out.println("Serial output stream has been assigned."); > }//try > catch(IOException e) > { > System.out.println("Error: Couldn't assign output stream to serial > port."); > }//catch > > > //assign it to an inputStream for use > try{ > serialIn = serialPort.getInputStream(); > System.out.println("Serial input stream has been assigned."); > }//try > catch(IOException e) > { > System.out.println("Error: Couldn't assign input stream to serial > port."); > }//catch This should be fine. In fact trying to do it another way will probably not work as you will run into lockfile issues. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun Feb 12 21:13:13 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:13:13 -0700 (MST) Subject: [Rxtx] Question about Serial I/O under Win32 In-Reply-To: <662084330@web.de> References: <662084330@web.de> Message-ID: On Sat, 11 Feb 2006 lunareclipse03 at web.de wrote: > Hello everybody, > > I have a strange problem with a piece of code I made for myself. No, > this is not really concerning rxtx, but nevertheless I post this to the > list, hoping that some of you can help me. I've written two libraries, > one for linux and one for win32. The linux port works quite well, I can > send / receive faxes and / or replay voice messages over the telephone > line using a voice modem. But the win32 port of the library causes some > trouble. If, for example, I send out a fax with a certain modem under > linux, it works well. The fax is complete when it comes out of the fax > machine. If I then use the same modem to send out a fax under win32, the > fax coming out of the fax machine gets "stuck" halfways, but the sending > modem thinks that transmission was ok and drops the connection. The > answering fax machine then gives me "error while receiving." The "upper > layer" java code MUST be right, because if I do the same thing under > linux (using the linux library), everything is alright. Now I have to > ask: Can somebody please help me out with this??!? Could it be the case > that some kind of flow control or COMMTIMEOUTS setting causes this > behaviour? I set flow control to RTS/CTS before sending out a fax. How > can I DISABLE flow control? Or what do you think? Can something else > cause this problems? Thank you all for your time and PLEASE write back > soon. > Hi Sven I'm not too willing to talk about flow control at the low level until I confirm some things with test equipment later. It is not clear if you are using rxtx or writing your own native code. So I'm not sure how to answer much of this :) If you are wondering how to change the flow control using rxtx from java, The BlackBox example from Sun flips this back and forth. SerialPort.java in rxtx 2.1 uses the following: SerialPort.java: public static final int FLOWCONTROL_NONE =0; SerialPort.java: public static final int FLOWCONTROL_RTSCTS_IN =1; SerialPort.java: public static final int FLOWCONTROL_RTSCTS_OUT =2; SerialPort.java: public static final int FLOWCONTROL_XONXOFF_IN =4; SerialPort.java: public static final int FLOWCONTROL_XONXOFF_OUT=8; So if you set flowcontrol to RTSCTS, you can set it to NONE to turn it off. If you are looking for how to do it in native code, the rxtx Source is SerialImp.c (unix/linux/mac os x/w32) and termios.c (w32 only with SerialImp.c) You can track the code: SerialImp.c:JNIEXPORT void JNICALL RXTXPort(setflowcontrol)( JNIEnv *env, jobject jobj, jint flowmode ) termios.c:int tcgetattr( int fd, struct termios *s_termios ) termios.c:int tcsetattr( int fd, int when, struct termios *s_termios ) There may be a problem in the rxtx flow control code though. Rather than guess, I want to test this with a gold standard. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Feb 6 00:00:16 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 00:00:16 -0700 (MST) Subject: [Rxtx] wiki delay until tomorrow night. In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: On Sun, 5 Feb 2006, Trent Jarvi wrote: > On Sun, 5 Feb 2006, Kim Lux wrote: > >> usb ? Tell me more... I need that too. > > usb is a very proper design. Thats all it is. > Maybe rxtx could help usb. But it would start with helping bring back the community that was already there. It's not something I'd love to do but maybe its the right thing to do. It would probably take 2 years to do right. But maybe thats better than what we have now. I honestly don't know what IBM is doing which could just run over everything. Just some thoughts after some fine german wine. -- Trent Jarvi tjarvi at qbang.org From gadelavega at yahoo.com.ar Mon Feb 6 02:17:05 2006 From: gadelavega at yahoo.com.ar (Gonzalo A. de la Vega) Date: Mon, 06 Feb 2006 10:17:05 +0100 Subject: [Rxtx] Serial port ownership question In-Reply-To: References: <20060205113618.30274.qmail@web53501.mail.yahoo.com> <1139157422.4553.9.camel@zd7280> <1139158698.4936.9.camel@zd7280> Message-ID: <43E71411.4050402@yahoo.com.ar> On my Fedora Core 4: ls -l /dev/ttyS* crw-rw---- 1 root uucp 4, 64 Feb 6 2006 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Feb 6 2006 /dev/ttyS1 ... and: grep "ttyUSB" /etc/udev/rules.d/50-udev.rules KERNEL=="ttyUSB*", GROUP="uucp", MODE="0660" So anyone in the "uucp" group can use serial ports. On Gentoo the group is "tty". Trent Jarvi escribi?: > > > On Sun, 5 Feb 2006, Dr. Douglas Lyon wrote: > >> I can confirm that this is the case (only root ownership of >> serial ports, under fedora 4). >> Wow, what were they thinking?! >> - DL >> >>> I've found that the newer kernels have the serial ports owned by root. >>> For example, >>> >>> $ls -al /dev/tty* >>> crw-rw-rw- 1 root root 5, 0 Feb 5 02:06 /dev/tty >>> crw-rw---- 1 root root 4, 0 Feb 5 02:06 /dev/tty0 >>> crw------- 1 root root 4, 1 Feb 5 09:07 /dev/tty1 >>> crw-rw---- 1 root tty 4, 10 Feb 5 02:06 /dev/tty10 >>> crw-rw---- 1 root tty 4, 11 Feb 5 02:06 /dev/tty11 >>> ... > > > This is just not a problem jcp or such are going to solve. Its a > platform spitwad fight. But do look at pam. In fact thats what Sun > is doing too. Maybe Linux followed their lead.. I'm not a pam guy. > I've spent 16 hours trying to understand it but your users wont :) > > Solution? I have no clue. Its two tangent mentalities from my > perspective. > > -- > Trent Jarvi > tjarvi at qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mtnvega at yahoo.com.br Mon Feb 6 05:35:43 2006 From: mtnvega at yahoo.com.br (Luiz Jr) Date: Mon, 6 Feb 2006 12:35:43 +0000 (GMT) Subject: [Rxtx] Documentation Wiki In-Reply-To: <1139157422.4553.9.camel@zd7280> Message-ID: <20060206123543.57256.qmail@web53515.mail.yahoo.com> Hello, Thank you for you answer, but so the usage of the API is pretty much like the Java Communications Api? If yes, what version of the Java Comm Api? Thank you, Luiz A. Brandao Jr Kim Lux escreveu: On Sun, 2006-02-05 at 08:36 -0300, Luiz Jr wrote: > Hello, > > I want to start using the RXTX libraries, but I would to know how, > since I can not access the documentation wiki page I just started using them yesterday. Below is how I installed the libraries, if that helps. I used snippets of code from the SimpleWrite application here to get me going. http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html Instead of "import javax.comm.*;", use "import gnu.io.*;" which is gotten from RXTXcomm.jar, which you will need to include in your project references. I am working in Eclipse. BTW: there is no way to open a port without going through the port list and finding it. Maybe sometime in the future someone (me ?) will write a method called openSerialPort that allows the user to give a port identifier, such as "/dev/tty1" and return a port ready to use. It wouldn't take much to write that and it would save users a lot of code. Hope this helps. ======================================================================= 1) Figure out which java you are running, incase there is more than one installed. $ java -version java version "1.5.0_05" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_05-b05) Java HotSpot(TM) Client VM (build 1.5.0_05-b05, mixed mode, sharing) 2) Find all the jre directories and the one from which you are currently running. kfind (jre) 3) cd to that directory plus /lib/i386 cd /usr/java/jre1.5.0_05/lib/i386 4) Copy the library files (*.so) to that directory. cp /home/krlux/Desktop/'Java Controls'/rxtx-linux/bin/* . 5) Check that the copy was successful ls librxtx* librxtxI2C.so librxtxRaw.so librxtxSerial.so librxtxParallel.so librxtxRS485.so 6) cd to the /lib/ext directory for your java. cd /usr/java/jre1.5.0_05/lib/ext 7) Copy the Jar files there cp /home/krlux/Desktop/'Java Controls'/rxtx-linux/lib/ext/* . 8) Check that it was successful ls RXTX* RXTXcomm.jar Rxtx is now installed on your machine ready to use. =================================================================== -- Kim Lux, Diesel Research Inc. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx --------------------------------- Yahoo! Acesso Gr?tis - Internet r?pida e gr?tis. Instale o discador agora! -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/544aa403/attachment-0066.html From lyon at docjava.com Mon Feb 6 05:49:34 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 06 Feb 2006 07:49:34 -0500 Subject: [Rxtx] wiki delay until tomorrow night. In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: Hi All, I have often thought about USB drivers being needed. For example, the ironman watch will not interface to a mac (windows only). It is USB. My dymo label writer has no Java driver (native only). Etc. Most cheap web cameras are USB (and Java drivers go through JAI, if it supports the camera at all). The JAI code shows how sun did the USB drivers. You have to be a member of the jai project to download the source code. https://jai.dev.java.net has the jai distro. And then you are not allowed to redistribute it. However, we can all learn from it (if so inclined). Basically: cvs -d :pserver:lyon at cvs.dev.java.net:/cvs login cvs -d :pserver:lyon at cvs.dev.java.net:/cvs checkout jai-core You will need to user your own uid and pw to get in. The ant build has over 100 warnings from sun deprecations of its own code. You might say that they were hoisted on their own Picard ;) One interesting thing is that they support several platforms: linux-amd64 64-bit Linux-AMD64 linux-i586 32-bit Linux-x86 solaris-amd64 64-bit Solaris-AMD64 solaris-i586 32-bit Solaris-x86 solaris-sparc 32-bit Solaris-SPARC solaris-sparcv9 64-bit Solaris-SPARC windows-i586 32-bit Windows-x86 Thus, ant is used to provide a multi-platform native method distro. Neat. How do they do it? check this out: And: The core download does not contain any C source code (it was all pre-built). Basically, they are just copying .so and .dll files into build directories. I would love to see the C code for this...but Sun does not post it on the https://jai.dev.java.net site. I don't know why...Perhaps I missed it. - Doug >On Sun, 5 Feb 2006, Trent Jarvi wrote: > >>On Sun, 5 Feb 2006, Kim Lux wrote: >> >>>usb ? Tell me more... I need that too. >> >>usb is a very proper design. Thats all it is. >> > >Maybe rxtx could help usb. But it would start with helping bring >back the community that was already there. > >It's not something I'd love to do but maybe its the right thing to do. > >It would probably take 2 years to do right. But maybe thats better >than what we have now. > >I honestly don't know what IBM is doing which could just run over everything. > >Just some thoughts after some fine german wine. > >-- >Trent Jarvi >tjarvi at qbang.org > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tdelenik at gmail.com Mon Feb 6 05:56:32 2006 From: tdelenik at gmail.com (Thanasis Delenikas) Date: Mon, 6 Feb 2006 14:56:32 +0200 Subject: Fwd: [Rxtx] Documentation Wiki In-Reply-To: <1139157422.4553.9.camel@zd7280> References: <20060205113618.30274.qmail@web53501.mail.yahoo.com> <1139157422.4553.9.camel@zd7280> Message-ID: <310a1a930602060456t129f1dc6p5f2b908f13ab5a0b@mail.gmail.com> Hello all, Kim, this is a snippet from the code I use. The closest to directly opening a specific port without enumeration. << ... portId = CommPortIdentifier.getPortIdentifier(getPort()); serialPort = (SerialPort) portId.open("jSMSEngine", 1971); ... >> where getPort() return the string identifier of the port, i.e. "/dev/ttyS0" or "COM1" or whatever. Thanasis. ---------- Forwarded message ---------- From: Kim Lux Date: Feb 5, 2006 6:37 PM Subject: Re: [Rxtx] Documentation Wiki To: RXTX Developers and Users BTW: there is no way to open a port without going through the port list and finding it. Maybe sometime in the future someone (me ?) will write a method called openSerialPort that allows the user to give a port identifier, such as "/dev/tty1" and return a port ready to use. It wouldn't take much to write that and it would save users a lot of code. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/182ab5b8/attachment-0066.html From tjarvi at qbang.org Mon Feb 6 11:53:57 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 11:53:57 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: On Mon, 6 Feb 2006, Dr. Douglas Lyon wrote: > Hi All, > I have often thought about USB drivers being needed. > For example, the ironman watch will not interface > to a mac (windows only). It is USB. > My dymo label writer has no Java driver (native only). > Etc. > Most cheap web cameras are USB (and Java drivers go > through JAI, if it supports the camera at all). > The JAI code shows how sun did the USB drivers. > You have to be a member of the jai project to download > the source code. > https://jai.dev.java.net has the jai distro. > And then you are not allowed to redistribute it. However, > we can all learn from it (if so inclined). Basically: > cvs -d :pserver:lyon at cvs.dev.java.net:/cvs login > cvs -d :pserver:lyon at cvs.dev.java.net:/cvs checkout jai-core > You will need to user your own uid and pw to get in. > The ant build has over 100 warnings from sun deprecations > of its own code. > > You might say that they were hoisted on their own Picard ;) > > One interesting thing is that they support several platforms: > linux-amd64 64-bit Linux-AMD64 > linux-i586 32-bit Linux-x86 > solaris-amd64 64-bit Solaris-AMD64 > solaris-i586 32-bit Solaris-x86 > solaris-sparc 32-bit Solaris-SPARC > solaris-sparcv9 64-bit Solaris-SPARC > windows-i586 32-bit Windows-x86 > Thus, ant is used to provide a multi-platform native method distro. > Neat. > How do they do it? > check this out: > > > > > > > > > > > > > And: > > > > > > > > > > The core download does not contain any C source code (it was all pre-built). > Basically, they are just copying .so and .dll files into build directories. > > I would love to see the C code for this...but Sun does not post it on the > https://jai.dev.java.net site. > > I don't know why...Perhaps I missed it. > > - Doug > > I've looked at moving rxtx to Ant builds. I think that would help IDEs a great deal. I requested a evalutation desk copy the O'Reilly Ant book for some j2ee material I was teaching. http://www.oreilly.com/catalog/anttdg/ It has a one sentence mention of JNI. So there was not luck there. I saw that there is another Ant book that does mention JNI more. I can't find it now. Ant must be able to support it with extensions. http://ant.apache.org/manual/OptionalTasks/javah.html What the auto(break :) tools do in the rxtx build is 4 things really. 1) gcc compile flags 2) ld compile flags 3) config.h 4) compile flags for customizing rxtx (lockfiles, ...) See 1 All of this information except 4 can be static once obtained. So I'm not attached to the auto tools. If I could find an example of Ant being used for JNI code, I'd be one of the first to start moving that direction. Maybe someone saw an example someplace. The other thing we have not completed discussing is the directory structure. There is interest in making rxtx more IDE friendly. I get more mail about that off the list than how to install rxtx. And I see we have Ken Thompson in da house :) He is our trusted CVS maintainer and the guy that purchased the rxtx.org domain. Old community. We will need Ken for changing the directory structure of source. I would like to open up discussion about both of these as it is more than time. The problem is I have little experience with Ant and even less with IDEs. It would be nice if we could work with Eclipse and NetBeans. http://www.netbeans.org/ (sun and some community) http://www.eclipes.org (ibm,rhat,... perhaps more community) http://maven.apache.org/what-is-maven.html (apache. It is community) borland should sortof be here too but I think thats covered in eclipse. >From what I understand so far, we should morph rxtx to support those three maybe trusting apaches lead with maven. But I use vi. I have little to no clues beyond what people have fed me. Can we agree that thats the right direction to go? -- Trent Jarvi tjarvi at qbang.org From brian at mbari.org Mon Feb 6 14:57:50 2006 From: brian at mbari.org (Brian Schlining) Date: Mon, 6 Feb 2006 13:57:50 -0800 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> > The other thing we have not completed discussing is the directory > structure. There is interest in making rxtx more IDE friendly. I > get more mail about that off the list than how to install rxtx. > > And I see we have Ken Thompson in da house :) He is our trusted > CVS maintainer and the guy that purchased the rxtx.org domain. Old > community. We will need Ken for changing the directory structure of > source. > > I would like to open up discussion about both of these as it is > more than time. The problem is I have little experience with Ant > and even less with IDEs. It would be nice if we could work with > Eclipse and NetBeans. > > http://www.netbeans.org/ (sun and some community) > http://www.eclipes.org (ibm,rhat,... perhaps more community) > http://maven.apache.org/what-is-maven.html (apache. It is community) > borland should sortof be here too but I think thats covered in > eclipse. > >> From what I understand so far, we should morph rxtx to support >> those three > maybe trusting apaches lead with maven. But I use vi. I have > little to no clues beyond what people have fed me. > Maven likes the directory structure below for Java code. (From http:// maven.apache.org/guides/getting-started/index.html) This structure works fine with ant, netbeans, and eclipse. rxtx_root_directory `-- src |-- main | `-- java | `-- gnu | `-- io `-- test `-- java `-- gnu `-- io Brian Schlining Software Engineer http://www.mbari.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/d9451eba/attachment-0066.html From tjarvi at qbang.org Mon Feb 6 15:11:45 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 15:11:45 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: > rxtx_root_directory > `-- src > |-- main > | `-- java > | `-- gnu > | `-- io > `-- test > `-- java > `-- gnu > `-- io > >From what I understand this will just be good. For me it makes no difference. So lets do the rxtx thing. Let if fester for two weeks and if nobody objects, we will do it. I'm not doing this because I care. I'm doing this to eliminate much of my inbox. But test... man is rxtx lacking there in the community aspect. It is covered but not right. _maybe_ I can change that this year. -- Trent Jarvi tjarvi at qbang.org (cat hurding since 1997) From lux at diesel-research.com Mon Feb 6 21:38:49 2006 From: lux at diesel-research.com (Kim Lux) Date: Mon, 06 Feb 2006 21:38:49 -0700 Subject: [Rxtx] How can I use Lock Files with rxtx (in FC4) ? Message-ID: <1139287129.17031.3.camel@zd7280> I am now running an rxtx application on FC4. I am getting: ========================================================= check_group_uucp(): error testing lock file creation Error details: Permission denied check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL ========================================================= $ ls -al /var/lock total 32 drwxrwxr-x 4 root lock 4096 Feb 6 16:04 . drwxr-xr-x 24 root root 4096 Nov 14 01:19 .. drwx------ 2 root root 4096 Apr 27 2005 lvm drwxr-xr-x 2 root root 4096 Feb 6 16:04 subsys How do I fix this for regulator users ? -- Kim Lux, Diesel Research Inc. From dmarkman at mac.com Mon Feb 6 22:24:44 2006 From: dmarkman at mac.com (Dmitry Markman) Date: Tue, 7 Feb 2006 00:24:44 -0500 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: if I understands the issue right in order to be able to use ant for c/c++ compilation you have to install ant's cc task http://ant-contrib.sourceforge.net/cc.html it looks like it should work on mac os x (authors claim, that it's platform independent) but I never tested so all you have to do it's providing right command line for the gcc compiler On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: >> rxtx_root_directory >> `-- src >> |-- main >> | `-- java >> | `-- gnu >> | `-- io >> `-- test >> `-- java >> `-- gnu >> `-- io >> > > >> From what I understand this will just be good. > > For me it makes no difference. So lets do the rxtx thing. Let if > fester for two weeks and if nobody objects, we will do it. > > I'm not doing this because I care. I'm doing this to eliminate > much of my inbox. > > But test... man is rxtx lacking there in the community aspect. It > is covered but not right. _maybe_ I can change that this year. > > -- > Trent Jarvi > tjarvi at qbang.org > (cat hurding since 1997) > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx Dmitry Markman From lux at diesel-research.com Mon Feb 6 23:20:15 2006 From: lux at diesel-research.com (Kim Lux) Date: Mon, 06 Feb 2006 23:20:15 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? Message-ID: <1139293215.3689.4.camel@zd7280> I'm running the code below. portlist.hasMoreElements() is false. /dev has ports in it as listed below. What am I doing wrong ? ========================================================== // Step through the list of ports until we find one that matches // the one we are looking for. portList = CommPortIdentifier.getPortIdentifiers(); while(portList.hasMoreElements()) { portID = (CommPortIdentifier) portList.nextElement(); // if (portID.getName().equals("/dev/ttyUSB0")) { myTA.append("Serial port ttyUSB0 has been found\n"); break; }// if portID equals... }// End of while... ========================================================== ls -al /dev/tty* crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 ... crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 -- Kim Lux, Diesel Research Inc. From david.garnier at trusted-logic.com Tue Feb 7 00:46:30 2006 From: david.garnier at trusted-logic.com (David Garnier) Date: Tue, 07 Feb 2006 08:46:30 +0100 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: <43E85056.2090608@trusted-logic.com> Hello, I think that the make-based build process is fine as it is, apart from the location of the Java source files. It is true that putting the Java source in a directory structure that map 1-to-1 to the Java package structure is the norm and should make it easier for everyone to modify the Java source, with or without an IDE. Ant is a good tool, but in the RXTX case I fail to see the advantage of using it compared to the current make-based process. As Trent said, they are more pressing issues, like testing. Regards, David Dmitry Markman wrote: > if I understands the issue right > in order to be able to use ant for c/c++ compilation > you have to install ant's cc task > http://ant-contrib.sourceforge.net/cc.html > > it looks like it should work on mac os x > (authors claim, that it's platform independent) > but I never tested > > so all you have to do it's providing right command line > for the gcc compiler > > > > > On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: > >>> rxtx_root_directory >>> `-- src >>> |-- main >>> | `-- java >>> | `-- gnu >>> | `-- io >>> `-- test >>> `-- java >>> `-- gnu >>> `-- io >>> >> >> >>> From what I understand this will just be good. >> >> For me it makes no difference. So lets do the rxtx thing. Let if >> fester for two weeks and if nobody objects, we will do it. >> >> I'm not doing this because I care. I'm doing this to eliminate much >> of my inbox. >> >> But test... man is rxtx lacking there in the community aspect. It is >> covered but not right. _maybe_ I can change that this year. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> (cat hurding since 1997) From tjarvi at qbang.org Tue Feb 7 01:11:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 01:11:31 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <43E85056.2090608@trusted-logic.com> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: On Tue, 7 Feb 2006, David Garnier wrote: > Hello, > > I think that the make-based build process is fine as it is, apart from the location of the Java > source files. It is true that putting the Java source in a directory structure that map 1-to-1 to > the Java package structure is the norm and should make it easier for everyone to modify the Java > source, with or without an IDE. > > Ant is a good tool, but in the RXTX case I fail to see the advantage of using it compared to the > current make-based process. As Trent said, they are more pressing issues, like testing. > Hi David I have more experience with testing rxtx than I can talk about. But let it be known, rxtx has gone trough 100's of hours of testing. We are hobby folks interested in toys but there is more. rxtx has had some of the best guidance in the industry there. This is not an easy thing. I may be able to come back in a month from the other side of the corperate fence and help. I suspect the tests could just be made public but they are in a very unusual environment that just wont work in a wider sense. This is something I'll be trying to change. At one point it was agreed we could just make the results public so this isnt just noise.. There is interest and I think its safe to mention that much. The big problem with testing in the past is most of it is done with a loopback connection. So we *still* have major questions regarding things like flow control. rxtx talks to itself over a loopback and it works. regardless of right or wrong. This requires more thought to be done right. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Feb 7 02:46:34 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 02:46:34 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: > The big problem with testing in the past is most of it is done with a > loopback connection. So we *still* have major questions regarding things > like flow control. rxtx talks to itself over a loopback and it works. > regardless of right or wrong. With serial communication there are gold standards. ckermit is probably a definitive 'standard.' Maybe its possible to do ping/pong tests with ckermit? Is it scriptable? There are known issues in rxtx. Probably the worst is some threading issues regarding some JREs with multiple JNI threads setting java variables. Man did I get schooled there. Just switch the c functions to returning variables and things go away. Sometimes they work fine, sometimes they blow up. Without understanding everything, somehow rhat got it right and debian (and especially gentoo) grabbed kernel patches causing all sort of harm. Its not hard to fix once you understand whats going on but nearly impossible to track with a debugger. So I have a good idea what 2.1-8 will have outside of the IDE modifications. rxtx 2.1-7 is a release for everyone to sync with. Its not even as stable as -pre17 as far as I know - I ran no test suites. I'll be chasing it too. We just had so many contributions that it was time. It seriously broke internal scheduals but thats a great thing :) The other thing I want to do in 2.1-8 is automagic baud rates. It turns out lots of shops are doing really funky baud rates for things like automobile test equipment. It is possible but it requires a fair amount of change in the native code. Is anyone looking at this? -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Feb 7 02:57:21 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 07 Feb 2006 04:57:21 -0500 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <43E85056.2090608@trusted-logic.com> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: Hi All, I agree, testing is very important. The problem I have been trying to address is related to cross-platform testing and the robust nature of the installs. Typically, I visit 3 platforms to deploy my product, windows, linux and mac. A build is performed on each platform. The idea that you can build for many platforms from one copy the source code seems attractive. This should enable synchronized deployments of identical code. The question of how to achieve this goal remains open. As Trent mentioned, this is hard. Perhaps Ant will help here (but perhaps not). Ant does seem to help with running unit tests. However, it does not help with multi-platform tests. For that you need many machines and different operating environments. Toward that end, I have created a multi-platform test that can be run from web start, located at: http://show.docjava.com:8086/book/cgij/code/jnlp/serialPort.PortTest.jnlp This is interesting because many people in the community can run the test and we can improve the test, as time permits. No, it is not a perfect solution, however, the idea does help with multi-platform tests using many machines and different operating environments. If the group has a good test for a general serial port set-ups, i would be happy to deploy it, for general evaluation using web start. And as for ANT, it is just an idea. Not all my ideas are good ones! - Doug >Hello, > >I think that the make-based build process is fine as it is, apart >from the location of the Java >source files. It is true that putting the Java source in a directory >structure that map 1-to-1 to >the Java package structure is the norm and should make it easier for >everyone to modify the Java >source, with or without an IDE. > >Ant is a good tool, but in the RXTX case I fail to see the advantage >of using it compared to the >current make-based process. As Trent said, they are more pressing >issues, like testing. > >Regards, >David > >Dmitry Markman wrote: >> if I understands the issue right >> in order to be able to use ant for c/c++ compilation >> you have to install ant's cc task >> http://ant-contrib.sourceforge.net/cc.html >> >> it looks like it should work on mac os x >> (authors claim, that it's platform independent) >> but I never tested >> >> so all you have to do it's providing right command line >> for the gcc compiler >> >> >> >> >> On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: >> >>>> rxtx_root_directory >>>> `-- src >>>> |-- main >>>> | `-- java >>>> | `-- gnu >>>> | `-- io >>>> `-- test >>>> `-- java >>>> `-- gnu >>>> `-- io >>>> >>> >>> >>>> From what I understand this will just be good. >>> >>> For me it makes no difference. So lets do the rxtx thing. Let if >>> fester for two weeks and if nobody objects, we will do it. >>> >>> I'm not doing this because I care. I'm doing this to eliminate much >>> of my inbox. >>> >>> But test... man is rxtx lacking there in the community aspect. It is >>> covered but not right. _maybe_ I can change that this year. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> (cat hurding since 1997) > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From matt.higgins at gmail.com Tue Feb 7 08:28:34 2006 From: matt.higgins at gmail.com (Matt Higgins) Date: Tue, 7 Feb 2006 10:28:34 -0500 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final Message-ID: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? import java.io.*; import java.util.*; import gnu.io.*; public class MySimpleRead implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; public static void main(String[] args) { boolean portFound = false; String defaultPort = "COM1"; if (args.length > 0) { defaultPort = args[0]; } portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; MySimpleRead reader = new MySimpleRead(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } } public MySimpleRead() { try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) { e.printStackTrace(); } try { inputStream = serialPort.getInputStream(); } catch (IOException e) { e.printStackTrace(); } try { serialPort.addEventListener(this); } catch (TooManyListenersException e) { e.printStackTrace(); } try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { e.printStackTrace(); } System.out.println("Baud is " + serialPort.getBaudRate()); System.out.println("Bits is " + serialPort.getDataBits()); System.out.println("Stop is " + serialPort.getStopBits()); System.out.println("Par is " + serialPort.getParity()); serialPort.notifyOnDataAvailable(true); readThread = new Thread(this); readThread.start(); } public void run() { // Thread.sleep(20000); //} catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { System.out.println("An event occurred " + event.getEventType()); switch (event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: byte[] readBuffer = new byte[20]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } System.out.print(new String(readBuffer)); } catch (IOException e) {} break; } } } --------------- Result on windows ------------------------------ Stable Library ============================================================== Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port:: COM1 Baud is 9600 Bits is 8 Stop is 1 Par is 0 ----------------- End Results ----------------------------------------- ------------------ Result on Linux ----------------------------------- Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 Found port: /dev/ttyS0 Baud is 9600 Bits is 8 Stop is 1 Par is 0 An event occurred 1 043100066224 ------------------ End Results --------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/a1431630/attachment-0066.html From brian at mbari.org Tue Feb 7 09:48:37 2006 From: brian at mbari.org (Brian Schlining) Date: Tue, 7 Feb 2006 08:48:37 -0800 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> Message-ID: <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> Hi Matt > The following code works fine on Linux but I never see any data > when run on Windows. This is a cut and paste from the SimpleRead > example. > I am attempting to read data from a bar code scanner. I can fire > up HyperTermianl on windows and see that the device is working > properly as I see the barcodes are scanned and echoed back to the > terminal. However when I run the app I don't see any data. It is > however associating with the com port as the informational bits > print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. Cheers Brian Schlining Software Engineer http://www.mbari.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/16d07f37/attachment-0066.html From lux at diesel-research.com Tue Feb 7 11:59:58 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 11:59:58 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139293215.3689.4.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> Message-ID: <1139338798.8145.4.camel@zd7280> Any ideas on this ? Any reason why portList.hasMoreElements() should be false even though there are devices in /dev ? On Mon, 2006-02-06 at 23:20 -0700, Kim Lux wrote: > I'm running the code below. > > portlist.hasMoreElements() is false. > > /dev has ports in it as listed below. > > What am I doing wrong ? > > > ========================================================== > // Step through the list of ports until we find one that matches > // the one we are looking for. > > portList = CommPortIdentifier.getPortIdentifiers(); > > while(portList.hasMoreElements()) > { > portID = (CommPortIdentifier) portList.nextElement(); // > if (portID.getName().equals("/dev/ttyUSB0")) > { > myTA.append("Serial port ttyUSB0 has been found\n"); > break; > }// if portID equals... > }// End of while... > ========================================================== > > ls -al /dev/tty* > crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty > crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 > crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 > crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 > crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 > ... > crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 > crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 > crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 > > > -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 12:20:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 12:20:25 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139338798.8145.4.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> Message-ID: On Tue, 7 Feb 2006, Kim Lux wrote: > > Any ideas on this ? Any reason why portList.hasMoreElements() should be > false even though there are devices in /dev ? > > > On Mon, 2006-02-06 at 23:20 -0700, Kim Lux wrote: >> I'm running the code below. >> >> portlist.hasMoreElements() is false. >> >> /dev has ports in it as listed below. >> >> What am I doing wrong ? >> >> >> ========================================================== >> // Step through the list of ports until we find one that matches >> // the one we are looking for. >> >> portList = CommPortIdentifier.getPortIdentifiers(); >> >> while(portList.hasMoreElements()) >> { >> portID = (CommPortIdentifier) portList.nextElement(); // >> if (portID.getName().equals("/dev/ttyUSB0")) >> { >> myTA.append("Serial port ttyUSB0 has been found\n"); >> break; >> }// if portID equals... >> }// End of while... >> ========================================================== >> >> ls -al /dev/tty* >> crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty >> crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 >> crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 >> crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 >> crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 >> ... >> crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 >> crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 >> crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 >> >> >> > Hi Kim What rxtx does is try to open the port and do a timed out read. If the kernel/... do not complain it's enumarted. I suspect you could do a crude test by doing something like cat /dev/ttyS0 > /dev/null If that barfs then rxtx wont enumerate the port. hmm looking at your question again, I suspect it's a lockfile problem. This is documented in INSTALL with the source. Its easy enough to test this too.. touch /var/lock/testingrxtxlockfiles && rm -f /var/lock/testingrxtxlockfiles If you are not in the right group it will bail. Root will work regardless. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 12:37:56 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 12:37:56 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> Message-ID: <1139341076.8145.11.camel@zd7280> Exactly which ports does rxtx attempt to put into the list ? /dev/* or /dev/tty* or /dev/tty[0-9[0-9] ? or /dev/ttyS* ? For the record, only /dev/ttyUSB0 is a valid port on the machine I am presently on. Will this be a problem ? On Tue, 2006-02-07 at 12:20 -0700, Trent Jarvi wrote: > This is documented in INSTALL with the source. > I was wondering where that file was. I will download source and dig it up. Thanks. -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 12:51:09 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 12:51:09 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139341076.8145.11.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: On Tue, 7 Feb 2006, Kim Lux wrote: > > Exactly which ports does rxtx attempt to put into the list ? /dev/* > or /dev/tty* or /dev/tty[0-9[0-9] ? or /dev/ttyS* ? > > For the record, only /dev/ttyUSB0 is a valid port on the machine I am > presently on. Will this be a problem ? > > > On Tue, 2006-02-07 at 12:20 -0700, Trent Jarvi wrote: >> This is documented in INSTALL with the source. >> > I was wondering where that file was. I will download source and dig it > up. > > Thanks. > Hmm I'm looking at pre17 so this may have changed. (its just what I have on this machine) if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA" // for the IPAQs }; CandidatePortPrefixes=Temp; } So you may need to add "ttyUSB" to that list. RXTX used to enumerate _everything_ see if(osName.equals("Linux-all-ports") But it became less than practical. This is all in RXTXCommDriver.java hmm I just did a cvs update. if(osName.equals("Linux")) { String[] Temp = { "ttyS", // linux Serial Ports "ttySA", // for the IPAQs "ttyUSB" // for USB frobs }; CandidatePortPrefixes=Temp; } You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have to get your fingers into the code. We aim for sane defaults. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 13:06:45 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 13:06:45 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139342805.8145.22.camel@zd7280> On Tue, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > Hmm I'm looking at pre17 so this may have changed. (its just what I have > on this machine) > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA" // for the IPAQs > }; > CandidatePortPrefixes=Temp; > } > > > So you may need to add "ttyUSB" to that list. RXTX used to enumerate > _everything_ see if(osName.equals("Linux-all-ports") But it became less > than practical. > > This is all in RXTXCommDriver.java > > hmm I just did a cvs update. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have > to get your fingers into the code. We aim for sane defaults. Excellent. Thanks for taking the time. -- Kim Lux, Diesel Research Inc. From ideiglenes1 at freemail.hu Tue Feb 7 13:53:39 2006 From: ideiglenes1 at freemail.hu (--) Date: Tue, 07 Feb 2006 21:53:39 +0100 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139345619.22534.2.camel@localhost> Hi! I use this code to get all the extra Linux devices. :) if ("Linux".equals(System.getProperty("os.name"))) { System.setProperty("os.name","Linux-all-ports"); } driver = new RXTXCommDriver(); On k, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > On Tue, 7 Feb 2006, Kim Lux wrote: > > > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux Serial Ports > "ttySA", // for the IPAQs > "ttyUSB" // for USB frobs > }; > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you have > to get your fingers into the code. We aim for sane defaults. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From matt.higgins at gmail.com Tue Feb 7 13:45:54 2006 From: matt.higgins at gmail.com (Matt Higgins) Date: Tue, 7 Feb 2006 15:45:54 -0500 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> Message-ID: <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> Sweet this is exactly what I needed. I was searching the archives through marc.theamisgroup they only have archives back to 1/3/05. Should have hit the mailman archive! Thanks a lot! On 2/7/06, Brian Schlining wrote: > > Hi Matt > > The following code works fine on Linux but I never see any data when run > on Windows. This is a cut and paste from the SimpleRead example. > I am attempting to read data from a bar code scanner. I can fire up > HyperTermianl on windows and see that the device is working properly as I > see the barcodes are scanned and echoed back to the terminal. However when I > run the app I don't see any data. It is however associating with the com > port as the informational bits print fine? > > > You're not the only one whose had this problem, I don't know if Trent has > addressed this is the latest release of RXTX but there is a workaround. > Here's the recent thread from the RXTX mailing list regarding this issues: > > Thanasis Delenikas tdelenik at gmail.com > Wed Jan 18 13:56:23 MST 2006 > > * Previous message: [Rxtx] Re: More close() performance fixes > * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] > > Hi all. > (I've subscribed again from my other email account). > > Trent, > > You are right. Linux *always* works, no matter what flow control you set. > Windows *works only* with hardware flow control (I haven't tested what > happens with software XON/XOFF flow control). > > I assume (but I am not certain) that even with no flow control at all, all > platforms should work. Without flow control, you have the risk of bumping > into overflow or framing errors, but that's your (the end programmer, I > mean) problem. > > >From my side, I shouldn't be working without flow control. That was a bug > too... It was some code forgotten from the old times, when I used to work > with phone emulation drivers which didn't support flow control. The > correct > way is to have some flow control enabled and that's why I suppose this is > a > low-severity bug for RxTx. > > I have no idea which platform shows the correct behaviour, since > my knowledge about Linux and the inner workings of these low-level i/o > operations is limited. > > Regards, > Thanasis Delenikas. > > > > > Message: 2 > > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > > From: Trent Jarvi > > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > > To: RXTX Developers and Users > > Message-ID: > > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > > > Hi all, > > > > > > Trent, I have found something. > > > I read your comment about flow control, so I experimented a bit. > > > > > > If you remember, in my sample program I've used no flow control at all > ( > > i.e. > > > Java constant FLOWCONTROL_NONE). > > > > > > Now, during testing, I've switch to hardware inbound flow control (i.e > . > > Java > > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > > beautifully! > > > > > > I think I will switch to H/W flow control and test things for a while, > > but > > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > > > > > Hi Thanasis, > > > > I'm fairly sure you have identified a bug. I would not worry too much > > about what Sun CommAPI w32 defaults are. I think they did more or less > > whatever the port opened with. Just a guess. Linux tries to stomp on > > ports so they are all the same. > > > > So this started out with Linux worked, Windows XP/.. did not as I > recall. > > Something is wrong in rxtx. Do I understand this right? > > > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > > > Perhaps there is something Wayne or I did not understand when we wrote > > that code. I wasnt programming back in the BBS days so modems are not > my > > thing. I have a few questions. > > > > Is the above matrix confirmed by observation? > > Linux just always worked? > > Which one _should_ work? I'm guessing modems work with hardware flow > > control. I'll have to dig around. > > > > The windows flow control changes a couple things with hardware flow > > control. Following the w32 API documentation is confusing sometimes. > > But it looks like Linux could have a bug too. > > Cheers > > Brian Schlining > Software Engineer > http://www.mbari.org > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/9c989144/attachment-0066.html From tjarvi at qbang.org Tue Feb 7 14:06:14 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 14:06:14 -0700 (MST) Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> <950550040602071245n5647b15bp421ff4146746bc3a@mail.gmail.com> Message-ID: >> >> You're not the only one whose had this problem, I don't know if Trent has >> addressed this is the latest release of RXTX but there is a workaround. >> Here's the recent thread from the RXTX mailing list regarding this issues: >> I have not. I expect to have access to some test equipment next month and I'll go through all of this. I really don't know whats going on and I need a gold standard. I thought maybe linux was autodetecting the flow control. Your observations would certainly be welcome. I need to talk to Russell King and see what he is doing. Until then I'd just be toying around over a loopback as usual. This is very high on the list though. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 17:25:05 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 17:25:05 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> Message-ID: <1139358305.17994.2.camel@zd7280> My application now works. I installed the libraries and jar from 2.1-7 (Final). portlist.hasMoreElements is no longer false. The application finds the port for /dev/ttyUSB0. Thanks for your help, Trent (et al) Sorry I bothered you with this. Next time I will look in the source first. I didn't think it was an rxtx issue, I thought it was a Linux setup issue . On Tue, 2006-02-07 at 12:51 -0700, Trent Jarvi wrote: > Hmm I'm looking at pre17 so this may have changed. (its just what I > have > on this machine) > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux > Serial Ports > "ttySA" // for the > IPAQs > }; > > CandidatePortPrefixes=Temp; > } > > > So you may need to add "ttyUSB" to that list. RXTX used to enumerate > _everything_ see if(osName.equals("Linux-all-ports") But it became > less > than practical. > > This is all in RXTXCommDriver.java > > hmm I just did a cvs update. > > if(osName.equals("Linux")) > { > String[] Temp = { > "ttyS", // linux > Serial Ports > "ttySA", // for the > IPAQs > "ttyUSB" // for USB > frobs > }; > > CandidatePortPrefixes=Temp; > } > > > You should be OK with 2.1-7 (Final). RXTX can do _much_ more but you > have > to get your fingers into the code. We aim for sane defaults. -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 19:21:54 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 19:21:54 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139358305.17994.2.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> <1139341076.8145.11.camel@zd7280> <1139358305.17994.2.camel@zd7280> Message-ID: >Sorry I bothered you with this. Next time I will look in the source >first. I didn't think it was an rxtx issue, I thought it was a Linux >setup issue . Why would you be sorry? I would have done the same. I'm glad it's working :) -- Trent Jarvi tjarvi at qbang.org From tma at mail.island.net Wed Feb 8 13:39:35 2006 From: tma at mail.island.net (Tom Alldread) Date: Wed, 08 Feb 2006 12:39:35 -0800 Subject: [Rxtx] Win32/Linux Serial Port Data Dropouts In-Reply-To: <200602060702.k167255O007882@www.qbang.org> References: <200602060702.k167255O007882@www.qbang.org> Message-ID: <43EA5707.4020200@mail.island.net> Greetings Folks at RXTX: During the last couple of months I have been alternately testing with javax.comm 2 and RXTX 2.1 under Windows XP and CommApi 3 and RXTX 2.1 under Suse 10.0 Linux. In the process I have learned a little about java multi-threading under NetBeans 5 with Profiler. My java (jdk 1.5_06) application is used for data acquisition and provides a graphical display of A-D conversion data received from a 56KBaud serial port. The actual data throughput is about 10KBaud thus it is well below the speed of the port. I use hardware RTS/CTS flow control which can stall the data acquisition sample rate if necessary. This ensures the display computer has the ability to slow the data acquisition rate should it become too busy to accept the regular data flow. Both the serial port buffer and the java read buffer are set at 16KB. Usually the data transfers into the java read buffer are less than 100 bytes unless the data acquisition is recovering from a stall. The data flow normally hesitates after each 5 KB block as a continue command is needed from the display computer to start the drawing of a new graphics display line. Separate threads have been provided for the serial port event monitoring and data processing. The serial port event thread has been given the maximum priority and data processing thread the minimum priority provided by java. Thread yield statements have been placed within all data processing while/for loops as an effort to ensure quick access to CPU cycles for the serial port event thread. I have found that short data transmissions are essentially error free but occasional dropouts occur with continuous data flow especially under Windows XP. ....................................................................................................................................................................................... Linux results: I am happy to report that RXTX 2.1 appears to work very well under Linux although I did notice some errors when the screen savers were running with my dual monitors. I believe this is a local problem associated with my dual graphics which needs further attention. The recent CommApi 3 Linux release from Sun did not work at all with my program. It seemed to send commands out OK but did not receive any data. Although the serial port event triggered the ISR, the input stream appeared filled with nulls and thus did not contain any data. As my understanding is that CommApi 3 was tested with a Red Hat distribution of Linux I wonder if this problem is distro dependent? Although somewhat off topic here I wonder if anyone reading this has had similar experience? .................................................................................................................................................................................. Windows XP results: There are problems with occasional data dropouts which become more frequent as the sampling rate is increased or if the computer becomes busy with other duties. The dropouts typically consist of a half dozen byte block of lost data. It appears the lost bytes never get added to the java input stream. There has not been any indication of garbled data, overruns or framing errors which suggests the UART communications remains solid. Using javax.comm 2 I found that the setting of SerialPort 'enableReceiveThreshold' to 40 and 'enableReceiveTimeout' of 100mS reduced the dropouts error rate significantly. I found that I could not get RXTX 2.1 to function with the aforementioned threshold and timeout settings. The javax.comm 2 interface is consequently performing better for me under Windows than RXTX 2.1. I wonder if anyone here has any suggestions as to what I might try to improve RXTX 2.1? Although my settings are the same as under Suse 10.0, RXTX 2.1 performs much better for me under Linux than any of the alternatives that I have tried under Windows XP . ............................................................................................................................................................................... I would like to establish, based on the experience of others, if I have reached the normally expected performance limit of java serial port communications? Should I expect to achieve virtually error free serial port data input from a continuous stream under Windows XP java software? I am considering changing my protocol to packets with error checking if necessary but would like to know if the dropout problems I am experiencing are typical or not before I take this rather work intensive plunge. Many thanks in advance for any help! Best Regards, Tom Alldread -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.375 / Virus Database: 267.15.2/253 - Release Date: 2006-02-07 From jlaxson at mac.com Wed Feb 8 23:56:48 2006 From: jlaxson at mac.com (John Laxson) Date: Thu, 9 Feb 2006 00:56:48 -0600 Subject: [Rxtx] PortInUseException: Unknown Application on OSX Message-ID: Hi, I've been trying to get RXTX 2.1.7 going on Mac OS X for a while here, and am running up into a wall here. I've tried with pre- compiled and the source version and get the same problem, a gnu.io.PortInUseException: Unknown Application. I have run the fixperms script included with the source distribution, and id shows me as a member of the uucp group, and permissions on /var/spool/uucp are 775 root:uucp. Running a test program (included at the bottom for clarity) lets me enumerate all the serial ports correctly, but trying to open any of them gives the PortInUseException. If it helps, when I try to open a port that's set to make an outgoing bluetooth connection, there is no delay and no connection attempt at all. Thanks, John Laxson PS: The documentation wiki on qbang.org shows 404, and has for a few days now. My test code: public static void main(String[] args) { SerialPort serialPort; try { Enumeration e = CommPortIdentifier.getPortIdentifiers(); CommPortIdentifier ident; while (e.hasMoreElements()) { ident = (CommPortIdentifier)e.nextElement(); System.out.println(ident.getName()); } ident = CommPortIdentifier.getPortIdentifier("/dev/cu.modem"); serialPort = (SerialPort) ident.open("Me", 5000); } catch (Exception e) { e.printStackTrace(); } } From rajesh.invincible at gmail.com Thu Feb 9 03:39:38 2006 From: rajesh.invincible at gmail.com (Rajesh N) Date: Thu, 9 Feb 2006 16:09:38 +0530 Subject: [Rxtx] Re: Move .java Files in gnu.io filesystem hierarchy - Maven (2) In-Reply-To: <43DF21D2.7090200@ngi.it> References: <43DF21D2.7090200@ngi.it> Message-ID: <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Can anybody tell me how to overcome these EXCEPTIONS I AM WORKING ON SERIAL COMMN IN JAVA ON LINUX. 1. " NOT ALL PARAMETERS SUPPORTED BY THE KERNEL" This i came across the following statement inmy prog. SerialP is A SerialPort object SerialP.setSerialPortParams(9600(BAUDRATE),DATABITS_8,STOPBITS_1,PARITY_NONE) 2. NullPointer Exception at Event Dispatch Now i have checked all my object references for a null reference but i found none i have put up my entire code in try catch blocks but still I AM UNABLE TO CATCH THIS EXCEPTION AND HENCE MY APPLICATION CLOSES HOW DOES THESE GO? PLEASE HELP ME IT IS URGENTTTTTTTTTTTTTTTT yours sincerely RAJESH On 1/31/06, Fabio Frumento wrote: > Hi Xavier, > > I don't know maven at all but the directory hierarchy listed buy Trent > is fine for me... > > I'll take a look to maven, it seems an interesting project > > Regards > > Fabio Frumento > > Trent Jarvi wrote: > > On Tue, 31 Jan 2006, Xavier Frisaye wrote: > > > >> Hi all, > >> > >> If you are going to rearrange the src folder, i will propose to use > >> maven 2 and follow its directory structure > >> > (http://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html). > >> > >> Maven 2 simplify java project and give a standard way to make projects > >> (http://maven.apache.org/). > >> We are using it for internal projects and we are very satisfied. > >> > >> Is anybody interested? > >> > >> I'm not an expert in maven 2 (yet) but i'm agree to help using it if > >> you choose to make so. > >> > > > > so this would be: > > > > rxtx-devel/src/main/java/gnu.io > > rxtx-devel/src/test/java/ManIwish.java > > > > I don't use IDEs very much so I'll let others comment. But I don't see > > a problem with that. > > > > -- > > Trent Jarvi > > tjarvi at qbang.org > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Thu Feb 9 09:50:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 9 Feb 2006 09:50:31 -0700 (MST) Subject: [Rxtx] Re: Move .java Files in gnu.io filesystem hierarchy - Maven (2) In-Reply-To: <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Message-ID: On Thu, 9 Feb 2006, Rajesh N wrote: > Can anybody tell me how to overcome these EXCEPTIONS > I AM WORKING ON SERIAL COMMN IN JAVA ON LINUX. > > 1. " NOT ALL PARAMETERS SUPPORTED BY THE KERNEL" > > This i came across the following statement inmy prog. > SerialP is A SerialPort object > SerialP.setSerialPortParams(9600(BAUDRATE),DATABITS_8,STOPBITS_1,PARITY_NONE) > Strange. The parameters you use are the same the port should open with by default. Could you paste the actual exception you are getting? I don't see that in the rxtx source. Also it would help to know the rxtx version. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Fri Feb 10 15:29:05 2006 From: lux at diesel-research.com (Kim Lux) Date: Fri, 10 Feb 2006 15:29:05 -0700 Subject: [Rxtx] One serial port object for both sending and receiving ? Message-ID: <1139610545.18177.4.camel@zd7280> Is it OK to use one SerialPort ojbect (ex Serial Port serialPort;) and use it for both sending and receiving ? For example: ======================================================================== static SerialPort serialPort = null; static OutputStream serialOut = null; static InputStream serialIn = null; // assign it to an outputStream for use try{ serialOut = serialPort.getOutputStream(); System.out.println("Serial output stream has been assigned."); }//try catch(IOException e) { System.out.println("Error: Couldn't assign output stream to serial port."); }//catch //assign it to an inputStream for use try{ serialIn = serialPort.getInputStream(); System.out.println("Serial input stream has been assigned."); }//try catch(IOException e) { System.out.println("Error: Couldn't assign input stream to serial port."); }//catch ======================================================================== -- Kim Lux, Diesel Research Inc. From lux at diesel-research.com Fri Feb 10 21:23:00 2006 From: lux at diesel-research.com (Kim Lux) Date: Fri, 10 Feb 2006 21:23:00 -0700 Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> Message-ID: <1139631780.23882.10.camel@zd7280> I've got a problem receiving chars with my version of serialRead, written in an SWT GUI. I had a Java pro have a good look at my code and he can't see anything wrong with it. I can send chars fine. When I receive a char the cpu usage for the app goes to 100% and the code in the serial event handler doesn't get executed. The instructions on the Java Comm Serial API How-To for Linux page state that I must install javacomm. Is that true ? Everything builds without it and I can send chars on rxtx just fine, but I can't receive them. Could this be the problem ? I downloaded and installed javacomm. I was not able to add "Driver=gnuio.RXTXCommDriver to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 installed in /usr/java/jre1.5.0_05. I added comm.jar to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext to the library paths. Is this OK ? Does it matter that I am receiving on /dev/ttyUSB0 ? Thanks. -- Kim Lux, Diesel Research Inc. From lunareclipse03 at web.de Sat Feb 11 09:44:46 2006 From: lunareclipse03 at web.de (lunareclipse03@web.de) Date: Sat, 11 Feb 2006 17:44:46 +0100 Subject: [Rxtx] Question about Serial I/O under Win32 Message-ID: <662084330@web.de> Hello everybody, I have a strange problem with a piece of code I made for myself. No, this is not really concerning rxtx, but nevertheless I post this to the list, hoping that some of you can help me. I've written two libraries, one for linux and one for win32. The linux port works quite well, I can send / receive faxes and / or replay voice messages over the telephone line using a voice modem. But the win32 port of the library causes some trouble. If, for example, I send out a fax with a certain modem under linux, it works well. The fax is complete when it comes out of the fax machine. If I then use the same modem to send out a fax under win32, the fax coming out of the fax machine gets "stuck" halfways, but the sending modem thinks that transmission was ok and drops the connection. The answering fax machine then gives me "error while receiving." The "upper layer" java code MUST be right, because if I do the same thing under linux (using the linux library), everything is alright. Now I have to ask: Can somebody please help me out with this??!? Could it be the case that some kind of flow control or COMMTIMEOUTS setting causes this behaviour? I set flow control to RTS/CTS before sending out a fax. How can I DISABLE flow control? Or what do you think? Can something else cause this problems? Thank you all for your time and PLEASE write back soon. Regards, --Sven Ahlemann Am Waldrand 31 45721 Haltern am See Germany ______________________________________________________________ Verschicken Sie romantische, coole und witzige Bilder per SMS! Jetzt bei WEB.DE FreeMail: http://f.web.de/?mc=021193 From lux at diesel-research.com Sat Feb 11 10:06:52 2006 From: lux at diesel-research.com (Kim Lux) Date: Sat, 11 Feb 2006 10:06:52 -0700 Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: <1139631780.23882.10.camel@zd7280> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> <1139631780.23882.10.camel@zd7280> Message-ID: <1139677612.3431.5.camel@zd7280> More on this problem. I copied and pasted simpleRead into a console based Eclipse project and I've got the same result, except that cpu usage doesn't go to 100%. I'm beginning to think there is an issue in rxtx. My imports for simpleRead are: ============================ import gnu.io.*; import java.util.*; //import javax.comm.*; import java.io.*; =========================== Any ideas ? I am trying to read from /dev/ttyUSB0 using a serial to USB adapter which has worked well with minicom and gtkterm. Thanks. On Fri, 2006-02-10 at 21:23 -0700, Kim Lux wrote: > I've got a problem receiving chars with my version of serialRead, > written in an SWT GUI. > > I had a Java pro have a good look at my code and he can't see anything > wrong with it. > > I can send chars fine. When I receive a char the cpu usage for the app > goes to 100% and the code in the serial event handler doesn't get > executed. > > The instructions on the Java Comm Serial API How-To for Linux page state > that I must install javacomm. Is that true ? Everything builds without > it and I can send chars on rxtx just fine, but I can't receive them. > Could this be the problem ? > > I downloaded and installed javacomm. I was not able to add > "Driver=gnuio.RXTXCommDriver > to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not > have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 > installed in /usr/java/jre1.5.0_05. I added comm.jar > to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext > to the library paths. Is this OK ? > > Does it matter that I am receiving on /dev/ttyUSB0 ? > > Thanks. > -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Sun Feb 12 21:01:33 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:01:33 -0700 (MST) Subject: [Rxtx] Problems receiving chars with rxtx. In-Reply-To: <1139677612.3431.5.camel@zd7280> References: <43DF21D2.7090200@ngi.it> <6b2c65f0602090239v250dd9b3p8a0e31ce24ca1f92@mail.gmail.com> <1139631780.23882.10.camel@zd7280> <1139677612.3431.5.camel@zd7280> Message-ID: I suspect what is happening is the select() is breaking out in the native code but the driver does not have support for notifying there are X bytes available. On some traditional Unix based systems, the only way you know data is available is the fd status changes and do an FIORDCHK ioctl. Or perhaps the only thing you can know is the fd status changed. It would take reading through the kernel driver code to know for sure. So on USB, depending upon the driver, the same may need to be done or the driver improved a bit if possible to support. Polling reads will also work but don't use the event driven model of CommAPI which isnt acceptable in the long run. The 100% cpu usage can then be explained because select no longer blocks until the data is read; the eventLoop spins loose. You can put a well placed sleep but rxtx only expects those are needed when it knows data is available. This may not be a super simple thing to understand and fix. I do have ideas to get you started. I'm going to be short on time the next couple weeks. I expect to put some good time in and answer some other questions I saw around the 25th. For now, I'd look at the following and go from there with the hints I've given. JNIEXPORT jint JNICALL RXTXPort(nativeavailable)( JNIEnv *env, jobject jobj ) { int fd = get_java_var( env, jobj,"fd","I" ); int result; /* char message[80]; ENTER( "RXTXPort:nativeavailable" ); On SCO OpenServer FIONREAD always fails for serial devices, so try ioctl FIORDCHK instead; will only tell us whether bytes are available, not how many, but better than nothing. This turns out to be true on Solaris also. taj. */ #ifdef FIORDCHK /* __unixware__ __sun__ probably others */ result = ioctl(fd, FIORDCHK, 0); #else if( ioctl( fd, FIONREAD, &result ) < 0 ) { goto fail; } #endif /* FIORDCHK */ On Sat, 11 Feb 2006, Kim Lux wrote: > > More on this problem. I copied and pasted simpleRead into a console > based Eclipse project and I've got the same result, except that cpu > usage doesn't go to 100%. I'm beginning to think there is an issue in > rxtx. > > My imports for simpleRead are: > > ============================ > import gnu.io.*; > import java.util.*; > //import javax.comm.*; > import java.io.*; > =========================== > > Any ideas ? I am trying to read from /dev/ttyUSB0 using a serial to > USB adapter which has worked well with minicom and gtkterm. > > Thanks. > > > > On Fri, 2006-02-10 at 21:23 -0700, Kim Lux wrote: >> I've got a problem receiving chars with my version of serialRead, >> written in an SWT GUI. >> >> I had a Java pro have a good look at my code and he can't see anything >> wrong with it. >> >> I can send chars fine. When I receive a char the cpu usage for the app >> goes to 100% and the code in the serial event handler doesn't get >> executed. >> >> The instructions on the Java Comm Serial API How-To for Linux page state >> that I must install javacomm. Is that true ? Everything builds without >> it and I can send chars on rxtx just fine, but I can't receive them. >> Could this be the problem ? >> >> I downloaded and installed javacomm. I was not able to add >> "Driver=gnuio.RXTXCommDriver >> to /usr/java/j2sdk.../jre/lib/javax.comm.properties because I do not >> have the j2sdk installed. I am using Eclipse. I have jre1.5.0_05 >> installed in /usr/java/jre1.5.0_05. I added comm.jar >> to /usr/java/jre1.5.0_05/lib/ext and added /usr/java/jre1.5.0_05/lib/ext >> to the library paths. Is this OK ? >> >> Does it matter that I am receiving on /dev/ttyUSB0 ? >> >> Thanks. >> > From tjarvi at qbang.org Sun Feb 12 21:03:30 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:03:30 -0700 (MST) Subject: [Rxtx] One serial port object for both sending and receiving ? In-Reply-To: <1139610545.18177.4.camel@zd7280> References: <1139610545.18177.4.camel@zd7280> Message-ID: On Fri, 10 Feb 2006, Kim Lux wrote: > > Is it OK to use one SerialPort ojbect (ex Serial Port serialPort;) and > use it for both sending and receiving ? > > For example: > > ======================================================================== > static SerialPort serialPort = null; > static OutputStream serialOut = null; > static InputStream serialIn = null; > > > > > // assign it to an outputStream for use > try{ > serialOut = serialPort.getOutputStream(); > System.out.println("Serial output stream has been assigned."); > }//try > catch(IOException e) > { > System.out.println("Error: Couldn't assign output stream to serial > port."); > }//catch > > > //assign it to an inputStream for use > try{ > serialIn = serialPort.getInputStream(); > System.out.println("Serial input stream has been assigned."); > }//try > catch(IOException e) > { > System.out.println("Error: Couldn't assign input stream to serial > port."); > }//catch This should be fine. In fact trying to do it another way will probably not work as you will run into lockfile issues. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun Feb 12 21:13:13 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 12 Feb 2006 21:13:13 -0700 (MST) Subject: [Rxtx] Question about Serial I/O under Win32 In-Reply-To: <662084330@web.de> References: <662084330@web.de> Message-ID: On Sat, 11 Feb 2006 lunareclipse03 at web.de wrote: > Hello everybody, > > I have a strange problem with a piece of code I made for myself. No, > this is not really concerning rxtx, but nevertheless I post this to the > list, hoping that some of you can help me. I've written two libraries, > one for linux and one for win32. The linux port works quite well, I can > send / receive faxes and / or replay voice messages over the telephone > line using a voice modem. But the win32 port of the library causes some > trouble. If, for example, I send out a fax with a certain modem under > linux, it works well. The fax is complete when it comes out of the fax > machine. If I then use the same modem to send out a fax under win32, the > fax coming out of the fax machine gets "stuck" halfways, but the sending > modem thinks that transmission was ok and drops the connection. The > answering fax machine then gives me "error while receiving." The "upper > layer" java code MUST be right, because if I do the same thing under > linux (using the linux library), everything is alright. Now I have to > ask: Can somebody please help me out with this??!? Could it be the case > that some kind of flow control or COMMTIMEOUTS setting causes this > behaviour? I set flow control to RTS/CTS before sending out a fax. How > can I DISABLE flow control? Or what do you think? Can something else > cause this problems? Thank you all for your time and PLEASE write back > soon. > Hi Sven I'm not too willing to talk about flow control at the low level until I confirm some things with test equipment later. It is not clear if you are using rxtx or writing your own native code. So I'm not sure how to answer much of this :) If you are wondering how to change the flow control using rxtx from java, The BlackBox example from Sun flips this back and forth. SerialPort.java in rxtx 2.1 uses the following: SerialPort.java: public static final int FLOWCONTROL_NONE =0; SerialPort.java: public static final int FLOWCONTROL_RTSCTS_IN =1; SerialPort.java: public static final int FLOWCONTROL_RTSCTS_OUT =2; SerialPort.java: public static final int FLOWCONTROL_XONXOFF_IN =4; SerialPort.java: public static final int FLOWCONTROL_XONXOFF_OUT=8; So if you set flowcontrol to RTSCTS, you can set it to NONE to turn it off. If you are looking for how to do it in native code, the rxtx Source is SerialImp.c (unix/linux/mac os x/w32) and termios.c (w32 only with SerialImp.c) You can track the code: SerialImp.c:JNIEXPORT void JNICALL RXTXPort(setflowcontrol)( JNIEnv *env, jobject jobj, jint flowmode ) termios.c:int tcgetattr( int fd, struct termios *s_termios ) termios.c:int tcsetattr( int fd, int when, struct termios *s_termios ) There may be a problem in the rxtx flow control code though. Rather than guess, I want to test this with a gold standard. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Feb 6 00:00:16 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 00:00:16 -0700 (MST) Subject: [Rxtx] wiki delay until tomorrow night. In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: On Sun, 5 Feb 2006, Trent Jarvi wrote: > On Sun, 5 Feb 2006, Kim Lux wrote: > >> usb ? Tell me more... I need that too. > > usb is a very proper design. Thats all it is. > Maybe rxtx could help usb. But it would start with helping bring back the community that was already there. It's not something I'd love to do but maybe its the right thing to do. It would probably take 2 years to do right. But maybe thats better than what we have now. I honestly don't know what IBM is doing which could just run over everything. Just some thoughts after some fine german wine. -- Trent Jarvi tjarvi at qbang.org From gadelavega at yahoo.com.ar Mon Feb 6 02:17:05 2006 From: gadelavega at yahoo.com.ar (Gonzalo A. de la Vega) Date: Mon, 06 Feb 2006 10:17:05 +0100 Subject: [Rxtx] Serial port ownership question In-Reply-To: References: <20060205113618.30274.qmail@web53501.mail.yahoo.com> <1139157422.4553.9.camel@zd7280> <1139158698.4936.9.camel@zd7280> Message-ID: <43E71411.4050402@yahoo.com.ar> On my Fedora Core 4: ls -l /dev/ttyS* crw-rw---- 1 root uucp 4, 64 Feb 6 2006 /dev/ttyS0 crw-rw---- 1 root uucp 4, 65 Feb 6 2006 /dev/ttyS1 ... and: grep "ttyUSB" /etc/udev/rules.d/50-udev.rules KERNEL=="ttyUSB*", GROUP="uucp", MODE="0660" So anyone in the "uucp" group can use serial ports. On Gentoo the group is "tty". Trent Jarvi escribi?: > > > On Sun, 5 Feb 2006, Dr. Douglas Lyon wrote: > >> I can confirm that this is the case (only root ownership of >> serial ports, under fedora 4). >> Wow, what were they thinking?! >> - DL >> >>> I've found that the newer kernels have the serial ports owned by root. >>> For example, >>> >>> $ls -al /dev/tty* >>> crw-rw-rw- 1 root root 5, 0 Feb 5 02:06 /dev/tty >>> crw-rw---- 1 root root 4, 0 Feb 5 02:06 /dev/tty0 >>> crw------- 1 root root 4, 1 Feb 5 09:07 /dev/tty1 >>> crw-rw---- 1 root tty 4, 10 Feb 5 02:06 /dev/tty10 >>> crw-rw---- 1 root tty 4, 11 Feb 5 02:06 /dev/tty11 >>> ... > > > This is just not a problem jcp or such are going to solve. Its a > platform spitwad fight. But do look at pam. In fact thats what Sun > is doing too. Maybe Linux followed their lead.. I'm not a pam guy. > I've spent 16 hours trying to understand it but your users wont :) > > Solution? I have no clue. Its two tangent mentalities from my > perspective. > > -- > Trent Jarvi > tjarvi at qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mtnvega at yahoo.com.br Mon Feb 6 05:35:43 2006 From: mtnvega at yahoo.com.br (Luiz Jr) Date: Mon, 6 Feb 2006 12:35:43 +0000 (GMT) Subject: [Rxtx] Documentation Wiki In-Reply-To: <1139157422.4553.9.camel@zd7280> Message-ID: <20060206123543.57256.qmail@web53515.mail.yahoo.com> Hello, Thank you for you answer, but so the usage of the API is pretty much like the Java Communications Api? If yes, what version of the Java Comm Api? Thank you, Luiz A. Brandao Jr Kim Lux escreveu: On Sun, 2006-02-05 at 08:36 -0300, Luiz Jr wrote: > Hello, > > I want to start using the RXTX libraries, but I would to know how, > since I can not access the documentation wiki page I just started using them yesterday. Below is how I installed the libraries, if that helps. I used snippets of code from the SimpleWrite application here to get me going. http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html Instead of "import javax.comm.*;", use "import gnu.io.*;" which is gotten from RXTXcomm.jar, which you will need to include in your project references. I am working in Eclipse. BTW: there is no way to open a port without going through the port list and finding it. Maybe sometime in the future someone (me ?) will write a method called openSerialPort that allows the user to give a port identifier, such as "/dev/tty1" and return a port ready to use. It wouldn't take much to write that and it would save users a lot of code. Hope this helps. ======================================================================= 1) Figure out which java you are running, incase there is more than one installed. $ java -version java version "1.5.0_05" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_05-b05) Java HotSpot(TM) Client VM (build 1.5.0_05-b05, mixed mode, sharing) 2) Find all the jre directories and the one from which you are currently running. kfind (jre) 3) cd to that directory plus /lib/i386 cd /usr/java/jre1.5.0_05/lib/i386 4) Copy the library files (*.so) to that directory. cp /home/krlux/Desktop/'Java Controls'/rxtx-linux/bin/* . 5) Check that the copy was successful ls librxtx* librxtxI2C.so librxtxRaw.so librxtxSerial.so librxtxParallel.so librxtxRS485.so 6) cd to the /lib/ext directory for your java. cd /usr/java/jre1.5.0_05/lib/ext 7) Copy the Jar files there cp /home/krlux/Desktop/'Java Controls'/rxtx-linux/lib/ext/* . 8) Check that it was successful ls RXTX* RXTXcomm.jar Rxtx is now installed on your machine ready to use. =================================================================== -- Kim Lux, Diesel Research Inc. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx --------------------------------- Yahoo! Acesso Gr?tis - Internet r?pida e gr?tis. Instale o discador agora! -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/544aa403/attachment-0067.html From lyon at docjava.com Mon Feb 6 05:49:34 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 06 Feb 2006 07:49:34 -0500 Subject: [Rxtx] wiki delay until tomorrow night. In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: Hi All, I have often thought about USB drivers being needed. For example, the ironman watch will not interface to a mac (windows only). It is USB. My dymo label writer has no Java driver (native only). Etc. Most cheap web cameras are USB (and Java drivers go through JAI, if it supports the camera at all). The JAI code shows how sun did the USB drivers. You have to be a member of the jai project to download the source code. https://jai.dev.java.net has the jai distro. And then you are not allowed to redistribute it. However, we can all learn from it (if so inclined). Basically: cvs -d :pserver:lyon at cvs.dev.java.net:/cvs login cvs -d :pserver:lyon at cvs.dev.java.net:/cvs checkout jai-core You will need to user your own uid and pw to get in. The ant build has over 100 warnings from sun deprecations of its own code. You might say that they were hoisted on their own Picard ;) One interesting thing is that they support several platforms: linux-amd64 64-bit Linux-AMD64 linux-i586 32-bit Linux-x86 solaris-amd64 64-bit Solaris-AMD64 solaris-i586 32-bit Solaris-x86 solaris-sparc 32-bit Solaris-SPARC solaris-sparcv9 64-bit Solaris-SPARC windows-i586 32-bit Windows-x86 Thus, ant is used to provide a multi-platform native method distro. Neat. How do they do it? check this out: And: The core download does not contain any C source code (it was all pre-built). Basically, they are just copying .so and .dll files into build directories. I would love to see the C code for this...but Sun does not post it on the https://jai.dev.java.net site. I don't know why...Perhaps I missed it. - Doug >On Sun, 5 Feb 2006, Trent Jarvi wrote: > >>On Sun, 5 Feb 2006, Kim Lux wrote: >> >>>usb ? Tell me more... I need that too. >> >>usb is a very proper design. Thats all it is. >> > >Maybe rxtx could help usb. But it would start with helping bring >back the community that was already there. > >It's not something I'd love to do but maybe its the right thing to do. > >It would probably take 2 years to do right. But maybe thats better >than what we have now. > >I honestly don't know what IBM is doing which could just run over everything. > >Just some thoughts after some fine german wine. > >-- >Trent Jarvi >tjarvi at qbang.org > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From tdelenik at gmail.com Mon Feb 6 05:56:32 2006 From: tdelenik at gmail.com (Thanasis Delenikas) Date: Mon, 6 Feb 2006 14:56:32 +0200 Subject: Fwd: [Rxtx] Documentation Wiki In-Reply-To: <1139157422.4553.9.camel@zd7280> References: <20060205113618.30274.qmail@web53501.mail.yahoo.com> <1139157422.4553.9.camel@zd7280> Message-ID: <310a1a930602060456t129f1dc6p5f2b908f13ab5a0b@mail.gmail.com> Hello all, Kim, this is a snippet from the code I use. The closest to directly opening a specific port without enumeration. << ... portId = CommPortIdentifier.getPortIdentifier(getPort()); serialPort = (SerialPort) portId.open("jSMSEngine", 1971); ... >> where getPort() return the string identifier of the port, i.e. "/dev/ttyS0" or "COM1" or whatever. Thanasis. ---------- Forwarded message ---------- From: Kim Lux Date: Feb 5, 2006 6:37 PM Subject: Re: [Rxtx] Documentation Wiki To: RXTX Developers and Users BTW: there is no way to open a port without going through the port list and finding it. Maybe sometime in the future someone (me ?) will write a method called openSerialPort that allows the user to give a port identifier, such as "/dev/tty1" and return a port ready to use. It wouldn't take much to write that and it would save users a lot of code. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/182ab5b8/attachment-0067.html From tjarvi at qbang.org Mon Feb 6 11:53:57 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 11:53:57 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: On Mon, 6 Feb 2006, Dr. Douglas Lyon wrote: > Hi All, > I have often thought about USB drivers being needed. > For example, the ironman watch will not interface > to a mac (windows only). It is USB. > My dymo label writer has no Java driver (native only). > Etc. > Most cheap web cameras are USB (and Java drivers go > through JAI, if it supports the camera at all). > The JAI code shows how sun did the USB drivers. > You have to be a member of the jai project to download > the source code. > https://jai.dev.java.net has the jai distro. > And then you are not allowed to redistribute it. However, > we can all learn from it (if so inclined). Basically: > cvs -d :pserver:lyon at cvs.dev.java.net:/cvs login > cvs -d :pserver:lyon at cvs.dev.java.net:/cvs checkout jai-core > You will need to user your own uid and pw to get in. > The ant build has over 100 warnings from sun deprecations > of its own code. > > You might say that they were hoisted on their own Picard ;) > > One interesting thing is that they support several platforms: > linux-amd64 64-bit Linux-AMD64 > linux-i586 32-bit Linux-x86 > solaris-amd64 64-bit Solaris-AMD64 > solaris-i586 32-bit Solaris-x86 > solaris-sparc 32-bit Solaris-SPARC > solaris-sparcv9 64-bit Solaris-SPARC > windows-i586 32-bit Windows-x86 > Thus, ant is used to provide a multi-platform native method distro. > Neat. > How do they do it? > check this out: > > > > > > > > > > > > > And: > > > > > > > > > > The core download does not contain any C source code (it was all pre-built). > Basically, they are just copying .so and .dll files into build directories. > > I would love to see the C code for this...but Sun does not post it on the > https://jai.dev.java.net site. > > I don't know why...Perhaps I missed it. > > - Doug > > I've looked at moving rxtx to Ant builds. I think that would help IDEs a great deal. I requested a evalutation desk copy the O'Reilly Ant book for some j2ee material I was teaching. http://www.oreilly.com/catalog/anttdg/ It has a one sentence mention of JNI. So there was not luck there. I saw that there is another Ant book that does mention JNI more. I can't find it now. Ant must be able to support it with extensions. http://ant.apache.org/manual/OptionalTasks/javah.html What the auto(break :) tools do in the rxtx build is 4 things really. 1) gcc compile flags 2) ld compile flags 3) config.h 4) compile flags for customizing rxtx (lockfiles, ...) See 1 All of this information except 4 can be static once obtained. So I'm not attached to the auto tools. If I could find an example of Ant being used for JNI code, I'd be one of the first to start moving that direction. Maybe someone saw an example someplace. The other thing we have not completed discussing is the directory structure. There is interest in making rxtx more IDE friendly. I get more mail about that off the list than how to install rxtx. And I see we have Ken Thompson in da house :) He is our trusted CVS maintainer and the guy that purchased the rxtx.org domain. Old community. We will need Ken for changing the directory structure of source. I would like to open up discussion about both of these as it is more than time. The problem is I have little experience with Ant and even less with IDEs. It would be nice if we could work with Eclipse and NetBeans. http://www.netbeans.org/ (sun and some community) http://www.eclipes.org (ibm,rhat,... perhaps more community) http://maven.apache.org/what-is-maven.html (apache. It is community) borland should sortof be here too but I think thats covered in eclipse. >From what I understand so far, we should morph rxtx to support those three maybe trusting apaches lead with maven. But I use vi. I have little to no clues beyond what people have fed me. Can we agree that thats the right direction to go? -- Trent Jarvi tjarvi at qbang.org From brian at mbari.org Mon Feb 6 14:57:50 2006 From: brian at mbari.org (Brian Schlining) Date: Mon, 6 Feb 2006 13:57:50 -0800 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> Message-ID: <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> > The other thing we have not completed discussing is the directory > structure. There is interest in making rxtx more IDE friendly. I > get more mail about that off the list than how to install rxtx. > > And I see we have Ken Thompson in da house :) He is our trusted > CVS maintainer and the guy that purchased the rxtx.org domain. Old > community. We will need Ken for changing the directory structure of > source. > > I would like to open up discussion about both of these as it is > more than time. The problem is I have little experience with Ant > and even less with IDEs. It would be nice if we could work with > Eclipse and NetBeans. > > http://www.netbeans.org/ (sun and some community) > http://www.eclipes.org (ibm,rhat,... perhaps more community) > http://maven.apache.org/what-is-maven.html (apache. It is community) > borland should sortof be here too but I think thats covered in > eclipse. > >> From what I understand so far, we should morph rxtx to support >> those three > maybe trusting apaches lead with maven. But I use vi. I have > little to no clues beyond what people have fed me. > Maven likes the directory structure below for Java code. (From http:// maven.apache.org/guides/getting-started/index.html) This structure works fine with ant, netbeans, and eclipse. rxtx_root_directory `-- src |-- main | `-- java | `-- gnu | `-- io `-- test `-- java `-- gnu `-- io Brian Schlining Software Engineer http://www.mbari.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060206/d9451eba/attachment-0067.html From tjarvi at qbang.org Mon Feb 6 15:11:45 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 6 Feb 2006 15:11:45 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: > rxtx_root_directory > `-- src > |-- main > | `-- java > | `-- gnu > | `-- io > `-- test > `-- java > `-- gnu > `-- io > >From what I understand this will just be good. For me it makes no difference. So lets do the rxtx thing. Let if fester for two weeks and if nobody objects, we will do it. I'm not doing this because I care. I'm doing this to eliminate much of my inbox. But test... man is rxtx lacking there in the community aspect. It is covered but not right. _maybe_ I can change that this year. -- Trent Jarvi tjarvi at qbang.org (cat hurding since 1997) From lux at diesel-research.com Mon Feb 6 21:38:49 2006 From: lux at diesel-research.com (Kim Lux) Date: Mon, 06 Feb 2006 21:38:49 -0700 Subject: [Rxtx] How can I use Lock Files with rxtx (in FC4) ? Message-ID: <1139287129.17031.3.camel@zd7280> I am now running an rxtx application on FC4. I am getting: ========================================================= check_group_uucp(): error testing lock file creation Error details: Permission denied check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL ========================================================= $ ls -al /var/lock total 32 drwxrwxr-x 4 root lock 4096 Feb 6 16:04 . drwxr-xr-x 24 root root 4096 Nov 14 01:19 .. drwx------ 2 root root 4096 Apr 27 2005 lvm drwxr-xr-x 2 root root 4096 Feb 6 16:04 subsys How do I fix this for regulator users ? -- Kim Lux, Diesel Research Inc. From dmarkman at mac.com Mon Feb 6 22:24:44 2006 From: dmarkman at mac.com (Dmitry Markman) Date: Tue, 7 Feb 2006 00:24:44 -0500 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: if I understands the issue right in order to be able to use ant for c/c++ compilation you have to install ant's cc task http://ant-contrib.sourceforge.net/cc.html it looks like it should work on mac os x (authors claim, that it's platform independent) but I never tested so all you have to do it's providing right command line for the gcc compiler On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: >> rxtx_root_directory >> `-- src >> |-- main >> | `-- java >> | `-- gnu >> | `-- io >> `-- test >> `-- java >> `-- gnu >> `-- io >> > > >> From what I understand this will just be good. > > For me it makes no difference. So lets do the rxtx thing. Let if > fester for two weeks and if nobody objects, we will do it. > > I'm not doing this because I care. I'm doing this to eliminate > much of my inbox. > > But test... man is rxtx lacking there in the community aspect. It > is covered but not right. _maybe_ I can change that this year. > > -- > Trent Jarvi > tjarvi at qbang.org > (cat hurding since 1997) > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx Dmitry Markman From lux at diesel-research.com Mon Feb 6 23:20:15 2006 From: lux at diesel-research.com (Kim Lux) Date: Mon, 06 Feb 2006 23:20:15 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? Message-ID: <1139293215.3689.4.camel@zd7280> I'm running the code below. portlist.hasMoreElements() is false. /dev has ports in it as listed below. What am I doing wrong ? ========================================================== // Step through the list of ports until we find one that matches // the one we are looking for. portList = CommPortIdentifier.getPortIdentifiers(); while(portList.hasMoreElements()) { portID = (CommPortIdentifier) portList.nextElement(); // if (portID.getName().equals("/dev/ttyUSB0")) { myTA.append("Serial port ttyUSB0 has been found\n"); break; }// if portID equals... }// End of while... ========================================================== ls -al /dev/tty* crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 ... crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 -- Kim Lux, Diesel Research Inc. From david.garnier at trusted-logic.com Tue Feb 7 00:46:30 2006 From: david.garnier at trusted-logic.com (David Garnier) Date: Tue, 07 Feb 2006 08:46:30 +0100 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> Message-ID: <43E85056.2090608@trusted-logic.com> Hello, I think that the make-based build process is fine as it is, apart from the location of the Java source files. It is true that putting the Java source in a directory structure that map 1-to-1 to the Java package structure is the norm and should make it easier for everyone to modify the Java source, with or without an IDE. Ant is a good tool, but in the RXTX case I fail to see the advantage of using it compared to the current make-based process. As Trent said, they are more pressing issues, like testing. Regards, David Dmitry Markman wrote: > if I understands the issue right > in order to be able to use ant for c/c++ compilation > you have to install ant's cc task > http://ant-contrib.sourceforge.net/cc.html > > it looks like it should work on mac os x > (authors claim, that it's platform independent) > but I never tested > > so all you have to do it's providing right command line > for the gcc compiler > > > > > On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: > >>> rxtx_root_directory >>> `-- src >>> |-- main >>> | `-- java >>> | `-- gnu >>> | `-- io >>> `-- test >>> `-- java >>> `-- gnu >>> `-- io >>> >> >> >>> From what I understand this will just be good. >> >> For me it makes no difference. So lets do the rxtx thing. Let if >> fester for two weeks and if nobody objects, we will do it. >> >> I'm not doing this because I care. I'm doing this to eliminate much >> of my inbox. >> >> But test... man is rxtx lacking there in the community aspect. It is >> covered but not right. _maybe_ I can change that this year. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> (cat hurding since 1997) From tjarvi at qbang.org Tue Feb 7 01:11:31 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 01:11:31 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <43E85056.2090608@trusted-logic.com> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: On Tue, 7 Feb 2006, David Garnier wrote: > Hello, > > I think that the make-based build process is fine as it is, apart from the location of the Java > source files. It is true that putting the Java source in a directory structure that map 1-to-1 to > the Java package structure is the norm and should make it easier for everyone to modify the Java > source, with or without an IDE. > > Ant is a good tool, but in the RXTX case I fail to see the advantage of using it compared to the > current make-based process. As Trent said, they are more pressing issues, like testing. > Hi David I have more experience with testing rxtx than I can talk about. But let it be known, rxtx has gone trough 100's of hours of testing. We are hobby folks interested in toys but there is more. rxtx has had some of the best guidance in the industry there. This is not an easy thing. I may be able to come back in a month from the other side of the corperate fence and help. I suspect the tests could just be made public but they are in a very unusual environment that just wont work in a wider sense. This is something I'll be trying to change. At one point it was agreed we could just make the results public so this isnt just noise.. There is interest and I think its safe to mention that much. The big problem with testing in the past is most of it is done with a loopback connection. So we *still* have major questions regarding things like flow control. rxtx talks to itself over a loopback and it works. regardless of right or wrong. This requires more thought to be done right. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Feb 7 02:46:34 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 02:46:34 -0700 (MST) Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: > The big problem with testing in the past is most of it is done with a > loopback connection. So we *still* have major questions regarding things > like flow control. rxtx talks to itself over a loopback and it works. > regardless of right or wrong. With serial communication there are gold standards. ckermit is probably a definitive 'standard.' Maybe its possible to do ping/pong tests with ckermit? Is it scriptable? There are known issues in rxtx. Probably the worst is some threading issues regarding some JREs with multiple JNI threads setting java variables. Man did I get schooled there. Just switch the c functions to returning variables and things go away. Sometimes they work fine, sometimes they blow up. Without understanding everything, somehow rhat got it right and debian (and especially gentoo) grabbed kernel patches causing all sort of harm. Its not hard to fix once you understand whats going on but nearly impossible to track with a debugger. So I have a good idea what 2.1-8 will have outside of the IDE modifications. rxtx 2.1-7 is a release for everyone to sync with. Its not even as stable as -pre17 as far as I know - I ran no test suites. I'll be chasing it too. We just had so many contributions that it was time. It seriously broke internal scheduals but thats a great thing :) The other thing I want to do in 2.1-8 is automagic baud rates. It turns out lots of shops are doing really funky baud rates for things like automobile test equipment. It is possible but it requires a fair amount of change in the native code. Is anyone looking at this? -- Trent Jarvi tjarvi at qbang.org From lyon at docjava.com Tue Feb 7 02:57:21 2006 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 07 Feb 2006 04:57:21 -0500 Subject: [Rxtx] Moving rxtx to Ant builds? In-Reply-To: <43E85056.2090608@trusted-logic.com> References: <1139202126.3213.4.camel@zd7280> <5DE95335-4E8C-4F05-8293-E752B8B0E246@mbari.org> <43E85056.2090608@trusted-logic.com> Message-ID: Hi All, I agree, testing is very important. The problem I have been trying to address is related to cross-platform testing and the robust nature of the installs. Typically, I visit 3 platforms to deploy my product, windows, linux and mac. A build is performed on each platform. The idea that you can build for many platforms from one copy the source code seems attractive. This should enable synchronized deployments of identical code. The question of how to achieve this goal remains open. As Trent mentioned, this is hard. Perhaps Ant will help here (but perhaps not). Ant does seem to help with running unit tests. However, it does not help with multi-platform tests. For that you need many machines and different operating environments. Toward that end, I have created a multi-platform test that can be run from web start, located at: http://show.docjava.com:8086/book/cgij/code/jnlp/serialPort.PortTest.jnlp This is interesting because many people in the community can run the test and we can improve the test, as time permits. No, it is not a perfect solution, however, the idea does help with multi-platform tests using many machines and different operating environments. If the group has a good test for a general serial port set-ups, i would be happy to deploy it, for general evaluation using web start. And as for ANT, it is just an idea. Not all my ideas are good ones! - Doug >Hello, > >I think that the make-based build process is fine as it is, apart >from the location of the Java >source files. It is true that putting the Java source in a directory >structure that map 1-to-1 to >the Java package structure is the norm and should make it easier for >everyone to modify the Java >source, with or without an IDE. > >Ant is a good tool, but in the RXTX case I fail to see the advantage >of using it compared to the >current make-based process. As Trent said, they are more pressing >issues, like testing. > >Regards, >David > >Dmitry Markman wrote: >> if I understands the issue right >> in order to be able to use ant for c/c++ compilation >> you have to install ant's cc task >> http://ant-contrib.sourceforge.net/cc.html >> >> it looks like it should work on mac os x >> (authors claim, that it's platform independent) >> but I never tested >> >> so all you have to do it's providing right command line >> for the gcc compiler >> >> >> >> >> On Feb 6, 2006, at 5:11 PM, Trent Jarvi wrote: >> >>>> rxtx_root_directory >>>> `-- src >>>> |-- main >>>> | `-- java >>>> | `-- gnu >>>> | `-- io >>>> `-- test >>>> `-- java >>>> `-- gnu >>>> `-- io >>>> >>> >>> >>>> From what I understand this will just be good. >>> >>> For me it makes no difference. So lets do the rxtx thing. Let if >>> fester for two weeks and if nobody objects, we will do it. >>> >>> I'm not doing this because I care. I'm doing this to eliminate much >>> of my inbox. >>> >>> But test... man is rxtx lacking there in the community aspect. It is >>> covered but not right. _maybe_ I can change that this year. >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >>> (cat hurding since 1997) > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From matt.higgins at gmail.com Tue Feb 7 08:28:34 2006 From: matt.higgins at gmail.com (Matt Higgins) Date: Tue, 7 Feb 2006 10:28:34 -0500 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final Message-ID: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> The following code works fine on Linux but I never see any data when run on Windows. This is a cut and paste from the SimpleRead example. I am attempting to read data from a bar code scanner. I can fire up HyperTermianl on windows and see that the device is working properly as I see the barcodes are scanned and echoed back to the terminal. However when I run the app I don't see any data. It is however associating with the com port as the informational bits print fine? import java.io.*; import java.util.*; import gnu.io.*; public class MySimpleRead implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; public static void main(String[] args) { boolean portFound = false; String defaultPort = "COM1"; if (args.length > 0) { defaultPort = args[0]; } portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; MySimpleRead reader = new MySimpleRead(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } } public MySimpleRead() { try { serialPort = (SerialPort) portId.open("SimpleReadApp", 2000); } catch (PortInUseException e) { e.printStackTrace(); } try { inputStream = serialPort.getInputStream(); } catch (IOException e) { e.printStackTrace(); } try { serialPort.addEventListener(this); } catch (TooManyListenersException e) { e.printStackTrace(); } try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { e.printStackTrace(); } System.out.println("Baud is " + serialPort.getBaudRate()); System.out.println("Bits is " + serialPort.getDataBits()); System.out.println("Stop is " + serialPort.getStopBits()); System.out.println("Par is " + serialPort.getParity()); serialPort.notifyOnDataAvailable(true); readThread = new Thread(this); readThread.start(); } public void run() { // Thread.sleep(20000); //} catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { System.out.println("An event occurred " + event.getEventType()); switch (event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: byte[] readBuffer = new byte[20]; try { while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } System.out.print(new String(readBuffer)); } catch (IOException e) {} break; } } } --------------- Result on windows ------------------------------ Stable Library ============================================================== Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Found port:: COM1 Baud is 9600 Bits is 8 Stop is 1 Par is 0 ----------------- End Results ----------------------------------------- ------------------ Result on Linux ----------------------------------- Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyS0 Found port: /dev/ttyS0 Baud is 9600 Bits is 8 Stop is 1 Par is 0 An event occurred 1 043100066224 ------------------ End Results --------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/a1431630/attachment-0067.html From brian at mbari.org Tue Feb 7 09:48:37 2006 From: brian at mbari.org (Brian Schlining) Date: Tue, 7 Feb 2006 08:48:37 -0800 Subject: [Rxtx] No events from notifyOnDataAvailable on windows rxtx 2.1-7 final In-Reply-To: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> References: <950550040602070728w2a9a5e94p789189370eee9bba@mail.gmail.com> Message-ID: <01F64280-2E81-4D0E-890E-E6E2DB7FD452@mbari.org> Hi Matt > The following code works fine on Linux but I never see any data > when run on Windows. This is a cut and paste from the SimpleRead > example. > I am attempting to read data from a bar code scanner. I can fire > up HyperTermianl on windows and see that the device is working > properly as I see the barcodes are scanned and echoed back to the > terminal. However when I run the app I don't see any data. It is > however associating with the com port as the informational bits > print fine? You're not the only one whose had this problem, I don't know if Trent has addressed this is the latest release of RXTX but there is a workaround. Here's the recent thread from the RXTX mailing list regarding this issues: Thanasis Delenikas tdelenik at gmail.com Wed Jan 18 13:56:23 MST 2006 * Previous message: [Rxtx] Re: More close() performance fixes * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Hi all. (I've subscribed again from my other email account). Trent, You are right. Linux *always* works, no matter what flow control you set. Windows *works only* with hardware flow control (I haven't tested what happens with software XON/XOFF flow control). I assume (but I am not certain) that even with no flow control at all, all platforms should work. Without flow control, you have the risk of bumping into overflow or framing errors, but that's your (the end programmer, I mean) problem. >From my side, I shouldn't be working without flow control. That was a bug too... It was some code forgotten from the old times, when I used to work with phone emulation drivers which didn't support flow control. The correct way is to have some flow control enabled and that's why I suppose this is a low-severity bug for RxTx. I have no idea which platform shows the correct behaviour, since my knowledge about Linux and the inner workings of these low-level i/o operations is limited. Regards, Thanasis Delenikas. > Message: 2 > Date: Tue, 17 Jan 2006 12:24:39 -0700 (MST) > From: Trent Jarvi > Subject: Re: [Rxtx] RXTX 20/01/2005 version on Win32 Problems > To: RXTX Developers and Users > Message-ID: > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 17 Jan 2006, jSMSEngine Admin wrote: > > > Hi all, > > > > Trent, I have found something. > > I read your comment about flow control, so I experimented a bit. > > > > If you remember, in my sample program I've used no flow control at all ( > i.e. > > Java constant FLOWCONTROL_NONE). > > > > Now, during testing, I've switch to hardware inbound flow control (i.e. > Java > > constant FLOWCONTROL_RTSCTS_IN) and everything seems to work > beautifully! > > > > I think I will switch to H/W flow control and test things for a while, > but > > up to now (a few hundred test read cycles) everything runs smoothly. > > > > > Hi Thanasis, > > I'm fairly sure you have identified a bug. I would not worry too much > about what Sun CommAPI w32 defaults are. I think they did more or less > whatever the port opened with. Just a guess. Linux tries to stomp on > ports so they are all the same. > > So this started out with Linux worked, Windows XP/.. did not as I recall. > Something is wrong in rxtx. Do I understand this right? > > FLOWCONTROL_RTSCTS_NONE: Linux worked, Windows did not. > FLOWCONTROL_RTSCTS_IN: Linux worked, Windows worked. > > Perhaps there is something Wayne or I did not understand when we wrote > that code. I wasnt programming back in the BBS days so modems are not my > thing. I have a few questions. > > Is the above matrix confirmed by observation? > Linux just always worked? > Which one _should_ work? I'm guessing modems work with hardware flow > control. I'll have to dig around. > > The windows flow control changes a couple things with hardware flow > control. Following the w32 API documentation is confusing sometimes. > But it looks like Linux could have a bug too. Cheers Brian Schlining Software Engineer http://www.mbari.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20060207/16d07f37/attachment-0067.html From lux at diesel-research.com Tue Feb 7 11:59:58 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 11:59:58 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139293215.3689.4.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> Message-ID: <1139338798.8145.4.camel@zd7280> Any ideas on this ? Any reason why portList.hasMoreElements() should be false even though there are devices in /dev ? On Mon, 2006-02-06 at 23:20 -0700, Kim Lux wrote: > I'm running the code below. > > portlist.hasMoreElements() is false. > > /dev has ports in it as listed below. > > What am I doing wrong ? > > > ========================================================== > // Step through the list of ports until we find one that matches > // the one we are looking for. > > portList = CommPortIdentifier.getPortIdentifiers(); > > while(portList.hasMoreElements()) > { > portID = (CommPortIdentifier) portList.nextElement(); // > if (portID.getName().equals("/dev/ttyUSB0")) > { > myTA.append("Serial port ttyUSB0 has been found\n"); > break; > }// if portID equals... > }// End of while... > ========================================================== > > ls -al /dev/tty* > crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty > crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 > crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 > crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 > crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 > ... > crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 > crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 > crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 > > > -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 12:20:25 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 12:20:25 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139338798.8145.4.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> Message-ID: On Tue, 7 Feb 2006, Kim Lux wrote: > > Any ideas on this ? Any reason why portList.hasMoreElements() should be > false even though there are devices in /dev ? > > > On Mon, 2006-02-06 at 23:20 -0700, Kim Lux wrote: >> I'm running the code below. >> >> portlist.hasMoreElements() is false. >> >> /dev has ports in it as listed below. >> >> What am I doing wrong ? >> >> >> ========================================================== >> // Step through the list of ports until we find one that matches >> // the one we are looking for. >> >> portList = CommPortIdentifier.getPortIdentifiers(); >> >> while(portList.hasMoreElements()) >> { >> portID = (CommPortIdentifier) portList.nextElement(); // >> if (portID.getName().equals("/dev/ttyUSB0")) >> { >> myTA.append("Serial port ttyUSB0 has been found\n"); >> break; >> }// if portID equals... >> }// End of while... >> ========================================================== >> >> ls -al /dev/tty* >> crw-rw-rw- 1 root root 5, 0 Feb 6 15:42 /dev/tty >> crw-rw---- 1 root root 4, 0 Feb 6 15:42 /dev/tty0 >> crw------- 1 root root 4, 1 Feb 6 22:43 /dev/tty1 >> crw-rw---- 1 root tty 4, 10 Feb 6 15:42 /dev/tty10 >> crw-rw---- 1 root tty 4, 11 Feb 6 15:42 /dev/tty11 >> ... >> crw-rw---- 1 root uucp 4, 72 Feb 6 15:42 /dev/ttyS8 >> crw-rw---- 1 root uucp 4, 73 Feb 6 15:42 /dev/ttyS9 >> crw-rw---- 1 krlux uucp 188, 0 Feb 6 15:42 /dev/ttyUSB0 >> >> >> > Hi Kim What rxtx does is try to open the port and do a timed out read. If the kernel/... do not complain it's enumarted. I suspect you could do a crude test by doing something like cat /dev/ttyS0 > /dev/null If that barfs then rxtx wont enumerate the port. hmm looking at your question again, I suspect it's a lockfile problem. This is documented in INSTALL with the source. Its easy enough to test this too.. touch /var/lock/testingrxtxlockfiles && rm -f /var/lock/testingrxtxlockfiles If you are not in the right group it will bail. Root will work regardless. -- Trent Jarvi tjarvi at qbang.org From lux at diesel-research.com Tue Feb 7 12:37:56 2006 From: lux at diesel-research.com (Kim Lux) Date: Tue, 07 Feb 2006 12:37:56 -0700 Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: References: <1139293215.3689.4.camel@zd7280> <1139338798.8145.4.camel@zd7280> Message-ID: <1139341076.8145.11.camel@zd7280> Exactly which ports does rxtx attempt to put into the list ? /dev/* or /dev/tty* or /dev/tty[0-9[0-9] ? or /dev/ttyS* ? For the record, only /dev/ttyUSB0 is a valid port on the machine I am presently on. Will this be a problem ? On Tue, 2006-02-07 at 12:20 -0700, Trent Jarvi wrote: > This is documented in INSTALL with the source. > I was wondering where that file was. I will download source and dig it up. Thanks. -- Kim Lux, Diesel Research Inc. From tjarvi at qbang.org Tue Feb 7 12:51:09 2006 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 7 Feb 2006 12:51:09 -0700 (MST) Subject: [Rxtx] portlist.hasMoreElements is false ? In-Reply-To: <1139341076.8145.11.camel@zd7280> References: <1139293215.3689.4.camel@zd7280> <113